var form_id = document.getElementById('edit_id');
var artikel = document.getElementById('form_artikel');
artikel.value = form_id.value;
- Debug.write('id: ' + form_id.value);
price_popup.openPopup(100,300);
+
+ var datum = document.getElementById('form_datum');
+ datum.activate();
}
function open_popup()
function add_price_callback(data)
{
info('Preis gespeichert');
+ grid_update(grid);
}
function add_price(obj)
if (!source) return false;
var parms = 'source=' + source.innerHTML + '&callback=price&';
- Debug.write(parms+Form.serialize(obj.form));
ajax_request('function', parms+Form.serialize(obj.form), add_price_callback);
preis.value = '';
'width' => 300,
'specs' => "filterUI: 't'",
),
+ 'netto' => array(
+ 'name' => 'netto',
+ 'width' => 60,
+ 'type' => 'number',
+ 'specs' => "decPlaces: 2, ClassName: 'alignrightpad'",
+ 'sql' => '(SELECT preis FROM metro_artikel_preis ' .
+ 'WHERE artikel = metro_artikel.id ORDER BY datum DESC LIMIT 1)',
+ ),
'preis' => array(
'name' => 'Preis',
'width' => 60,
'type' => 'number',
- 'specs' => "decPlaces: 2, ClassName: 'alignrightpad', filterUI: 't'",
+ 'specs' => "decPlaces: 2, ClassName: 'alignrightpad'",
'sql' => '(SELECT preis * ((100 + steuersatz)/100) FROM metro_artikel_preis ' .
'WHERE artikel = metro_artikel.id ORDER BY datum DESC LIMIT 1)',
),
return array('error' => 'Nicht ausreichend Daten übermittelt');
$date = format_date($_POST['datum']);
+ $_POST['preis'] = str_replace(',','.',$_POST['preis']);
$sql = sprintf("INSERT INTO metro_artikel_preis (artikel,preis,steuersatz,datum,sys_user,sys_edit) " .
"VALUES (%d,%.3f,%d,'%s',%s,now())",