mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 04:27:14 +01:00
versandpakete bugfix check completion
This commit is contained in:
parent
662410fdc8
commit
3e70af8466
@ -540,15 +540,10 @@ class Versandpakete {
|
|||||||
$this->versandpakete_status_select();
|
$this->versandpakete_status_select();
|
||||||
|
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
versandpaket,
|
|
||||||
belegnr,
|
belegnr,
|
||||||
l.name
|
l.name
|
||||||
FROM
|
FROM
|
||||||
versandpaket_lieferschein_position vlp
|
lieferschein l
|
||||||
INNER JOIN
|
|
||||||
lieferschein_position lp ON lp.id = vlp.lieferschein_position
|
|
||||||
INNER JOIN
|
|
||||||
lieferschein l ON l.id = lp.lieferschein
|
|
||||||
WHERE l.id = ".$lieferschein_filter." LIMIT 1";
|
WHERE l.id = ".$lieferschein_filter." LIMIT 1";
|
||||||
|
|
||||||
$info = $this->app->DB->SelectArr($sql);
|
$info = $this->app->DB->SelectArr($sql);
|
||||||
@ -557,10 +552,11 @@ class Versandpakete {
|
|||||||
$this->app->Tpl->Set('BELEGNR', $info[0]['belegnr']);
|
$this->app->Tpl->Set('BELEGNR', $info[0]['belegnr']);
|
||||||
$this->app->Tpl->SetText('KURZUEBERSCHRIFT2', $info[0]['name']." Lieferung ".$info[0]['belegnr']);
|
$this->app->Tpl->SetText('KURZUEBERSCHRIFT2', $info[0]['name']." Lieferung ".$info[0]['belegnr']);
|
||||||
|
|
||||||
if ($this->versandpakete_check_completion($info[0]['versandpaket'])) {
|
$complete = $this->versandpakete_check_completion($lieferschein_filter, null);
|
||||||
|
if ($complete === true) {
|
||||||
$this->app->Tpl->addMessage('success', 'Lieferung vollständig in Paketen.', false, 'MESSAGE');
|
$this->app->Tpl->addMessage('success', 'Lieferung vollständig in Paketen.', false, 'MESSAGE');
|
||||||
}
|
}
|
||||||
else {
|
else if ($complete === false) {
|
||||||
$this->app->Tpl->addMessage('info', 'Lieferung unvollständig.', false, 'MESSAGE');
|
$this->app->Tpl->addMessage('info', 'Lieferung unvollständig.', false, 'MESSAGE');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -640,7 +636,6 @@ class Versandpakete {
|
|||||||
|
|
||||||
$sql = "SELECT status FROM versandpakete WHERE id = ".$id;
|
$sql = "SELECT status FROM versandpakete WHERE id = ".$id;
|
||||||
$input['status'] = $this->app->DB->SelectArr($sql)[0]['status'];
|
$input['status'] = $this->app->DB->SelectArr($sql)[0]['status'];
|
||||||
|
|
||||||
if ($input['status'] != 'neu') {
|
if ($input['status'] != 'neu') {
|
||||||
$input = Array('bemerkung' => $input['bemerkung']);
|
$input = Array('bemerkung' => $input['bemerkung']);
|
||||||
}
|
}
|
||||||
@ -766,10 +761,11 @@ class Versandpakete {
|
|||||||
$icons = $this->app->DB->SelectArr($sql);
|
$icons = $this->app->DB->SelectArr($sql);
|
||||||
$this->app->Tpl->Set('ICONS', $icons[0]['icons']);
|
$this->app->Tpl->Set('ICONS', $icons[0]['icons']);
|
||||||
|
|
||||||
if ($this->versandpakete_check_completion($id)) {
|
$complete = $this->versandpakete_check_completion(null, $id);
|
||||||
|
if ($complete === true) {
|
||||||
$this->app->Tpl->addMessage('success', 'Lieferung vollständig in Paketen.', false, 'MESSAGE');
|
$this->app->Tpl->addMessage('success', 'Lieferung vollständig in Paketen.', false, 'MESSAGE');
|
||||||
}
|
}
|
||||||
else {
|
else if ($complete === false) {
|
||||||
$this->app->Tpl->addMessage('info', 'Lieferung unvollständig.', false, 'MESSAGE');
|
$this->app->Tpl->addMessage('info', 'Lieferung unvollständig.', false, 'MESSAGE');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -931,10 +927,11 @@ class Versandpakete {
|
|||||||
$this->app->User->SetParameter('versandpakete_lieferschein', $lieferschein);
|
$this->app->User->SetParameter('versandpakete_lieferschein', $lieferschein);
|
||||||
$this->app->User->SetParameter('versandpakete_versandpaket', $id);
|
$this->app->User->SetParameter('versandpakete_versandpaket', $id);
|
||||||
|
|
||||||
if ($this->versandpakete_check_completion($id)) {
|
$complete = $this->versandpakete_check_completion($lieferschein,null);
|
||||||
|
if ($complete === true) {
|
||||||
$this->app->Tpl->addMessage('success', 'Lieferung vollständig in Paketen.', false, 'MESSAGE');
|
$this->app->Tpl->addMessage('success', 'Lieferung vollständig in Paketen.', false, 'MESSAGE');
|
||||||
}
|
}
|
||||||
else {
|
else if ($complete === false) {
|
||||||
$this->app->Tpl->addMessage('info', 'Lieferung unvollständig.', false, 'MESSAGE');
|
$this->app->Tpl->addMessage('info', 'Lieferung unvollständig.', false, 'MESSAGE');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -944,14 +941,24 @@ class Versandpakete {
|
|||||||
$this->app->Tpl->Parse('PAGE', "versandpakete_add.tpl");
|
$this->app->Tpl->Parse('PAGE', "versandpakete_add.tpl");
|
||||||
}
|
}
|
||||||
|
|
||||||
function versandpakete_check_completion($id) : bool {
|
// null if versandpaket not associated with lieferschein
|
||||||
$sql_lieferschein = "
|
function versandpakete_check_completion($lieferung, $versandpaket) : ?bool {
|
||||||
|
|
||||||
|
if (!empty($lieferung)) {
|
||||||
|
$sql_where_lieferung = " AND l.id = ".$lieferung;
|
||||||
|
} else {
|
||||||
|
$sql_join_lieferschein = "
|
||||||
|
INNER JOIN (
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
lieferschein
|
lieferschein
|
||||||
FROM
|
FROM
|
||||||
versandpaket_lieferschein_position vlp
|
versandpaket_lieferschein_position vlp
|
||||||
INNER JOIN lieferschein_position lp ON vlp.lieferschein_position = lp.id
|
INNER JOIN lieferschein_position lp ON vlp.lieferschein_position = lp.id
|
||||||
WHERE versandpaket = ".$id;
|
WHERE versandpaket = ".$versandpaket."
|
||||||
|
) lieferschein_filter
|
||||||
|
ON lieferschein_filter.lieferschein = lp.lieferschein
|
||||||
|
";
|
||||||
|
}
|
||||||
|
|
||||||
$sql_lieferschein_mengen = "
|
$sql_lieferschein_mengen = "
|
||||||
SELECT
|
SELECT
|
||||||
@ -964,11 +971,10 @@ class Versandpakete {
|
|||||||
artikel a ON a.id = lp.artikel
|
artikel a ON a.id = lp.artikel
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
lieferschein l on l.id = lp.lieferschein
|
lieferschein l on l.id = lp.lieferschein
|
||||||
INNER JOIN
|
".$sql_join_lieferschein."
|
||||||
(".$sql_lieferschein.") lieferschein_filter
|
|
||||||
ON lieferschein_filter.lieferschein = lp.lieferschein
|
|
||||||
WHERE
|
WHERE
|
||||||
a.lagerartikel
|
a.lagerartikel
|
||||||
|
".$sql_where_lieferung."
|
||||||
GROUP BY
|
GROUP BY
|
||||||
lp.id
|
lp.id
|
||||||
";
|
";
|
||||||
@ -1015,10 +1021,13 @@ class Versandpakete {
|
|||||||
if (!empty($completion)) {
|
if (!empty($completion)) {
|
||||||
if ($completion[0]['lmenge'] == $completion[0]['vmenge']) {
|
if ($completion[0]['lmenge'] == $completion[0]['vmenge']) {
|
||||||
return(true);
|
return(true);
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function versandpakete_minidetail() {
|
function versandpakete_minidetail() {
|
||||||
$id = $this->app->Secure->GetGET('id');
|
$id = $this->app->Secure->GetGET('id');
|
||||||
@ -1113,22 +1122,6 @@ class Versandpakete {
|
|||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Set all fields in the page corresponding to $input
|
|
||||||
*/
|
|
||||||
function SetInput($input) {
|
|
||||||
// $this->app->Tpl->Set('EMAIL', $input['email']);
|
|
||||||
|
|
||||||
$this->app->Tpl->Set('VERSAND', $input['versand']);
|
|
||||||
$this->app->Tpl->Set('NR', $input['nr']);
|
|
||||||
$this->app->Tpl->Set('TRACKING', $input['tracking']);
|
|
||||||
$this->app->Tpl->Set('VERSENDER', $input['versender']);
|
|
||||||
$this->app->Tpl->Set('GEWICHT', $input['gewicht']);
|
|
||||||
$this->app->Tpl->Set('BEMERKUNG', $input['bemerkung']);
|
|
||||||
$this->app->Tpl->Set('STATUS', $input['status']);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static function versandpakete_lieferstatus_sql($app) {
|
static function versandpakete_lieferstatus_sql($app) {
|
||||||
|
|
||||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',id,'\" />') AS `auswahl`";
|
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',id,'\" />') AS `auswahl`";
|
||||||
|
Loading…
Reference in New Issue
Block a user