From ecf986d33b4a6901de4d94af986e531fed8957e6 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Thu, 26 Oct 2023 20:23:19 +0200 Subject: [PATCH] versandpakete improvements --- phpwf/plugins/class.yui.php | 6 ++-- www/pages/ajax.php | 5 ++- www/pages/content/versandpakete_edit.tpl | 6 ++-- www/pages/content/versandpakete_lieferung.tpl | 2 +- www/pages/versandpakete.php | 34 +++++++++++++------ 5 files changed, 35 insertions(+), 18 deletions(-) diff --git a/phpwf/plugins/class.yui.php b/phpwf/plugins/class.yui.php index c06f3ab2..9dd92f04 100644 --- a/phpwf/plugins/class.yui.php +++ b/phpwf/plugins/class.yui.php @@ -3693,10 +3693,10 @@ class YUI { } function IconsSQL_lieferung() { - $lieferschein_kein = "app->Conf->WFconf['defaulttheme']}/images/lagerstop.png\" title=\"Keine Artikel\" border=\"0\" style=\"margin-right:1px\">"; + $lieferschein_kein = "app->Conf->WFconf['defaulttheme']}/images/lagerstop.png\" title=\"Keine Artikel in Versandpaketen\" border=\"0\" style=\"margin-right:1px\">"; $lieferschein_ohne_pos = "app->Conf->WFconf['defaulttheme']}/images/summe_go.png\" title=\"Lieferschein ohne Positionen\" border=\"0\" style=\"margin-right:1px\">"; - $lieferschein_voll = "app->Conf->WFconf['defaulttheme']}/images/lagergo.png\" title=\"Artikel vollständig\" border=\"0\" style=\"margin-right:1px\">"; - $lieferschein_teil = "app->Conf->WFconf['defaulttheme']}/images/lagergo_stop.png\" title=\"Artikel teilweise\" border=\"0\" style=\"margin-right:1px\">"; + $lieferschein_voll = "app->Conf->WFconf['defaulttheme']}/images/lagergo.png\" title=\"Artikel vollständig in Versandpaketen\" border=\"0\" style=\"margin-right:1px\">"; + $lieferschein_teil = "app->Conf->WFconf['defaulttheme']}/images/lagergo_stop.png\" title=\"Artikel teilweise in Versandpaketen\" border=\"0\" style=\"margin-right:1px\">"; $versendet = "app->Conf->WFconf['defaulttheme']}/images/liefersperrego.png\" title=\"Versendet\" border=\"0\" style=\"margin-right:1px\">"; $versendet_nicht = "app->Conf->WFconf['defaulttheme']}/images/liefersperrestop.png\" title=\"Nicht versendet\" border=\"0\" style=\"margin-right:1px\">"; diff --git a/www/pages/ajax.php b/www/pages/ajax.php index 8faae048..a2c7e04b 100644 --- a/www/pages/ajax.php +++ b/www/pages/ajax.php @@ -1603,7 +1603,10 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku $subwhere = $this->AjaxFilterWhere($termorig,$felder); $sql = "SELECT CONCAT(art.nummer,' ',art.name_de) as name FROM artikel art INNER JOIN $doctype"."_position ap ON ap.artikel = art.id AND $doctype = '$doctypeid' - WHERE art.geloescht=0 AND ($artikel_freitext1_suche) AND art.geloescht=0 AND art.intern_gesperrt!=1 LIMIT 20"; + WHERE + art.geloescht=0 AND ($artikel_freitext1_suche) AND art.geloescht=0 AND art.intern_gesperrt!=1 AND + (name_de LIKE '%$term%' OR art.nummer LIKE '%$term%') + LIMIT 20"; $arr = $this->app->DB->SelectArr($sql); $carr = !empty($arr)?count($arr):0; for($i = 0; $i < $carr; $i++) { diff --git a/www/pages/content/versandpakete_edit.tpl b/www/pages/content/versandpakete_edit.tpl index 486bd8bb..eb2597f4 100644 --- a/www/pages/content/versandpakete_edit.tpl +++ b/www/pages/content/versandpakete_edit.tpl @@ -59,7 +59,7 @@ {|Gewicht Kg|}: - + @@ -90,7 +90,7 @@ - {|Lieferschein|}: + {|Artikel von Lieferschein hinzufügen|}: @@ -107,7 +107,7 @@ - + diff --git a/www/pages/content/versandpakete_lieferung.tpl b/www/pages/content/versandpakete_lieferung.tpl index 78a322f1..3f50efe0 100644 --- a/www/pages/content/versandpakete_lieferung.tpl +++ b/www/pages/content/versandpakete_lieferung.tpl @@ -19,7 +19,7 @@
-
+ [TAB1]
diff --git a/www/pages/versandpakete.php b/www/pages/versandpakete.php index 4c80bbe0..cc39fb51 100644 --- a/www/pages/versandpakete.php +++ b/www/pages/versandpakete.php @@ -71,6 +71,7 @@ class Versandpakete { $lieferschein_filter = $app->User->GetParameter('versandpakete_lieferschein_filter'); if ($lieferschein_filter) { $lieferschein_filter_where = "WHERE lieferschein = ".$lieferschein_filter; + $lieferung_link = "&lieferung=".$lieferschein_filter; } // break omitted intentionally case "versandpakete_list": @@ -97,8 +98,7 @@ class Versandpakete { $menu_link = array( '', "Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\">", '', @@ -177,7 +177,7 @@ class Versandpakete { id, ".$dropnbox.", id id2, - ".$app->erp->FormatDateShort("datum").", + ".$app->erp->FormatDateTimeShort("datum").", name, lieferscheine, versandart, @@ -345,7 +345,7 @@ class Versandpakete { ".$app->erp->FormatMenge("lmenge").", ".$app->erp->FormatMenge("vmenge").", ".$app->YUI->IconsSQL_lieferung().", - CONCAT('Conf->WFconf['defaulttheme']}/images/forward.svg\" border=\"0\">'), + if(vmenge=0,'',CONCAT('Conf->WFconf['defaulttheme']}/images/forward.svg\" title=\"Pakete anzeigen\" border=\"0\">')), id, alle_abgeschlossen FROM ( @@ -477,7 +477,7 @@ class Versandpakete { $lieferschein_id = $app->User->GetParameter('versandpakete_lieferschein'); $allowed['versandpakete_lieferschein_paket_list'] = array('list'); - $heading = array('Pos', 'Artikel', 'Artikel-Nr.','Menge Lieferschein', 'Menge in Versandpaketen', 'Paket-Nr.'); + $heading = array('Pos', 'Artikel', 'Artikel-Nr.','Menge Lieferschein', 'Menge in Versandpaketen', 'Paket-Nr.',''); $width = array('10%','10%','10%'); // Fill out manually later // columns that are aligned right (numbers etc) @@ -567,19 +567,25 @@ class Versandpakete { $selectedIds[] = $selectedId; } } - - $status = $this->app->Secure->GetPOST('status'); - + $status = $this->app->Secure->GetPOST('status'); $sql = "UPDATE versandpakete SET status = '".$status."'"; $sql .= " WHERE id IN (".implode(",",$selectedIds).")"; $this->app->DB->Update($sql); } - $this->versandpakete_list(); + + $from = $this->app->Secure->GetGET('from'); + if ($from == "lieferung") { + $this->versandpakete_lieferung(); + } + else { + $this->versandpakete_list(); + } } function versandpakete_lieferungen() { $this->versandpakete_menu(); $this->app->YUI->TableSearch('TAB1', 'versandpakete_lieferscheine', "show", "", "", basename(__FILE__), __CLASS__); + $this->app->Tpl->SetText('KURZUEBERSCHRIFT2', 'Lieferungen'); $this->app->Tpl->Parse('PAGE', "versandpakete_lieferungen.tpl"); } @@ -587,6 +593,7 @@ class Versandpakete { $lieferschein_filter = (int) $this->app->Secure->GetGET('id'); $this->versandpakete_menu(); $this->app->erp->MenuEintrag("index.php?module=versandpakete&action=add&lieferschein=".$lieferschein_filter, "Neu anlegen"); + $this->app->erp->MenuEintrag("index.php?module=versandpakete&action=lieferung&id=".$lieferschein_filter, "Details"); $this->app->User->SetParameter('versandpakete_lieferschein_filter',$lieferschein_filter); $this->versandpakete_status_select(); @@ -616,6 +623,8 @@ class Versandpakete { } } + $this->app->Tpl->Set('FROMID', $lieferschein_filter); + $this->app->YUI->TableSearch('TAB1', 'lieferung_versandpakete_list', "show", "", "", basename(__FILE__), __CLASS__); $this->app->Tpl->Parse('PAGE', "versandpakete_lieferung.tpl"); } @@ -652,7 +661,9 @@ class Versandpakete { if ($lieferung) { $this->app->erp->MenuEintrag("index.php?module=versandpakete&action=lieferung&id=".$lieferung, "Zurück"); } + $this->versandpakete_menu(); + $this->app->erp->MenuEintrag("index.php?module=versandpakete&action=edit&id=".$id, "Details"); // Check if other users are editing this id if($this->app->erp->DisableModul('versandpakete',$id)) @@ -825,8 +836,10 @@ class Versandpakete { } function versandpakete_add() { - $this->versandpakete_menu(); $id = $this->app->Secure->GetGET('id'); + $this->versandpakete_menu(); + $this->app->erp->MenuEintrag("index.php?module=versandpakete&action=edit&id=".$id, "Details"); + $this->app->Tpl->SetText('KURZUEBERSCHRIFT2', 'Artikel hinzufügen'); if (empty($id)) { $lieferschein = $this->app->Secure->GetGET('lieferschein'); if (empty($lieferschein)) { @@ -838,6 +851,7 @@ class Versandpakete { $sql = "INSERT INTO versandpakete (status, versender) VALUES ('neu','".$this->app->User->GetName()."')"; $this->app->DB->Insert($sql); $id = $this->app->DB->GetInsertId(); + $this->app->Tpl->addMessage('success', 'Versandpaket Paket Nr. '.$id.' wurde erstellt.', false, 'MESSAGE'); } } else { // $id not empty $lieferschein_input = $this->app->Secure->GetPOST('lieferschein');