From d41675b028a232e83315ca12adbc190ec04e1b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Sun, 8 Dec 2019 18:15:13 +0100 Subject: [PATCH 1/6] Fix translations --- htdocs/langs/en_US/sendings.lang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index f3f023f8dcf..5ce3b7f67e9 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -54,10 +54,10 @@ ActionsOnShipping=Events on shipment LinkToTrackYourPackage=Link to track your package ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card. ShipmentLine=Shipment line -ProductQtyInCustomersOrdersRunning=Product quantity into open sales orders -ProductQtyInSuppliersOrdersRunning=Product quantity into open purchase orders +ProductQtyInCustomersOrdersRunning=Product quantity from open sales orders +ProductQtyInSuppliersOrdersRunning=Product quantity from open purchase orders ProductQtyInShipmentAlreadySent=Product quantity from open sales order already sent -ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from open purchase order already received +ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from open purchase orders already received NoProductToShipFoundIntoStock=No product to ship found in warehouse %s. Correct stock or go back to choose another warehouse. WeightVolShort=Weight/Vol. ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments. From 3762bbd64374034fffb0aa2f90afc36bb17b440d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 10 Dec 2019 18:46:07 +0100 Subject: [PATCH 2/6] do not trim int --- htdocs/contrat/class/contrat.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 25fe68fb8aa..e17bb9800da 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -643,7 +643,7 @@ class Contrat extends CommonObject $sql .= " note_private, note_public, model_pdf, extraparams"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat"; if (!$id) $sql .= " WHERE entity IN (".getEntity('contract').")"; - else $sql .= " WHERE rowid=".$id; + else $sql .= " WHERE rowid=".(int) $id; if ($ref_customer) { $sql .= " AND ref_customer = '".$this->db->escape($ref_customer)."'"; @@ -1291,20 +1291,20 @@ class Contrat extends CommonObject // Clean parameters if (empty($this->fk_commercial_signature) && $this->commercial_signature_id > 0) $this->fk_commercial_signature = $this->commercial_signature_id; if (empty($this->fk_commercial_suivi) && $this->commercial_suivi_id > 0) $this->fk_commercial_suivi = $this->commercial_suivi_id; - if (empty($this->fk_soc) && $this->socid > 0) $this->fk_soc = $this->socid; - if (empty($this->fk_project) && $this->projet > 0) $this->fk_project = $this->projet; + if (empty($this->fk_soc) && $this->socid > 0) $this->fk_soc = (int) $this->socid; + if (empty($this->fk_project) && $this->projet > 0) $this->fk_project = (int) $this->projet; if (isset($this->ref)) $this->ref = trim($this->ref); if (isset($this->ref_customer)) $this->ref_customer = trim($this->ref_customer); if (isset($this->ref_supplier)) $this->ref_supplier = trim($this->ref_supplier); if (isset($this->ref_ext)) $this->ref_ext = trim($this->ref_ext); - if (isset($this->entity)) $this->entity = trim($this->entity); + if (isset($this->entity)) $this->entity = (int) $this->entity); if (isset($this->statut)) $this->statut = (int) $this->statut; - if (isset($this->fk_soc)) $this->fk_soc = trim($this->fk_soc); + if (isset($this->fk_soc)) $this->fk_soc = (int) $this->fk_soc; if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature = trim($this->fk_commercial_signature); if (isset($this->fk_commercial_suivi)) $this->fk_commercial_suivi = trim($this->fk_commercial_suivi); if (isset($this->fk_user_mise_en_service)) $this->fk_user_mise_en_service = trim($this->fk_user_mise_en_service); - if (isset($this->fk_user_cloture)) $this->fk_user_cloture = trim($this->fk_user_cloture); + if (isset($this->fk_user_cloture)) $this->fk_user_cloture = (int) $this->fk_user_cloture); if (isset($this->note_private)) $this->note_private = trim($this->note_private); if (isset($this->note_public)) $this->note_public = trim($this->note_public); if (isset($this->import_key)) $this->import_key = trim($this->import_key); From b5c5b4e76548ec92366d892e4ae62684c2fa91a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 10 Dec 2019 18:55:22 +0100 Subject: [PATCH 3/6] Update contrat.class.php --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e17bb9800da..cf4ca6d28b3 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1298,7 +1298,7 @@ class Contrat extends CommonObject if (isset($this->ref_customer)) $this->ref_customer = trim($this->ref_customer); if (isset($this->ref_supplier)) $this->ref_supplier = trim($this->ref_supplier); if (isset($this->ref_ext)) $this->ref_ext = trim($this->ref_ext); - if (isset($this->entity)) $this->entity = (int) $this->entity); + if (isset($this->entity)) $this->entity = (int) $this->entity; if (isset($this->statut)) $this->statut = (int) $this->statut; if (isset($this->fk_soc)) $this->fk_soc = (int) $this->fk_soc; if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature = trim($this->fk_commercial_signature); From 2b869558907b8ffcc71cb0980944f5614a6e75b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 10 Dec 2019 19:44:20 +0100 Subject: [PATCH 4/6] Update contrat.class.php --- htdocs/contrat/class/contrat.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index cf4ca6d28b3..89ee93a39e8 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1303,8 +1303,8 @@ class Contrat extends CommonObject if (isset($this->fk_soc)) $this->fk_soc = (int) $this->fk_soc; if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature = trim($this->fk_commercial_signature); if (isset($this->fk_commercial_suivi)) $this->fk_commercial_suivi = trim($this->fk_commercial_suivi); - if (isset($this->fk_user_mise_en_service)) $this->fk_user_mise_en_service = trim($this->fk_user_mise_en_service); - if (isset($this->fk_user_cloture)) $this->fk_user_cloture = (int) $this->fk_user_cloture); + if (isset($this->fk_user_mise_en_service)) $this->fk_user_mise_en_service = (int) $this->fk_user_mise_en_service; + if (isset($this->fk_user_cloture)) $this->fk_user_cloture = (int) $this->fk_user_cloture; if (isset($this->note_private)) $this->note_private = trim($this->note_private); if (isset($this->note_public)) $this->note_public = trim($this->note_public); if (isset($this->import_key)) $this->import_key = trim($this->import_key); From cc96ad03c1315d5265d1897f18a566114d07d418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Wed, 11 Dec 2019 14:00:27 +0100 Subject: [PATCH 5/6] Update replenish.php --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index d3a647adfcf..b909a9f2e9d 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -367,7 +367,7 @@ if ($usevirtualstock) $sqlExpeditionsCli .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON (c.rowid = cd.fk_commande)"; $sqlExpeditionsCli .= " WHERE e.entity IN (".getEntity('expedition').")"; $sqlExpeditionsCli .= " AND cd.fk_product = p.rowid"; - $sqlExpeditionsCli .= " AND c.fk_statut IN (1,2))"; + $sqlExpeditionsCli .= " AND e.fk_statut IN (1,2))"; $sqlCommandesFourn = "(SELECT ".$db->ifsql("SUM(cd.qty) IS NULL", "0", "SUM(cd.qty)")." as qty"; $sqlCommandesFourn .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as cd"; From 4dd3cb346967e7cebecd2598a259f2587b2c7480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Fri, 13 Dec 2019 07:58:36 +0100 Subject: [PATCH 6/6] Prevent stock amount from becoming NULL Set stock to 0 if NULL --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cac859c53b5..223f34a7dce 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2095,7 +2095,7 @@ class Form } else { - $selectFieldsGrouped = ", p.stock"; + $selectFieldsGrouped = ", ".$db->ifsql("p.stock IS NULL", 0, "p.stock")." AS stock"; } $sql = "SELECT ";