Several improvements
[misc/hallinta-metro] / artikel.php
index e26008d..1f4ed5e 100644 (file)
@@ -157,6 +157,14 @@ $mask = array(
                                            'sql' => '(SELECT preis * ((100 + steuersatz)/100) FROM metro_artikel_preis ' .
                                                     'WHERE artikel = metro_artikel.id ORDER BY datum DESC LIMIT 1)',
                                            ),
+                             'datum' => array(
+                                           'name' => 'Datum',
+                                           'width' => 85,
+                                           'type' => 'text',
+                                           'sql' => '(SELECT datum FROM metro_artikel_preis ' .
+                                                    'WHERE artikel = metro_artikel.id ORDER BY datum DESC LIMIT 1)',
+                                           'visible' => false,
+                                           ),
                              'hersteller' => array(
                                            'name' => 'Hersteller',
                                            'width' => 100,
@@ -233,6 +241,46 @@ $mask = array(
                                            'sql' => false,
                                            ),
                              ),
+             'second' => array(
+                               'title' => 'Preisverlauf',
+                               'rows' => 5,
+                               'table' => 'metro_artikel_preis',
+                               'where' => 'artikel = {id} ORDER BY datum DESC',
+                               'list' => array(
+                                               'id' => array(
+                                                             'name' => 'ID',
+                                                             'visible' => false,
+                                                             ),
+                                               'datum' => array(
+                                                             'name' => 'Datum',
+                                                             'width' => 180,
+                                                             ),
+                                               'steuersatz' => array(
+                                                             'name' => 'Steuer',
+                                                             'width' => 60,
+                                                             'type' => 'number',
+                                                             'specs' => "decPlaces: 2, ClassName: 'alignrightpad'",
+                                                             ),
+                                               'preis' => array(
+                                                             'name' => 'netto',
+                                                             'width' => 60,
+                                                             'type' => 'number',
+                                                             'specs' => "decPlaces: 2, ClassName: 'alignrightpad'",
+                                                             ),
+                                               'brutto' => array(
+                                                             'name' => 'Preis',
+                                                             'width' => 60,
+                                                             'type' => 'number',
+                                                             'specs' => "decPlaces: 2, ClassName: 'alignrightpad'",
+                                                             'sql' => 'preis * ((100 + steuersatz)/100)',
+                                                             ),
+                                               'empty' => array(
+                                                             'name' => '',
+                                                             'width' => 10,
+                                                             'sql' => "''",
+                                                             ),
+                                               ),
+                               ),
              'callbacks' => array(
                                   'price' => cb_price,
                                ),