['8 mal bestellen', '8', 8],
['10 mal bestellen', '10', 10],
['12 mal bestellen', '12', 12],
- ['14 mal bestellen', '14', 14]
+ ['Wert eingeben', 'Bitte geben Sie die gewünschte Menge ein', 'prompt']
]
};
return false;
}
-function import_callback(data)
+function import_articles_callback(data)
{
if (data.status == true) {
info('Ordersatz aktualisiert');
}
}
-function import()
+function import_articles()
{
var source = document.getElementById('source');
if (!source) return false;
var parms = 'source=' + source.innerHTML + '&callback=import';
- ajax_request('function', parms, import_callback);
+ ajax_request('function', parms, import_articles_callback);
return false;
}
$buttons = <<<EOC
<p style="margin-top: 0px; margin-bottom: 4px; text-align: center;">
-<button onclick="return import()">Artikel importieren</button>
+<button onclick="return import_articles()">Artikel importieren</button>
<button onclick="return build_pdf()">PDF erstellen</button>
'artnr' => array(
'name' => 'Artnr',
'width' => 60,
- 'specs' => "filterUI: 't'",
'visible' => false,
),
'menge' => array(
'name' => 'Menge',
'width' => 60,
- 'specs' => "ClassName: 'alignrightpad', filterUI: 't'",
+ 'specs' => "ClassName: 'alignrightpad', filterUI: 't2'",
),
'bezeichnung' => array(
'name' => 'Bezeichnung',
'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' => 80,
- 'specs' => "filterUI: 't'",
+ 'specs' => "filterUI: 't5'",
),
'vpe' => array(
'name' => 'Einheit',
'save' => false,
'insert' => false,
'delete' => false,
+ 'changes' => false,
),
);
$tmpdir = mk_tempdir();
$result = ordersatz_write($_SESSION['ordersatz'], $tmpdir, false);
- if ($result !== true)
+ if ($result !== true) {
+ rm_tempdir($tmpdir);
return array('error' => $result);
+ }
return array('tmpdir' => substr($tmpdir,strlen($_SESSION['sys']['basedir'])));
}