From 0046bfc53fd910ea7002eb65c4cc0fac76d710f1 Mon Sep 17 00:00:00 2001 From: Stephane Lesage Date: Sun, 29 Nov 2020 23:42:47 +0100 Subject: [PATCH 1/8] Fix Users list filter by gender --- htdocs/user/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index ef6e205fd0d..1f59656dcbd 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -231,7 +231,7 @@ if ($search_thirdparty != '') $sql .= natural_search(array('s.nom'), $search_thi if ($search_login != '') $sql .= natural_search("u.login", $search_login); if ($search_lastname != '') $sql .= natural_search("u.lastname", $search_lastname); if ($search_firstname != '') $sql .= natural_search("u.firstname", $search_firstname); -if ($search_gender != '' && $search_gender != '-1') $sql .= " AND u.gender = '".$search_gender."'"; +if ($search_gender != '' && $search_gender != '-1') $sql .= " AND u.gender = '".$db->escape($search_gender)."'"; // Cannot use natural_search as looking for %man% also includes woman if (is_numeric($search_employee) && $search_employee >= 0) { $sql .= ' AND u.employee = '.(int) $search_employee; } From 4f762cf73d81163ccc17fb0a6aab369b83592d24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Nov 2020 08:29:19 +0100 Subject: [PATCH 2/8] Fix label --- htdocs/fourn/commande/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 00b620a201b..69db75ce5fc 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -486,14 +486,14 @@ if ($socid > 0) $title .= ' - '.$fourn->name; } -if ($search_status) +/*if ($search_status) { if ($search_status == '1,2') $title .= ' - '.$langs->trans("SuppliersOrdersToProcess"); elseif ($search_status == '3,4') $title .= ' - '.$langs->trans("SuppliersOrdersAwaitingReception"); elseif ($search_status == '1,2,3') $title .= ' - '.$langs->trans("StatusOrderToProcessShort"); elseif ($search_status == '6,7') $title .= ' - '.$langs->trans("StatusOrderCanceled"); - elseif(is_numeric($search_status)) $title .= ' - '.$commandestatic->LibStatut($search_status); -} + elseif (is_numeric($search_status) && $search_status >= 0) $title .= ' - '.$commandestatic->LibStatut($search_status); +}*/ if ($search_billed > 0) $title .= ' - '.$langs->trans("Billed"); //$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; From 560194c3b95e4eac183d0e6a1245e474fa0b6c4f Mon Sep 17 00:00:00 2001 From: teleassist <30868208+teleassist@users.noreply.github.com> Date: Mon, 30 Nov 2020 11:22:49 +0100 Subject: [PATCH 3/8] FIX #15374 : "New" doesn't clear total amounts Invoice's total amounts where not updated because of direct lines deleting in database. --- htdocs/takepos/invoice.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 1ff0db279b0..7bd15687037 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -411,17 +411,18 @@ if ($action == "delete") { if ($result > 0 && $invoice->statut == Facture::STATUS_DRAFT) { $db->begin(); - - // We delete the lines - $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_extrafields where fk_object = ".$placeid; - $resql1 = $db->query($sql); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet where fk_facture = ".$placeid; - $resql2 = $db->query($sql); + + // We delete the lines + $resdeletelines = 1; + foreach($invoice->lines as $line){ + $resdeletelines *= $invoice->deleteline($line->id); + } + $sql = "UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}; $sql .= " WHERE ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; - $resql3 = $db->query($sql); + $resql1 = $db->query($sql); - if ($resql1 && $resql2 && $resql3) + if ($resdeletelines && $resql1) { $db->commit(); } @@ -429,8 +430,8 @@ if ($action == "delete") { { $db->rollback(); } - - $invoice->fetch($placeid); + + $invoice->fetch($placeid); } } } From 9ee37153f77ed142e21483854de03296fe06d8b4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 30 Nov 2020 10:32:58 +0000 Subject: [PATCH 4/8] Fixing style errors. --- htdocs/takepos/invoice.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 7bd15687037..323b105caed 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -411,13 +411,13 @@ if ($action == "delete") { if ($result > 0 && $invoice->statut == Facture::STATUS_DRAFT) { $db->begin(); - + // We delete the lines $resdeletelines = 1; foreach($invoice->lines as $line){ $resdeletelines *= $invoice->deleteline($line->id); } - + $sql = "UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}; $sql .= " WHERE ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql1 = $db->query($sql); @@ -430,7 +430,7 @@ if ($action == "delete") { { $db->rollback(); } - + $invoice->fetch($placeid); } } From 7870a33fd3de524674ad2dd919929cc89132ec06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Nov 2020 15:39:35 +0100 Subject: [PATCH 5/8] Update invoice.php --- htdocs/takepos/invoice.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 323b105caed..493202376a9 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -415,7 +415,11 @@ if ($action == "delete") { // We delete the lines $resdeletelines = 1; foreach($invoice->lines as $line){ - $resdeletelines *= $invoice->deleteline($line->id); + $tmpres = $invoice->deleteline($line->id); + if ($tmpres < 0) { + $resdeletelines = 0; + break; + } } $sql = "UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}; From 3caf65ce6f9b9da799925aa52fd247252d20df55 Mon Sep 17 00:00:00 2001 From: Stephane Lesage Date: Tue, 1 Dec 2020 19:30:09 +0100 Subject: [PATCH 6/8] Create/Edit extra-field with multi-line text area for computed value --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 7 +++++-- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 6c25b5c07b5..fca100b2e07 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -180,11 +180,14 @@ $langs->load("modulebuilder"); trans("LanguageFile"); ?> + global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> - textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> - textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + + trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 191b4cf40c8..3af89dcede5 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -263,11 +263,14 @@ else trans("LanguageFile"); ?> + global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> - textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> - textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + + trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> From 1c4876b417d24e80aa380a7deaf179afc302aa5b Mon Sep 17 00:00:00 2001 From: Stephane Lesage Date: Tue, 1 Dec 2020 21:17:03 +0100 Subject: [PATCH 7/8] more transporters in llx_c_shipment_mode.sql --- htdocs/install/mysql/data/llx_c_shipment_mode.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_shipment_mode.sql b/htdocs/install/mysql/data/llx_c_shipment_mode.sql index af3cf09f9f8..e5026f8d2f7 100644 --- a/htdocs/install/mysql/data/llx_c_shipment_mode.sql +++ b/htdocs/install/mysql/data/llx_c_shipment_mode.sql @@ -37,3 +37,9 @@ INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (6,'KIALA','KIALA','Relais Kiala','http://www.kiala.fr/tnt/delivery/{TRACKID}', 0); INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (7,'GLS','GLS','General Logistics Systems','https://gls-group.eu/FR/fr/suivi-colis?match={TRACKID}', 0); INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (8,'CHRONO','Chronopost','Chronopost','http://www.chronopost.fr/expedier/inputLTNumbersNoJahia.do?listeNumeros={TRACKID}', 0); +INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (9,'INPERSON', 'In person at your site', NULL, NULL, 0, NULL), +INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (10,'FEDEX', 'Fedex', NULL, 'https://www.fedex.com/apps/fedextrack/index.html?tracknumbers={TRACKID}', 0, NULL), +INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (11,'TNT', 'TNT', NULL, 'https://www.tnt.com/express/fr_fr/site/outils-expedition/suivi.html?searchType=con&cons=={TRACKID}', 0, NULL), +INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (12,'DHL', 'DHL', NULL, 'https://www.dhl.com/fr-fr/home/tracking/tracking-global-forwarding.html?submit=1&tracking-id={TRACKID}', 0, NULL), +INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (13,'DPD', 'DPD', NULL, 'https://www.dpd.fr/trace/{TRACKID}', 0, NULL), +INSERT INTO llx_c_shipment_mode (rowid,code,libelle,description,tracking,active) VALUES (14,'MAINFREIGHT', 'Mainfreight', NULL, 'https://www.mainfreight.com/track?{TRACKID}', 0, NULL); From a2dca42965f1f64c6d32699bd7302d1863b71d7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Dec 2020 18:55:55 +0100 Subject: [PATCH 8/8] Revert "Create/Edit extra-field with multi-line text area for computed value" --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 7 ++----- htdocs/core/tpl/admin_extrafields_edit.tpl.php | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index fca100b2e07..6c25b5c07b5 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -180,14 +180,11 @@ $langs->load("modulebuilder"); trans("LanguageFile"); ?> - global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> - textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> - textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> - - trans("DefaultValue").' ('.$langs->trans("Database").')'; ?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 3af89dcede5..191b4cf40c8 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -263,14 +263,11 @@ else trans("LanguageFile"); ?> - global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) { ?> - textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc"), 1, 'help', '', 0, 2, 'tooltipcompute'); ?> - textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> + textwithpicto($langs->trans("ComputedFormula"), $langs->trans("ComputedFormulaDesc")).$form->textwithpicto($langs->trans("Computedpersistent"), $langs->trans("ComputedpersistentDesc"), 1, 'warning'); ?> - - trans("DefaultValue").' ('.$langs->trans("Database").')'; ?>