From 30ce816c0cc3b7cab2d2364bf26a6e576cbfcd17 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Thu, 1 Sep 2022 17:07:20 +0200 Subject: [PATCH 01/14] Fix: On a not configured personalized accounting group, the group code would be used in the formula. --- htdocs/compta/resultat/result.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 635531ab86b..b6ac4c1b33f 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -405,6 +405,9 @@ if ($modecompta == 'CREANCES-DETTES') { // Set $cpts with array of accounts in the category/group $cpts = $AccCat->getCptsCat($cat['rowid']); + // We should loop over empty $cpts array, else the category _code_ is used in the formula, which leads to wrong result if the code is a number. + if (empty($cpts)) $cpts[] = array(); + $arrayofaccountforfilter = array(); foreach ($cpts as $i => $cpt) { // Loop on each account. @@ -477,7 +480,7 @@ if ($modecompta == 'CREANCES-DETTES') { // Label of group print ''; print dol_escape_htmltag($cat['label']); - if (count($cpts) > 0) { // Show example of 5 first accounting accounts + if (count($cpts) > 0 && !empty($cpts[0])) { // Show example of 5 first accounting accounts $i = 0; foreach ($cpts as $cpt) { if ($i > 5) { From ce78e0164aeb2ca4dd3a77861ce28c2b5fcd9ec3 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Thu, 1 Sep 2022 17:19:08 +0200 Subject: [PATCH 02/14] Fix: When a custom compta group would be unactive, its code would stay in the computed formula. This would lead to wrong totals if the code is a number. --- htdocs/accountancy/class/accountancycategory.class.php | 7 ++++--- htdocs/compta/resultat/result.php | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 77d10516daa..5aec2d48fa2 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -785,12 +785,13 @@ class AccountancyCategory // extends CommonObject } /** - * Return list of custom groups that are active + * Return list of custom groups. * * @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups + * @param int $active 1= active, 0=not active * @return array|int Array of groups or -1 if error */ - public function getCats($categorytype = -1) + public function getCats($categorytype = -1, $active = 1) { global $conf, $mysoc; @@ -801,7 +802,7 @@ class AccountancyCategory // extends CommonObject $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens"; $sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c"; - $sql .= " WHERE c.active = 1"; + $sql .= " WHERE c.active = " . (int) $active; $sql .= " AND c.entity = ".$conf->entity; if ($categorytype >= 0) { $sql .= " AND c.category_type = 1"; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index b6ac4c1b33f..93fc7d57203 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -274,6 +274,7 @@ if ($modecompta == 'CREANCES-DETTES') { } elseif ($modecompta == "BOOKKEEPING") { // Get array of all report groups that are active $cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include + $unactive_cats = $AccCat->getCats(-1, 0); /* $sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa'; @@ -325,6 +326,11 @@ if ($modecompta == 'CREANCES-DETTES') { $vars = array(); + // Unactive categories have a total of 0 to be used in the formula. + foreach($unactive_cats as $un_cat) { + $vars[$un_cat['code']] = 0; + } + // Previous Fiscal year (N-1) foreach ($sommes as $code => $det) { $vars[$code] = $det['NP']; From f1ce73263915d5d24197fe956ab9d6164006fb49 Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Thu, 1 Sep 2022 18:06:35 +0200 Subject: [PATCH 03/14] empty commit to re-launch stickler From 16e1c7ea713bbb8bef343b5c784b3722ebc473eb Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 2 Sep 2022 10:25:12 +0200 Subject: [PATCH 04/14] Update result.php Fixed Stickler --- htdocs/compta/resultat/result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 93fc7d57203..378e594c9db 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -327,7 +327,7 @@ if ($modecompta == 'CREANCES-DETTES') { $vars = array(); // Unactive categories have a total of 0 to be used in the formula. - foreach($unactive_cats as $un_cat) { + foreach ($unactive_cats as $un_cat) { $vars[$un_cat['code']] = 0; } From 7fe9784ddb184d8c7a4438fe5e2291ca5ded2273 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sat, 3 Sep 2022 12:55:54 +0200 Subject: [PATCH 05/14] fix: better global declaration --- htdocs/bookmarks/bookmarks.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 8eef3396eaa..696545f324c 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -29,9 +29,9 @@ */ function printDropdownBookmarksList() { - global $conf, $user, $db, $langs; + global $conf, $user, $db, $langs, $sortfield, $sortorder; - require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php'; + require_once DOL_DOCUMENT_ROOT.'/boo, kmarks/class/bookmark.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; $langs->load("bookmarks"); @@ -48,7 +48,6 @@ function printDropdownBookmarksList() } } } - global $sortfield, $sortorder; $tmpurl = ''; // No urlencode, all param $url will be urlencoded later if ($sortfield) { From d5665e220e3ed88874fce45921513ba2e57c8112 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sat, 3 Sep 2022 13:00:24 +0200 Subject: [PATCH 06/14] fix: better global declaration --- htdocs/bookmarks/bookmarks.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 696545f324c..f983e25f1da 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -31,7 +31,7 @@ function printDropdownBookmarksList() { global $conf, $user, $db, $langs, $sortfield, $sortorder; - require_once DOL_DOCUMENT_ROOT.'/boo, kmarks/class/bookmark.class.php'; + require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; $langs->load("bookmarks"); From c5b3df23baa79aeae32831ae2adb7446b9666aab Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 4 Sep 2022 04:49:09 +0200 Subject: [PATCH 07/14] FIX Dictionary - Display error on >cache_vatrates --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index eab0942ee4e..8ea30ef3b93 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1963,7 +1963,7 @@ if ($id) { } elseif ($value == 'fk_tva') { foreach ($form->cache_vatrates as $key => $Tab) { if ($form->cache_vatrates[$key]['rowid'] == $valuetoshow) { - $valuetoshow = $form->cache_vatrates[$key]['libtva']; + $valuetoshow = $form->cache_vatrates[$key]['label']; break; } } From a542c86bcda2af394670e3bca49b3f0d9f1b8fe2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sun, 4 Sep 2022 04:59:31 +0200 Subject: [PATCH 08/14] FIX Project - on global view, missing display of ref customer --- htdocs/compta/facture/class/facture.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b1eb8656645..d646da3b413 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2013 Cedric Gross * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018-2022 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2022 Sylvain Legrand * @@ -1671,8 +1671,9 @@ class Facture extends CommonInvoice $this->id = $obj->rowid; $this->entity = $obj->entity; - $this->ref = $obj->ref; - $this->ref_client = $obj->ref_client; + $this->ref = $obj->ref; + $this->ref_client = $obj->ref_client; + $this->ref_customer = $obj->ref_client; $this->ref_ext = $obj->ref_ext; $this->type = $obj->type; $this->date = $this->db->jdate($obj->df); From aff9a423abfef3c223ba236417ba155fababb031 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 5 Sep 2022 12:28:59 +0200 Subject: [PATCH 09/14] FIX : fk_expedition in $line can be usefull for triggers --- htdocs/expedition/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index e8bfb0249b1..42214d1165e 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -581,6 +581,7 @@ if (empty($reshook)) { for ($i = 0; $i < $num_prod; $i++) { if ($lines[$i]->id == $line_id) { // we have found line to update $line = new ExpeditionLigne($db); + $line->fk_expedition = $object->id; // Extrafields Lines $line->array_options = $extrafields->getOptionalsFromPost($object->table_element_line); From 9a5927d833bf17fdac2a9bbf982d815ba8c50c13 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 6 Sep 2022 05:30:35 +0200 Subject: [PATCH 10/14] FIX Column label --- htdocs/adherents/class/adherent.class.php | 4 ++-- htdocs/comm/propal/class/propal.class.php | 4 ++-- htdocs/commande/class/commande.class.php | 4 ++-- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- htdocs/compta/facture/class/facture.class.php | 4 ++-- htdocs/contrat/class/contrat.class.php | 4 ++-- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- htdocs/societe/class/societe.class.php | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index b7f2810912b..abc002b4e89 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -327,8 +327,8 @@ class Adherent extends CommonObject 'photo' => array('type' => 'varchar(255)', 'label' => 'Photo', 'enabled' => 1, 'visible' => -1, 'position' => 135), 'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145), 'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => -1, 'position' => 150), - 'note_private' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155), - 'note_public' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160), + 'note_private' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 155), + 'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 160), 'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 65a2e60777f..f36b8027461 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -310,8 +310,8 @@ class Propal extends CommonObject 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>155), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>160), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>165), - 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>170), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>175), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>175), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'PDFTemplate', 'enabled'=>1, 'visible'=>0, 'position'=>180), 'date_livraison' =>array('type'=>'date', 'label'=>'DateDeliveryPlanned', 'enabled'=>1, 'visible'=>-1, 'position'=>185), 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'ShippingMethod', 'enabled'=>1, 'visible'=>-1, 'position'=>190), diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f02e74687af..54e50baa9f7 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -314,8 +314,8 @@ class Commande extends CommonOrder 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LocalTax2', 'enabled'=>1, 'visible'=>-1, 'position'=>135, 'isameasure'=>1), 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1), 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>145, 'isameasure'=>1), - 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>150), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>155), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>150), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>155), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'PDFTemplate', 'enabled'=>1, 'visible'=>0, 'position'=>160), //'facture' =>array('type'=>'tinyint(4)', 'label'=>'ParentInvoice', 'enabled'=>1, 'visible'=>-1, 'position'=>165), 'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>170), diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index c3628e12b7c..70f03bc21c8 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -295,7 +295,7 @@ class Account extends CommonObject 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>157), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>160), 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>165), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>170), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>175), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>180), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>185), diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 6b9837e77bd..8306a5c9c0d 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -184,8 +184,8 @@ class FactureRec extends CommonInvoice 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), 'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>105), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>110), 'modelpdf' =>array('type'=>'varchar(255)', 'label'=>'Modelpdf', 'enabled'=>1, 'visible'=>-1, 'position'=>115), 'date_last_gen' =>array('type'=>'varchar(7)', 'label'=>'Last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>120), 'unit_frequency' =>array('type'=>'varchar(2)', 'label'=>'Unit frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>125), diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d646da3b413..4e5f1923297 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -327,8 +327,8 @@ class Facture extends CommonInvoice 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'CurrencyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>185), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>190), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>195), - 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>205), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>210), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>205), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>210), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>215), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>225), 'situation_cycle_ref' =>array('type'=>'smallint(6)', 'label'=>'Situation cycle ref', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>230), diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index f364e82dd68..309df80605e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -237,8 +237,8 @@ class Contrat extends CommonObject 'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk commercial signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk commercial suivi', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), - 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>105), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>110), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>115), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>120), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>125), diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 5f671599c50..e78dd9dd02a 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -213,8 +213,8 @@ class CommandeFournisseur extends CommonOrder 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>140, 'isameasure'=>1), 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>145, 'isameasure'=>1), 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>150, 'isameasure'=>1), - 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>155), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>160), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>155), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>160), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>165), 'fk_input_method' =>array('type'=>'integer', 'label'=>'InputMethod', 'enabled'=>1, 'visible'=>-1, 'position'=>170), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>175), diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 66c441841d1..c4635962368 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -282,8 +282,8 @@ class FactureFournisseur extends CommonInvoice 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>155), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>160), 'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateLimReglement', 'enabled'=>1, 'visible'=>-1, 'position'=>165), - 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>170), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>175), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>175), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPdf', 'enabled'=>1, 'visible'=>0, 'position'=>180), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>190), 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>-1, 'position'=>195), diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 7c5773363c4..fe72e99e76f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -192,8 +192,8 @@ class Societe extends CommonObject 'tva_intra' =>array('type'=>'varchar(20)', 'label'=>'Tva intra', 'enabled'=>1, 'visible'=>-1, 'position'=>210), 'capital' =>array('type'=>'double(24,8)', 'label'=>'Capital', 'enabled'=>1, 'visible'=>-1, 'position'=>215), 'fk_stcomm' =>array('type'=>'integer', 'label'=>'CommercialStatus', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220), - 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>225), - 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>230), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>225), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>230), 'prefix_comm' =>array('type'=>'varchar(5)', 'label'=>'Prefix comm', 'enabled'=>'$conf->global->SOCIETE_USEPREFIX', 'visible'=>-1, 'position'=>235), 'client' =>array('type'=>'tinyint(4)', 'label'=>'Client', 'enabled'=>1, 'visible'=>-1, 'position'=>240), 'fournisseur' =>array('type'=>'tinyint(4)', 'label'=>'Fournisseur', 'enabled'=>1, 'visible'=>-1, 'position'=>245), From 4d396bbf50b3149daba7310bb23368bfe36cd54c Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 6 Sep 2022 09:48:10 +0200 Subject: [PATCH 11/14] FIX : same thing in deleteline --- htdocs/expedition/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 42214d1165e..8aa54ca8904 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -540,6 +540,7 @@ if (empty($reshook)) { $object->fetch($id); $lines = $object->lines; $line = new ExpeditionLigne($db); + $line->fk_expedition = $object->id; $num_prod = count($lines); for ($i = 0; $i < $num_prod; $i++) { From f27a49d30c3aa56663fb99233c8bca82292ae4b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Sep 2022 12:45:43 +0200 Subject: [PATCH 12/14] Fix missing var --- htdocs/compta/facture/class/facture.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d646da3b413..f6ed3468f9c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -137,7 +137,8 @@ class Facture extends CommonInvoice /** * @var string customer ref */ - public $ref_client; + public $ref_client; // deprecated; use ref_customer instead + public $ref_customer; /** * @var int Ref Int From fa64be5e82ef7093985f5c88aafeb3580c4a5404 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Sep 2022 00:29:45 +0200 Subject: [PATCH 13/14] Fix wrong number of td --- htdocs/compta/resultat/clientfourn.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 936adb482d2..915fa4de771 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -1520,15 +1520,17 @@ $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addBalanceLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; + + // Total print ''; -print ' '; +print ' '; print ''; print ''.$langs->trans("Income").''; if ($modecompta == 'CREANCES-DETTES') { print ''.price(price2num($total_ht_income, 'MT')).''; -} else { +} elseif ($modecompta == 'RECETTES-DEPENSES') { print ''; } print ''.price(price2num($total_ttc_income, 'MT')).''; @@ -1536,7 +1538,7 @@ print ''; print ''.$langs->trans("Outcome").''; if ($modecompta == 'CREANCES-DETTES') { print ''.price(price2num(-$total_ht_outcome, 'MT')).''; -} else { +} elseif ($modecompta == 'RECETTES-DEPENSES') { print ''; } print ''.price(price2num(-$total_ttc_outcome, 'MT')).''; @@ -1544,7 +1546,7 @@ print ''; print ''.$langs->trans("Profit").''; if ($modecompta == 'CREANCES-DETTES') { print ''.price(price2num($total_ht, 'MT')).''; -} else { +} elseif ($modecompta == 'RECETTES-DEPENSES') { print ''; } print ''.price(price2num($total_ttc, 'MT')).''; From 5341c7a4a18cb7f12d376e4666c1ecfb1e9ffb53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Sep 2022 01:36:58 +0200 Subject: [PATCH 14/14] Fix sql error --- htdocs/compta/resultat/clientfourn.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 915fa4de771..2c9d467ddc2 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -1062,7 +1062,11 @@ if ($modecompta == 'BOOKKEEPING') { $sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; } - $sql .= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; + if ($modecompta == 'CREANCES-DETTES') { + //No need of GROUP BY + } else { + $sql .= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; + } $newsortfield = $sortfield; if ($newsortfield == 's.nom, s.rowid') { $newsortfield = 'p.ref';