From e120780c6c65f79140558ea2a4228a6909ce27c5 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Sat, 1 Apr 2023 16:53:54 +0200 Subject: [PATCH 01/12] FIX - Filter status order in list --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 0d9ed8423cb..f04b6cfd501 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -898,7 +898,7 @@ if ($search_status <> '') { if ($search_status == -3) { // To bill //$sql.= ' AND c.fk_statut in (1,2,3)'; //$sql.= ' AND c.facture = 0'; // invoice not created - $sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed + $sql .= ' AND (c.fk_statut IN (1,2,3))'; // validated, in process or closed } if ($search_status == -4) { // "validate and in progress" $sql .= ' AND (c.fk_statut IN (1,2))'; // validated, in process From 01bcd93580bd7fed89d3a3d6899021c34c484bda Mon Sep 17 00:00:00 2001 From: Guenter Lukas Date: Sun, 2 Apr 2023 12:01:48 +0200 Subject: [PATCH 02/12] FIX: #24414 --- htdocs/core/class/extrafields.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 6644548d87c..a878e39674b 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1083,6 +1083,11 @@ class ExtraFields if ((string) $okey == '') { continue; } + + if (($pipepos = strpos ($val, '|')) > 0) { + // Select-Field depending on other field, remove extra data from value + $val = substr ($val, 0, $pipepos); + } if ($langfile && $val) { $options[$okey] = $langs->trans($val); From 3c74a3272cfc2c72104835b7678b8c686e3de06a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 2 Apr 2023 10:07:36 +0000 Subject: [PATCH 03/12] Fixing style errors. --- htdocs/core/class/extrafields.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a878e39674b..e2e24c15a24 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1083,10 +1083,10 @@ class ExtraFields if ((string) $okey == '') { continue; } - - if (($pipepos = strpos ($val, '|')) > 0) { + + if (($pipepos = strpos($val, '|')) > 0) { // Select-Field depending on other field, remove extra data from value - $val = substr ($val, 0, $pipepos); + $val = substr($val, 0, $pipepos); } if ($langfile && $val) { From 3c00b00066e939a3a7eb06e76b0cb14fd890e040 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Mon, 3 Apr 2023 10:40:52 +0200 Subject: [PATCH 04/12] Product Stats : Fix facture rec status --- htdocs/product/stats/facturerec.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index 9b982407825..9b18e510a78 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -156,7 +156,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).''; } elseif ($user->rights->facture->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,"; - $sql .= "f.titre, f.datec, f.rowid as facid,"; + $sql .= "f.titre, f.datec, f.rowid as facid, f.suspended as suspended,"; $sql .= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= ", sc.fk_soc, sc.fk_user "; @@ -251,7 +251,7 @@ if ($id > 0 || !empty($ref)) { print_liste_field_titre("DateInvoice", $_SERVER["PHP_SELF"], "f.datec", "", $option, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Qty", $_SERVER["PHP_SELF"], "d.qty", "", $option, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], "d.total_ht", "", $option, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.paye,f.fk_statut", "", $option, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "f.suspended", "", $option, 'align="right"', $sortfield, $sortorder); print "\n"; if ($num > 0) { @@ -280,7 +280,7 @@ if ($id > 0 || !empty($ref)) { print dol_print_date($db->jdate($objp->datec), 'dayhour').""; print ''.$objp->qty."\n"; print ''.price($objp->total_ht)."\n"; - print ''.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5, $paiement, $objp->type).''; + print ''.$invoicestatic->LibStatut(1, $objp->suspended, 5, $paiement, $objp->type).''; print "\n"; $i++; } From 0173688d0577ca9305d13fc36347528ec08698a7 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 3 Apr 2023 15:49:38 +0200 Subject: [PATCH 05/12] FIX Propagate extrafields from supplier order to reception --- htdocs/reception/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 3ee755bef37..3c2c0ba53ba 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -871,7 +871,7 @@ if ($action == 'create') { if ($objectsrc->fetch_optionals() > 0) { $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } - print $object->showOptionals($extrafields, 'create', $parameters); + print $recept->showOptionals($extrafields, 'create', $parameters); } // Incoterms From 144d061db3612c04a7b66299ad22bfdd1462f09a Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 4 Apr 2023 11:01:03 +0200 Subject: [PATCH 06/12] FIX supplier link on bank transfer line --- htdocs/compta/prelevement/line.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 6eb10ce6a1a..a7690ca51a2 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -315,7 +315,11 @@ if ($id) { print ''.$obj->ref."\n"; } - print ''; + if ($type == 'bank-transfer') { + print ''; + } else { + print ''; + } print img_object($langs->trans("ShowCompany"), "company").' '.$obj->name."\n"; print ''.price($obj->total_ttc)."\n"; From 66f1696a9b16725765a7b401a907c16aae8377b6 Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Tue, 4 Apr 2023 11:05:50 +0200 Subject: [PATCH 07/12] FIX filter missing id --- htdocs/contact/consumption.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index da00374cc2a..017cd2d64d1 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -339,7 +339,7 @@ if ($sql_select) $num = $db->num_rows($resql); - $param = "&socid=".urlencode($socid)."&type_element=".urlencode($type_element); + $param = "&socid=".urlencode($socid)."&type_element=".urlencode($type_element)."&id=".urlencode($id); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($sprod_fulldescr) $param .= "&sprod_fulldescr=".urlencode($sprod_fulldescr); From 9f8b67a6ec5ba35d642a1a02de920c68f40b8f46 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 4 Apr 2023 11:33:23 +0200 Subject: [PATCH 08/12] FIX supplier invoice status on bank transfer line --- htdocs/compta/prelevement/line.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 6eb10ce6a1a..d094a61e0b8 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -116,7 +116,13 @@ if ($action == 'confirm_rejet') { * View */ -$invoicestatic = new Facture($db); +if ($type == 'bank-transfer') { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $invoicestatic = new FactureFournisseur($db); +} else { + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $invoicestatic = new Facture($db); +} $title = $langs->trans("WithdrawalsLine"); if ($type == 'bank-transfer') { From 36ffcbc5da75d3451c78f4682bda4e767337294e Mon Sep 17 00:00:00 2001 From: atm-lena Date: Tue, 4 Apr 2023 12:26:59 +0200 Subject: [PATCH 09/12] FIX Search List Select Extrafields with condition --- htdocs/core/class/extrafields.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 6644548d87c..6f346179aa8 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1084,6 +1084,9 @@ class ExtraFields continue; } + $valarray = explode('|', $val); + $val = $valarray[0]; + if ($langfile && $val) { $options[$okey] = $langs->trans($val); } else { From 5ba1f2dc56deafb2018ffd309585ae6acb0f3f31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Apr 2023 22:38:05 +0200 Subject: [PATCH 10/12] Update list.php --- htdocs/commande/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index f04b6cfd501..1ca36c2e3c0 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -888,19 +888,19 @@ if ($search_status <> '') { if ($search_status == 1 && empty($conf->expedition->enabled)) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated' } else { - $sql .= ' AND c.fk_statut = '.((int) $search_status); // brouillon, validee, en cours, annulee + $sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled } } - if ($search_status == -2) { // To process + if ($search_status == -2) { // "validated + in process" //$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0'; $sql .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected } - if ($search_status == -3) { // To bill + if ($search_status == -3) { // "validated + in process + delivered" //$sql.= ' AND c.fk_statut in (1,2,3)'; //$sql.= ' AND c.facture = 0'; // invoice not created $sql .= ' AND (c.fk_statut IN (1,2,3))'; // validated, in process or closed } - if ($search_status == -4) { // "validate and in progress" + if ($search_status == -4) { // "validate + in progress" $sql .= ' AND (c.fk_statut IN (1,2))'; // validated, in process } } From 3b9853f7d323d007da1ebaea9509e580c38db1bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Apr 2023 22:45:30 +0200 Subject: [PATCH 11/12] FIX More complete fix for #24411 --- htdocs/commande/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1ca36c2e3c0..8169193ea08 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -893,7 +893,7 @@ if ($search_status <> '') { } if ($search_status == -2) { // "validated + in process" //$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0'; - $sql .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected + $sql .= " AND (c.fk_statut IN (1,2))"; } if ($search_status == -3) { // "validated + in process + delivered" //$sql.= ' AND c.fk_statut in (1,2,3)'; From 9ab2fb3856f4cede9cf5ea40ad35f3af8b953c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20de=20Grandpr=C3=A9?= Date: Tue, 4 Apr 2023 15:31:06 -0400 Subject: [PATCH 12/12] Edit button now available on subscription card when Bank module disabled. --- htdocs/adherents/subscription/card.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 7cbb187c319..86725b332f3 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -351,11 +351,11 @@ if ($rowid && $action != 'edit') { */ print '
'; - if ($user->rights->adherent->cotisation->creer) { - if (!empty($bankline->rappro)) { + if ($user->hasRight('adherent', 'cotisation', 'creer')) { + if (!empty($bankline->rappro) || empty($bankline)) { print '"; } else { - print '"; + print '"; } }