Display price for articles
[misc/hallinta-metro] / artikel.php
index 018a00f..76398ad 100644 (file)
@@ -13,23 +13,29 @@ $mask = array(
                              'artnr' => array(
                                            'name' => 'ArtNr',
                                            'width' => 60,
-                                           'specs' => "filterUI: 't'",
                                            ),
                              'menge' => array(
                                            'name' => 'Menge',
                                            'width' => 60,
-                                           'specs' => "ClassName: 'alignrightpad', filterUI: 't'",
+                                           'specs' => "ClassName: 'alignrightpad'",
                                            ),
                              'bezeichnung' => array(
                                            'name' => 'Bezeichnung',
-                                           'width' => 345,
+                                           'width' => 300,
                                            'specs' => "filterUI: 't'",
                                            ),
+                             'preis' => array(
+                                           'name' => 'Preis',
+                                           'width' => 60,
+                                           'type' => 'number',
+                                           'specs' => "decPlaces: 2, ClassName: 'alignrightpad', filterUI: 't'",
+                                           'sql' => '(SELECT preis * ((100 + steuersatz)/100) FROM metro_artikel_preis ' .
+                                                    'WHERE artikel = metro_artikel.id ORDER BY datum DESC LIMIT 1)',
+                                           ),
                              'hersteller' => array(
                                            'name' => 'Hersteller',
                                            'width' => 100,
                                            'specs' => "filterUI: 't'",
-                                           'visible' => false,
                                            ),
                              'abteilung' => array(
                                            'name' => 'Abteilung',
@@ -55,7 +61,7 @@ $mask = array(
                              'artnr' => array(
                                            'name' => 'Artikelnummer',
                                            'type' => 'number',
-                                           'size' => 25,
+                                           'size' => 15,
                                            'required' => true,
                                            ),
                              'abteilung' => array(
@@ -81,13 +87,13 @@ $mask = array(
                              'bezeichnung' => array(
                                            'name' => 'Bezeichnung',
                                            'type' => 'text',
-                                           'size' => 25,
+                                           'size' => 21,
                                            'required' => true,
                                            ),
                              'hersteller' => array(
                                            'name' => 'Hersteller',
                                            'type' => 'text',
-                                           'size' => 25,
+                                           'size' => 21,
                                            'null' => true,
                                            ),
                              ),