mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 06:00:28 +01:00
versand process added versand_status to lieferschein and status processing
This commit is contained in:
parent
7dcaae7fbb
commit
662410fdc8
@ -5817,12 +5817,8 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fester filter
|
// Fester filter
|
||||||
$more_data6 = $this->app->Secure->GetGET("more_data6");
|
|
||||||
$more_data7 = $this->app->Secure->GetGET("more_data7");
|
|
||||||
$more_data8 = $this->app->Secure->GetGET("more_data8");
|
|
||||||
|
|
||||||
$more_data4 = $this->app->Secure->GetGET("more_data4");
|
$more_data4 = $this->app->Secure->GetGET("more_data4");
|
||||||
|
/*
|
||||||
$versandjoin = "";
|
$versandjoin = "";
|
||||||
if(isset($parameter['offenversandzentrum']) && !empty($parameter['offenversandzentrum']))
|
if(isset($parameter['offenversandzentrum']) && !empty($parameter['offenversandzentrum']))
|
||||||
{
|
{
|
||||||
@ -5856,8 +5852,8 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($versandjoin)$sql .= $versandjoin;
|
if($versandjoin)$sql .= $versandjoin;
|
||||||
|
*/
|
||||||
|
|
||||||
if($more_data4 || (isset($parameter['ohnerechnung']) && !empty($parameter['ohnerechnung']))) {
|
if($more_data4 || (isset($parameter['ohnerechnung']) && !empty($parameter['ohnerechnung']))) {
|
||||||
|
|
||||||
$paramsArray[] = " l.status !='storniert' ";
|
$paramsArray[] = " l.status !='storniert' ";
|
||||||
@ -5932,6 +5928,21 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
|||||||
if ($more_data3 == 1) $subwhere[] = " l.lieferantenretoure=1 ";
|
if ($more_data3 == 1) $subwhere[] = " l.lieferantenretoure=1 ";
|
||||||
|
|
||||||
// ENDE EXTRA more
|
// ENDE EXTRA more
|
||||||
|
$more_data6 = $this->app->Secure->GetGET("more_data6");
|
||||||
|
$more_data7 = $this->app->Secure->GetGET("more_data7");
|
||||||
|
$more_data8 = $this->app->Secure->GetGET("more_data8");
|
||||||
|
|
||||||
|
if ($more_data6) {
|
||||||
|
$subwhere[] = "l.versand_status = 3";
|
||||||
|
}
|
||||||
|
if ($more_data7) {
|
||||||
|
$subwhere[] = "l.versand_status = 1";
|
||||||
|
}
|
||||||
|
if ($more_data8) {
|
||||||
|
$subwhere[] = "l.versand_status IN (2,3)";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for ($j = 0;$j < (empty($subwhere)?0:count($subwhere));$j++) $tmp.= " AND " . $subwhere[$j];
|
for ($j = 0;$j < (empty($subwhere)?0:count($subwhere));$j++) $tmp.= " AND " . $subwhere[$j];
|
||||||
$where = " l.id!='' AND l.status!='angelegt' $tmp " . $this->app->erp->ProjektRechte('p.id', true, 'l.vertriebid');
|
$where = " l.id!='' AND l.status!='angelegt' $tmp " . $this->app->erp->ProjektRechte('p.id', true, 'l.vertriebid');
|
||||||
|
|
||||||
|
@ -57169,6 +57169,17 @@
|
|||||||
"Extra": "",
|
"Extra": "",
|
||||||
"Privileges": "select,insert,update,references",
|
"Privileges": "select,insert,update,references",
|
||||||
"Comment": ""
|
"Comment": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Field": "versand_status",
|
||||||
|
"Type": "int(11)",
|
||||||
|
"Collation": null,
|
||||||
|
"Null": "NO",
|
||||||
|
"Key": "",
|
||||||
|
"Default": "0",
|
||||||
|
"Extra": "",
|
||||||
|
"Privileges": "select,insert,update,references",
|
||||||
|
"Comment": ""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"keys": [
|
"keys": [
|
||||||
|
@ -5694,8 +5694,13 @@ Die Gesamtsumme stimmt nicht mehr mit ursprünglich festgelegten Betrag '.
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->app->DB->Update("UPDATE lieferschein SET
|
$this->app->DB->Update("UPDATE lieferschein SET
|
||||||
belegnr='$ls_belegnr', status='freigegeben', versand='".$this->app->User->GetDescription()."'
|
belegnr='$ls_belegnr',
|
||||||
WHERE id='$lieferschein' LIMIT 1");
|
status='freigegeben',
|
||||||
|
versand='".$this->app->User->GetDescription()."',
|
||||||
|
versand_status = 1
|
||||||
|
WHERE id='$lieferschein' LIMIT 1");
|
||||||
|
|
||||||
|
// Versand_status: 1 = process in versandpakete, 2 = finished, 3 = finished manually
|
||||||
|
|
||||||
$this->app->erp->LieferscheinProtokoll($lieferschein, 'Lieferschein freigegeben');
|
$this->app->erp->LieferscheinProtokoll($lieferschein, 'Lieferschein freigegeben');
|
||||||
|
|
||||||
@ -6342,7 +6347,7 @@ Die Gesamtsumme stimmt nicht mehr mit ursprünglich festgelegten Betrag '.
|
|||||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=list','Übersicht');
|
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=list','Übersicht');
|
||||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=create','Neuen Auftrag anlegen');
|
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=create','Neuen Auftrag anlegen');
|
||||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=offene','Offene Positionen');
|
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=offene','Offene Positionen');
|
||||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=versandzentrum','Versandzentrum');
|
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=versandzentrum','Versandübergabe');
|
||||||
|
|
||||||
if(strlen($backurl)>5){
|
if(strlen($backurl)>5){
|
||||||
$this->app->erp->MenuEintrag("$backurl", 'Zurück zur Übersicht');
|
$this->app->erp->MenuEintrag("$backurl", 'Zurück zur Übersicht');
|
||||||
@ -6387,7 +6392,7 @@ Die Gesamtsumme stimmt nicht mehr mit ursprünglich festgelegten Betrag '.
|
|||||||
$this->AuftraguebersichtMenu();
|
$this->AuftraguebersichtMenu();
|
||||||
$targetMessage = 'AUTOVERSANDBERECHNEN';
|
$targetMessage = 'AUTOVERSANDBERECHNEN';
|
||||||
|
|
||||||
$this->app->Tpl->Add('MESSAGE','<div class="info">Aufträge an Versand übergeben mit automatischem Druck und Mailversand.</div>');
|
$this->app->Tpl->Add('MESSAGE','<div class="info">Aufträge an Versand übergeben mit automatischem Druck und Mailversand. <a class="button" href="index.php?module=versandpakete&action=lieferungen">Zum Versand</a></div>');
|
||||||
|
|
||||||
$autoshipmentEnabled = true;
|
$autoshipmentEnabled = true;
|
||||||
$this->app->erp->RunHook('OrderAutoShipment', 2, $targetMessage, $autoshipmentEnabled);
|
$this->app->erp->RunHook('OrderAutoShipment', 2, $targetMessage, $autoshipmentEnabled);
|
||||||
|
@ -17,33 +17,6 @@
|
|||||||
<li class="filter-item"><input type="checkbox" id="anlieferanten"><label for="anlieferanten">{|an Lieferanten|}</label></li>
|
<li class="filter-item"><input type="checkbox" id="anlieferanten"><label for="anlieferanten">{|an Lieferanten|}</label></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="filter-block filter-inline">
|
|
||||||
<div class="filter-title">{|Filter Versandzentrum|}</div>
|
|
||||||
<ul class="filter-list">
|
|
||||||
<li class="filter-item">
|
|
||||||
<label for="abgeschlossenlogistik" class="switch">
|
|
||||||
<input type="checkbox" id="abgeschlossenlogistik">
|
|
||||||
<span class="slider round"></span>
|
|
||||||
</label>
|
|
||||||
<label for="abgeschlossenlogistik">{|abgeschlossen über Logistik|}</label>
|
|
||||||
</li>
|
|
||||||
<li class="filter-item">
|
|
||||||
<label for="nochinlogistik" class="switch">
|
|
||||||
<input type="checkbox" id="nochinlogistik">
|
|
||||||
<span class="slider round"></span>
|
|
||||||
</label>
|
|
||||||
<label for="nochinlogistik">{|noch in Logistik|}</label>
|
|
||||||
</li>
|
|
||||||
<li class="filter-item">
|
|
||||||
<label for="manuellabgeschlossen" class="switch">
|
|
||||||
<input type="checkbox" id="manuellabgeschlossen">
|
|
||||||
<span class="slider round"></span>
|
|
||||||
</label>
|
|
||||||
<label for="manuellabgeschlossen">{|manuell abgeschlossen|}</label>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
[MESSAGE]
|
[MESSAGE]
|
||||||
|
@ -287,72 +287,14 @@ class Versandpakete {
|
|||||||
$defaultorder = 1;
|
$defaultorder = 1;
|
||||||
$defaultorderdesc = 0;
|
$defaultorderdesc = 0;
|
||||||
|
|
||||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`, CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',id,'\" />') AS `auswahl`";
|
|
||||||
$menucol = 1;
|
$menucol = 1;
|
||||||
$moreinfoaction = "lieferschein";
|
$moreinfoaction = "lieferschein";
|
||||||
$moreinfo = true; // Allow drop down details
|
$moreinfo = true; // Allow drop down details
|
||||||
$aligncenter = [5,6,7,8,9,10];
|
$aligncenter = [5,6,7,8,9,10];
|
||||||
|
|
||||||
$menu = "<a href=\"index.php?module=versandpakete&action=add&lieferschein=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/add.png\" border=\"0\"></a>";
|
$menu = "<a href=\"index.php?module=versandpakete&action=add&lieferschein=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/add.png\" border=\"0\"></a>";
|
||||||
|
|
||||||
$sql_lieferschein_position = "
|
|
||||||
SELECT
|
|
||||||
l.id,
|
|
||||||
l.belegnr,
|
|
||||||
l.name,
|
|
||||||
lp.menge lmenge,
|
|
||||||
SUM(vlp.menge) vmenge,
|
|
||||||
BIT_OR(COALESCE(v.status,0) IN ('versendet')) AS eins_versendet,
|
|
||||||
BIT_AND(COALESCE(v.status,0) IN ('versendet')) AS alle_versendet,
|
|
||||||
BIT_OR(COALESCE(v.status,0) IN ('abgeschlossen')) AS eins_abgeschlossen,
|
|
||||||
BIT_AND(COALESCE(v.status,0) IN ('abgeschlossen')) AS alle_abgeschlossen
|
|
||||||
FROM
|
|
||||||
lieferschein l
|
|
||||||
INNER JOIN lieferschein_position lp ON lp.lieferschein = l.id
|
|
||||||
INNER JOIN artikel a ON lp.artikel = a.id
|
|
||||||
LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id
|
|
||||||
LEFT JOIN versandpakete v ON vlp.versandpaket = v.id
|
|
||||||
WHERE
|
|
||||||
l.belegnr <> '' AND
|
|
||||||
(v.status <> 'storniert' OR v.status IS NULL) AND
|
|
||||||
a.lagerartikel
|
|
||||||
GROUP BY lp.id
|
|
||||||
";
|
|
||||||
|
|
||||||
$sql_lieferschein = "
|
|
||||||
SELECT
|
|
||||||
id,
|
|
||||||
belegnr,
|
|
||||||
name,
|
|
||||||
SUM(lmenge) lmenge,
|
|
||||||
SUM(COALESCE(vmenge,0)) vmenge,
|
|
||||||
eins_versendet,
|
|
||||||
alle_versendet,
|
|
||||||
eins_abgeschlossen,
|
|
||||||
alle_abgeschlossen
|
|
||||||
FROM (
|
|
||||||
".$sql_lieferschein_position."
|
|
||||||
) lp
|
|
||||||
GROUP BY id
|
|
||||||
";
|
|
||||||
|
|
||||||
$sql = "
|
|
||||||
SELECT SQL_CALC_FOUND_ROWS
|
|
||||||
id,
|
|
||||||
".$dropnbox.",
|
|
||||||
CONCAT('<a href=\"index.php?module=lieferschein&action=edit&id=',id,'\">',belegnr,'</a>'),
|
|
||||||
name,
|
|
||||||
".$app->erp->FormatMenge("lmenge").",
|
|
||||||
".$app->erp->FormatMenge("vmenge").",
|
|
||||||
".$app->YUI->IconsSQL_lieferung().",
|
|
||||||
if(vmenge=0,'',CONCAT('<a href=\"index.php?module=versandpakete&action=lieferung&id=',id,'\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/forward.svg\" title=\"Pakete anzeigen\" border=\"0\"></a>')),
|
|
||||||
id,
|
|
||||||
alle_abgeschlossen
|
|
||||||
FROM (
|
|
||||||
".$sql_lieferschein."
|
|
||||||
) l
|
|
||||||
";
|
|
||||||
|
|
||||||
|
$sql = Versandpakete::versandpakete_lieferstatus_sql($app);
|
||||||
$where = "";
|
$where = "";
|
||||||
|
|
||||||
// Toggle filters
|
// Toggle filters
|
||||||
@ -1187,4 +1129,69 @@ class Versandpakete {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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`";
|
||||||
|
|
||||||
|
$sql_lieferschein_position = "
|
||||||
|
SELECT
|
||||||
|
l.id,
|
||||||
|
l.belegnr,
|
||||||
|
l.name,
|
||||||
|
lp.menge lmenge,
|
||||||
|
SUM(vlp.menge) vmenge,
|
||||||
|
BIT_OR(COALESCE(v.status,0) IN ('versendet')) AS eins_versendet,
|
||||||
|
BIT_AND(COALESCE(v.status,0) IN ('versendet')) AS alle_versendet,
|
||||||
|
BIT_OR(COALESCE(v.status,0) IN ('abgeschlossen')) AS eins_abgeschlossen,
|
||||||
|
BIT_AND(COALESCE(v.status,0) IN ('abgeschlossen')) AS alle_abgeschlossen
|
||||||
|
FROM
|
||||||
|
lieferschein l
|
||||||
|
INNER JOIN lieferschein_position lp ON lp.lieferschein = l.id
|
||||||
|
INNER JOIN artikel a ON lp.artikel = a.id
|
||||||
|
LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id
|
||||||
|
LEFT JOIN versandpakete v ON vlp.versandpaket = v.id
|
||||||
|
WHERE
|
||||||
|
l.versand_status <> 0 AND
|
||||||
|
l.belegnr <> '' AND
|
||||||
|
(v.status <> 'storniert' OR v.status IS NULL) AND
|
||||||
|
a.lagerartikel
|
||||||
|
GROUP BY lp.id
|
||||||
|
";
|
||||||
|
|
||||||
|
$sql_lieferschein = "
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
belegnr,
|
||||||
|
name,
|
||||||
|
SUM(lmenge) lmenge,
|
||||||
|
SUM(COALESCE(vmenge,0)) vmenge,
|
||||||
|
eins_versendet,
|
||||||
|
alle_versendet,
|
||||||
|
eins_abgeschlossen,
|
||||||
|
alle_abgeschlossen
|
||||||
|
FROM (
|
||||||
|
".$sql_lieferschein_position."
|
||||||
|
) lp
|
||||||
|
GROUP BY id
|
||||||
|
";
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
SELECT SQL_CALC_FOUND_ROWS
|
||||||
|
id,
|
||||||
|
".$dropnbox.",
|
||||||
|
CONCAT('<a href=\"index.php?module=lieferschein&action=edit&id=',id,'\">',belegnr,'</a>'),
|
||||||
|
name,
|
||||||
|
".$app->erp->FormatMenge("lmenge").",
|
||||||
|
".$app->erp->FormatMenge("vmenge").",
|
||||||
|
".$app->YUI->IconsSQL_lieferung().",
|
||||||
|
if(vmenge=0,'',CONCAT('<a href=\"index.php?module=versandpakete&action=lieferung&id=',id,'\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/forward.svg\" title=\"Pakete anzeigen\" border=\"0\"></a>')),
|
||||||
|
id,
|
||||||
|
alle_abgeschlossen
|
||||||
|
FROM (
|
||||||
|
".$sql_lieferschein."
|
||||||
|
) l
|
||||||
|
";
|
||||||
|
return($sql);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user