versandpakete improvements

This commit is contained in:
OpenXE 2023-10-22 18:22:07 +02:00
parent 4488cf8688
commit ca73f3dda5
4 changed files with 171 additions and 67 deletions

View File

@ -3691,6 +3691,43 @@ class YUI {
END, END,
'</td></tr></table>')"; '</td></tr></table>')";
} }
function IconsSQL_lieferung() {
$lieferschein_kein = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/summe_stop.png\" title=\"Kein Lieferschein\" border=\"0\" style=\"margin-right:1px\">";
$lieferschein_ohne_pos = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/summe_go.png\" title=\"Lieferschein ohne Positionen\" border=\"0\" style=\"margin-right:1px\">";
$lieferschein_voll = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/lagergo.png\" title=\"Lieferschein vollst&auml;ndig\" border=\"0\" style=\"margin-right:1px\">";
$lieferschein_teil = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/lagergo_stop.png\" title=\"Lieferschein teilweise\" border=\"0\" style=\"margin-right:1px\">";
$versendet = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/liefersperrego.png\" title=\"Versendet\" border=\"0\" style=\"margin-right:1px\">";
$versendet_nicht = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/liefersperrestop.png\" title=\"Nicht versendet\" border=\"0\" style=\"margin-right:1px\">";
$versendet_teil = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/liefersperregostop.png\" title=\"Teilweise versendet\" border=\"0\" style=\"margin-right:1px\">";
$ausgeliefert = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delivery_ok.png\" style=\"margin-right:1px\" title=\"Ausgeliefert\" border=\"0\">";
$ausgeliefert_nicht = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delivery.png\" style=\"margin-right:1px\" title=\"Nicht ausgeliefert\" border=\"0\">";
$ausgeliefert_teil = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delivery_pending.png\" style=\"margin-right:1px\" title=\"Teilweise ausgeliefert\" border=\"0\">";
$storno = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/storno.png\" style=\"margin-right:1px\" title=\"Storniert\" border=\"0\">";
return "CONCAT(
'<table><tr><td nowrap>',
CASE
WHEN vmenge >= lmenge THEN '$lieferschein_voll'
WHEN vmenge < lmenge AND vmenge <> 0 THEN '$lieferschein_teil'
ELSE '$lieferschein_kein'
END,
CASE
WHEN alle_abgeschlossen THEN '$versendet'
WHEN alle_versendet THEN '$versendet'
WHEN eins_versendet THEN '$versendet_teil'
ELSE '$versendet_nicht'
END,
CASE
WHEN alle_abgeschlossen THEN '$ausgeliefert'
WHEN eins_abgeschlossen THEN '$ausgeliefert_teil'
ELSE '$ausgeliefert_nicht'
END,
'</td></tr></table>')";
}
function TablePositionSearch($parsetarget, $name, $callback = "show", $gener) { function TablePositionSearch($parsetarget, $name, $callback = "show", $gener) {

View File

@ -2482,7 +2482,7 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku
$adresse = $this->app->DB->Select("SELECT id FROM adresse WHERE kundennummer = '".$kunde[0]."' AND kundennummer <> '' LIMIT 1"); $adresse = $this->app->DB->Select("SELECT id FROM adresse WHERE kundennummer = '".$kunde[0]."' AND kundennummer <> '' LIMIT 1");
} }
$beleg = str_replace('kunden','',$filtername); $beleg = str_replace('kunden','',$filtername);
$arr = $this->app->DB->SelectArr("SELECT CONCAT(belegnr,' ',kundennummer,' ',name) as name FROM $beleg WHERE (belegnr <> '') AND (belegnr LIKE '%$term%' OR name LIKE '%$term%' OR kundennummer LIKE '$%term%') AND (status = 'angelegt' OR status = 'freigegeben') $arr = $this->app->DB->SelectArr("SELECT CONCAT(belegnr,' ',kundennummer,' ',name) as name FROM $beleg WHERE (belegnr <> '') AND (belegnr LIKE '%$term%' OR name LIKE '%$term%' OR kundennummer LIKE '$%term%') AND (status IN ('angelegt','freigegeben','versendet'))
".($adresse?" AND adresse = '$adresse' ":'')." ".$this->app->erp->ProjektRechte('projekt')." ".($adresse?" AND adresse = '$adresse' ":'')." ".$this->app->erp->ProjektRechte('projekt')."
ORDER by belegnr LIMIT 20"); ORDER by belegnr LIMIT 20");
$carr = !empty($arr)?count($arr):0; $carr = !empty($arr)?count($arr):0;

View File

@ -1,10 +0,0 @@
<div id="tabs">
<ul>
<li><a href="#tabs-1">[TABTEXT1]</a></li>
</ul>
<div id="tabs-1">
[MESSAGE]
[TAB1]
[TAB1NEXT]
</div>
</div>

View File

@ -38,7 +38,7 @@ class Versandpakete {
$this->app->ActionHandler("create", "versandpakete_edit"); // This automatically adds a "New" button $this->app->ActionHandler("create", "versandpakete_edit"); // This automatically adds a "New" button
$this->app->ActionHandler("edit", "versandpakete_edit"); $this->app->ActionHandler("edit", "versandpakete_edit");
$this->app->ActionHandler("add", "versandpakete_add"); $this->app->ActionHandler("add", "versandpakete_add");
$this->app->ActionHandler("lieferscheine", "versandpakete_lieferscheine"); $this->app->ActionHandler("pakete", "versandpakete_pakete");
$this->app->ActionHandler("stapelverarbeitung", "versandpakete_stapelverarbeitung"); $this->app->ActionHandler("stapelverarbeitung", "versandpakete_stapelverarbeitung");
$this->app->ActionHandler("paketmarke", "versandpakete_paketmarke"); $this->app->ActionHandler("paketmarke", "versandpakete_paketmarke");
$this->app->ActionHandler("delete", "versandpakete_delete"); $this->app->ActionHandler("delete", "versandpakete_delete");
@ -63,11 +63,12 @@ class Versandpakete {
// columns that are aligned right (numbers etc) // columns that are aligned right (numbers etc)
// $alignright = array(4,5,6,7,8); // $alignright = array(4,5,6,7,8);
$findcols = array('id','id','id','datum'); $findcols = array('id','id','id','datum','name','if (lieferscheine IS NULL, lieferscheine_ohne_pos, lieferscheine)','versandart','tracking','lmenge','vmenge','gewicht','versender','bemerkung','status','id','id');
$searchsql = array('v.versand', 'v.nr', 'v.tracking', 'v.versender', 'v.gewicht', 'v.bemerkung', 'v.status'); $searchsql = array('name', 'if (lieferscheine IS NULL, lieferscheine_ohne_pos, lieferscheine)', 'tracking', 'bemerkung');
$defaultorder = 1; $defaultorder = 1;
$defaultorderdesc = 0; $defaultorderdesc = 0;
$aligncenter = [9,10,11];
$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`";
@ -103,9 +104,9 @@ class Versandpakete {
id, id,
$dropnbox, $dropnbox,
id, id,
datum, datum_format,
if (lieferscheine IS NULL,alop_name,name), if (lieferscheine IS NULL,alop_name,name) as name,
if (lieferscheine IS NULL, lieferscheine_ohne_pos, lieferscheine), if (lieferscheine IS NULL, lieferscheine_ohne_pos, lieferscheine) as belegnr,
versandart, versandart,
tracking_link, tracking_link,
lmenge, lmenge,
@ -115,12 +116,14 @@ class Versandpakete {
bemerkung, bemerkung,
status, status,
".$app->YUI->IconsSQL_versandpaket().", ".$app->YUI->IconsSQL_versandpaket().",
id id,
datum
FROM FROM
( (
SELECT SELECT
v.id, v.id,
".$app->erp->FormatDateTimeShort('v.datum')." AS datum, ".$app->erp->FormatDateShort('v.datum')." AS datum_format,
v.datum,
a.name, a.name,
alop.name alop_name, alop.name alop_name,
GROUP_CONCAT(DISTINCT ".$app->erp->ConcatSQL($lieferschein_link)." SEPARATOR ', ') as lieferscheine, GROUP_CONCAT(DISTINCT ".$app->erp->ConcatSQL($lieferschein_link)." SEPARATOR ', ') as lieferscheine,
@ -153,7 +156,7 @@ class Versandpakete {
) temp ) temp
"; ";
$where = "status IN ('neu', 'versendet')"; $where = "((status IN ('neu', 'versendet')";
// Toggle filters // Toggle filters
$app->Tpl->Add('JQUERYREADY', "$('#geschlossene').click( function() { fnFilterColumn1( 0 ); } );"); $app->Tpl->Add('JQUERYREADY', "$('#geschlossene').click( function() { fnFilterColumn1( 0 ); } );");
$app->Tpl->Add('JQUERYREADY', "$('#stornierte').click( function() { fnFilterColumn2( 0 ); } );"); $app->Tpl->Add('JQUERYREADY', "$('#stornierte').click( function() { fnFilterColumn2( 0 ); } );");
@ -179,15 +182,17 @@ class Versandpakete {
$more_data1 = $app->Secure->GetGET("more_data1"); $more_data1 = $app->Secure->GetGET("more_data1");
if ($more_data1 == 1) { if ($more_data1 == 1) {
$where .= " OR status IN ('abgeschlossen')"; $where .= " OR status IN ('abgeschlossen'))";
} else { } else {
$where .= " )";
} }
$more_data2 = $app->Secure->GetGET("more_data2"); $more_data2 = $app->Secure->GetGET("more_data2");
if ($more_data2 == 1) { if ($more_data2 == 1) {
$where .= " OR status IN ('storniert')"; $where .= " OR status IN ('storniert'))";
} }
else { else {
$where .= " )";
} }
// END Toggle filters // END Toggle filters
@ -199,14 +204,14 @@ class Versandpakete {
$allowed['versandpakete_lieferscheine'] = array('lieferscheine'); $allowed['versandpakete_lieferscheine'] = array('lieferscheine');
$heading = array('','', 'Lieferschein', 'Adresse','Menge','Menge in Versandpaketen', 'Paket erstellen'); $heading = array('', '', 'Lieferschein', 'Adresse','Menge','Menge in Versandpaketen','Monitor','Paket erstellen');
$width = array('1%','1%', '10%', '10%', '10%', '10%' ,'10%', '1%'); // Fill out manually later $width = array( '1%','1%', '10%', '10%', '10%', '10%' ,'1%', '1%'); // Fill out manually later
// columns that are aligned right (numbers etc) // columns that are aligned right (numbers etc)
// $alignright = array(4,5,6,7,8); // $alignright = array(4,5,6,7,8);
$findcols = array('id','id'); $findcols = array('id','id','belegnr','name','lmenge','vmenge','(alle_versendet+alle_abgeschlossen*2)','id');
$searchsql = array('v.versand', 'v.nr', 'v.tracking', 'v.versender', 'v.gewicht', 'v.bemerkung', 'v.status'); $searchsql = array('belegnr','name');
$defaultorder = 1; $defaultorder = 1;
$defaultorderdesc = 0; $defaultorderdesc = 0;
@ -215,40 +220,110 @@ class Versandpakete {
$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];
$menu = "<a href=\"index.php?module=versandpakete&action=add&lieferschein=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/forward.svg\" border=\"0\"></a>"; $menu = "<a href=\"index.php?module=versandpakete&action=add&lieferschein=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/forward.svg\" 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 = " $sql = "
SELECT SQL_CALC_FOUND_ROWS SELECT SQL_CALC_FOUND_ROWS
id, id,
".$dropnbox.", ".$dropnbox.",
CONCAT('<a href=\"index.php?module=lieferschein&action=edit&id=',id,'\">',belegnr,'</a>'), CONCAT('<a href=\"index.php?module=lieferschein&action=edit&id=',id,'\">',belegnr,'</a>'),
name, name,
".$app->erp->FormatMenge("SUM(lmenge)")." as lmenge, ".$app->erp->FormatMenge("lmenge").",
".$app->erp->FormatMenge("SUM(vmenge)")." as vmenge, ".$app->erp->FormatMenge("vmenge").",
id ".$app->YUI->IconsSQL_lieferung().",
FROM id,
( alle_abgeschlossen
SELECT FROM (
l.id, ".$sql_lieferschein."
l.belegnr, ) l
l.name,
lp.menge lmenge,
SUM(vlp.menge) vmenge
FROM
lieferschein l
INNER JOIN lieferschein_position lp ON lp.lieferschein = l.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 l.versendet <> 1 AND (v.status IS NULL OR (v.status != 'storniert' AND v.status <> 'abgeschlossen'))
GROUP BY lp.id
) l_mengen
"; ";
$where = ""; $where = "";
// Toggle filters
$app->Tpl->Add('JQUERYREADY', "$('#geschlossene').click( function() { fnFilterColumn1( 0 ); } );");
$app->Tpl->Add('JQUERYREADY', "$('#unterwegs').click( function() { fnFilterColumn2( 0 ); } );");
for ($r = 1;$r <= 2;$r++) {
$app->Tpl->Add('JAVASCRIPT', '
function fnFilterColumn' . $r . ' ( i )
{
if(oMoreData' . $r . $name . '==1)
oMoreData' . $r . $name . ' = 0;
else
oMoreData' . $r . $name . ' = 1;
$(\'#' . $name . '\').dataTable().fnFilter(
\'\',
i,
0,0
);
}
');
}
$more_data1 = $app->Secure->GetGET("more_data1");
if ($more_data1 == 1) {
$where = "1";
} else {
$where = "(!alle_abgeschlossen)";
}
$more_data2 = $app->Secure->GetGET("more_data2");
if ($more_data2 == 1) {
$where .= " AND (alle_versendet)";
} else {
}
// END Toggle filters
// $count = "SELECT count(DISTINCT id) FROM versandpakete v WHERE $where"; // $count = "SELECT count(DISTINCT id) FROM versandpakete v WHERE $where";
$groupby = "GROUP BY id"; $groupby = "";
break; break;
case "versandpakete_paketinhalt_list": case "versandpakete_paketinhalt_list":
@ -257,12 +332,12 @@ class Versandpakete {
$allowed['versandpakete_paketinhalt_list'] = array('list'); $allowed['versandpakete_paketinhalt_list'] = array('list');
$heading = array('Lieferschein','Pos', 'Artikel', 'Artikel-Nr.','Menge Lieferschein', 'Menge Paket', 'Men&uuml;',''); $heading = array('Lieferschein','Pos', 'Artikel', 'Artikel-Nr.','Menge Lieferschein', 'Menge Paket', 'Men&uuml;','');
$width = array('10%','10%','10%'); // Fill out manually later $width = array( '10%', '10%', '10%', '10%', '1%', '1%', '1%', '1%'); // Fill out manually later
// columns that are aligned right (numbers etc) // columns that are aligned right (numbers etc)
// $alignright = array(4,5,6,7,8); // $alignright = array(4,5,6,7,8);
$findcols = array('lp.id','v.id','v.id','a.name','l.belegnr','v.tracking', 'v.versender', 'v.gewicht', 'v.bemerkung', 'v.status'); $findcols = array('l.belegnr','sort','a.name_de','a.nummer','lp.menge', 'vlp.menge', 'l.belegnr', 'l.belegnr');
$searchsql = array('v.versand', 'v.nr', 'v.tracking', 'v.versender', 'v.gewicht', 'v.bemerkung', 'v.status'); $searchsql = array('v.versand', 'v.nr', 'v.tracking', 'v.versender', 'v.gewicht', 'v.bemerkung', 'v.status');
$defaultorder = 1; $defaultorder = 1;
@ -278,7 +353,8 @@ class Versandpakete {
// $menu = "<a href=\"index.php?module=versandpakete&action=deletepos&pos=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>"; // $menu = "<a href=\"index.php?module=versandpakete&action=deletepos&pos=%value%\"><img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>";
$menu = ""; $menu = "";
$menucol = 6; $menucol = 6;
$aligncenter = [5,6,7];
$lieferschein_link = array( $lieferschein_link = array(
'<a href="index.php?module=lieferschein&action=edit&id=', '<a href="index.php?module=lieferschein&action=edit&id=',
@ -329,20 +405,21 @@ class Versandpakete {
$lieferschein_id = $app->User->GetParameter('versandpakete_lieferschein'); $lieferschein_id = $app->User->GetParameter('versandpakete_lieferschein');
$allowed['versandpakete_lieferschein_paket_list'] = array('list'); $allowed['versandpakete_lieferschein_paket_list'] = array('list');
$heading = array('Pos', 'Artikel', 'Artikel-Nr.','Menge Lieferschein', 'Menge in Versandpaketen', 'Paket-Nr.', 'Men&uuml;'); $heading = array('Pos', 'Artikel', 'Artikel-Nr.','Menge Lieferschein', 'Menge in Versandpaketen', 'Paket-Nr.');
$width = array('10%','10%','10%'); // Fill out manually later $width = array('10%','10%','10%'); // Fill out manually later
// columns that are aligned right (numbers etc) // columns that are aligned right (numbers etc)
// $alignright = array(4,5,6,7,8); // $alignright = array(4,5,6,7,8);
$findcols = array('lp.id','lp.id'); $findcols = array('sort','name_de','a.nummer','lp.menge','vlp.menge','versandpaket');
$searchsql = array('v.versand', 'v.nr', 'v.tracking', 'v.versender', 'v.gewicht', 'v.bemerkung', 'v.status'); $searchsql = array('v.versand', 'v.nr', 'v.tracking', 'v.versender', 'v.gewicht', 'v.bemerkung', 'v.status');
$defaultorder = 1; $defaultorder = 1;
$defaultorderdesc = 0; $defaultorderdesc = 0;
$menu = ""; $menu = "";
$menucol = 6; $menucol = 6;
$aligncenter = [4,5];
$paket_link = array( $paket_link = array(
'<a href="index.php?module=versandpakete&action=edit&id=', '<a href="index.php?module=versandpakete&action=edit&id=',
@ -362,14 +439,12 @@ class Versandpakete {
GROUP_CONCAT(".$app->erp->ConcatSQL($paket_link)." SEPARATOR ', ') as pakete, GROUP_CONCAT(".$app->erp->ConcatSQL($paket_link)." SEPARATOR ', ') as pakete,
vlp.id vlp.id
FROM lieferschein l FROM lieferschein l
INNER JOIN lieferschein_position lp ON INNER JOIN lieferschein_position lp ON lp.lieferschein = l.id
lp.lieferschein = l.id INNER JOIN artikel a ON lp.artikel = a.id
INNER JOIN artikel a ON
lp.artikel = a.id
LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id
"; ";
$where = "l.id =".$lieferschein_id; $where = "l.id =".$lieferschein_id." AND a.lagerartikel";
// $count = "SELECT count(DISTINCT id) FROM versandpakete v WHERE $where"; // $count = "SELECT count(DISTINCT id) FROM versandpakete v WHERE $where";
// $groupby = "GROUP BY lp.id"; // $groupby = "GROUP BY lp.id";
$groupby = "GROUP BY lp.id"; $groupby = "GROUP BY lp.id";
@ -387,12 +462,12 @@ class Versandpakete {
} }
function versandpakete_menu() { function versandpakete_menu() {
$this->app->erp->MenuEintrag("index.php?module=versandpakete&action=list", "&Uuml;bersicht"); $this->app->erp->MenuEintrag("index.php?module=versandpakete&action=list", "Lieferungen");
$this->app->erp->MenuEintrag("index.php?module=versandpakete&action=lieferscheine", "Offene Lieferscheine"); $this->app->erp->MenuEintrag("index.php?module=versandpakete&action=pakete", "Versandpakete");
$this->app->erp->MenuEintrag("index.php?module=versandpakete&action=create", "Neu anlegen"); $this->app->erp->MenuEintrag("index.php?module=versandpakete&action=create", "Neu anlegen");
} }
function versandpakete_list() { function versandpakete_pakete() {
$this->versandpakete_menu(); $this->versandpakete_menu();
// Status select // Status select
$options_text = ""; $options_text = "";
@ -426,10 +501,10 @@ class Versandpakete {
$this->versandpakete_list(); $this->versandpakete_list();
} }
function versandpakete_lieferscheine() { function versandpakete_list() {
$this->versandpakete_menu(); $this->versandpakete_menu();
$this->app->YUI->TableSearch('TAB1', 'versandpakete_lieferscheine', "show", "", "", basename(__FILE__), __CLASS__); $this->app->YUI->TableSearch('TAB1', 'versandpakete_lieferscheine', "show", "", "", basename(__FILE__), __CLASS__);
$this->app->Tpl->Parse('PAGE', "versandpakete_lieferscheine.tpl"); $this->app->Tpl->Parse('PAGE', "versandpakete_lieferungen.tpl");
} }
public function versandpakete_delete() { public function versandpakete_delete() {
@ -688,8 +763,9 @@ class Versandpakete {
MAX(lp.menge) AS lp_menge, MAX(lp.menge) AS lp_menge,
SUM(vlp.menge) AS v_menge SUM(vlp.menge) AS v_menge
FROM lieferschein_position lp FROM lieferschein_position lp
LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id INNER JOIN artikel a ON lp.artikel = a.id
WHERE lp.lieferschein = ".$lieferschein." AND lp.artikel = ".$artikel." LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id
WHERE lp.lieferschein = ".$lieferschein." AND lp.artikel = ".$artikel." AND a.lagerartikel
GROUP BY lp.id GROUP BY lp.id
"; ";
@ -738,8 +814,9 @@ class Versandpakete {
MAX(lp.menge) AS lp_menge, MAX(lp.menge) AS lp_menge,
SUM(vlp.menge) AS v_menge SUM(vlp.menge) AS v_menge
FROM lieferschein_position lp FROM lieferschein_position lp
INNER JOIN artikel a ON lp.artikel = a. id
LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id
WHERE lp.lieferschein = ".$lieferschein." WHERE lp.lieferschein = ".$lieferschein." AND a.lagerartikel
GROUP BY lp.id GROUP BY lp.id
"; ";