From 44d006ea584d677f834974a465256f22a9668c99 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 19 Aug 2022 06:46:59 +0200 Subject: [PATCH 01/14] PHP8 Warning --- htdocs/compta/accounting-files.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 996ad22fbce..44a60414846 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -1,9 +1,10 @@ - * Copyright (C) 2004-2019 Laurent Destailleur - * Copyright (C) 2017 Pierre-Henry Favre - * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2021 Gauthier VERDOL +/* Copyright (C) 2001-2006 Rodolphe Quiedeville + * Copyright (C) 2004-2019 Laurent Destailleur + * Copyright (C) 2017 Pierre-Henry Favre + * Copyright (C) 2020 Maxime DEMAREST + * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2022 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -594,6 +595,7 @@ print ''."\n"; print dol_get_fiche_end(); +$param = ''; if (!empty($date_start) && !empty($date_stop)) { $param .= '&date_startday='.GETPOST('date_startday', 'int'); $param .= '&date_startmonth='.GETPOST('date_startmonth', 'int'); From d33573bf0534d18102acd6e7dc5c7deae2f7371f Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 19 Aug 2022 07:02:52 +0200 Subject: [PATCH 02/14] PHP8 Warnings Accountancy - Balance --- htdocs/accountancy/bookkeeping/balance.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 7a65fa0ffaa..2af12470b08 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Florian Henry - * Copyright (C) 2016-2021 Alexandre Spangaro + * Copyright (C) 2016-2022 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->loadLangs(array("accountancy", "compta")); $action = GETPOST('action', 'aZ09'); +$optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ09'); // Load variable for pagination @@ -158,7 +159,8 @@ if (empty($user->rights->accounting->mouvements->lire)) { * Action */ -$parameters = array('socid'=>$socid); +$parameters = array(); +$arrayfields = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); From 0e5a463f307782380088e4d91fb2fec62feddb29 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 19 Aug 2022 07:17:48 +0200 Subject: [PATCH 03/14] PHP8 Warnings Accountancy - Result report --- htdocs/compta/resultat/result.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index c296d4037e5..81e6672a1e4 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016 Alexandre Spangaro + * Copyright (C) 2016-2022 Alexandre Spangaro * Copyright (C) 2018-2020 Laurent Destailleur * Copyright (C) 2018 Frédéric France * @@ -228,7 +228,7 @@ if ($modecompta == "CREANCES-DETTES") { $period .= '     '.$langs->trans("DetailByAccount").' '.$form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0); $periodlink = $textprevyear.$textnextyear; $exportlink = ''; - $description = $langs->trans("RulesResultBookkeepingPersonalized"). + $description = $langs->trans("RulesResultBookkeepingPersonalized"); $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("AccountingCategory")).')'; //if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); //else $description.= $langs->trans("DepositsAreIncluded"); From 4c8ba7db218d119c1cc7f1eea364de9b4f6c4a9b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 20 Aug 2022 03:13:20 +0200 Subject: [PATCH 04/14] PHP8 Warnings / Wrong data / CSS - Accountancy - Result sales revenues by soc --- htdocs/compta/stats/casoc.php | 51 ++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 320efa36ed6..ca8a3b1c6f8 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Antoine Iauch * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Frédéric France + * Copyright (C) 2022 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -158,13 +159,27 @@ $commonparams['sortorder'] = $sortorder; $commonparams['sortfield'] = $sortfield; $headerparams = array(); -$headerparams['date_startyear'] = $date_startyear; -$headerparams['date_startmonth'] = $date_startmonth; -$headerparams['date_startday'] = $date_startday; -$headerparams['date_endyear'] = $date_endyear; -$headerparams['date_endmonth'] = $date_endmonth; -$headerparams['date_endday'] = $date_endday; -$headerparams['q'] = $q; +if (!empty($date_startyear)) { + $headerparams['date_startyear'] = $date_startyear; +} +if (!empty($date_startmonth)) { + $headerparams['date_startmonth'] = $date_startmonth; +} +if (!empty($date_startday)) { + $headerparams['date_startday'] = $date_startday; +} +if (!empty($date_endyear)) { + $headerparams['date_endyear'] = $date_endyear; +} +if (!empty($date_endmonth)) { + $headerparams['date_endmonth'] = $date_endmonth; +} +if (!empty($date_endday)) { + $headerparams['date_endday'] = $date_endday; +} +if (!empty($q)) { + $headerparams['q'] = $q; +} $tableparams = array(); $tableparams['search_categ'] = $selected_cat; @@ -250,8 +265,10 @@ $name = array(); // Show Array $catotal = 0; +$catotal_ht = 0; + if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays,"; + $sql = "SELECT DISTINCT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays,"; $sql .= " sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; if ($selected_cat === -2) { // Without any category @@ -281,10 +298,10 @@ if ($modecompta == 'CREANCES-DETTES') { } } elseif ($modecompta == "RECETTES-DEPENSES") { /* - * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les - * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) + * List of payments (old payments are not seen by this query because on older versions, + * they were not linked via the table llx_paiement_facture. They are added later) */ - $sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.fk_pays, sum(pf.amount) as amount_ttc"; + $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.fk_pays, sum(pf.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= ", ".MAIN_DB_PREFIX."paiement_facture as pf"; $sql .= ", ".MAIN_DB_PREFIX."paiement as p"; @@ -344,7 +361,11 @@ if ($result) { $obj = $db->fetch_object($result); $amount_ht[$obj->socid] = $obj->amount; $amount[$obj->socid] = $obj->amount_ttc; - $name[$obj->socid] = $obj->name.' '.$obj->firstname; + $fullname = $obj->name; + if (!empty($obj->name_alias)) { + $fullname .= ' ('.$obj->name_alias.')'; + } + $name[$obj->socid] = $fullname; $address_zip[$obj->socid] = $obj->zip; $address_town[$obj->socid] = $obj->town; $address_pays[$obj->socid] = getCountry($obj->fk_pays); @@ -356,7 +377,7 @@ if ($result) { dol_print_error($db); } -// On ajoute les paiements anciennes version, non lies par paiement_facture +// We add the old versions of payments, not linked by table llx_paiement_facture if ($modecompta == "RECETTES-DEPENSES") { $sql = "SELECT '0' as socid, 'Autres' as name, sum(p.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -409,7 +430,7 @@ print ''; -print ''; print ''; print ''; From 6bae6f5310a5fa278ed929946cdedcc27fb3b81a Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 20 Aug 2022 01:19:41 +0000 Subject: [PATCH 05/14] Fixing style errors. --- htdocs/compta/stats/casoc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index ca8a3b1c6f8..a2326a49b69 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -362,9 +362,9 @@ if ($result) { $amount_ht[$obj->socid] = $obj->amount; $amount[$obj->socid] = $obj->amount_ttc; $fullname = $obj->name; - if (!empty($obj->name_alias)) { - $fullname .= ' ('.$obj->name_alias.')'; - } + if (!empty($obj->name_alias)) { + $fullname .= ' ('.$obj->name_alias.')'; + } $name[$obj->socid] = $fullname; $address_zip[$obj->socid] = $obj->zip; $address_town[$obj->socid] = $obj->town; From d523c64f930e211b4f0af8e29e954f9396d70165 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 20 Aug 2022 03:25:54 +0200 Subject: [PATCH 06/14] PHP8 Warnings - Accountancy - Result sales revenues by user --- htdocs/compta/stats/cabyuser.php | 42 +++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 2b8f40b3aba..6c3fa64f6d6 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -135,23 +135,36 @@ $commonparams['sortorder'] = $sortorder; $commonparams['sortfield'] = $sortfield; $headerparams = array(); -$headerparams['date_startyear'] = $date_startyear; -$headerparams['date_startmonth'] = $date_startmonth; -$headerparams['date_startday'] = $date_startday; -$headerparams['date_endyear'] = $date_endyear; -$headerparams['date_endmonth'] = $date_endmonth; -$headerparams['date_endday'] = $date_endday; -$headerparams['q'] = $q; +if (!empty($date_startyear)) { + $headerparams['date_startyear'] = $date_startyear; +} +if (!empty($date_startmonth)) { + $headerparams['date_startmonth'] = $date_startmonth; +} +if (!empty($date_startday)) { + $headerparams['date_startday'] = $date_startday; +} +if (!empty($date_endyear)) { + $headerparams['date_endyear'] = $date_endyear; +} +if (!empty($date_endmonth)) { + $headerparams['date_endmonth'] = $date_endmonth; +} +if (!empty($date_endday)) { + $headerparams['date_endday'] = $date_endday; +} +if (!empty($q)) { + $headerparams['q'] = $q; +} $tableparams = array(); -$tableparams['search_categ'] = $selected_cat; -$tableparams['subcat'] = ($subcat === true) ? 'yes' : ''; // Adding common parameters $allparams = array_merge($commonparams, $headerparams, $tableparams); $headerparams = array_merge($commonparams, $headerparams); $tableparams = array_merge($commonparams, $tableparams); +$paramslink=""; foreach ($allparams as $key => $value) { $paramslink .= '&'.$key.'='.$value; } @@ -172,6 +185,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $modecompta = "RECETTES-DEPENSES"; } +$exportlink=""; +$namelink=""; + // Show report header if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("Turnover").', '.$langs->trans("ByUserAuthorOfInvoice"); @@ -230,6 +246,8 @@ foreach ($headerparams as $key => $value) { } $catotal = 0; +$catotal_ht = 0; + if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -245,8 +263,8 @@ if ($modecompta == 'CREANCES-DETTES') { } } elseif ($modecompta == "RECETTES-DEPENSES") { /* - * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les - * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin) + * List of payments (old payments are not seen by this query because on older versions, + * they were not linked via the table llx_paiement_facture. They are added later) */ $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -287,7 +305,7 @@ if ($result) { dol_print_error($db); } -// Adding old-version payments, non-bound by "paiement_facture" then without User +// Adding old-version payments, non-bound by table llx_paiement_facture then without User if ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; From 3f7df661ab00cf7abda7101528d54ad1a557d8d7 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 20 Aug 2022 03:56:11 +0200 Subject: [PATCH 07/14] PHP8 Warnings - Accountancy - Report sales revenues by product --- htdocs/compta/stats/cabyprodserv.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index e201d403bf4..0cf653844d0 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -186,7 +186,9 @@ if (!empty($year)) { if (!empty($month)) { $headerparams['month'] = $month; } -$headerparams['q'] = $q; +if (!empty($q)) { + $headerparams['q'] = $q; +} $tableparams = array(); if (!empty($selected_cat)) { @@ -205,6 +207,7 @@ $allparams = array_merge($commonparams, $headerparams, $tableparams); $headerparams = array_merge($commonparams, $headerparams); $tableparams = array_merge($commonparams, $tableparams); +$paramslink=""; foreach ($allparams as $key => $value) { $paramslink .= '&'.$key.'='.$value; } @@ -227,6 +230,9 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") { $modecompta = "RECETTES-DEPENSES"; } +$exportlink=""; +$namelink=""; + // Show report header if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("Turnover").', '.$langs->trans("ByProductsAndServices"); From b77f29fa4d925ffe6d3e9b210d956838a49bb9cd Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 20 Aug 2022 04:13:09 +0200 Subject: [PATCH 08/14] PHP8 Warnings, fix - Accountancy - Report of sales revenues billed by VAT rate --- htdocs/compta/stats/byratecountry.php | 26 ++++++++++++++------------ htdocs/compta/stats/cabyprodserv.php | 1 + htdocs/compta/stats/cabyuser.php | 1 + 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index afc56532fdf..e188cdae859 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2022 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,7 +55,9 @@ if (empty($year)) { } $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere + // Quarter +$q = ''; if (empty($date_start) || empty($date_end)) { // We define date_start and date_end $q = GETPOST("q", "int"); if (empty($q)) { @@ -155,10 +158,12 @@ foreach ($listofparams as $param) { llxHeader('', $langs->trans("TurnoverReport"), '', '', 0, 0, '', '', $morequerystring); - +$exportlink=""; +$namelink=""; //print load_fiche_titre($langs->trans("VAT"),""); //$fsearch.='
'; +$fsearch = ''; $fsearch .= ' '; $fsearch .= ' '; //$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': '; @@ -198,14 +203,17 @@ if ($nextquarter < 4) { $nextquarter = 1; $nextyear++; } -$description .= $fsearch; +$description = $fsearch; $builddate = dol_now(); +if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { + $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); +} if ($conf->global->TAX_MODE_SELL_PRODUCT == 'invoice') { - $description .= $langs->trans("RulesVATDueProducts"); + $description .= '
'.$langs->trans("RulesVATDueProducts"); } if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') { - $description .= $langs->trans("RulesVATInProducts"); + $description .= '
'.$langs->trans("RulesVATInProducts"); } if ($conf->global->TAX_MODE_SELL_SERVICE == 'invoice') { $description .= '
'.$langs->trans("RulesVATDueServices"); @@ -216,9 +224,6 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } -if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { - $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); -} // Customers invoices $elementcust = $langs->trans("CustomersInvoices"); @@ -229,9 +234,6 @@ $amountcust = $langs->trans("AmountHT"); $elementsup = $langs->trans("SuppliersInvoices"); $productsup = $productcust; $amountsup = $amountcust; -$namesup = $namecust; - - // TODO Report from bookkeeping not yet available, so we switch on report on business events if ($modecompta == "BOOKKEEPING") { @@ -247,7 +249,7 @@ if ($modecompta == "CREANCES-DETTES") { $calcmode = $langs->trans("CalcModeDebt"); //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; - $description = $langs->trans("RulesCADue"); + $description .= '
'.$langs->trans("RulesCADue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("DepositsAreNotIncluded"); } else { @@ -260,7 +262,7 @@ if ($modecompta == "CREANCES-DETTES") { $calcmode = $langs->trans("CalcModeEngagement"); //$calcmode.='
('.$langs->trans("SeeReportInDueDebtMode",'','').')'; - $description = $langs->trans("RulesCAIn"); + $description .= $langs->trans("RulesCAIn"); $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 0cf653844d0..6b4f8f3e9f2 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2016 Laurent Destailleur * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Frédéric France + * Copyright (C) 2022 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 6c3fa64f6d6..7c0454a9afd 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Antoine Iauch * Copyright (C) 2018 Frédéric France + * Copyright (C) 2022 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 6da57e512b529f9c90cc3eb536701d05d277c4c5 Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 22 Aug 2022 16:04:40 +0200 Subject: [PATCH 09/14] FIX PHP8 warning in ShowOutputField function --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 0c48cefa281..ad5ff16cb29 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1583,7 +1583,7 @@ class ExtraFields if (!empty($value)) { //$value=price($value); $sizeparts = explode(",", $size); - $number_decimals = $sizeparts[1]; + $number_decimals = array_key_exists(1, $sizeparts) ? $sizeparts[1] : 0; $value = price($value, 0, $langs, 0, 0, $number_decimals, ''); } } elseif ($type == 'boolean') { From f78ea1e73e8c1e4ed88f871cc26cadbd5c5d81b4 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 22 Aug 2022 21:32:15 +0200 Subject: [PATCH 10/14] Fix SQL --- htdocs/compta/stats/casoc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index a2326a49b69..50f326dc252 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -346,7 +346,7 @@ $sql .= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) { $sql .= " AND f.fk_soc = ".((int) $socid); } -$sql .= " GROUP BY s.rowid, s.nom, s.zip, s.town, s.fk_pays"; +$sql .= " GROUP BY s.rowid, s.nom, s.name_alias, s.zip, s.town, s.fk_pays"; $sql .= " ORDER BY s.rowid"; //echo $sql; From 3b3ea5eea31f99182bed8490e37122e17026f34d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Aug 2022 23:50:21 +0200 Subject: [PATCH 11/14] Fix typo --- htdocs/accountancy/class/accountingaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 710443c9bad..11b28b85cb9 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -863,7 +863,7 @@ class AccountingAccount extends CommonObject if (!empty($buyer->code_compta_product)) { $code_t = $buyer->code_compta_product; $suggestedid = $accountingAccount['thirdparty']; - $suggestedaccountingaccountfor = 'thridparty'; + $suggestedaccountingaccountfor = 'thirdparty'; } } From 36b5195da9ef56a685db4bc1a5c7ff43ac4abb43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 00:46:03 +0200 Subject: [PATCH 12/14] Doc --- htdocs/install/mysql/tables/llx_societe_contacts.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_societe_contacts.sql b/htdocs/install/mysql/tables/llx_societe_contacts.sql index 31d82f3003d..3f301c0cf34 100644 --- a/htdocs/install/mysql/tables/llx_societe_contacts.sql +++ b/htdocs/install/mysql/tables/llx_societe_contacts.sql @@ -13,9 +13,11 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . --- +-- -- ======================================================================== +-- This table contains the contacts by default of a thirdparty +-- Such contacts will be added to document automatiall if their role match the one expected by the document. create table llx_societe_contacts ( From def8b1c7a66a8d7afb70391e09744d8ce9fb7d58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 01:02:09 +0200 Subject: [PATCH 13/14] Fix if SOCIETE_DISABLE_PARENTCOMPANY on, we must not show_subsidiaries --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 2245392f7ca..f55f1c37867 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -3144,7 +3144,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Subsidiaries list - if (empty($conf->global->SOCIETE_DISABLE_SUBSIDIARIES)) { + if (!empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY) && empty($conf->global->SOCIETE_DISABLE_SHOW_SUBSIDIARIES)) { $result = show_subsidiaries($conf, $langs, $db, $object); } From f5004012ed147a6821543c34730f24eaa0db6ea8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 00:16:59 +0200 Subject: [PATCH 14/14] Removed hard coded fetch --- htdocs/admin/receiptprinter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index ac136af0c61..53f0cd9f7f0 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -183,8 +183,8 @@ if ($action == 'testtemplate' && $user->admin) { // test require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object = new Facture($db); - //$object->initAsSpecimen(); - $object->fetch(18); + $object->initAsSpecimen(); + //$object->fetch(18); //var_dump($object->lines); $ret = $printer->sendToPrinter($object, $templateid, 1); if ($ret == 0) {
'; +print ''; print img_picto('', 'category', 'class="paddingrightonly"'); print $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', 0, $langs->trans("Category")); print ' '; @@ -435,7 +456,7 @@ print ''; print ''; print ''; -print $form->select_country($search_country, 'search_country'); +print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); //print ''; print '