artikel.value = form_id.value;
var datum = document.getElementById('form_datum');
- datum.activate();
+ var preis = document.getElementById('form_preis');
+ if (datum.value.length)
+ preis.activate();
+ else
+ datum.activate();
}
function open_popup()
'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,
'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,
),