mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
Wareneingang added empty and fill from bestellung
This commit is contained in:
parent
bdb05c747a
commit
b2bf2f14f2
@ -48,14 +48,12 @@
|
||||
</td></tr>
|
||||
[AFTERMANUELLERFASSEN]
|
||||
[ISLIEFERANTSTART]
|
||||
<!--
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="fuellen">{|Aus Bestellungen füllen|}</button>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="leeren">{|Leeren|}</button>
|
||||
</td></tr>
|
||||
-->
|
||||
[ISLIEFERANTENDE]
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="speichern">{|Speichern|}</button>
|
||||
|
@ -1691,8 +1691,56 @@ class Wareneingang {
|
||||
|
||||
switch ($submit) {
|
||||
case 'fuellen':
|
||||
// Get bestellung_position from form
|
||||
$form_input = $this->app->Secure->GetPOSTArray();
|
||||
foreach ($form_input as $key => $menge) {
|
||||
if ((strpos($key,'menge_') === 0)) {
|
||||
$bestellposition = substr($key,'6');
|
||||
// Remove existing preliminary value
|
||||
$sql = "DELETE FROM paketdistribution WHERE paketannahme = ".$id." AND bestellung_position = ".$bestellposition." AND vorlaeufig = 1";
|
||||
$this->app->DB->Delete($sql);
|
||||
|
||||
// Write paketdistribution
|
||||
$sql = "INSERT INTO paketdistribution(
|
||||
id,
|
||||
bearbeiter,
|
||||
zeit,
|
||||
paketannahme,
|
||||
adresse,
|
||||
artikel,
|
||||
menge,
|
||||
vpe,
|
||||
etiketten,
|
||||
bemerkung,
|
||||
bestellung_position,
|
||||
vorlaeufig
|
||||
)
|
||||
VALUES(
|
||||
'',
|
||||
'" . $this->app->User->GetName() . "',
|
||||
NOW(),
|
||||
'$id',
|
||||
'',
|
||||
'$artikel',
|
||||
(SELECT menge-geliefert FROM bestellung_position WHERE id = ".$bestellposition."),
|
||||
'$vpe',
|
||||
'',
|
||||
'$bemerkung',
|
||||
'$bestellposition',
|
||||
1
|
||||
)";
|
||||
|
||||
$this->app->DB->Insert($sql);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 'leeren':
|
||||
// Remove existing preliminary value
|
||||
$sql = "DELETE FROM paketdistribution WHERE paketannahme = ".$id." AND vorlaeufig = 1";
|
||||
$this->app->DB->Delete($sql);
|
||||
break;
|
||||
case 'manuellerfassen':
|
||||
$this->app->Location->execute('index.php?module=wareneingang&action=manuellerfassen&id=' . $id);
|
||||
@ -1789,8 +1837,8 @@ class Wareneingang {
|
||||
foreach ($menge_input as $key => $menge) {
|
||||
if ((strpos($key,'menge_') === 0) && ($menge !== '')) {
|
||||
$bestellposition = substr($key,'6');
|
||||
if ($menge > 0) {
|
||||
|
||||
if ($menge >= 0) { // Allow 0 for reset of saved value
|
||||
// Gather info bestellung
|
||||
$bparr = $this->app->DB->SelectRow("SELECT * FROM bestellung INNER JOIN bestellung_position ON bestellung_position.bestellung = bestellung.id INNER JOIN artikel ON bestellung_position.artikel = artikel.id WHERE bestellung_position.id='$bestellposition' LIMIT 1");
|
||||
$artikel = $bparr['artikel'];
|
||||
|
Loading…
Reference in New Issue
Block a user