From 02517b7c3f8370b91a3ff72268c6c19b202b0875 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Feb 2024 20:44:36 +0100 Subject: [PATCH] Fix #28055 --- htdocs/compta/facture/list.php | 25 +++++++++++++------------ htdocs/fourn/facture/list.php | 10 +++++++++- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f66b13dca46..078a19d9437 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -65,9 +65,9 @@ $langs->loadLangs(array('bills', 'companies', 'products', 'categories')); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOST('id', 'int') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); @@ -82,7 +82,6 @@ if ($contextpage == 'poslist') { $optioncss = 'print'; } -$lineid = GETPOST('lineid', 'int'); $userid = GETPOST('userid', 'int'); $search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); @@ -580,9 +579,19 @@ $facturestatic = new Facture($db); $formcompany = new FormCompany($db); $companystatic = new Societe($db); $companyparent = new Societe($db); + $company_url_list = array(); $subtypearray = $object->getArrayOfInvoiceSubtypes(0); -$title = $langs->trans('BillsCustomers').' '.($socid > 0 ? ' '.$soc->name : ''); + +if ($socid > 0) { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_company)) { + $search_company = $soc->name; + } +} + +$title = $langs->trans('BillsCustomers').' '.($socid > 0 ? ' - '.$soc->name : ''); $help_url = 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; @@ -970,14 +979,6 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s llxHeader('', $title, $help_url); -if ($socid > 0) { - $soc = new Societe($db); - $soc->fetch($socid); - if (empty($search_company)) { - $search_company = $soc->name; - } -} - $param = '&socid='.urlencode($socid); if (!empty($mode)) { $param .= '&mode='.urlencode($mode); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index a65fca4d55c..b61ec85ab97 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -407,7 +407,15 @@ $thirdparty = new Societe($db); $subtypearray = $object->getArrayOfInvoiceSubtypes(0); $now = dol_now(); -$title = $langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''); +if ($socid > 0) { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_company)) { + $search_company = $soc->name; + } +} + +$title = $langs->trans("BillsSuppliers").($socid ? ' - '.$soc->name : ''); $help_url = 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'; // Build and execute select