mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
Produktion ziellagerplatz, use lagerplatz of artikel or produktion
This commit is contained in:
parent
8518e327aa
commit
3ee518af03
@ -123,7 +123,7 @@
|
||||
<div [POSITIONEN_TAB_VISIBLE]>
|
||||
<div id="tabs-2">
|
||||
[MESSAGE]
|
||||
<form action="" method="post">
|
||||
<form action="#tabs-2" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
@ -140,7 +140,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-14 col-md-6 col-md-height">
|
||||
<div class="col-xs-14 col-md-5 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend [AKTION_PLANEN_VISIBLE]>{|Zu produzierende Artikel|}</legend>
|
||||
@ -169,6 +169,7 @@
|
||||
<td>[MENGE_PRODUZIERBAR]</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr [ARTIKEL_MENGE_VISIBLE]>
|
||||
<td>{|Ausschuss|}:</td>
|
||||
<td>[MENGEAUSSCHUSS]</td>
|
||||
</tr>
|
||||
@ -176,15 +177,23 @@
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-14 col-md-6 col-md-height">
|
||||
<div class="col-xs-14 col-md-5 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend [AKTION_PRODUZIEREN_VISIBLE]>{|Parameter|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td>{|Menge|}:</td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td><input type="text" name="menge_produzieren" id="menge_produzieren" value="[MENGE_PRODUZIEREN]" size="20" style="width:100%;"></td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td>{|Ausschuss|}:</td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td><input type="text" name="menge_ausschuss" id="menge_ausschuss" value="[MENGE_AUSSCHUSS]" size="20" style="width:100%;"></td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]>
|
||||
<td>{|Menge|}:</td>
|
||||
<td><input type="text" name="menge_produzieren" id="menge_produzieren" value="[MENGE_PRODUZIEREN]" size="20""></td>
|
||||
</tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]>
|
||||
<td>{|Ausschuss|}:</td>
|
||||
<td><input type="text" name="menge_ausschuss" id="menge_ausschuss" value="[MENGE_AUSSCHUSS]" size="20"></td>
|
||||
</tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]>
|
||||
<td>{|Ziellager|}:</td>
|
||||
<td><input type="text" name="ziellager" id="ziellager" value="[ZIELLAGER]" size="20"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
@ -193,14 +202,23 @@
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<legend>{|Aktionen|}</legend>
|
||||
<tr [AKTION_PLANEN_VISIBLE]><td><button name="submit" value="planen" class="ui-button-icon" style="width:100%;">Planen</button></td></tr>
|
||||
<tr [AKTION_FREIGEBEN_VISIBLE]><td><button name="submit" value="freigeben" class="ui-button-icon" style="width:100%;">Freigeben</button></td></tr>
|
||||
<legend>{|Anpassen|}</legend>
|
||||
<tr [AKTION_PLANEN_VISIBLE]><td><button name="submit" value="planen" class="ui-button-icon" style="width:100%;">Planen</button></td></tr>
|
||||
<tr [AKTION_LEEREN_VISIBLE]><td><button name="submit" value="leeren" class="ui-button-icon" style="width:100%;">Leeren</button></td></tr>
|
||||
<tr [AKTION_FREIGEBEN_VISIBLE]><td><button name="submit" value="freigeben" class="ui-button-icon" style="width:100%;">Freigeben</button></td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td><button name="submit" value="teilen" class="ui-button-icon" style="width:100%;">Teilen</button></td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td><button name="submit" value="anpassen" class="ui-button-icon" style="width:100%;">Anpassen</button></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-14 col-md-2 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<legend>{|Produzieren|}</legend>
|
||||
<tr [AKTION_RESERVIEREN_VISIBLE]><td><button name="submit" value="reservieren" class="ui-button-icon" style="width:100%;">Reservieren</button></td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td><button name="submit" value="produzieren" class="ui-button-icon" style="width:100%;">Produzieren</button></td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td><button name="submit" value="teilen" class="ui-button-icon" style="width:100%;">Teilproduktion erstellen</button></td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td><button name="submit" value="anpassen" class="ui-button-icon" style="width:100%;">Anpassen</button></td></tr>
|
||||
<tr [AKTION_LEEREN_VISIBLE]><td><button name="submit" value="leeren" class="ui-button-icon" style="width:100%;">Leeren</button></td></tr>
|
||||
<tr [AKTION_PRODUZIEREN_VISIBLE]><td><button name="submit" value="produzieren" class="ui-button-icon" style="width:100%;">Produzieren</button></td></tr>
|
||||
<tr [AKTION_ABSCHLIESSEN_VISIBLE]><td><button name="submit" value="abschliessen" class="ui-button-icon" style="width:100%;">Abschliessen</button></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
@ -366,7 +366,6 @@ class Produktion {
|
||||
// Write to database
|
||||
|
||||
// Add checks here
|
||||
$input['standardlager'] = $this->app->erp->ReplaceLagerPlatz(true,$input['standardlager'],true); // Parameters: Target db?, value, from form?
|
||||
|
||||
if (empty($input['datum'])) {
|
||||
$input['datum'] = date("Y-m-d");
|
||||
@ -376,7 +375,6 @@ class Produktion {
|
||||
|
||||
if ($id == 'NULL') {
|
||||
$input['status'] = 'angelegt';
|
||||
$this->ProtokollSchreiben($id,'Produktion angelegt');
|
||||
}
|
||||
|
||||
$input['datumauslieferung'] = $this->app->erp->ReplaceDatum(true,$input['datumauslieferung'],true);
|
||||
@ -405,7 +403,9 @@ class Produktion {
|
||||
$id = $this->app->DB->GetInsertID();
|
||||
|
||||
if (!empty($id)) {
|
||||
$msg .= $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
||||
$this->ProtokollSchreiben($id,'Produktion angelegt');
|
||||
$msg .= "<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>";
|
||||
$msg = $this->app->erp->base64_url_encode($msg);
|
||||
header("Location: index.php?module=produktion&action=edit&id=$id&msg=$msg");
|
||||
}
|
||||
|
||||
@ -459,7 +459,7 @@ class Produktion {
|
||||
$this->app->DB->Update($sql);
|
||||
|
||||
$msg .= "<div class=\"success\">Planung angelegt.</div>";
|
||||
$this->ProtokollSchreiben($id,'Produktion geplant');
|
||||
$this->ProtokollSchreiben($id,'Produktion geplant ($artikel_planen_menge)');
|
||||
|
||||
break;
|
||||
case 'freigeben':
|
||||
@ -573,17 +573,55 @@ class Produktion {
|
||||
break;
|
||||
}
|
||||
|
||||
// Insert produced parts into stock
|
||||
// Insert produced parts into stock
|
||||
// Check target stock, if not existing, use default stock of article, if not given use production stock
|
||||
|
||||
|
||||
$ziellager_from_form = $this->app->erp->ReplaceLagerPlatz(true,$this->app->Secure->GetPOST('ziellager'),true); // Parameters: Target db?, value, from form?
|
||||
|
||||
$use_artikel_lager = false;
|
||||
$ziellager = $global_standardlager;
|
||||
|
||||
if (!empty($ziellager_from_form)) {
|
||||
$sql = "SELECT id FROM lager_platz WHERE id = ".$ziellager_from_form;
|
||||
$result = $this->app->DB->SelectArr($sql);
|
||||
if (!empty($result)) {
|
||||
$ziellager = $ziellager_from_form;
|
||||
} else {
|
||||
$use_artikel_lager = true;
|
||||
}
|
||||
} else {
|
||||
$use_artikel_lager = true;
|
||||
}
|
||||
|
||||
if ($use_artikel_lager) {
|
||||
$sql = "SELECT lager_platz FROM artikel WHERE id = ".$produktionsartikel_position['artikel'];
|
||||
$result = $this->app->DB->SelectArr($sql);
|
||||
if (!empty($result) && !empty($result[0]['lager_platz'])) {
|
||||
$ziellager = $result[0]['lager_platz'];
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
$sql = "SELECT kurzbezeichnung FROM lager_platz WHERE id = $ziellager";
|
||||
$lagername = $this->app->DB->SelectArr($sql)[0]['kurzbezeichnung'];
|
||||
|
||||
// ERPAPI
|
||||
// function LagerEinlagern($artikel,$menge,$regal,$projekt,$grund="",$importer="",$paketannahme="",$doctype = "", $doctypeid = 0, $vpeid = 0, $permanenteinventur = 0, $adresse = 0)
|
||||
$this->app->erp->LagerEinlagern($produktionsartikel_position['artikel'],$menge_produzieren,$global_standardlager,$global_projekt,"Produktion $global_produktionsnummer");
|
||||
$this->app->erp->LagerEinlagern($produktionsartikel_position['artikel'],$menge_produzieren,$ziellager,$global_projekt,"Produktion $global_produktionsnummer");
|
||||
// No error handling in LagerEinlagern...
|
||||
|
||||
$sql = "UPDATE produktion SET mengeerfolgreich = mengeerfolgreich + $menge_produzieren, mengeausschuss = mengeausschuss + $menge_ausschuss WHERE id = $id";
|
||||
$this->app->DB->Update($sql);
|
||||
|
||||
$msg .= "<div class=\"info\">Produktion durchgeführt.</div>";
|
||||
$this->ProtokollSchreiben($id,"Produktion durchgeführt ($menge_produzieren, davon $menge_ausschuss Ausschuss)");
|
||||
if ($menge_ausschuss < $menge_produzieren) {
|
||||
$lagertext = ", eingelagert in $lagername";
|
||||
}
|
||||
$text = "Produktion durchgeführt ($menge_produzieren, davon $menge_ausschuss Ausschuss)$lagertext";
|
||||
$msg .= "<div class=\"info\">$text.</div>";
|
||||
$this->ProtokollSchreiben($id,$text);
|
||||
|
||||
break;
|
||||
case 'teilen':
|
||||
@ -714,8 +752,10 @@ class Produktion {
|
||||
|
||||
}
|
||||
|
||||
$msg .= $this->app->erp->base64_url_encode("<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>");
|
||||
header("Location: index.php?module=produktion&action=list&msg=$msg");
|
||||
$this->ProtokollSchreiben($id,"Teilproduktion erstellt: ".$produktion_neu['belegnr']." (Menge $menge_abteilen)");
|
||||
$msg .= "<div class=\"success\">Das Element wurde erfolgreich angelegt.</div>";
|
||||
$msg = $this->app->erp->base64_url_encode($msg);
|
||||
header("Location: index.php?module=produktion&action=edit&id=$produktion_neu_id&msg=$msg");
|
||||
|
||||
break;
|
||||
case 'leeren':
|
||||
@ -981,6 +1021,8 @@ class Produktion {
|
||||
$this->app->YUI->AutoComplete("artikel_planen", "stuecklistenartikel");
|
||||
|
||||
$this->app->YUI->AutoComplete("standardlager", "lagerplatz");
|
||||
$this->app->YUI->AutoComplete("ziellager", "lagerplatz");
|
||||
|
||||
$this->app->Tpl->Set('STANDARDLAGER', $this->app->erp->ReplaceLagerPlatz(false,$produktion_from_db['standardlager'],false)); // Convert ID to form display
|
||||
|
||||
$this->app->YUI->DatePicker("datum");
|
||||
@ -1120,13 +1162,11 @@ class Produktion {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function produktion_minidetail($parsetarget='',$menu=true) {
|
||||
|
||||
$id = $this->app->Secure->GetGET('id');
|
||||
|
||||
$fortschritt = $this->MengeFortschritt($id, 0);
|
||||
$fortschritt = $this->MengeFortschritt((int) $id, 0);
|
||||
|
||||
if (!empty($fortschritt)) {
|
||||
$this->app->Tpl->Set('MENGE_GEPLANT',$fortschritt['geplant']);
|
||||
@ -1167,6 +1207,7 @@ class Produktion {
|
||||
|
||||
$input['datum'] = $this->app->Secure->GetPOST('datum');
|
||||
$input['standardlager'] = $this->app->Secure->GetPOST('standardlager');
|
||||
$input['standardlager'] = $this->app->erp->ReplaceLagerPlatz(true,$input['standardlager'],true); // Parameters: Target db?, value, from form?
|
||||
|
||||
$input['reservierart'] = $this->app->Secure->GetPOST('reservierart');
|
||||
$input['auslagerart'] = $this->app->Secure->GetPOST('auslagerart');
|
||||
|
Loading…
Reference in New Issue
Block a user