From 00dca7ff9b6ceb5d383e96aece0e889919b64aab Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 30 Nov 2020 13:01:45 +0100 Subject: [PATCH 01/33] =?UTF-8?q?NEW=20:=20Encours=20d=C3=A9pass=C3=A9=20#?= =?UTF-8?q?15307?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...box_customers_outstanding_bill_reached.php | 194 ++++++++++++++++++ htdocs/core/modules/modFacture.class.php | 3 +- 2 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 htdocs/core/boxes/box_customers_outstanding_bill_reached.php diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php new file mode 100644 index 00000000000..2baa02a912c --- /dev/null +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -0,0 +1,194 @@ + + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/boxes/box_clients.php + * \ingroup societes + * \brief Module de generation de l'affichage de la box clients + */ + +include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; + + +/** + * Class to manage the box to show last thirdparties + */ +class box_customers_outstanding_bill_reached extends ModeleBoxes +{ + public $boxcode = "customersoutstandingbillreached"; + public $boximg = "object_company"; + public $boxlabel = "BoxCustomersOutstandingBillReached"; + public $depends = array("facture","societe"); + + /** + * @var DoliDB Database handler. + */ + public $db; + + public $enabled = 1; + + public $info_box_head = array(); + public $info_box_contents = array(); + + + /** + * Constructor + * + * @param DoliDB $db Database handler + * @param string $param More parameters + */ + public function __construct($db, $param = '') + { + global $conf, $user; + + $this->db = $db; + + // disable box for such cases + if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled = 0; // disabled by this option + + $this->hidden = !($user->rights->societe->lire && empty($user->socid)); + } + + /** + * Load data for box to show them later + * + * @param int $max Maximum number of records to load + * @return void + */ + public function loadBox($max = 5) + { + global $user, $langs, $conf; + $langs->load("boxes"); + + $this->max = $max; + + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $thirdpartystatic = new Societe($this->db); + + $this->info_box_head = array('text' => "Last Cutomers Outstanding Bill Reached"); + + if ($user->rights->societe->lire) + { + $sql = "SELECT s.nom as name, s.rowid as socid"; + $sql .= ", s.code_client"; + $sql .= ", s.client"; + $sql .= ", s.code_fournisseur"; + $sql .= ", s.fournisseur"; + $sql .= ", s.code_compta"; + $sql .= ", s.code_compta_fournisseur"; + $sql .= ", s.logo"; + $sql .= ", s.email"; + $sql .= ", s.outstanding_limit"; + $sql .= ", s.datec, s.tms, s.status, s.entity"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE s.client IN (1, 3)"; + $sql .= " AND s.entity IN (".getEntity('societe').")"; + if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + if ($user->socid) $sql .= " AND s.rowid = $user->socid"; + $sql .= " ORDER BY s.tms DESC"; + $sql .= $this->db->plimit($max, 0); + + dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $num = $this->db->num_rows($result); + + $line = 0; + while ($line < $num) + { + $objp = $this->db->fetch_object($result); + $datec = $this->db->jdate($objp->datec); + $datem = $this->db->jdate($objp->tms); + $thirdpartystatic->id = $objp->socid; + $thirdpartystatic->name = $objp->name; + $thirdpartystatic->code_client = $objp->code_client; + $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; + $thirdpartystatic->code_compta = $objp->code_compta; + $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdpartystatic->client = $objp->client; + $thirdpartystatic->fournisseur = $objp->fournisseur; + $thirdpartystatic->logo = $objp->logo; + $thirdpartystatic->email = $objp->email; + $thirdpartystatic->entity = $objp->entity; + $thirdpartystatic->outstanding_limit = $objp->outstanding_limit; + + $outstandingtotal = $thirdpartystatic->getOutstandingBills()['opened']; + $outstandinglimit = $thirdpartystatic->outstanding_limit; + + $nboutstandingbillreachedcustomers = 0; + + if ($outstandingtotal >= $outstandinglimit) { + + $this->info_box_contents[$line][] = array( + 'td' => '', + 'text' => $thirdpartystatic->getNomUrl(1), + 'asis' => 1, + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => dol_print_date($datem, "day") + ); + + $this->info_box_contents[$line][] = array( + 'td' => 'class="right" width="18"', + 'text' => $thirdpartystatic->LibStatut($objp->status, 3) + ); + $nboutstandingbillreachedcustomers++; + } + $line++; + } + + if ($num == 0 || $nboutstandingbillreachedcustomers == 0) $this->info_box_contents[$line][0] = array( + 'td' => 'class="center opacitymedium"', + 'text'=>$langs->trans("NoRecordedCustomers") + ); + + $this->db->free($result); + } else { + $this->info_box_contents[0][0] = array( + 'td' => '', + 'maxlength'=>500, + 'text' => ($this->db->error().' sql='.$sql) + ); + } + } else { + $this->info_box_contents[0][0] = array( + 'td' => 'class="nohover opacitymedium left"', + 'text' => $langs->trans("ReadPermissionNotAllowed") + ); + } + } + + /** + * Method to show box + * + * @param array $head Array with properties of box title + * @param array $contents Array with properties of box lines + * @param int $nooutput No print, only return string + * @return string + */ + public function showBox($head = null, $contents = null, $nooutput = 0) + { + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + } +} diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index fdd7205b19c..c58752395d3 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -111,7 +111,8 @@ class modFacture extends DolibarrModules $this->boxes = array( 0=>array('file'=>'box_factures_imp.php', 'enabledbydefaulton'=>'Home'), 1=>array('file'=>'box_factures.php', 'enabledbydefaulton'=>'Home'), - 2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home') + 2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home'), + 3=>array('file'=>'box_customers_outstanding_bill_reached.php','enabledbydefaulton'=>'Home') ); // Cronjobs From 6e9a3c05f43fcc651c175ac64e880817b638a27d Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 30 Nov 2020 13:52:02 +0100 Subject: [PATCH 02/33] =?UTF-8?q?Close=20:=20Encours=20d=C3=A9pass=C3=A9?= =?UTF-8?q?=20#15307?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/boxes/box_customers_outstanding_bill_reached.php | 7 +------ htdocs/langs/en_US/boxes.lang | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 2baa02a912c..49b9de88d03 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -82,7 +82,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $thirdpartystatic = new Societe($this->db); - $this->info_box_head = array('text' => "Last Cutomers Outstanding Bill Reached"); + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastOutstandingBillReached", $max)); if ($user->rights->societe->lire) { @@ -144,11 +144,6 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes 'asis' => 1, ); - $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => dol_print_date($datem, "day") - ); - $this->info_box_contents[$line][] = array( 'td' => 'class="right" width="18"', 'text' => $thirdpartystatic->LibStatut($objp->status, 3) diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 14db79809bc..75f8eb14f49 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -46,6 +46,7 @@ BoxTitleLastModifiedDonations=Latest %s modified donations BoxTitleLastModifiedExpenses=Latest %s modified expense reports BoxTitleLatestModifiedBoms=Latest %s modified BOMs BoxTitleLatestModifiedMos=Latest %s modified Manufacturing Orders +BoxTitleLastOutstandingBillReached=Latest %s customers with maximum outstanding exceeded BoxGlobalActivity=Global activity (invoices, proposals, orders) BoxGoodCustomers=Good customers BoxTitleGoodCustomers=%s Good customers From 595bb893bec7c18dbf05e2481e764f51dd6a6f61 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 30 Nov 2020 14:01:56 +0100 Subject: [PATCH 03/33] =?UTF-8?q?Close=20:=20Encours=20d=C3=A9pass=C3=A9?= =?UTF-8?q?=20#15307?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/boxes/box_customers_outstanding_bill_reached.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 49b9de88d03..f83ed7a663e 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -136,8 +136,8 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes $nboutstandingbillreachedcustomers = 0; - if ($outstandingtotal >= $outstandinglimit) { - + if ($outstandingtotal >= $outstandinglimit) + { $this->info_box_contents[$line][] = array( 'td' => '', 'text' => $thirdpartystatic->getNomUrl(1), From cee1b3cee44c2995ad23c529c4510449df9f2fdc Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 30 Nov 2020 14:52:27 +0100 Subject: [PATCH 04/33] =?UTF-8?q?=20Close=20:=20Encours=20d=C3=A9pass?= =?UTF-8?q?=C3=A9=20#15307?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/boxes/box_customers_outstanding_bill_reached.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index f83ed7a663e..f3c358d2335 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -20,8 +20,8 @@ /** * \file htdocs/core/boxes/box_clients.php - * \ingroup societes - * \brief Module de generation de l'affichage de la box clients + * \ingroup Facture + * \brief Module d'affichage pour les encours dépassés */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; From ff30021d3588a9971f3c9e8613d4b1e79abe449c Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 30 Nov 2020 16:50:12 +0100 Subject: [PATCH 05/33] =?UTF-8?q?Close=20#15307=20Encours=20dpass=C3=A9=20?= =?UTF-8?q?with=20eldy=20suggestions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/boxes/box_customers_outstanding_bill_reached.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index f3c358d2335..24690895ff5 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -103,6 +103,8 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes $sql .= " AND s.entity IN (".getEntity('societe').")"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($user->socid) $sql .= " AND s.rowid = $user->socid"; + $sql .= " AND s.outstanding_limit > 0"; + $sql .= " AND s.rowid IN (SELECT fk_soc from ".MAIN_DB_PREFIX."facture as f WHERE f.fk_statut = 1 and f.fk_soc = s.rowid)"; $sql .= " ORDER BY s.tms DESC"; $sql .= $this->db->plimit($max, 0); From fc91e70e47a61e59144afddf05b04462b48fa90d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 30 Nov 2020 18:37:07 +0100 Subject: [PATCH 06/33] Update modFacture.class.php --- htdocs/core/modules/modFacture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index c58752395d3..8f4172112b5 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -112,7 +112,7 @@ class modFacture extends DolibarrModules 0=>array('file'=>'box_factures_imp.php', 'enabledbydefaulton'=>'Home'), 1=>array('file'=>'box_factures.php', 'enabledbydefaulton'=>'Home'), 2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home'), - 3=>array('file'=>'box_customers_outstanding_bill_reached.php','enabledbydefaulton'=>'Home') + 3=>array('file'=>'box_customers_outstanding_bill_reached.php', 'enabledbydefaulton'=>'Home') ); // Cronjobs From f847425f23252a2b59ddd92c0d50f7234be8b428 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 1 Dec 2020 13:48:18 +0100 Subject: [PATCH 07/33] Update llx_accounting_abc.sql --- .../install/mysql/data/llx_accounting_abc.sql | 77 +++++++++++++------ 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index d3f9ad5fd69..9118b7a4651 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -8,7 +8,12 @@ -- Copyright (C) 2011-2018 Alexandre Spangaro -- Copyright (C) 2015-2017 Juanjo Menent -- Copyright (C) 2018 Abbes bahfir +-- Copyright (C) 2020 Udo Tamm -- +-- +-------------------------------------------------------------------------------------- +-- License +-- ####### -- 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 -- the Free Software Foundation; either version 3 of the License, or @@ -22,14 +27,25 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -- --- +-------------------------------------------------------------------------------------- +-- Comment +-- ####### +-- (EN) +-- Do not place a comment at the end of the line, this file is parsed at the end of the line. +-- from the install and all '--' are removed. -- +-- (FR) -- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors -- de l'install et tous les sigles '--' sont supprimés. -- +-------------------------------------------------------------------------------------- +-- PCG = Plan Comptable Général (FR) - General Accounting Plan (EN) +-------------------------------------------------------------------------------------- +-- Accounting Journals + INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('VT', 'ACCOUNTING_SELL_JOURNAL', 2, 1, 1); INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AC', 'ACCOUNTING_PURCHASE_JOURNAL', 3, 1, 1); INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('BQ', 'FinanceJournal', 4, 1, 1); @@ -39,6 +55,9 @@ INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('INV', 'InventoryJournal', 8, 1, 1); + +-- Accounting Charts / Plans (Templates) for Countries + -- Description of chart of account FR PCG99-ABREGE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 1, 'PCG99-ABREGE', 'The simple accountancy french plan', 1); -- Description of chart of account FR PCG99-BASE @@ -56,8 +75,9 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account ES PCG08-PYME INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 4, 'PCG08-PYME', 'The PYME accountancy spanish plan', 1); --- Description of chart of account DE SKR03 +-- Description of chart of account DE SKR-03 INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 5, 'SKR03', 'Standardkontenrahmen SKR 03', 1); +-- Description of chart of account DE SKR-04 INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 5, 'SKR04', 'Standardkontenrahmen SKR 04', 1); -- Description of chart of account CH PCG_SUISSE @@ -69,6 +89,18 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account TN PCT INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 10, 'PCT', 'The Tunisia plan', 1); +-- Description of chart of account MA PCG +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 12, 'PCG', 'The Moroccan chart of accounts', 1); + +-- Description of chart of account DZ NSCF +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 13, 'NSCF', 'Nouveau système comptable financier', 1); + +-- Description of chart of account NL NL-VERKORT +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 17, 'NL-VERKORT', 'Verkort rekeningschema', 1); + +-- Description of chart of account SE BAS-K1-MINI +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 20, 'BAS-K1-MINI', 'The Swedish mini chart of accounts', 1); + -- Description of chart of account AT AT-BASE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 41, 'AT-BASE', 'Plan Austria', 1); @@ -78,54 +110,60 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account DK DK-STD INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 80, 'DK-STD', 'Standardkontoplan fra SKAT', 1); +-- Description of chart of account EC EC-SUPERCIAS +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 84, 'EC-SUPERCIAS', 'Plan de cuentas Ecuador', 1); + + -- Description of chart of account LU PCN-LUXEMBURG INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (140, 'PCN-LUXEMBURG', 'Plan comptable normalisé Luxembourgeois', 1); --- Description of chart of account MA PCG -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 12, 'PCG', 'The Moroccan chart of accounts', 1); --- Description of chart of account SE BAS-K1-MINI -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 20, 'BAS-K1-MINI', 'The Swedish mini chart of accounts', 1); +-- Description of chart of account RO RO-BASE +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (188, 'RO-BASE', 'Plan de conturi romanesc', 1); + + --DELETE FROM llx_accounting_system WHERE pcg_version = 'SYSCOHADA'; +-- Plans SYSCOAHA Western Africa -- sorted alphabetical by countries abbreviations + -- Description of chart of account BJ SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 49,'SYSCOHADA-BJ', 'Plan comptable Ouest-Africain', 1); -- Description of chart of account BF SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 60,'SYSCOHADA-BF', 'Plan comptable Ouest-Africain', 1); --- Description of chart of account CM SYSCOHADA -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1); +-- Description of chart of account CD SYSCOHADA +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1); -- Description of chart of account CF SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 65,'SYSCOHADA-CF', 'Plan comptable Ouest-Africain', 1); --- Description of chart of account KM SYSCOHADA -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1); - -- Description of chart of account CG SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 72,'SYSCOHADA-CG', 'Plan comptable Ouest-Africain', 1); -- Description of chart of account CI SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 21,'SYSCOHADA-CI', 'Plan comptable Ouest-Africain', 1); +-- Description of chart of account CM SYSCOHADA +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 24,'SYSCOHADA-CM', 'Plan comptable Ouest-Africain', 1); + -- Description of chart of account GA SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 16,'SYSCOHADA-GA', 'Plan comptable Ouest-Africain', 1); -- Description of chart of account GQ SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 87,'SYSCOHADA-GQ', 'Plan comptable Ouest-Africain', 1); +-- Description of chart of account KM SYSCOHADA +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 71,'SYSCOHADA-KM', 'Plan comptable Ouest-Africain', 1); + -- Description of chart of account ML SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (147,'SYSCOHADA-ML', 'Plan comptable Ouest-Africain', 1); -- Description of chart of account NE SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES (168,'SYSCOHADA-NE', 'Plan comptable Ouest-Africain', 1); --- Description of chart of account CD SYSCOHADA -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 73,'SYSCOHADA-CD', 'Plan comptable Ouest-Africain', 1); - -- Description of chart of account SN SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 22,'SYSCOHADA-SN', 'Plan comptable Ouest-Africain', 1); @@ -135,14 +173,3 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account TG SYSCOHADA INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1); --- Description of chart of account RO RO-BASE -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 188, 'RO-BASE', 'Plan de conturi romanesc', 1); - --- Description of chart of account DZ NSCF -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 13, 'NSCF', 'Nouveau système comptable financier', 1); - --- Description of chart of account NL NL-VERKORT -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 17, 'NL-VERKORT', 'Verkort rekeningschema', 1); - --- Description of chart of account EC EC-SUPERCIAS -INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 84, 'EC-SUPERCIAS', 'Plan de cuentas Ecuador', 1); \ No newline at end of file From 9d1da25f0361981be3cdaf91efbc82fd45a80dc1 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 1 Dec 2020 13:57:33 +0100 Subject: [PATCH 08/33] Update llx_const.sql --- htdocs/install/mysql/data/llx_const.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index 99da23f53a5..7cd039a2c19 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -47,17 +47,17 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_U -- Hidden but specific to one entity insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_OVERWRITE_TRANSLATION','1','chaine','Enable translation overwrite',0,1); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_ENABLE_DEFAULT_VALUES','1','chaine','Enable default value overwrite',0,1); -insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Monnaie',0,1); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Currency',0,1); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_SMTP_SERVER','','chaine','Host or ip address for SMTP server',0,1); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_SMTP_PORT','','chaine','Port for SMTP server',0,1); -insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_EMAIL_FROM','robot@domain.com','chaine','EMail emetteur pour les emails automatiques Dolibarr',0,1); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_EMAIL_FROM','robot@domain.com','chaine','email emitter for Dolibarr automatic emails',0,1); -- -- IHM -- -insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Longueur maximum des listes',0,0); -insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Longueur maximum des listes courtes (fiche client)',0,0); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Maximum length of lists',0,0); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Maximum length of short lists',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MENU_STANDARD','eldy_menu.php','chaine','Menu manager for internal users',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MENUFRONT_STANDARD','eldy_menu.php','chaine','Menu manager for external users',0,0); From c0c03f5270a8afb79d52386a01365af9bdcde5c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Dec 2020 15:59:54 +0100 Subject: [PATCH 09/33] Fix allow tag
into translation strings --- htdocs/core/class/translate.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 3c0aa7fba9e..4202191b39a 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -623,8 +623,8 @@ class Translate // We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities because // we want to keep '"' '' '' '' '' '
' '< ' '' that are reliable HTML tags inside translation strings. $str = str_replace( - array('"', '', '', '', '', '
', '
', '', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>' - array('__quot__', '__tagbold__', '__tagboldend__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'), + array('"', '', '', '
', '
', '', '', '
', '
', '', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>' + array('__quot__', '__tagbold__', '__tagboldend__', '__tagcenter__', '__tagcenterend__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'), $str ); @@ -638,8 +638,8 @@ class Translate // Restore reliable HTML tags into original translation string $str = str_replace( - array('__quot__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'), - array('"', '', '', '
', '
', '', '< ', '> '), + array('__quot__', '__tagbold__', '__tagboldend__', '__tagcenter__', '__tagcenterend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'), + array('"', '', '', '
', '
', '
', '
', '', '< ', '> '), $str ); From c8b0570c90425be9ab4f4a10671ddc1159fe4a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric?= <35066297+c3do@users.noreply.github.com> Date: Tue, 1 Dec 2020 16:32:36 +0100 Subject: [PATCH 10/33] NEW API: Get the list of ordering reasons --- htdocs/api/class/api_setup.class.php | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 4516d2e1d45..9045626bde4 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -111,6 +111,71 @@ class Setup extends DolibarrApi return $list; } + /** + * Get the list of ordering reasons. + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Number of items per page + * @param int $page Page number {@min 0} + * @param int $active Payment type is active or not {@min 0} {@max 1} + * @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')" + * + * @url GET dictionary/ordering_reasons + * + * @return array [List of ordering reasons] + * + * @throws RestException 400 + */ + public function getOrderingReasons($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '') + { + $list = array(); + + if (!DolibarrApiAccess::$user->rights->commande->lire) { + throw new RestException(401); + } + + $sql = "SELECT rowid, code, label, module"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_input_reason as t"; + $sql .= " WHERE t.active = ".$active; + // Add sql filters + if ($sqlfilters) + { + if (!DolibarrApi::_checkFilters($sqlfilters)) + { + throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + + + $sql .= $this->db->order($sortfield, $sortorder); + + if ($limit) { + if ($page < 0) { + $page = 0; + } + $offset = $limit * $page; + + $sql .= $this->db->plimit($limit, $offset); + } + + $result = $this->db->query($sql); + + if ($result) { + $num = $this->db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + for ($i = 0; $i < $min; $i++) { + $list[] = $this->db->fetch_object($result); + } + } else { + throw new RestException(400, $this->db->lasterror()); + } + + return $list; + } + /** * Get the list of payments types. * From c5ff32c2d2178f677d16384f4b3c2d51bdd27a20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Dec 2020 17:01:35 +0100 Subject: [PATCH 11/33] Fix accept and into translation strings --- htdocs/core/class/translate.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 4202191b39a..7655d6033d9 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -623,8 +623,8 @@ class Translate // We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities because // we want to keep '"' '' '' '' '
' '
' '< ' '' that are reliable HTML tags inside translation strings. $str = str_replace( - array('"', '', '', '
', '
', '', '', '
', '
', '', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>' - array('__quot__', '__tagbold__', '__tagboldend__', '__tagcenter__', '__tagcenterend__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'), + array('"', '', '', '', '', '', '', '
', '
', '', '', '
', '
', '', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>' + array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__tagb__', '__tagbend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'), $str ); @@ -638,8 +638,8 @@ class Translate // Restore reliable HTML tags into original translation string $str = str_replace( - array('__quot__', '__tagbold__', '__tagboldend__', '__tagcenter__', '__tagcenterend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'), - array('"', '', '', '
', '
', '
', '
', '', '< ', '> '), + array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'), + array('"', '', '', '', '', '', '', '
', '
', '
', '
', '', '< ', '> '), $str ); From ea1393a7cb7c607814ce2734d7f2d1e41c0c794b Mon Sep 17 00:00:00 2001 From: Marcio Zebedeu Date: Tue, 1 Dec 2020 19:29:11 +0100 Subject: [PATCH 12/33] New add VAT RAT for Angola VAT rate support for Angola was added. --- htdocs/install/mysql/data/llx_c_tva.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 19c6070eb2a..08e327d5ce1 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -366,6 +366,10 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 1 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 132, 13, '9','0','TVA 9%',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 133, 13, '19','0','TVA 19%', 1); +-- ANGOLA (id country=35) +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 351, 35, '0','0','VAT Rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 353, 35, '14','0','VAT standard rate',1); -- Example of code to insert a vat rate 0 for each country --delete from llx_c_tva where rowid = 1181; -- to delete a record that does not follow rules for rowid (fk_pays+'1') From de9a32972fa910c86e2878516f0331282375d36a Mon Sep 17 00:00:00 2001 From: Marcio Zebedeu Date: Tue, 1 Dec 2020 19:48:49 +0100 Subject: [PATCH 13/33] New currency for Angolan added Support for Angolan currency added --- htdocs/install/mysql/data/llx_c_currencies.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index 41cb07416bb..d05015721c8 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -37,6 +37,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ALL', '[76,101,107]', 1, 'Albania Lek'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'DZD', NULL, 1, 'Algeria Dinar'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AOA', NULL, 1, 'Angola Kwanza'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AFN', '[1547]', 1, 'Afghanistan Afghani'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ARS', '[36]', 1, 'Argentino Peso'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'AWG', '[402]', 1, 'Aruba Guilder'); From 800f8977b95b3ede565f5cf7480499da5e967e17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 1 Dec 2020 20:00:02 +0100 Subject: [PATCH 14/33] Fix tooltips --- htdocs/website/index.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f2734483acb..3a8e8bda794 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3009,7 +3009,7 @@ if ($action == 'editcss') print dol_get_fiche_head(); - print ''."\n"; + print ''."\n"; print ''; // Website @@ -3039,8 +3039,8 @@ if ($action == 'editcss') // Other languages print ''; @@ -3049,10 +3049,11 @@ if ($action == 'editcss') // VirtualHost print ''; + if (!$i) $totalarray['nbfield']++; - $db->free($result); -} else { - dol_print_error($db); + print ''."\n"; + + $i++; } +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + + +// If no record found +if ($num == 0) +{ + $colspan = 1; + foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } + print ''; +} + + +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print '
'; - $htmltext = ''; - print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2, 'WEBSITE_OTHERLANG'); + $htmltext = $langs->trans("Example").': fr,de,sv,it,pt'; + print $form->textwithpicto($langs->trans('OtherLanguages'), $htmltext, 1, 'help', '', 0, 2); print ''; print ''; print '
'; - $htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/'.$websitekey.''); + $htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/{s1}'.$websitekey.'{s2}'); + $htmltext = str_replace(array('{s1}', '{s2}'), array('', ''), $htmltext); $htmltext .= '
'; - $htmltext .= '
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); - $htmltext .= '
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); + $htmltext .= '
'.$langs->transnoentitiesnoconv("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); + $htmltext .= '
'.$langs->transnoentitiesnoconv("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'virtualhosttooltip'); print '
'; From f7a8a02b9833ebc514ac3f03c28f2c991f5c88d0 Mon Sep 17 00:00:00 2001 From: Marcio Zebedeu Date: Tue, 1 Dec 2020 20:07:58 +0100 Subject: [PATCH 15/33] Update llx_c_tva.sql --- htdocs/install/mysql/data/llx_c_tva.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 08e327d5ce1..793b29ab640 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -368,7 +368,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 1 -- ANGOLA (id country=35) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 351, 35, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT reduced rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 353, 35, '14','0','VAT standard rate',1); -- Example of code to insert a vat rate 0 for each country From 80a5882d9ef14eacb7b586f9a241cf108084f817 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 1 Dec 2020 23:04:36 +0100 Subject: [PATCH 16/33] Update ChangeLog NEW: VAT rate for Angola #15606 --- ChangeLog | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17cebdf9a73..637a8a27407 100644 --- a/ChangeLog +++ b/ChangeLog @@ -167,7 +167,8 @@ NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding am NEW: ticket classification on create from email collector NEW: Ticket message notifications when edited from public interface NEW: translate classification labels in ticket -NEW: Add VAT and juridical status for Algeria +NEW: VAT rate for Angola #15606 +NEW: VAT and juridical status for Algeria NEW: VAT report - Invert constant to show by default zero VAT in reports NEW: website page fields selection NEW: Weighing Scale compatibility with TakePOS connector @@ -211,7 +212,6 @@ NEW: Triggers Attributes and Attributes values NEW: added incoterms data into the substitution array NEW: add send context for ticket NEW: add a message in error_log after detection of SQL or script injection -NEW: add two hooks printFieldListFrom and printFieldSearchParam NEW: add __TYPE__ substitution key NEW: add validation of MX domain for emails NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') ) @@ -221,6 +221,7 @@ NEW: Hook on propal card NEW: add hooks on newpayment page to allow external payment modules NEW: add hooks on stats pages NEW: add formConfirm hook on product page +NEW: add two hooks printFieldListFrom and printFieldSearchParam WARNING: @@ -269,7 +270,7 @@ FIX: Look and feel v12: First tab must be name of object FIX: missing entity check FIX: missing param for hook FIX: Missing transaction on PO actions -FIX: MySql Strict mode +FIX: MySQL Strict mode FIX: param entity in html form file FIX: Problems on FEC format FIX: round stock value on product list From 8944670c03df10896025464de4bacabbfeea0502 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 2 Dec 2020 08:28:16 +0100 Subject: [PATCH 17/33] Update llx_accounting_account_ca.sql subtype_pcg removed --- .../mysql/data/llx_accounting_account_ca.sql | 306 +++++++++--------- 1 file changed, 153 insertions(+), 153 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_ca.sql b/htdocs/install/mysql/data/llx_accounting_account_ca.sql index 45d856414c5..e219ad7e67f 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_ca.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_ca.sql @@ -32,157 +32,157 @@ -- ID 1000 - 9999 -- ADD 1400000 to rowid # Do no remove this comment -- -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1000,'CA-ENG-BASE','ASSETS', 'XXXXXX', '1', '0', 'Assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 2000,'CA-ENG-BASE','LIABILITIES', 'XXXXXX', '2', '0', 'Liabilities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 3000,'CA-ENG-BASE','CAPITAL', 'XXXXXX', '3', '0', 'Equity', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 4000,'CA-ENG-BASE','INCOME', 'XXXXXX', '4', '0', 'Revenue', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 5000,'CA-ENG-BASE','COGS', 'XXXXXX', '5', '0', 'Cost of Goods Sold', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 6000,'CA-ENG-BASE','EXPENSE', 'XXXXXX', '6', '0', 'Expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1000,'CA-ENG-BASE','ASSETS', '1', '0', 'Assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 2000,'CA-ENG-BASE','LIABILITIES', '2', '0', 'Liabilities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 3000,'CA-ENG-BASE','CAPITAL', '3', '0', 'Equity', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4000,'CA-ENG-BASE','INCOME', '4', '0', 'Revenue', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5000,'CA-ENG-BASE','COGS', '5', '0', 'Cost of Goods Sold', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 6000,'CA-ENG-BASE','EXPENSE', '6', '0', 'Expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1010, 'CA-ENG-BASE', 'ASSETS', 'CASH', '1010', '1000', 'Cash', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1011, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1030', '1000', 'Investments and Securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1012, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1100', '1000', 'Accounts Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1013, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1120', '1000', 'Other Receivables', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1014, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1140', '1000', 'Allowance for Doubtful Accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1015, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1160', '1000', 'Customers Account Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1016, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1200', '1000', 'Raw Materials Inventory', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1017, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1220', '1000', 'Supplies Inventory', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1018, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1240', '1000', 'Work in Progress Inventory', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1019, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1260', '1000', 'Finished Goods Inventory', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1020, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1300', '1000', 'Prepaid Expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1021, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1350', '1000', 'Employee Advances', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1022, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1400', '1000', 'Notes Receivable - Current', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1023, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1430', '1000', 'Prepaid Interest', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1024, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1450', '1000', 'Other Current Assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1025, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1500', '1000', 'Furniture and Fixtures', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1026, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1520', '1000', 'Equipment', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1027, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1540', '1000', 'Vehicles', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1028, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1560', '1000', 'Other Depreciable Property', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1029, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1580', '1000', 'Buildings', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1030, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1600', '1000', 'Building Improvements', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1031, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1620', '1000', 'Land', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1032, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1640', '1000', 'Accumulated Depreciation, Furniture and Fixtures', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1033, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1660', '1000', 'Accumulated Depreciation, Equipment', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1034, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1680', '1000', 'Accumulated Depreciation, Vehicles', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1035, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1700', '1000', 'Accumulated Depreciation, Buildings', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1036, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1720', '1000', 'Accumulated Depreciation, Building Improvements', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1037, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1740', '1000', 'Accumulated Depreciation, Other', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1038, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1760', '1000', 'Goods and Services Tax (GST) Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1039, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1800', '1000', 'Harmonized Sales Tax (HST) Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1040, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1820', '1000', 'Provincial Sales Tax (PST) Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1041, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1840', '1000', 'Québec Sales Tax (QST) Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1042, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1860', '1000', 'Deposits', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1043, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1880', '1000', 'Accumulated Amortization', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1044, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1900', '1000', 'Notes Receivable - Non-current', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1045, 'CA-ENG-BASE', 'ASSETS', 'XXXXXX', '1940', '1000', 'Other Non-current Assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1046, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2100', '2000', 'Accounts Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1047, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2200', '2000', 'Accrued Expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1048, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2300', '2000', 'Current Financial Debts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1049, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2320', '2000', 'Employment Insurance Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1050, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2321', '2000', 'Employment insurance (EI) Employees Contribution', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1051, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2322', '2000', 'Employment insurance (EI) Employer Contribution', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1052, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2340', '2000', 'Federal Income Tax', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1053, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2350', '2000', 'Annuities Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1054, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2351', '2000', 'Annuities - Employee Contribution', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1055, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2352', '2000', 'Annuities - Employer Contribution', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1056, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2360', '2000', 'Health Services Fund Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1057, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2370', '2000', 'Labour Health and Safety Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1058, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2380', '2000', 'Labour Standards to Pay', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1059, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2390', '2000', 'Parental Insurance Plan Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1060, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2391', '2000', 'Parental Insurance Plan Payable - Employee Contribution', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1061, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2392', '2000', 'Parental Insurance Plan Payable - Employer Contribution', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2400', '2000', 'Provincial Income Tax', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2410', '2000', 'Other Accounts Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2420', '2000', 'Goods and Services Tax (GST) Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2430', '2000', 'Harmonized Sales Tax (HST) Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2440', '2000', 'Provincial Sales Tax (PST) Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2450', '2000', 'Québec Sales Tax (QST) Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2460', '2000', 'Other Taxes Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2470', '2000', 'Employee Benefits Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2480', '2000', 'Deposits from Customers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2490', '2000', 'Other Current Liabilities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2500', '2000', 'Notes Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1073, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2600', '2000', 'Land Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1074, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2630', '2000', 'Equipment Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1075, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2660', '2000', 'Vehicles Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1076, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2700', '2000', 'Bank Loans Payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1077, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2730', '2000', 'Non-current Financial Debts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1078, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2760', '2000', 'Other Non-current Liabilities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1079, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2800', '2000', 'Deferred Revenue', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1080, 'CA-ENG-BASE', 'LIABILITIES', 'XXXXXX', '2900', '2000', 'Deferred Fees', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1081, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3100', '3000', 'Common Shares', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1082, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3200', '3000', 'Preferred Shares (Voting)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1083, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3300', '3000', 'Preferred Shares (Non-voting)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1084, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3400', '3000', 'Contributed Surplus', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1085, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3500', '3000', 'Retained Earnings', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1086, 'CA-ENG-BASE', 'CAPITAL', 'XXXXXX', '3600', '3000', 'Dividends', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1087, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4100', '4000', 'Harmonized Provinces Sales', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1088, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4200', '4000', 'Non-Harmonized Provinces Sales', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1089, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4300', '4000', 'Inside Sales', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1090, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4400', '4000', 'International Sales', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1091, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4500', '4000', 'Reimbursible Expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1092, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4600', '4000', 'Shipping Charges Reimbursed', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1093, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4700', '4000', 'Other Operating Revenues', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1094, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4800', '4000', 'Interests', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1095, 'CA-ENG-BASE', 'INCOME', 'XXXXXX', '4900', '4000', 'Other Non-operating Revenues', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1096, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5010', '5000', 'Inside Purchases', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1097, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5050', '5000', 'International Purchases', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1098, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5100', '5000', 'Purchases in Harmonized Provinces', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1099, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5150', '5000', 'Purchases in Non-harmonized Provinces', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1100, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5200', '5000', 'Direct Labor Costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1101, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5250', '5000', 'Indirect Labor Costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1102, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5270', '5000', 'Heat and Power', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1103, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5300', '5000', 'Commissions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1104, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5350', '5000', 'Miscellaneous Factory Costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1105, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5400', '5000', 'Cost of Goods Sold, Salaries and Wages', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1106, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5450', '5000', 'Cost of Goods Sold, Contract Labor', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1107, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5500', '5000', 'Cost of Goods Sold, Freight', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1108, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5550', '5000', 'Cost of Goods Sold, Other', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1109, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5600', '5000', 'Inventory Adjustments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1110, 'CA-ENG-BASE', 'COGS', 'XXXXXX', '5700', '5000', 'Purchase Returns and Allowances', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1111, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6010', '6000', 'Federal Income Tax', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1112, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6020', '6000', 'Health Services Fund', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1113, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6030', '6000', 'Holidays', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1114, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6040', '6000', 'Labour Health and Safety', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1115, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6050', '6000', 'Labour Standards', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1116, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6060', '6000', 'Parental Insurance', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1117, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6080', '6000', 'Provincial Income Tax', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1118, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6100', '6000', 'Salaries, wages', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1119, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6130', '6000', 'Employee Benefit Expense, Pension Plans', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1120, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6160', '6000', 'Employee Benefit Expense, Profit Sharing Plan', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1121, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6180', '6000', 'Employee Benefit Expense, Other', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1122, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6200', '6000', 'Commissions and Fees Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1123, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6230', '6000', 'Annuities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1124, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6250', '6000', 'Employment Insurance', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1125, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6280', '6000', 'Insurance Expense, Product Liability', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1126, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6300', '6000', 'Insurance Expense, Vehicle', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1127, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6340', '6000', 'Payroll Tax Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1128, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6360', '6000', 'Penalties and Fines Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1129, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6380', '6000', 'Other Taxes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1130, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6400', '6000', 'Advertising Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1131, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6420', '6000', 'Amortization Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1132, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6460', '6000', 'Auto Expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1133, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6480', '6000', 'Legal and Professional Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1134, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6500', '6000', 'Licenses Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1135, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6520', '6000', 'Maintenance Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1136, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6540', '6000', 'Repair and Maintenance Expense, Office', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1137, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6560', '6000', 'Repair and Maintenance Expense, Vehicle', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1138, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6580', '6000', 'Office Supplies Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1139, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6600', '6000', 'Telephone Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1140, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6610', '6000', 'Training Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1141, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6630', '6000', 'Travel Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1142, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6650', '6000', 'Utilities Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1143, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6670', '6000', 'Postage Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1144, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6690', '6000', 'Freight Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1145, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6700', '6000', 'Rent or Lease Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1146, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6720', '6000', 'Meals and Entertainment Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1147, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6730', '6000', 'Gain/Loss on Sale of Assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1148, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6740', '6000', 'Depreciation Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1149, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6750', '6000', 'Bad Debt Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1150, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6760', '6000', 'Bank Fees', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1151, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6790', '6000', 'Loss on Non-sufficient Funds Checks', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1152, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6800', '6000', 'Gifts Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1153, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6820', '6000', 'Charitable Contributions Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1154, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6840', '6000', 'Other Operating Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1155, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6860', '6000', 'Interests Expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (__ENTITY__, 1156, 'CA-ENG-BASE', 'EXPENSE', 'XXXXXX', '6900', '6000', 'Other Non-operating Expense', 1); \ No newline at end of file +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1010, 'CA-ENG-BASE', 'ASSETS', '1010', '1000', 'Cash', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1011, 'CA-ENG-BASE', 'ASSETS', '1030', '1000', 'Investments and Securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1012, 'CA-ENG-BASE', 'ASSETS', '1100', '1000', 'Accounts Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1013, 'CA-ENG-BASE', 'ASSETS', '1120', '1000', 'Other Receivables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1014, 'CA-ENG-BASE', 'ASSETS', '1140', '1000', 'Allowance for Doubtful Accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1015, 'CA-ENG-BASE', 'ASSETS', '1160', '1000', 'Customers Account Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1016, 'CA-ENG-BASE', 'ASSETS', '1200', '1000', 'Raw Materials Inventory', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1017, 'CA-ENG-BASE', 'ASSETS', '1220', '1000', 'Supplies Inventory', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1018, 'CA-ENG-BASE', 'ASSETS', '1240', '1000', 'Work in Progress Inventory', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1019, 'CA-ENG-BASE', 'ASSETS', '1260', '1000', 'Finished Goods Inventory', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1020, 'CA-ENG-BASE', 'ASSETS', '1300', '1000', 'Prepaid Expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1021, 'CA-ENG-BASE', 'ASSETS', '1350', '1000', 'Employee Advances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1022, 'CA-ENG-BASE', 'ASSETS', '1400', '1000', 'Notes Receivable - Current', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1023, 'CA-ENG-BASE', 'ASSETS', '1430', '1000', 'Prepaid Interest', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1024, 'CA-ENG-BASE', 'ASSETS', '1450', '1000', 'Other Current Assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1025, 'CA-ENG-BASE', 'ASSETS', '1500', '1000', 'Furniture and Fixtures', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1026, 'CA-ENG-BASE', 'ASSETS', '1520', '1000', 'Equipment', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1027, 'CA-ENG-BASE', 'ASSETS', '1540', '1000', 'Vehicles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1028, 'CA-ENG-BASE', 'ASSETS', '1560', '1000', 'Other Depreciable Property', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1029, 'CA-ENG-BASE', 'ASSETS', '1580', '1000', 'Buildings', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1030, 'CA-ENG-BASE', 'ASSETS', '1600', '1000', 'Building Improvements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1031, 'CA-ENG-BASE', 'ASSETS', '1620', '1000', 'Land', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1032, 'CA-ENG-BASE', 'ASSETS', '1640', '1000', 'Accumulated Depreciation, Furniture and Fixtures', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1033, 'CA-ENG-BASE', 'ASSETS', '1660', '1000', 'Accumulated Depreciation, Equipment', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1034, 'CA-ENG-BASE', 'ASSETS', '1680', '1000', 'Accumulated Depreciation, Vehicles', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1035, 'CA-ENG-BASE', 'ASSETS', '1700', '1000', 'Accumulated Depreciation, Buildings', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1036, 'CA-ENG-BASE', 'ASSETS', '1720', '1000', 'Accumulated Depreciation, Building Improvements', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1037, 'CA-ENG-BASE', 'ASSETS', '1740', '1000', 'Accumulated Depreciation, Other', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1038, 'CA-ENG-BASE', 'ASSETS', '1760', '1000', 'Goods and Services Tax (GST) Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1039, 'CA-ENG-BASE', 'ASSETS', '1800', '1000', 'Harmonized Sales Tax (HST) Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1040, 'CA-ENG-BASE', 'ASSETS', '1820', '1000', 'Provincial Sales Tax (PST) Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1041, 'CA-ENG-BASE', 'ASSETS', '1840', '1000', 'Québec Sales Tax (QST) Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1042, 'CA-ENG-BASE', 'ASSETS', '1860', '1000', 'Deposits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1043, 'CA-ENG-BASE', 'ASSETS', '1880', '1000', 'Accumulated Amortization', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1044, 'CA-ENG-BASE', 'ASSETS', '1900', '1000', 'Notes Receivable - Non-current', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1045, 'CA-ENG-BASE', 'ASSETS', '1940', '1000', 'Other Non-current Assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1046, 'CA-ENG-BASE', 'LIABILITIES', '2100', '2000', 'Accounts Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1047, 'CA-ENG-BASE', 'LIABILITIES', '2200', '2000', 'Accrued Expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1048, 'CA-ENG-BASE', 'LIABILITIES', '2300', '2000', 'Current Financial Debts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1049, 'CA-ENG-BASE', 'LIABILITIES', '2320', '2000', 'Employment Insurance Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1050, 'CA-ENG-BASE', 'LIABILITIES', '2321', '2000', 'Employment insurance (EI) Employees Contribution', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1051, 'CA-ENG-BASE', 'LIABILITIES', '2322', '2000', 'Employment insurance (EI) Employer Contribution', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1052, 'CA-ENG-BASE', 'LIABILITIES', '2340', '2000', 'Federal Income Tax', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1053, 'CA-ENG-BASE', 'LIABILITIES', '2350', '2000', 'Annuities Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1054, 'CA-ENG-BASE', 'LIABILITIES', '2351', '2000', 'Annuities - Employee Contribution', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1055, 'CA-ENG-BASE', 'LIABILITIES', '2352', '2000', 'Annuities - Employer Contribution', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1056, 'CA-ENG-BASE', 'LIABILITIES', '2360', '2000', 'Health Services Fund Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1057, 'CA-ENG-BASE', 'LIABILITIES', '2370', '2000', 'Labour Health and Safety Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1058, 'CA-ENG-BASE', 'LIABILITIES', '2380', '2000', 'Labour Standards to Pay', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1059, 'CA-ENG-BASE', 'LIABILITIES', '2390', '2000', 'Parental Insurance Plan Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1060, 'CA-ENG-BASE', 'LIABILITIES', '2391', '2000', 'Parental Insurance Plan Payable - Employee Contribution', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1061, 'CA-ENG-BASE', 'LIABILITIES', '2392', '2000', 'Parental Insurance Plan Payable - Employer Contribution', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'CA-ENG-BASE', 'LIABILITIES', '2400', '2000', 'Provincial Income Tax', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'CA-ENG-BASE', 'LIABILITIES', '2410', '2000', 'Other Accounts Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'CA-ENG-BASE', 'LIABILITIES', '2420', '2000', 'Goods and Services Tax (GST) Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'CA-ENG-BASE', 'LIABILITIES', '2430', '2000', 'Harmonized Sales Tax (HST) Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'CA-ENG-BASE', 'LIABILITIES', '2440', '2000', 'Provincial Sales Tax (PST) Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'CA-ENG-BASE', 'LIABILITIES', '2450', '2000', 'Québec Sales Tax (QST) Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'CA-ENG-BASE', 'LIABILITIES', '2460', '2000', 'Other Taxes Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'CA-ENG-BASE', 'LIABILITIES', '2470', '2000', 'Employee Benefits Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'CA-ENG-BASE', 'LIABILITIES', '2480', '2000', 'Deposits from Customers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'CA-ENG-BASE', 'LIABILITIES', '2490', '2000', 'Other Current Liabilities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'CA-ENG-BASE', 'LIABILITIES', '2500', '2000', 'Notes Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1073, 'CA-ENG-BASE', 'LIABILITIES', '2600', '2000', 'Land Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1074, 'CA-ENG-BASE', 'LIABILITIES', '2630', '2000', 'Equipment Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1075, 'CA-ENG-BASE', 'LIABILITIES', '2660', '2000', 'Vehicles Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1076, 'CA-ENG-BASE', 'LIABILITIES', '2700', '2000', 'Bank Loans Payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1077, 'CA-ENG-BASE', 'LIABILITIES', '2730', '2000', 'Non-current Financial Debts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1078, 'CA-ENG-BASE', 'LIABILITIES', '2760', '2000', 'Other Non-current Liabilities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1079, 'CA-ENG-BASE', 'LIABILITIES', '2800', '2000', 'Deferred Revenue', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1080, 'CA-ENG-BASE', 'LIABILITIES', '2900', '2000', 'Deferred Fees', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1081, 'CA-ENG-BASE', 'CAPITAL', '3100', '3000', 'Common Shares', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1082, 'CA-ENG-BASE', 'CAPITAL', '3200', '3000', 'Preferred Shares (Voting)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1083, 'CA-ENG-BASE', 'CAPITAL', '3300', '3000', 'Preferred Shares (Non-voting)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1084, 'CA-ENG-BASE', 'CAPITAL', '3400', '3000', 'Contributed Surplus', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1085, 'CA-ENG-BASE', 'CAPITAL', '3500', '3000', 'Retained Earnings', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1086, 'CA-ENG-BASE', 'CAPITAL', '3600', '3000', 'Dividends', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1087, 'CA-ENG-BASE', 'INCOME', '4100', '4000', 'Harmonized Provinces Sales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1088, 'CA-ENG-BASE', 'INCOME', '4200', '4000', 'Non-Harmonized Provinces Sales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1089, 'CA-ENG-BASE', 'INCOME', '4300', '4000', 'Inside Sales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1090, 'CA-ENG-BASE', 'INCOME', '4400', '4000', 'International Sales', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1091, 'CA-ENG-BASE', 'INCOME', '4500', '4000', 'Reimbursible Expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1092, 'CA-ENG-BASE', 'INCOME', '4600', '4000', 'Shipping Charges Reimbursed', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1093, 'CA-ENG-BASE', 'INCOME', '4700', '4000', 'Other Operating Revenues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1094, 'CA-ENG-BASE', 'INCOME', '4800', '4000', 'Interests', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1095, 'CA-ENG-BASE', 'INCOME', '4900', '4000', 'Other Non-operating Revenues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1096, 'CA-ENG-BASE', 'COGS', '5010', '5000', 'Inside Purchases', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1097, 'CA-ENG-BASE', 'COGS', '5050', '5000', 'International Purchases', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1098, 'CA-ENG-BASE', 'COGS', '5100', '5000', 'Purchases in Harmonized Provinces', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1099, 'CA-ENG-BASE', 'COGS', '5150', '5000', 'Purchases in Non-harmonized Provinces', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1100, 'CA-ENG-BASE', 'COGS', '5200', '5000', 'Direct Labor Costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1101, 'CA-ENG-BASE', 'COGS', '5250', '5000', 'Indirect Labor Costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1102, 'CA-ENG-BASE', 'COGS', '5270', '5000', 'Heat and Power', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1103, 'CA-ENG-BASE', 'COGS', '5300', '5000', 'Commissions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1104, 'CA-ENG-BASE', 'COGS', '5350', '5000', 'Miscellaneous Factory Costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1105, 'CA-ENG-BASE', 'COGS', '5400', '5000', 'Cost of Goods Sold, Salaries and Wages', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1106, 'CA-ENG-BASE', 'COGS', '5450', '5000', 'Cost of Goods Sold, Contract Labor', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1107, 'CA-ENG-BASE', 'COGS', '5500', '5000', 'Cost of Goods Sold, Freight', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1108, 'CA-ENG-BASE', 'COGS', '5550', '5000', 'Cost of Goods Sold, Other', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1109, 'CA-ENG-BASE', 'COGS', '5600', '5000', 'Inventory Adjustments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1110, 'CA-ENG-BASE', 'COGS', '5700', '5000', 'Purchase Returns and Allowances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1111, 'CA-ENG-BASE', 'EXPENSE', '6010', '6000', 'Federal Income Tax', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1112, 'CA-ENG-BASE', 'EXPENSE', '6020', '6000', 'Health Services Fund', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1113, 'CA-ENG-BASE', 'EXPENSE', '6030', '6000', 'Holidays', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1114, 'CA-ENG-BASE', 'EXPENSE', '6040', '6000', 'Labour Health and Safety', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1115, 'CA-ENG-BASE', 'EXPENSE', '6050', '6000', 'Labour Standards', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1116, 'CA-ENG-BASE', 'EXPENSE', '6060', '6000', 'Parental Insurance', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1117, 'CA-ENG-BASE', 'EXPENSE', '6080', '6000', 'Provincial Income Tax', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1118, 'CA-ENG-BASE', 'EXPENSE', '6100', '6000', 'Salaries, wages', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1119, 'CA-ENG-BASE', 'EXPENSE', '6130', '6000', 'Employee Benefit Expense, Pension Plans', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1120, 'CA-ENG-BASE', 'EXPENSE', '6160', '6000', 'Employee Benefit Expense, Profit Sharing Plan', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1121, 'CA-ENG-BASE', 'EXPENSE', '6180', '6000', 'Employee Benefit Expense, Other', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1122, 'CA-ENG-BASE', 'EXPENSE', '6200', '6000', 'Commissions and Fees Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1123, 'CA-ENG-BASE', 'EXPENSE', '6230', '6000', 'Annuities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1124, 'CA-ENG-BASE', 'EXPENSE', '6250', '6000', 'Employment Insurance', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1125, 'CA-ENG-BASE', 'EXPENSE', '6280', '6000', 'Insurance Expense, Product Liability', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1126, 'CA-ENG-BASE', 'EXPENSE', '6300', '6000', 'Insurance Expense, Vehicle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1127, 'CA-ENG-BASE', 'EXPENSE', '6340', '6000', 'Payroll Tax Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1128, 'CA-ENG-BASE', 'EXPENSE', '6360', '6000', 'Penalties and Fines Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1129, 'CA-ENG-BASE', 'EXPENSE', '6380', '6000', 'Other Taxes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1130, 'CA-ENG-BASE', 'EXPENSE', '6400', '6000', 'Advertising Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1131, 'CA-ENG-BASE', 'EXPENSE', '6420', '6000', 'Amortization Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1132, 'CA-ENG-BASE', 'EXPENSE', '6460', '6000', 'Auto Expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1133, 'CA-ENG-BASE', 'EXPENSE', '6480', '6000', 'Legal and Professional Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1134, 'CA-ENG-BASE', 'EXPENSE', '6500', '6000', 'Licenses Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1135, 'CA-ENG-BASE', 'EXPENSE', '6520', '6000', 'Maintenance Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1136, 'CA-ENG-BASE', 'EXPENSE', '6540', '6000', 'Repair and Maintenance Expense, Office', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1137, 'CA-ENG-BASE', 'EXPENSE', '6560', '6000', 'Repair and Maintenance Expense, Vehicle', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1138, 'CA-ENG-BASE', 'EXPENSE', '6580', '6000', 'Office Supplies Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1139, 'CA-ENG-BASE', 'EXPENSE', '6600', '6000', 'Telephone Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1140, 'CA-ENG-BASE', 'EXPENSE', '6610', '6000', 'Training Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1141, 'CA-ENG-BASE', 'EXPENSE', '6630', '6000', 'Travel Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1142, 'CA-ENG-BASE', 'EXPENSE', '6650', '6000', 'Utilities Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1143, 'CA-ENG-BASE', 'EXPENSE', '6670', '6000', 'Postage Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1144, 'CA-ENG-BASE', 'EXPENSE', '6690', '6000', 'Freight Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1145, 'CA-ENG-BASE', 'EXPENSE', '6700', '6000', 'Rent or Lease Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1146, 'CA-ENG-BASE', 'EXPENSE', '6720', '6000', 'Meals and Entertainment Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1147, 'CA-ENG-BASE', 'EXPENSE', '6730', '6000', 'Gain/Loss on Sale of Assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1148, 'CA-ENG-BASE', 'EXPENSE', '6740', '6000', 'Depreciation Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1149, 'CA-ENG-BASE', 'EXPENSE', '6750', '6000', 'Bad Debt Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1150, 'CA-ENG-BASE', 'EXPENSE', '6760', '6000', 'Bank Fees', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1151, 'CA-ENG-BASE', 'EXPENSE', '6790', '6000', 'Loss on Non-sufficient Funds Checks', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1152, 'CA-ENG-BASE', 'EXPENSE', '6800', '6000', 'Gifts Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1153, 'CA-ENG-BASE', 'EXPENSE', '6820', '6000', 'Charitable Contributions Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1154, 'CA-ENG-BASE', 'EXPENSE', '6840', '6000', 'Other Operating Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1155, 'CA-ENG-BASE', 'EXPENSE', '6860', '6000', 'Interests Expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1156, 'CA-ENG-BASE', 'EXPENSE', '6900', '6000', 'Other Non-operating Expense', 1); From 73edd081dd7a256c3b2c3225f7099823668d16d9 Mon Sep 17 00:00:00 2001 From: Marcio Zebedeu Date: Wed, 2 Dec 2020 12:04:35 +0100 Subject: [PATCH 18/33] New Support for Angolan currency added Support for Region Angola added --- htdocs/install/mysql/data/llx_10_c_regions.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index bbb7af35bb7..43d2652298f 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -380,3 +380,7 @@ insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,931, insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,932, '新',0,'新疆维吾尔自治区'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,933, '港',0,'香港特别行政区'); insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,934, '澳',0,'澳门特别行政区'); + +-- Regions Angola (rowid country=35) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (35, 35001, 'AO', NULL, 'Angola'); + From 561c7438bc3b3d4830544f52c91160647cdf4f7e Mon Sep 17 00:00:00 2001 From: Marcio Zebedeu Date: Wed, 2 Dec 2020 12:36:15 +0100 Subject: [PATCH 19/33] New Add Angola City name Angola province/city support added --- .../mysql/data/llx_20_c_departements.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 54ab237c9b8..00f30fab0be 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -1606,3 +1606,23 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI038', NULL, NULL, 'UPPER CARNIOLA', 'Upper Carniola'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI043', NULL, NULL, 'GORIZIA', 'Gorizia'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('20204', 'SI044', NULL, NULL, 'COASTAL–KARST', 'Coastal–Karst'); + +-- Provinces (postal districts) Angola (rowid country=35) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-ABO', NULL, NULL, 'BENGO', 'Bengo'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-BGU', NULL, NULL, 'BENGUELA', 'Benguela'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-BIE', NULL, NULL, 'BIÉ', 'Bié'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CAB', NULL, NULL, 'CABINDA', 'Cabinda'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CCU', NULL, NULL, 'KUANDO KUBANGO', 'Kuando Kubango'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CNO', NULL, NULL, 'KWANZA NORTE', 'Kwanza Norte'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CUS', NULL, NULL, 'KWANZA SUL', 'Kwanza Sul'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-CNN', NULL, NULL, 'CUNENE', 'Cunene'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-HUA', NULL, NULL, 'HUAMBO', 'Huambo'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-HUI', NULL, NULL, 'HUÍLA', 'Huila'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LUA', NULL, NULL, 'LUANDA', 'Luanda'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LNO', NULL, NULL, 'LUNDA-NORTE', 'Lunda-Norte'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-LSU',NULL, NULL, 'LUNDA-SUL', 'Lunda-Sul'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-MAL', NULL, NULL, 'MALANGE', 'Malange'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-MOX', NULL, NULL, 'MOXICO', 'Moxico'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-NAM', NULL, NULL, 'NAMÍBE', 'Namíbe'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-UIG', NULL, NULL, 'UÍGE', 'Uíge'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-ZAI', NULL, NULL, 'ZAÍRE', 'Zaíre'); From 49be354c3e12ad96036f46a2d1f288776dcf9aab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Dec 2020 14:05:17 +0100 Subject: [PATCH 20/33] Fix warning --- htdocs/core/class/commonobject.class.php | 27 ++++++++---------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9d2317d3c2c..243d4d57f7c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5417,26 +5417,20 @@ abstract class CommonObject $sql .= ",".$attributeKey; } // We must insert a default value for fields for other entities that are mandatory to avoid not null error - if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'])) - { - foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval) - { - if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously - { + if (!empty($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']) && is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'])) { + foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval) { + if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) { // If field not already added previously $sql .= ",".$tmpkey; } } } $sql .= ") VALUES (".$this->id; - foreach ($new_array_options as $key => $value) - { + foreach ($new_array_options as $key => $value) { $attributeKey = substr($key, 8); // Remove 'options_' prefix // Add field of attribute - if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator) - { - if ($new_array_options[$key] != '' || $new_array_options[$key] == '0') - { + if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') { // Only for other type than separator) + if ($new_array_options[$key] != '' || $new_array_options[$key] == '0') { $sql .= ",'".$this->db->escape($new_array_options[$key])."'"; } else { $sql .= ",null"; @@ -5444,12 +5438,9 @@ abstract class CommonObject } } // We must insert a default value for fields for other entities that are mandatory to avoid not null error - if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'])) - { - foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval) - { - if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously - { + if (!empty($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']) && is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'])) { + foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval) { + if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) { // If field not already added previously if (in_array($tmpval, array('int', 'double', 'price'))) $sql .= ", 0"; else $sql .= ", ''"; } From 25bedc34971abddab215c70f54899425691b8d4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Dec 2020 14:09:03 +0100 Subject: [PATCH 21/33] Fix warning --- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index a94fe759125..52f9a60d2be 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -717,7 +717,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $langs->loadLangs(array("admin", "help")); $warnpicto = ''; - if (!empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) + if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) { $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); @@ -725,7 +725,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/admin/company.php?mainmenu=home", $langs->trans("MenuCompanySetup").$warnpicto, 1); $warnpicto = ''; - if (1 || count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled + if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled { $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete")); From 409b73fe2c16fd1568e275cf0a9f8b1c09c303d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Dec 2020 15:16:04 +0100 Subject: [PATCH 22/33] FIX #15582 --- .../box_customers_outstanding_bill_reached.php | 14 ++++++++------ htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 + htdocs/langs/en_US/boxes.lang | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index 24690895ff5..f4f4d5015cc 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -106,7 +106,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes $sql .= " AND s.outstanding_limit > 0"; $sql .= " AND s.rowid IN (SELECT fk_soc from ".MAIN_DB_PREFIX."facture as f WHERE f.fk_statut = 1 and f.fk_soc = s.rowid)"; $sql .= " ORDER BY s.tms DESC"; - $sql .= $this->db->plimit($max, 0); + //$sql .= $this->db->plimit($max, 0); dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); $result = $this->db->query($sql); @@ -114,10 +114,13 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes { $num = $this->db->num_rows($result); + $nboutstandingbillreachedcustomers = 0; + $line = 0; while ($line < $num) { $objp = $this->db->fetch_object($result); + $datec = $this->db->jdate($objp->datec); $datem = $this->db->jdate($objp->tms); $thirdpartystatic->id = $objp->socid; @@ -136,22 +139,21 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes $outstandingtotal = $thirdpartystatic->getOutstandingBills()['opened']; $outstandinglimit = $thirdpartystatic->outstanding_limit; - $nboutstandingbillreachedcustomers = 0; - if ($outstandingtotal >= $outstandinglimit) { - $this->info_box_contents[$line][] = array( + $this->info_box_contents[$nboutstandingbillreachedcustomers][] = array( 'td' => '', - 'text' => $thirdpartystatic->getNomUrl(1), + 'text' => $thirdpartystatic->getNomUrl(1, 'customer'), 'asis' => 1, ); - $this->info_box_contents[$line][] = array( + $this->info_box_contents[$nboutstandingbillreachedcustomers][] = array( 'td' => 'class="right" width="18"', 'text' => $thirdpartystatic->LibStatut($objp->status, 3) ); $nboutstandingbillreachedcustomers++; } + $line++; } diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 18802301e5a..7d3118fe891 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -542,3 +542,4 @@ CREATE TABLE llx_session( user_agent varchar(128) NULL )ENGINE=innodb; +INSERT INTO llx_boxes_def(file, entity) VALUES ('box_customers_outstanding_bill_reached', 1); diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 75f8eb14f49..502a3642afe 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -46,7 +46,7 @@ BoxTitleLastModifiedDonations=Latest %s modified donations BoxTitleLastModifiedExpenses=Latest %s modified expense reports BoxTitleLatestModifiedBoms=Latest %s modified BOMs BoxTitleLatestModifiedMos=Latest %s modified Manufacturing Orders -BoxTitleLastOutstandingBillReached=Latest %s customers with maximum outstanding exceeded +BoxTitleLastOutstandingBillReached=Customers with maximum outstanding exceeded BoxGlobalActivity=Global activity (invoices, proposals, orders) BoxGoodCustomers=Good customers BoxTitleGoodCustomers=%s Good customers From ea1c55cf1e1ce149c42176c30822f2c88560816e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Dec 2020 15:16:20 +0100 Subject: [PATCH 23/33] Fix widgets that has disappeared --- htdocs/core/boxes/box_last_modified_ticket.php | 2 +- htdocs/core/boxes/box_last_ticket.php | 2 +- htdocs/core/boxes/box_lastlogin.php | 2 +- htdocs/index.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index 2950eb9cfd8..94734894ad7 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -204,6 +204,6 @@ class box_last_modified_ticket extends ModeleBoxes */ public function showBox($head = null, $contents = null, $nooutput = 0) { - parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 9ada300901c..268a6861524 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -202,6 +202,6 @@ class box_last_ticket extends ModeleBoxes */ public function showBox($head = null, $contents = null, $nooutput = 0) { - parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index b45986387a8..c3ddb0fcdff 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -111,6 +111,6 @@ class box_lastlogin extends ModeleBoxes */ public function showBox($head = null, $contents = null, $nooutput = 0) { - parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); + return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } } diff --git a/htdocs/index.php b/htdocs/index.php index 887baa04e78..33fd93e649e 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -888,7 +888,7 @@ print '
'; /* - * Show boxes + * Show widgets (boxes) */ $boxlist .= '
'; From 5bdd52500d5255ff2fa0f79d08106be1b949b016 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Dec 2020 15:47:56 +0100 Subject: [PATCH 24/33] Fix warning --- htdocs/societe/class/societe.class.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 38c6479d0f2..73c41aeb782 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3241,7 +3241,7 @@ class Societe extends CommonObject // si son index (position dans la chaîne en commence à 0 au premier caractère) est impair // on double sa valeur et si cette dernière est supérieure à 9, on lui retranche 9 // on ajoute cette valeur à la somme totale - + $sum = 0; for ($index = 0; $index < 9; $index++) { $number = (int) $chaine[$index]; @@ -3266,7 +3266,7 @@ class Societe extends CommonObject // si son index (position dans la chaîne en commence à 0 au premier caractère) est pair // on double sa valeur et si cette dernière est supérieure à 9, on lui retranche 9 // on ajoute cette valeur à la somme totale - + $sum = 0; for ($index = 0; $index < 14; $index++) { $number = (int) $chaine[$index]; @@ -3343,10 +3343,6 @@ class Societe extends CommonObject $string = trim($this->idprof1); $string = preg_replace('/(\s)/', '', $string); - for ($i = 0; $i < 9; $i++) { - $num[$i] = substr($string, $i, 1); - } - //Check NIF if (preg_match('/(^[0-9]{9}$)/', $string)) { return 1; From 8a86593b13d5f6bd5d2d86748e1f5a52ade29bd8 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 2 Dec 2020 16:24:01 +0100 Subject: [PATCH 25/33] Fix a bug in bank's graph with option and mode --- htdocs/compta/bank/graph.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 524877746f8..f4fa779fd7d 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -771,11 +771,11 @@ print ''; print ''; - if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { + if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && $action == 'view') { $out .= ''; } $out .= ''; // Date value for bank @@ -305,16 +305,6 @@ if ($action == 'create') print ''; print ''; - // Project - if (!empty($conf->projet->enabled)) - { - $formproject = new FormProjets($db); - - print ''; - } - // Bank if (!empty($conf->banque->enabled)) { @@ -340,6 +330,16 @@ if ($action == 'create') print ''."\n"; } + // Project + if (!empty($conf->projet->enabled)) + { + $formproject = new FormProjets($db); + + print ''; + } + // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -476,9 +476,8 @@ if ($id) print dol_get_fiche_end(); - /* - * Action buttons - */ + // Action buttons + print '
'."\n"; if ($object->rappro == 0) { diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 3ef6531e6fd..726710f52de 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -113,17 +113,17 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid,"; $sql .= " ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = s.fk_user"; -$sql .= " AND s.entity = ".$conf->entity; +$sql .= " AND s.entity IN (".getEntity('payment_salaries').")"; if (empty($user->rights->salaries->readall)) $sql .= " AND s.fk_user IN (".join(',', $childids).")"; // Search criteria -if ($search_ref) $sql .= " AND s.rowid=".$search_ref; +if ($search_ref) $sql .= " AND s.rowid=".((int) $search_ref); if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user); if ($search_label) $sql .= natural_search(array('s.label'), $search_label); if ($search_date_start) $sql .= " AND s.datep >= '".$db->idate($search_date_start)."'"; if ($search_date_end) $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'"; if ($search_amount) $sql .= natural_search("s.amount", $search_amount, 1); -if ($search_account > 0) $sql .= " AND b.fk_account=".$search_account; +if ($search_account > 0) $sql .= " AND b.fk_account=".((int) $search_account); if ($filtre) { $filtre = str_replace(":", "=", $filtre); $sql .= " AND ".$filtre; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 7a40af26ac0..3288571d2a7 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -342,8 +342,8 @@ class User extends CommonObject public $fields = array( 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), - 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), - 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), + 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1), + 'firstname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1), ); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 257bcd4c6be..1a85ed309db 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -109,45 +109,32 @@ if (!empty($conf->api->enabled)) // Definition of fields for list $arrayfields = array( - 'u.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), - 'u.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), - 'u.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'u.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0), - 'u.employee'=>array('label'=>$langs->trans("Employee"), 'checked'=>($mode == 'employee' ? 1 : 0)), - 'u.accountancy_code'=>array('label'=>$langs->trans("AccountancyCode"), 'checked'=>0), - 'u.email'=>array('label'=>$langs->trans("EMail"), 'checked'=>1), - 'u.api_key'=>array('label'=>$langs->trans("ApiKey"), 'checked'=>0, "enabled"=>($conf->api->enabled && $user->admin)), - 'u.fk_soc'=>array('label'=>$langs->trans("Company"), 'checked'=>1), - 'u.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))), - 'u.fk_user'=>array('label'=>$langs->trans("HierarchicalResponsible"), 'checked'=>1), - 'u.datelastlogin'=>array('label'=>$langs->trans("LastConnexion"), 'checked'=>1, 'position'=>100), - 'u.datepreviouslogin'=>array('label'=>$langs->trans("PreviousConnexion"), 'checked'=>0, 'position'=>110), - 'u.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'u.login'=>array('label'=>"Login", 'checked'=>1, 'position'=>10), + 'u.lastname'=>array('label'=>"Lastname", 'checked'=>1, 'position'=>15), + 'u.firstname'=>array('label'=>"Firstname", 'checked'=>1, 'position'=>20), + 'u.entity'=>array('label'=>"Entity", 'checked'=>1, 'position'=>50, 'enabled'=>(!empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))), + 'u.gender'=>array('label'=>"Gender", 'checked'=>0, 'position'=>22), + 'u.employee'=>array('label'=>"Employee", 'checked'=>($mode == 'employee' ? 1 : 0), 'position'=>25), + 'u.fk_user'=>array('label'=>"HierarchicalResponsible", 'checked'=>1, 'position'=>27), + 'u.accountancy_code'=>array('label'=>"AccountancyCode", 'checked'=>0, 'position'=>30), + 'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35), + 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>($conf->api->enabled && $user->admin)), + 'u.fk_soc'=>array('label'=>"Company", 'checked'=>1, 'position'=>45), + 'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>($conf->salaries->enabled && !empty($user->rights->salaries->readall))), + 'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100), + 'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110), + 'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), + 'u.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 'u.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); // Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) -{ - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) - { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]), - 'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key], - 'help'=>$extrafields->attributes[$object->table_element]['help'][$key] - ); - } - } -} +include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; + $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); // Init search fields -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_user = GETPOST('search_user', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_lastname = GETPOST('search_lastname', 'alpha'); @@ -183,6 +170,8 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $error = 0; +$childids = $user->getAllChildIds(1); + /* * Actions @@ -308,7 +297,7 @@ if ($contextpage == 'employeelist' && $search_employee == 1) { $user2 = new User($db); $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.api_key, u.accountancy_code, u.gender, u.employee, u.photo,"; -$sql .= " u.datelastlogin, u.datepreviouslogin,"; +$sql .= " u.salary, u.datelastlogin, u.datepreviouslogin,"; $sql .= " u.ldap_sid, u.statut, u.entity,"; $sql .= " u.tms as date_update, u.datec as date_creation,"; $sql .= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2, u2.statut as statut2,"; @@ -356,6 +345,7 @@ if ($catid > 0) $sql .= " AND cu.fk_categorie = ".((int) $catid); if ($catid == -2) $sql .= " AND cu.fk_categorie IS NULL"; if ($search_categ > 0) $sql .= " AND cu.fk_categorie = ".$db->escape($search_categ); if ($search_categ == -2) $sql .= " AND cu.fk_categorie IS NULL"; +if ($mode == 'employee' && empty($user->rights->salaries->readall)) $sql .= " AND s.fk_user IN (".join(',', $childids).")"; // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -541,6 +531,13 @@ if (!empty($arrayfields['u.employee']['checked'])) print $form->selectyesno('search_employee', $search_employee, 1, false, 1); print ''; } +// Supervisor +if (!empty($arrayfields['u.fk_user']['checked'])) +{ + print '
'; +} if (!empty($arrayfields['u.accountancy_code']['checked'])) { print ''; @@ -561,12 +558,9 @@ if (!empty($arrayfields['u.entity']['checked'])) { print ''; } -// Supervisor -if (!empty($arrayfields['u.fk_user']['checked'])) +if (!empty($arrayfields['u.salary']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['u.datelastlogin']['checked'])) { @@ -615,12 +609,13 @@ if (!empty($arrayfields['u.lastname']['checked'])) print_liste_field_titre if (!empty($arrayfields['u.firstname']['checked'])) print_liste_field_titre("FirstName", $_SERVER['PHP_SELF'], "u.firstname", $param, "", "", $sortfield, $sortorder); if (!empty($arrayfields['u.gender']['checked'])) print_liste_field_titre("Gender", $_SERVER['PHP_SELF'], "u.gender", $param, "", "", $sortfield, $sortorder); if (!empty($arrayfields['u.employee']['checked'])) print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.employee", $param, "", "", $sortfield, $sortorder); +if (!empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder); if (!empty($arrayfields['u.accountancy_code']['checked'])) print_liste_field_titre("AccountancyCode", $_SERVER['PHP_SELF'], "u.accountancy_code", $param, "", "", $sortfield, $sortorder); if (!empty($arrayfields['u.email']['checked'])) print_liste_field_titre("EMail", $_SERVER['PHP_SELF'], "u.email", $param, "", "", $sortfield, $sortorder); if (!empty($arrayfields['u.api_key']['checked'])) print_liste_field_titre("ApiKey", $_SERVER['PHP_SELF'], "u.api_key", $param, "", "", $sortfield, $sortorder); if (!empty($arrayfields['u.fk_soc']['checked'])) print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "u.fk_soc", $param, "", "", $sortfield, $sortorder); if (!empty($arrayfields['u.entity']['checked'])) print_liste_field_titre("Entity", $_SERVER['PHP_SELF'], "u.entity", $param, "", "", $sortfield, $sortorder); -if (!empty($arrayfields['u.fk_user']['checked'])) print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder); +if (!empty($arrayfields['u.salary']['checked'])) print_liste_field_titre("Salary", $_SERVER['PHP_SELF'], "u.salary", $param, "", "", $sortfield, $sortorder, 'right '); if (!empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre("LastConnexion", $_SERVER['PHP_SELF'], "u.datelastlogin", $param, "", '', $sortfield, $sortorder, 'center '); if (!empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre("PreviousConnexion", $_SERVER['PHP_SELF'], "u.datepreviouslogin", $param, "", '', $sortfield, $sortorder, 'center '); // Extra fields @@ -713,6 +708,37 @@ while ($i < ($limit ? min($num, $limit) : $num)) print ''; if (!$i) $totalarray['nbfield']++; } + + // Supervisor + if (!empty($arrayfields['u.fk_user']['checked'])) + { + // Resp + print ''; + if (!$i) $totalarray['nbfield']++; + } + if (!empty($arrayfields['u.accountancy_code']['checked'])) { print ''; @@ -763,34 +789,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) if (!$i) $totalarray['nbfield']++; } } - // Supervisor - if (!empty($arrayfields['u.fk_user']['checked'])) + + // Salary + if (!empty($arrayfields['u.salary']['checked'])) { - // Resp - print ''; - if (!$i) $totalarray['nbfield']++; + print ''; + if (!$i) $totalarray['nbfield']++; } // Date last login From dd54d28dc6197ce5b8812fee6a9aa140d49ef82b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Dec 2020 10:13:13 +0100 Subject: [PATCH 32/33] Debug v13 --- htdocs/bom/bom_list.php | 17 +- htdocs/core/tpl/contacts.tpl.php | 4 +- htdocs/projet/info.php | 4 +- htdocs/projet/list.php | 24 +- htdocs/salaries/list.php | 563 +++++++++++++++++++++---------- htdocs/ticket/agenda.php | 4 +- htdocs/ticket/messaging.php | 4 +- 7 files changed, 396 insertions(+), 224 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 1135f5df5dd..8f8c13f2556 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -383,21 +383,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; @@ -469,7 +454,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print '
'; print '
'.$morehtml.'     '; if ($mode == 'showalltime') { - print ''; + print ''; print $langs->trans("GoBack"); print ''; } else { - print ''; + print ''; print $langs->trans("ShowAllTimeBalance"); print ''; } @@ -793,7 +793,7 @@ if ($mode == 'standard') if ($nextmonth > 12) { $nextmonth = 1; $nextyear++; } // For month - $link = "".img_previous('', 'class="valignbottom"')." ".$langs->trans("Month")." ".img_next('', 'class="valignbottom"').""; + $link = "".img_previous('', 'class="valignbottom"')." ".$langs->trans("Month")." ".img_next('', 'class="valignbottom"').""; print '
'.$link.'
'; print '
'; @@ -807,7 +807,7 @@ if ($mode == 'standard') // For year $prevyear = $year - 1; $nextyear = $year + 1; - $link = "".img_previous('', 'class="valignbottom"')." ".$langs->trans("Year")." ".img_next('', 'class="valignbottom"').""; + $link = "".img_previous('', 'class="valignbottom"')." ".$langs->trans("Year")." ".img_next('', 'class="valignbottom"').""; print '
'.$link.'
'; From 9e18997e64ec3b4ef7ec360c1cf17a67c9dd8331 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Dec 2020 16:35:43 +0100 Subject: [PATCH 26/33] FIX #15595 --- htdocs/compta/facture/card-rec.php | 14 ++++++++++++-- htdocs/compta/facture/card.php | 2 +- htdocs/core/class/commonobject.class.php | 6 +++++- htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/fr_FR/errors.lang | 1 + 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 4f754fbd173..11dec142a17 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -117,6 +117,8 @@ $usercancreatewithdrarequest = $user->rights->prelevement->bons->creer; $now = dol_now(); +$error = 0; + /* * Actions @@ -287,13 +289,21 @@ if (empty($reshook)) elseif ($action == 'setref' && $user->rights->facture->creer) { //var_dump(GETPOST('ref', 'alpha'));exit; - $result = $object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY'); + $result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY'); if ($result > 0) { $object->titre = GETPOST('ref', 'alpha'); // deprecated $object->title = GETPOST('ref', 'alpha'); $object->ref = $object->title; - } else dol_print_error($db, $object->error, $object->errors); + } else { + $error++; + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $langs->load("errors"); + setEventMessages($langs->trans('ErrorRefAlreadyExists', $ref), null, 'errors'); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } } // Set bank account elseif ($action == 'setbankaccount' && $user->rights->facture->creer) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index def74e173a3..110db6d8166 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4074,7 +4074,7 @@ if ($action == 'create') print $object->getLibType(); print ''; if ($object->module_source) { - print ' ('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')'; + print ' ('.$langs->trans("POS").' '.ucfirst($object->module_source).' - '.$langs->trans("Terminal").' '.$object->pos_source.')'; } if ($object->type == Facture::TYPE_REPLACEMENT) { $facreplaced = new Facture($db); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 243d4d57f7c..ec03bb66524 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1817,7 +1817,11 @@ abstract class CommonObject return -2; } } else { - $this->error = $this->db->lasterror(); + if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $this->error = 'DB_ERROR_RECORD_ALREADY_EXISTS'; + } else { + $this->error = $this->db->lasterror(); + } $this->db->rollback(); return -1; } diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 255bce66531..2413e6d76ba 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -8,6 +8,7 @@ ErrorBadEMail=Email %s is wrong ErrorBadMXDomain=Email %s seems wrong (domain has no valid MX record) ErrorBadUrl=Url %s is wrong ErrorBadValueForParamNotAString=Bad value for your parameter. It appends generally when translation is missing. +ErrorRefAlreadyExists=Reference %s already exists. ErrorLoginAlreadyExists=Login %s already exists. ErrorGroupAlreadyExists=Group %s already exists. ErrorRecordNotFound=Record not found. diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 97d3e48f512..abd1c6ec9f9 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -7,6 +7,7 @@ ErrorButCommitIsDone=Erreurs trouvées mais on valide malgré tout ErrorBadEMail=email %s invalide ErrorBadUrl=Url %s invalide ErrorBadValueForParamNotAString=Mauvaise valeur de paramètre. Ceci arrive lors d'une tentative de traduction d'une clé non renseignée. +ErrorRefAlreadyExists=La référence %s existe déjà. ErrorLoginAlreadyExists=L'identifiant %s existe déjà. ErrorGroupAlreadyExists=Le groupe %s existe déjà. ErrorRecordNotFound=Enregistrement non trouvé. From 6440dcbd93787a090ddf938edab17dcf4a9c0b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 2 Dec 2020 18:21:13 +0100 Subject: [PATCH 27/33] doxygen --- htdocs/zapier/class/hook.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index 8e6d3fa725f..5d5a9c84eda 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -212,9 +212,14 @@ class Hook extends CommonObject public $label; /** - * @var string amount + * @var string url of webhook */ - public $amount; + public $url; + + /** + * @var int ID of user owner webhook + */ + public $fk_user; /** * @var int Status From d88173d7baceaa66646c92420aa390636fefce6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Dec 2020 19:13:32 +0100 Subject: [PATCH 28/33] Fix bad column --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/install/mysql/tables/llx_c_input_reason.sql | 2 ++ htdocs/projet/card.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ec03bb66524..33ac1aba696 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6889,7 +6889,7 @@ abstract class CommonObject $helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]); $out .= '
Date: Wed, 2 Dec 2020 21:27:15 +0100 Subject: [PATCH 30/33] Fix option MAIN_USE_COMPANY_NAME_OF_CONTACT --- .../modules/bom/doc/doc_generic_bom_odt.modules.php | 7 ++++--- .../commande/doc/doc_generic_order_odt.modules.php | 8 ++++---- .../modules/commande/doc/pdf_einstein.modules.php | 5 ++--- .../commande/doc/pdf_eratosthene.modules.php | 3 +-- .../doc/doc_generic_contract_odt.modules.php | 5 ++--- .../modules/contract/doc/pdf_strato.modules.php | 5 ++--- .../core/modules/delivery/doc/pdf_storm.modules.php | 5 ++--- .../modules/delivery/doc/pdf_typhon.modules.php | 5 ++--- .../doc/doc_generic_shipment_odt.modules.php | 7 +++---- .../modules/expedition/doc/pdf_espadon.modules.php | 5 ++--- .../modules/expedition/doc/pdf_merou.modules.php | 3 +-- .../modules/expedition/doc/pdf_rouget.modules.php | 5 ++--- .../facture/doc/doc_generic_invoice_odt.modules.php | 5 ++--- .../core/modules/facture/doc/pdf_crabe.modules.php | 5 ++--- .../core/modules/facture/doc/pdf_sponge.modules.php | 5 ++--- .../modules/fichinter/doc/pdf_soleil.modules.php | 5 ++--- .../member/doc/doc_generic_member_odt.class.php | 3 +-- .../modules/mrp/doc/doc_generic_mo_odt.modules.php | 9 ++++----- .../product/doc/doc_generic_product_odt.modules.php | 6 ++---- .../doc/doc_generic_proposal_odt.modules.php | 6 +++--- .../core/modules/propale/doc/pdf_azur.modules.php | 5 ++--- .../core/modules/propale/doc/pdf_cyan.modules.php | 5 ++--- .../doc/doc_generic_reception_odt.modules.php | 13 ++++++++----- .../modules/reception/doc/pdf_squille.modules.php | 5 ++--- .../stock/doc/doc_generic_stock_odt.modules.php | 3 +-- .../supplier_invoice/doc/pdf_canelle.modules.php | 5 ++--- .../doc/doc_generic_supplier_order_odt.modules.php | 6 +++--- .../supplier_order/doc/pdf_cornas.modules.php | 5 ++--- .../supplier_order/doc/pdf_muscadet.modules.php | 5 ++--- .../doc_generic_supplier_proposal_odt.modules.php | 9 +++------ .../supplier_proposal/doc/pdf_aurore.modules.php | 13 ++++++++----- .../user/doc/doc_generic_user_odt.modules.php | 6 +++--- .../doc/doc_generic_usergroup_odt.modules.php | 6 +++--- .../doc/doc_generic_myobject_odt.modules.php | 6 +++--- .../mymodule/doc/pdf_standard_myobject.modules.php | 2 +- ...c_generic_recruitmentjobposition_odt.modules.php | 6 +++--- .../pdf_standard_recruitmentjobposition.modules.php | 2 +- 37 files changed, 94 insertions(+), 115 deletions(-) diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 750f1a7ab39..b5e1fc80a1d 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -294,10 +294,11 @@ class doc_generic_bom_odt extends ModelePDFBom if (!empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index eb2c8121397..3165760b541 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -305,11 +305,11 @@ class doc_generic_order_odt extends ModelePDFCommandes $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 3536daab5eb..5a0bbc30327 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1446,9 +1446,8 @@ class pdf_einstein extends ModelePDFCommandes $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 7fda31f4c71..97354c5c266 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1628,8 +1628,7 @@ class pdf_eratosthene extends ModelePDFCommandes } //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 7a0b1f91109..edad675857f 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -291,12 +291,11 @@ class doc_generic_contract_odt extends ModelePDFContract // Recipient name $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $socobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 08fefaf5634..e28cd62efae 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -711,9 +711,8 @@ class pdf_strato extends ModelePDFContract $this->recipient = $object->thirdparty; - //Recipient name - // You can use the name of the contact company - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index e6da731fb21..d6376e6cd17 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -860,9 +860,8 @@ class pdf_storm extends ModelePDFDeliveryOrder $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 8b7c899af91..3b8baa107ad 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -850,9 +850,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 039ef128cd7..254bb5bf377 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -304,12 +304,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition // Recipient name $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $socobject = $object->contact; - else { + } else { $socobject = $object->thirdparty; - // if we have a SHIIPPING contact and we dont use it as recipient we store the contact object for later use + // if we have a SHIPPING contact and we dont use as recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index a48e28ecef6..5cdeaa693a7 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -1020,9 +1020,8 @@ class pdf_espadon extends ModelePdfExpedition $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // You can use the name of the contact company - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index be163ea4c18..f530121ec08 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -678,8 +678,7 @@ class pdf_merou extends ModelePdfExpedition } // Recipient name - // You can use the name of the contact company - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 8b0dd134d65..a43c6aba352 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -1054,9 +1054,8 @@ class pdf_rouget extends ModelePdfExpedition $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 1d4b65fdb32..f2f4ee31823 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -305,10 +305,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures // Recipient name $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $socobject = $object->contact; - else { + } else { $socobject = $object->thirdparty; // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 32c58f21eac..f1c90305bef 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1842,9 +1842,8 @@ class pdf_crabe extends ModelePDFFactures $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 66035df58db..4087e3db098 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -2108,9 +2108,8 @@ class pdf_sponge extends ModelePDFFactures $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index c79b2ac4137..622cd0b2250 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -665,9 +665,8 @@ class pdf_soleil extends ModelePDFFicheinter $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 6d2f2772610..be91acd7a3f 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -280,8 +280,7 @@ class doc_generic_member_odt extends ModelePDFMember // Recipient name if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $socobject = $object->contact; } else { $socobject = $object->thirdparty; diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 84f225dfb6e..eeaeb2c8e54 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -298,11 +298,10 @@ class doc_generic_mo_odt extends ModelePDFMo // Recipient name $contactobject = null; - if (!empty($usecontact)) - { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if (!empty($usecontact)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index d017a559b37..ef5e97997f9 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -315,10 +315,8 @@ class doc_generic_product_odt extends ModelePDFProduct // Recipient name $contactobject = null; - if (!empty($usecontact)) - { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + if (!empty($usecontact)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $socobject = $object->contact; } else { $socobject = $object->thirdparty; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 59df720269b..b27e94b46b7 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -334,9 +334,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index a5a6b850f7f..a889dec7815 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1618,9 +1618,8 @@ class pdf_azur extends ModelePDFPropales $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 1baf9712cdb..119932949b2 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1729,9 +1729,8 @@ class pdf_cyan extends ModelePDFPropales $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 45bfabe4b62..1105a5f6d4c 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -294,11 +294,14 @@ class doc_generic_reception_odt extends ModelePdfReception } // Recipient name - if (!empty($usecontact)) - { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else $socobject = $object->thirdparty; + if (!empty($usecontact)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { + $socobject = $object->thirdparty; + // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use + $contactobject = $object->contact; + } } else { $socobject = $object->thirdparty; } diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 446b03daf0a..8043f9f9ba6 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -944,9 +944,8 @@ class pdf_squille extends ModelePdfReception $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 89a5ea9d784..1b3053aaaaf 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -306,8 +306,7 @@ class doc_generic_stock_odt extends ModelePDFStock $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $socobject = $object->contact; } else { $socobject = $object->thirdparty; diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 5e2e4380a0b..7a3ecf88e19 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -1209,9 +1209,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // We can use the name of the contact's company - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $mysoc; diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 37f773783cc..18c3a9a3574 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -295,9 +295,9 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 0d66fe5b83b..3a4bc56f64a 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1371,9 +1371,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index bc91d690f36..c8edef0679c 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -1283,9 +1283,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $result = $object->fetch_contact($arrayidcontact[0]); } - //Recipient name - // On peut utiliser le nom de la societe du contact - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + // Recipient name + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index b5efe6801ff..918f5fd9215 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -330,15 +330,12 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal // Recipient name $contactobject = null; - if (!empty($usecontact)) - { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) - { + if (!empty($usecontact)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $socobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a BILLING contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 3aafb09aa86..8c82198999a 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -1417,14 +1417,17 @@ class pdf_aurore extends ModelePDFSupplierProposal // Recipient name if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; - else $socname = $object->thirdparty->name; - $carac_client_name = $outputlangs->convToOutputCharset($socname); + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socname = $object->contact->socname; + } else { + $socname = $object->thirdparty->name; + } } else { - $carac_client_name = $outputlangs->convToOutputCharset($object->thirdparty->name); + $socname = $object->thirdparty->name; } + $carac_client_name = pdfBuildThirdpartyName($socname, $outputlangs); + $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object); // Show recipient diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 771231e6041..2a326282fa0 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -323,9 +323,9 @@ class doc_generic_user_odt extends ModelePDFUser // Recipient name if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 3cbce44511f..6fcc6160a97 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -314,9 +314,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup // Recipient name if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 80b4f4ecb5a..d6cb191a405 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -299,9 +299,9 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index e8e39ec2adb..fbab4d53b0f 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -1091,7 +1091,7 @@ class pdf_standard_myobject extends ModelePDFMyObject } // Recipient name - if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index 6e9788c2e9f..be36b96682c 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -299,9 +299,9 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi $contactobject = null; if (!empty($usecontact)) { - // On peut utiliser le nom de la societe du contact - if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; - else { + if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { + $socobject = $object->contact; + } else { $socobject = $object->thirdparty; // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use $contactobject = $object->contact; diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index af62344296b..cad6888f7c5 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -1002,7 +1002,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio } // Recipient name - /*if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { + /*if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) { $thirdparty = $object->contact; } else { $thirdparty = $object->thirdparty; From 9137713056a504de874ff6a401ad2206efdd87cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Dec 2020 00:40:41 +0100 Subject: [PATCH 31/33] Debug v13 --- htdocs/salaries/card.php | 29 ++++--- htdocs/salaries/list.php | 6 +- htdocs/user/class/user.class.php | 4 +- htdocs/user/list.php | 138 ++++++++++++++++--------------- 4 files changed, 90 insertions(+), 87 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 487757ad567..7fb8427a517 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2014 Laurent Destailleur + * Copyright (C) 2014-2020 Laurent Destailleur * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Charlie BENKE * Copyright (C) 2018 Frédéric France @@ -265,7 +265,7 @@ if ($action == 'create') // Date payment print '
'; print $form->editfieldkey('DatePayment', 'datep', '', $object, 0, 'string', '', 1).''; - print $form->selectDate((empty($datep) ?-1 : $datep), "datep", '', '', '', 'add', 1, 1); + print $form->selectDate((empty($datep) ? '' : $datep), "datep", 0, 0, 0, 'add', 1, 1); print '
'.$langs->trans("Project").''; - $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); - print '
'.$langs->trans("Project").''; + $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + print '
'; + print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200'); + print ''; - print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, array(), 0, '', 0, 0, 0, 0, '', 0, '', 'maxwidth200'); - print ''.yn($obj->employee).''; + if ($obj->login2) + { + $user2->id = $obj->id2; + $user2->login = $obj->login2; + $user2->lastname = $obj->lastname2; + $user2->firstname = $obj->firstname2; + $user2->gender = $obj->gender2; + $user2->photo = $obj->photo2; + $user2->admin = $obj->admin2; + $user2->email = $obj->email2; + $user2->socid = $obj->fk_soc2; + $user2->statut = $obj->statut2; + print $user2->getNomUrl(-1, '', 0, 0, 24, 0, '', '', 1); + if (!empty($conf->multicompany->enabled) && $obj->admin2 && !$obj->entity2) + { + print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); + } elseif ($obj->admin2) + { + print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); + } + } + print ''.$obj->accountancy_code.''; - if ($obj->login2) - { - $user2->id = $obj->id2; - $user2->login = $obj->login2; - $user2->lastname = $obj->lastname2; - $user2->firstname = $obj->firstname2; - $user2->gender = $obj->gender2; - $user2->photo = $obj->photo2; - $user2->admin = $obj->admin2; - $user2->email = $obj->email2; - $user2->socid = $obj->fk_soc2; - $user2->statut = $obj->statut2; - print $user2->getNomUrl(-1, '', 0, 0, 24, 0, '', '', 1); - if (!empty($conf->multicompany->enabled) && $obj->admin2 && !$obj->entity2) - { - print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); - } elseif ($obj->admin2) - { - print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); - } - } - print ''.($obj->salary ? price($obj->salary) : '').'
'."\n"; diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index fc24f1aa02a..a1abc3a9240 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -239,8 +239,8 @@ foreach (array('internal', 'external') as $source) } -$sortfield = GETPOST("sortfield", "alpha"); -$sortorder = GETPOST("sortorder", 'alpha'); +$sortfield = GETPOST("sortfield", "aZ09comma"); +$sortorder = GETPOST("sortorder", 'aZ09comma'); if (!$sortfield) $sortfield = "nature"; if (!$sortorder) $sortorder = "asc"; diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index ba1b0629365..5b408717f40 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -37,8 +37,8 @@ $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", "alpha"); -$sortorder = GETPOST("sortorder", 'alpha'); +$sortfield = GETPOST("sortfield", "aZ09comma"); +$sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 63bb21527e5..586d78ae7b3 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -67,8 +67,8 @@ if (!$user->rights->projet->lire) accessforbidden(); $diroutputmassaction = $conf->projet->dir_output.'/temp/massgeneration/'.$user->id; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", "alpha"); -$sortorder = GETPOST("sortorder", 'alpha'); +$sortfield = GETPOST("sortfield", "aZ09comma"); +$sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; @@ -144,15 +144,7 @@ $fieldstosearchall['s.nom'] = "ThirdPartyName"; $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field - if (empty($val['visible'])) { - continue; - } - - $arrayfields['p.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($val['visible'] < 0) ? 0 : 1), - 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), - 'position'=>$val['position']); + if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']); } // Add none object fields to fields for list @@ -165,8 +157,14 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) - $arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); + if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { + $arrayfields["ef.".$key] = array( + 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], + 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), + 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], + 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]) + ); + } } } diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 726710f52de..135e2f53080 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -31,7 +31,42 @@ if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/account // Load translation files required by the page $langs->loadLangs(array("compta", "salaries", "bills", "hrm")); +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') + +// Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortfield) $sortfield = "s.datep,s.rowid"; +if (!$sortorder) $sortorder = "DESC,DESC"; + +// Initialize technical objects +$object = new PaymentSalary($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('salarieslist')); // Note that conf->hooks_modules contains array + +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); + +if (!$sortfield) $sortfield = "s.datep,s.rowid"; +if (!$sortorder) $sortorder = "DESC,DESC"; + $search_ref = GETPOST('search_ref', 'int'); $search_user = GETPOST('search_user', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -40,30 +75,19 @@ $search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int') $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'int'); -$sortfield = GETPOST("sortfield", 'alpha'); -$sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (!$sortfield) $sortfield = "s.datep,s.rowid"; -if (!$sortorder) $sortorder = "DESC,DESC"; -$optioncss = GETPOST('optioncss', 'alpha'); - $filtre = GETPOST("filtre", 'restricthtml'); -if (!GETPOST('typeid', 'int')) +if (!GETPOST('search_type_id', 'int')) { $newfiltre = str_replace('filtre=', '', $filtre); $filterarray = explode('-', $newfiltre); foreach ($filterarray as $val) { $part = explode(':', $val); - if ($part[0] == 's.fk_typepayment') $typeid = $part[1]; + if ($part[0] == 's.fk_typepayment') $search_type_id = $part[1]; } } else { - $typeid = GETPOST('typeid', 'int'); + $search_type_id = GETPOST('search_type_id', 'int'); } $childids = $user->getAllChildIds(1); @@ -73,36 +97,92 @@ $socid = GETPOST("socid", "int"); if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'salaries', '', '', ''); +// Initialize array of search criterias +$search_all = GETPOST("search_all", 'alpha'); +$search = array(); +foreach ($object->fields as $key => $val) +{ + if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key] = GETPOST('search_'.$key, 'alpha'); +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) +{ + if ($val['searchall']) $fieldstosearchall['t.'.$key] = $val['label']; +} + +$permissiontoread = $user->rights->salaries->read; +$permissiontoadd = $user->rights->salaries->write; +$permissiontodelete = $user->rights->salaries->delete; /* * Actions */ -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers -{ - $search_ref = ""; - $search_user = ""; - $search_label = ""; - $search_date_start = ''; - $search_date_end = ''; - $search_amount = ""; - $search_account = ''; - $typeid = ""; -} +if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; } +$parameters = 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'); + +if (empty($reshook)) +{ + // Selection of new fields + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + // Purge search criteria + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers + { + $search_ref = ""; + $search_user = ""; + $search_label = ""; + $search_date_start = ''; + $search_date_end = ''; + $search_amount = ""; + $search_account = ''; + $search_type_id = ""; + } + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) + { + $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation + } + + // Mass actions + $objectclass = 'PaymentSalary'; + $objectlabel = 'SalariesPayments'; + $permissiontoread = $user->rights->salaries->read; + $permissiontodelete = $user->rights->salaries->delete; + $uploaddir = $conf->bom->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + + // Validate records + if (!$error && $massaction == 'buildsepa' && $permissiontoadd) + { + $objecttmp = new $objectclass($db); + + // TODO + } +} /* * View */ -llxHeader('', $langs->trans("Salaries")); - $form = new Form($db); $salstatic = new PaymentSalary($db); $userstatic = new User($db); $accountstatic = new Account($db); +$now = dol_now(); + +//$help_url="EN:Module_BillOfMaterials|FR:Module_BillOfMaterials_FR|ES:Módulo_BillOfMaterials"; +$help_url = ''; +$title = $langs->trans('SalariesPayments'); + $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary as current_salary, u.fk_soc as fk_soc, u.statut as status,"; $sql .= " s.rowid, s.fk_user, s.amount, s.salary, s.label, s.datep as datep, s.datev as datev, s.fk_typepayment as type, s.num_payment, s.fk_bank,"; $sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel,"; @@ -128,195 +208,304 @@ if ($filtre) { $filtre = str_replace(":", "=", $filtre); $sql .= " AND ".$filtre; } -if ($typeid) { - $sql .= " AND s.fk_typepayment=".$typeid; +if ($search_type_id) { + $sql .= " AND s.fk_typepayment=".$search_type_id; } $sql .= $db->order($sortfield, $sortorder); -//$sql.= " GROUP BY u.rowid, u.lastname, u.firstname, s.rowid, s.fk_user, s.amount, s.label, s.datev, s.fk_typepayment, s.num_payment, pst.code"; -$totalnboflines = 0; -$result = $db->query($sql); -if ($result) +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $totalnboflines = $db->num_rows($result); + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0 + { + $page = 0; + $offset = 0; + } } -$sql .= $db->plimit($limit + 1, $offset); - - -$result = $db->query($sql); -if ($result) +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { - $num = $db->num_rows($result); - $i = 0; - $total = 0; + $num = $nbtotalofrecords; +} else { + if ($limit) $sql .= $db->plimit($limit + 1, $offset); - $param = ''; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; - if ($typeid) $param .= '&typeid='.$typeid; - if ($optioncss != '') $param .= '&optioncss='.$optioncss; + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + exit; + } - $url = DOL_URL_ROOT.'/salaries/card.php?action=create'; - if (!empty($socid)) $url .= '&socid='.$socid; - $newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write); + $num = $db->num_rows($resql); +} - print ''; - if ($optioncss != '') print ''; - print ''; - print ''; - print ''; - print ''; - print ''; +// Output page +// -------------------------------------------------------------------- - print_barre_liste($langs->trans("SalariesPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); +llxHeader('', $title, $help_url); - print '
'; - print '
'."\n"; +$arrayofselected = is_array($toselect) ? $toselect : array(); - print ''; - // Ref - print ''; - // Employee +$param = ''; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); +if ($search_type_id) $param .= '&search_type_id='.urlencode($search_type_id); +if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); +if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); +if ($search_user > 0) $param .= '&search_user='.urlencode($search_user); +if ($search_label) $param .= '&search_label='.urlencode($search_label); +if ($search_account) $param .= '&search_account='.urlencode($search_account); +if ($search_date_start) $param .= '&search_date_startday='.urlencode(GETPOST('search_date_startday', 'int')).'&search_date_startmonth='.urlencode(GETPOST('search_date_startmonth', 'int')).'&search_date_startyear='.urlencode(GETPOST('search_date_startyear', 'int')); +if ($search_date_end) $param .= '&search_date_endday='.urlencode(GETPOST('search_date_endday', 'int')).'&search_date_endmonth='.urlencode(GETPOST('search_date_endmonth', 'int')).'&search_date_endyear='.urlencode(GETPOST('search_date_endyear', 'int')); +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + +// List of mass actions available +$arrayofmassactions = array( + //'presend'=>$langs->trans("SendByMail"), + 'buildsepa'=>$langs->trans("BuildSepa"), +); +//if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); + +print ''; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$url = DOL_URL_ROOT.'/salaries/card.php?action=create'; +if (!empty($socid)) $url .= '&socid='.$socid; +$newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write); + +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +//$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = ''; +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + +print '
'; +print '
'; - print ''; - print '
'."\n"; + +// Fields title search +// -------------------------------------------------------------------- +print ''; +// Ref +print ''; +// Employee +print ''; +// Label +print ''; +// Date +print ''; +// Type +print ''; +// Account +if (!empty($conf->banque->enabled)) +{ print ''; - // Label - print ''; - // Date - print ''; +} +// Amount +print ''; + +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print ''; +print ''."\n"; + + +// Fields title label +// -------------------------------------------------------------------- +print ''; +print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder); +print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder); +print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, 'class="left"', $sortfield, $sortorder); +print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "s.datep,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder); +print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder); +if (!empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); +print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder); +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Action column +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +print ''."\n"; + + +// Detect if we need a fetch on each output line +$needToFetchEachLine = 0; +if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) +{ + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) + { + if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object + } +} + +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$total = 0; +$totalarray = array(); +while ($i < ($limit ? min($num, $limit) : $num)) +{ + $obj = $db->fetch_object($resql); + if (empty($obj)) break; // Should not happen + + // Store properties in $object + $object->setVarsFromFetchObj($obj); + + // Show here line of result + print ''; + + $userstatic->id = $obj->uid; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->admin = $obj->admin; + $userstatic->login = $obj->login; + $userstatic->email = $obj->email; + $userstatic->socid = $obj->fk_soc; + $userstatic->statut = $obj->status; + + $salstatic->id = $obj->rowid; + $salstatic->ref = $obj->rowid; + + // Ref + print "\n"; + if (!$i) $totalarray['nbfield']++; + + // Employee + print "\n"; + if (!$i) $totalarray['nbfield']++; + + // Label payment + print "\n"; + if (!$i) $totalarray['nbfield']++; + + // Date payment + print '\n"; + if (!$i) $totalarray['nbfield']++; + // Type - print ''; + print ''; + if (!$i) $totalarray['nbfield']++; + // Account if (!empty($conf->banque->enabled)) { - print ''; - } - // Amount - print ''; - - print ''; - - print ''; - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, 'class="left"', $sortfield, $sortorder); - print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "s.datep,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder); - if (!empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); - print "\n"; - - print "\n"; - - while ($i < min($num, $limit)) - { - $obj = $db->fetch_object($result); - - print ''; - - $userstatic->id = $obj->uid; - $userstatic->lastname = $obj->lastname; - $userstatic->firstname = $obj->firstname; - $userstatic->admin = $obj->admin; - $userstatic->login = $obj->login; - $userstatic->email = $obj->email; - $userstatic->socid = $obj->fk_soc; - $userstatic->statut = $obj->status; - - $salstatic->id = $obj->rowid; - $salstatic->ref = $obj->rowid; - - // Ref - print "\n"; - if (!$i) $totalarray['nbfield']++; - - // Employee - print "\n"; - if (!$i) $totalarray['nbfield']++; - - // Label payment - print "\n"; - if (!$i) $totalarray['nbfield']++; - - // Date payment - print '\n"; - if (!$i) $totalarray['nbfield']++; - - // Type - print ''; - if (!$i) $totalarray['nbfield']++; - - // Account - if (!empty($conf->banque->enabled)) + print ''; - if (!$i) $totalarray['nbfield']++; - } - - // Amount - print ''; + $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); + } + $accountstatic->label = $obj->blabel; + print $accountstatic->getNomUrl(1); + } else print ' '; + print ''; if (!$i) $totalarray['nbfield']++; - if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; - $totalarray['val']['totalttcfield'] += $obj->amount; - - print ''; - - if (!$i) $totalarray['nbfield']++; - - print "\n"; - - $i++; } - // Show total line - include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // Amount + print ''; + if (!$i) $totalarray['nbfield']++; + if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; + $totalarray['val']['totalttcfield'] += $obj->amount; - print "
'; +print ''; +print ''; +print ''; +print ''; +print '
'; +print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); +print '
'; +print '
'; +print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); +print '
'; +print '
'; +$form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16); +print ''; - print ''; - print ''; - print '
'; - print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
'; - print '
'; - print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); - print '
'; + $form->select_comptes($search_account, 'search_account', 0, '', 1); print '
'; +$searchpicto = $form->showFilterButtons(); +print $searchpicto; +print '
".$salstatic->getNomUrl(1)."".$userstatic->getNomUrl(1)."".dol_trunc($obj->label, 40)."'.dol_print_date($db->jdate($obj->datep), 'day')."'; - $form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16); - print ''.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; - $form->select_comptes($search_account, 'search_account', 0, '', 1); - print ''; - $searchpicto = $form->showFilterAndCheckAddButtons(0); - print $searchpicto; - print '
".$salstatic->getNomUrl(1)."".$userstatic->getNomUrl(1)."".dol_trunc($obj->label, 40)."'.dol_print_date($db->jdate($obj->datep), 'day')."'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; + if ($obj->fk_bank > 0) { - print ''; - if ($obj->fk_bank > 0) + //$accountstatic->fetch($obj->fk_bank); + $accountstatic->id = $obj->bid; + $accountstatic->ref = $obj->bref; + $accountstatic->number = $obj->bnumber; + + if (!empty($conf->accounting->enabled)) { - //$accountstatic->fetch($obj->fk_bank); - $accountstatic->id = $obj->bid; - $accountstatic->ref = $obj->bref; - $accountstatic->number = $obj->bnumber; + $accountstatic->account_number = $obj->account_number; - if (!empty($conf->accounting->enabled)) - { - $accountstatic->account_number = $obj->account_number; + $accountingjournal = new AccountingJournal($db); + $accountingjournal->fetch($obj->fk_accountancy_journal); - $accountingjournal = new AccountingJournal($db); - $accountingjournal->fetch($obj->fk_accountancy_journal); - - $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); - } - $accountstatic->label = $obj->blabel; - print $accountstatic->getNomUrl(1); - } else print ' '; - print ''.price($obj->amount).'
'.price($obj->amount).'
"; - print '
'; - print ''; + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print '
'; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected = 0; + if (in_array($object->id, $arrayofselected)) $selected = 1; + print ''; + } + print '
'.$langs->trans("NoRecordFound").'
'."\n"; +print ''."\n"; + +print ''."\n"; + + + // End of page llxFooter(); $db->close(); diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index b14e5b718ba..be68e1f68ee 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -41,8 +41,8 @@ $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", "alpha"); -$sortorder = GETPOST("sortorder", 'alpha'); +$sortfield = GETPOST("sortfield", "aZ09comma"); +$sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index af6f78fe98c..49f15412965 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -41,8 +41,8 @@ $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", "alpha"); -$sortorder = GETPOST("sortorder", 'alpha'); +$sortfield = GETPOST("sortfield", "aZ09comma"); +$sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = is_numeric($page) ? $page : 0; $page = $page == -1 ? 0 : $page; From 56d5cd040238a04280c465b0417639cc232b43e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Dec 2020 10:22:17 +0100 Subject: [PATCH 33/33] Fix missing .php into name of boxes added into llx_boxes_def --- ChangeLog | 1 + htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 637a8a27407..2d0fd358c2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ NEW: Accountancy - change menu disposition NEW: Accountancy - on transfers, select the periodicity by default NEW: Accountancy - Add export for Gestinum (v3 & v5) NEW: new currency rate editor +NEW: add a widget to show the customers with outstanding limits reached NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr NEW: add a counter of number of words for pages in website module NEW: add alert before changing thirdparty in TakePOS diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 7d3118fe891..4a804e5fe4a 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -542,4 +542,4 @@ CREATE TABLE llx_session( user_agent varchar(128) NULL )ENGINE=innodb; -INSERT INTO llx_boxes_def(file, entity) VALUES ('box_customers_outstanding_bill_reached', 1); +INSERT INTO llx_boxes_def(file, entity) VALUES ('box_customers_outstanding_bill_reached.php', 1);