From d4f20df3ea174a49a53056c8d1c00131eb6c6e78 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Tue, 28 Mar 2023 13:52:20 +0200 Subject: [PATCH 001/156] FIX : no usage of the function updateProduction in the update function --- htdocs/mrp/class/mo.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 9c27a21b1f5..43b6adac644 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -612,11 +612,6 @@ class Mo extends CommonObject $error++; } - $result = $this->updateProduction($user, $notrigger); - if ($result <= 0) { - $error++; - } - if (!$error) { $this->db->commit(); return 1; From 805d457be11d32e62043bf67118f751902d71a19 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 3 Apr 2023 16:54:37 +0200 Subject: [PATCH 002/156] FIX : redesign of the function : updateProduction --- htdocs/mrp/class/mo.class.php | 99 ++++++----------------------------- htdocs/mrp/mo_card.php | 2 + 2 files changed, 19 insertions(+), 82 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 43b6adac644..7745d05d71a 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -631,93 +631,28 @@ class Mo extends CommonObject public function updateProduction(User $user, $notrigger = true) { $error = 0; - $role = ""; - if ($this->status != self::STATUS_DRAFT) { - //$this->error = 'BadStatusForUpdateProduction'; - //return -1; - return 1; - } + if ($this->status != self::STATUS_DRAFT) return 1; $this->db->begin(); - // Insert lines in mrp_production table from BOM data - if (!$error) { - // TODO Check that production has not started. If yes, we stop here. + $oldQty = $this->oldQty; + $newQty = $this->qty; + if($newQty != $oldQty) { + $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . $this->id; + $resql = $this->db->query($sql); + if($resql) { + while ($obj = $this->db->fetch_object($resql)) { + $moLine = new MoLine($this->db); + $res = $moLine->fetch($obj->rowid); + if(!$res) $error++; - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'mrp_production WHERE fk_mo = '.((int) $this->id); - $this->db->query($sql); - - $moline = new MoLine($this->db); - - // Line to produce - $moline->fk_mo = $this->id; - $moline->qty = $this->qty; - $moline->fk_product = $this->fk_product; - $moline->position = 1; - - if ($this->fk_bom > 0) { // If a BOM is defined, we know what to produce. - include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; - $bom = new Bom($this->db); - $bom->fetch($this->fk_bom); - if ($bom->bomtype == 1) { - $role = 'toproduce'; - $moline->role = 'toconsume'; - } else { - $role = 'toconsume'; - $moline->role = 'toproduce'; - } - } else { - if ($this->mrptype == 1) { - $moline->role = 'toconsume'; - } else { - $moline->role = 'toproduce'; - } - } - - $resultline = $moline->create($user, false); // Never use triggers here - if ($resultline <= 0) { - $error++; - $this->error = $moline->error; - $this->errors = $moline->errors; - dol_print_error($this->db, $moline->error, $moline->errors); - } - - if ($this->fk_bom > 0) { // If a BOM is defined, we know what to consume. - if ($bom->id > 0) { - // Lines to consume - if (!$error) { - foreach ($bom->lines as $line) { - $moline = new MoLine($this->db); - - $moline->fk_mo = $this->id; - $moline->origin_id = $line->id; - $moline->origin_type = 'bomline'; - if ($line->qty_frozen) { - $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce - } else { - $moline->qty = price2num(($line->qty / ( !empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( !empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition - } - if ($moline->qty <= 0) { - $error++; - $this->error = "BadValueForquantityToConsume"; - break; - } else { - $moline->fk_product = $line->fk_product; - $moline->role = $role; - $moline->position = $line->position; - $moline->qty_frozen = $line->qty_frozen; - $moline->disable_stock_change = $line->disable_stock_change; - - $resultline = $moline->create($user, false); // Never use triggers here - if ($resultline <= 0) { - $error++; - $this->error = $moline->error; - $this->errors = $moline->errors; - dol_print_error($this->db, $moline->error, $moline->errors); - break; - } - } + if($moLine->role == 'toconsume' || $moLine->role == 'toproduce') { + if (empty($moLine->qty_frozen)) { + $qty = $newQty * $moLine->qty / $oldQty; + $moLine->qty = price2num($qty * (!empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition + $res = $moLine->update($user); + if(!$res) $error++; } } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index b3a4b3aced8..8a460056a13 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -123,6 +123,8 @@ if (empty($reshook)) { $backurlforlist = dol_buildpath('/mrp/mo_list.php', 1); + $object->oldQty = $object->qty; + if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { From 700efad2355a6a2ecabc5a1d710c3477a165a8a9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 3 Apr 2023 15:00:40 +0000 Subject: [PATCH 003/156] Fixing style errors. --- htdocs/mrp/class/mo.class.php | 10 +++++----- htdocs/mrp/mo_card.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 7745d05d71a..8e0b94ccb5b 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -638,21 +638,21 @@ class Mo extends CommonObject $oldQty = $this->oldQty; $newQty = $this->qty; - if($newQty != $oldQty) { + if ($newQty != $oldQty) { $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . $this->id; $resql = $this->db->query($sql); - if($resql) { + if ($resql) { while ($obj = $this->db->fetch_object($resql)) { $moLine = new MoLine($this->db); $res = $moLine->fetch($obj->rowid); - if(!$res) $error++; + if (!$res) $error++; - if($moLine->role == 'toconsume' || $moLine->role == 'toproduce') { + if ($moLine->role == 'toconsume' || $moLine->role == 'toproduce') { if (empty($moLine->qty_frozen)) { $qty = $newQty * $moLine->qty / $oldQty; $moLine->qty = price2num($qty * (!empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition $res = $moLine->update($user); - if(!$res) $error++; + if (!$res) $error++; } } } diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 8a460056a13..974e6eae4df 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -123,7 +123,7 @@ if (empty($reshook)) { $backurlforlist = dol_buildpath('/mrp/mo_list.php', 1); - $object->oldQty = $object->qty; + $object->oldQty = $object->qty; if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { From 1ea251d813126f5a0b9edb28e824758f2ce7a035 Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 4 Apr 2023 16:10:02 +0200 Subject: [PATCH 004/156] new attributes on propal card --- htdocs/comm/propal/card.php | 73 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index abf68f1d30e..d7b51735243 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2753,53 +2753,50 @@ if ($action == 'create') { print ''; + print ''; + print ''; + print ''; - print ''; - print ''; - - // Multicurrency Amount VAT - print ''; - print ''; - print ''; - - // Multicurrency Amount TTC - print ''; - print ''; - print ''; + print ' - ' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code); } + print ''; + print ''; - // Amount HT - print ''; - print ''; + print ''; + print ''; + print ''; print ''; - // Amount VAT - print ''; - print ''; - print ''; - - // Amount Local Taxes - if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 - print ''; - print ''; - print ''; - } - if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 - print ''; - print ''; - print ''; + if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { + print ''; + print ''; + print ''; + print ''; + if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { + print ''; + print ''; + print ''; + print ''; + } } - // Amount TTC - print ''; - print ''; + print ''; + print ''; + print ''; print ''; - // Statut - //print ''; - print '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - // Multicurrency Amount HT - print '
'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$langs->trans('AmountHT').''.price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency).'' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency); + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + print ' - ' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code); + } + print '
'.$langs->trans('AmountVAT').''.price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency).'
'.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency).'
'.$langs->transcountry("AmountLT2", $mysoc->country_code).''.price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency).'
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency); + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + print ' - ' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code); + } + print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency); + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + print ' - ' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code); + } + print '
'.$langs->trans('AmountTTC').''.price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency).'
' . $langs->trans('AmountTTC') . '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . '
' . $langs->trans('Status') . '' . $object->getLibStatut(4) . '
'; // Margin Infos From c7657ed3fd9431b4df1f3f6433ffbeff1f859a7b Mon Sep 17 00:00:00 2001 From: FLIO Date: Wed, 5 Apr 2023 02:40:39 +0200 Subject: [PATCH 005/156] fix the missing condition and missing price total_ttc --- htdocs/comm/propal/card.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d7b51735243..fb2ec070b3c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2757,16 +2757,15 @@ if ($action == 'create') { print '' . $langs->trans('AmountHT') . ''; print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ' - ' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code); + print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; - print ''; - print ''; + print '' . $langs->trans('AmountVAT') . ''; print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ' - ' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code); + print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; @@ -2776,16 +2775,15 @@ if ($action == 'create') { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ' - ' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code); + print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; - print ''; + if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { - print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ' - ' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code); + print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; @@ -2795,6 +2793,9 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountTTC') . ''; print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + } print ''; print ''; From 87397a4d207bd35c17ea031536716a0b0f5d1b46 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 5 Apr 2023 10:48:45 +0200 Subject: [PATCH 006/156] NEW: Accountancy - Add specific page to export accounting data rather than the journals page --- htdocs/accountancy/bookkeeping/export.php | 1403 +++++++++++++++++++++ htdocs/accountancy/bookkeeping/list.php | 287 +---- htdocs/core/menus/init_menu_auguria.sql | 9 +- htdocs/core/menus/standard/eldy.lib.php | 3 + htdocs/langs/en_US/accountancy.lang | 7 +- 5 files changed, 1422 insertions(+), 287 deletions(-) create mode 100644 htdocs/accountancy/bookkeeping/export.php diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php new file mode 100644 index 00000000000..a9dcb76ce53 --- /dev/null +++ b/htdocs/accountancy/bookkeeping/export.php @@ -0,0 +1,1403 @@ + + * Copyright (C) 2013-2016 Florian Henry + * Copyright (C) 2013-2023 Alexandre Spangaro + * Copyright (C) 2022 Lionel Vessiller + * Copyright (C) 2016-2017 Laurent Destailleur + * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2022 Progiseize + * + * 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/accountancy/bookkeeping/export.php + * \ingroup Accountancy (Double entries) + * \brief Export operation of book keeping + */ + +// Load Dolibarr environment +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + +// Load translation files required by the page +$langs->loadLangs(array("accountancy", "compta")); + +$socid = GETPOST('socid', 'int'); + +$action = GETPOST('action', 'aZ09'); +$massaction = GETPOST('massaction', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; +$search_mvt_num = GETPOST('search_mvt_num', 'int'); +$search_doc_type = GETPOST("search_doc_type", 'alpha'); +$search_doc_ref = GETPOST("search_doc_ref", 'alpha'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); +$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); +$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); +$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); +$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); +$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); +$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); +$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); +$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); +$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); +$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); +$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); +$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); +$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); +$search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); +$search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); +$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); +$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); +$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); +$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); +$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); +$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); +$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); +$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); +$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); +$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); +$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); +$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); +$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); +$search_import_key = GETPOST("search_import_key", 'alpha'); + +//var_dump($search_date_start);exit; +if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { + $action = 'delbookkeepingyear'; +} +if (GETPOST("button_export_file_x") || GETPOST("button_export_file.x") || GETPOST("button_export_file")) { + $action = 'export_file'; +} + +$search_account_category = GETPOST('search_account_category', 'int'); + +$search_accountancy_code = GETPOST("search_accountancy_code", 'alpha'); +$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); +if ($search_accountancy_code_start == - 1) { + $search_accountancy_code_start = ''; +} +$search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha'); +if ($search_accountancy_code_end == - 1) { + $search_accountancy_code_end = ''; +} + +$search_accountancy_aux_code = GETPOST("search_accountancy_aux_code", 'alpha'); +$search_accountancy_aux_code_start = GETPOST('search_accountancy_aux_code_start', 'alpha'); +if ($search_accountancy_aux_code_start == - 1) { + $search_accountancy_aux_code_start = ''; +} +$search_accountancy_aux_code_end = GETPOST('search_accountancy_aux_code_end', 'alpha'); +if ($search_accountancy_aux_code_end == - 1) { + $search_accountancy_aux_code_end = ''; +} +$search_mvt_label = GETPOST('search_mvt_label', 'alpha'); +$search_direction = GETPOST('search_direction', 'alpha'); +$search_debit = GETPOST('search_debit', 'alpha'); +$search_credit = GETPOST('search_credit', 'alpha'); +$search_ledger_code = GETPOST('search_ledger_code', 'array'); +$search_lettering_code = GETPOST('search_lettering_code', 'alpha'); +$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); + +// Load variable for pagination +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$optioncss = GETPOST('optioncss', 'alpha'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0) { + $page = 0; +} +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if ($sortorder == "") { + $sortorder = "ASC"; +} +if ($sortfield == "") { + $sortfield = "t.piece_num,t.rowid"; +} + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$object = new BookKeeping($db); +$hookmanager->initHooks(array('bookkeepingexport')); + +$formaccounting = new FormAccounting($db); +$form = new Form($db); + +if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { + if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { + $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; + $res = $db->query($query); + + if ($res->num_rows > 0) { + $fiscalYear = $db->fetch_object($res); + $search_date_start = strtotime($fiscalYear->date_start); + $search_date_end = strtotime($fiscalYear->date_end); + } else { + $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); + $year_start = dol_print_date(dol_now(), '%Y'); + if (dol_print_date(dol_now(), '%m') < $month_start) { + $year_start--; // If current month is lower that starting fiscal month, we start last year + } + $year_end = $year_start + 1; + $month_end = $month_start - 1; + if ($month_end < 1) { + $month_end = 12; + $year_end--; + } + $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start); + $search_date_end = dol_get_last_day($year_end, $month_end); + } + } +} + + +$arrayfields = array( + 't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1), + 't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1), + 't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1), + 't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1), + 't.numero_compte'=>array('label'=>$langs->trans("AccountAccountingShort"), 'checked'=>1), + 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1), + 't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1), + 't.debit'=>array('label'=>$langs->trans("AccountingDebit"), 'checked'=>1), + 't.credit'=>array('label'=>$langs->trans("AccountingCredit"), 'checked'=>1), + 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), + 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), + 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), + 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), + 't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), + 't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100), +); + +if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { + unset($arrayfields['t.lettering_code']); +} + +$accountancyexport = new AccountancyExport($db); +$listofformat = $accountancyexport->getType(); +$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'); +if (empty($listofformat[$formatexportset])) { + $formatexportset = 1; +} + +$error = 0; + +if (!isModEnabled('accounting')) { + accessforbidden(); +} +if ($user->socid > 0) { + accessforbidden(); +} +if (!$user->hasRight('accounting', 'mouvements', 'lire')) { + accessforbidden(); +} + + +/* + * Actions + */ + +$param = ''; + +if (GETPOST('cancel', 'alpha')) { + $action = 'list'; $massaction = ''; +} +if (!GETPOST('confirmmassaction', 'alpha')) { + $massaction = ''; +} + +$parameters = array('socid'=>$socid); +$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)) { + include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $search_mvt_num = ''; + $search_doc_type = ''; + $search_doc_ref = ''; + $search_doc_date = ''; + $search_account_category = ''; + $search_accountancy_code = ''; + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; + $search_accountancy_aux_code = ''; + $search_accountancy_aux_code_start = ''; + $search_accountancy_aux_code_end = ''; + $search_mvt_label = ''; + $search_direction = ''; + $search_ledger_code = array(); + $search_date_startyear = ''; + $search_date_startmonth = ''; + $search_date_startday = ''; + $search_date_endyear = ''; + $search_date_endmonth = ''; + $search_date_endday = ''; + $search_date_start = ''; + $search_date_end = ''; + $search_date_creation_startyear = ''; + $search_date_creation_startmonth = ''; + $search_date_creation_startday = ''; + $search_date_creation_endyear = ''; + $search_date_creation_endmonth = ''; + $search_date_creation_endday = ''; + $search_date_creation_start = ''; + $search_date_creation_end = ''; + $search_date_modification_startyear = ''; + $search_date_modification_startmonth = ''; + $search_date_modification_startday = ''; + $search_date_modification_endyear = ''; + $search_date_modification_endmonth = ''; + $search_date_modification_endday = ''; + $search_date_modification_start = ''; + $search_date_modification_end = ''; + $search_date_export_startyear = ''; + $search_date_export_startmonth = ''; + $search_date_export_startday = ''; + $search_date_export_endyear = ''; + $search_date_export_endmonth = ''; + $search_date_export_endday = ''; + $search_date_export_start = ''; + $search_date_export_end = ''; + $search_date_validation_startyear = ''; + $search_date_validation_startmonth = ''; + $search_date_validation_startday = ''; + $search_date_validation_endyear = ''; + $search_date_validation_endmonth = ''; + $search_date_validation_endday = ''; + $search_date_validation_start = ''; + $search_date_validation_end = ''; + $search_debit = ''; + $search_credit = ''; + $search_lettering_code = ''; + $search_not_reconciled = ''; + $search_import_key = ''; + $toselect = array(); + } + + // Must be after the remove filter action, before the export. + $filter = array(); + if (!empty($search_date_start)) { + $filter['t.doc_date>='] = $search_date_start; + $tmp = dol_getdate($search_date_start); + $param .= '&search_date_startmonth='.urlencode($tmp['mon']).'&search_date_startday='.urlencode($tmp['mday']).'&search_date_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_end)) { + $filter['t.doc_date<='] = $search_date_end; + $tmp = dol_getdate($search_date_end); + $param .= '&search_date_endmonth='.urlencode($tmp['mon']).'&search_date_endday='.urlencode($tmp['mday']).'&search_date_endyear='.urlencode($tmp['year']); + } + if (!empty($search_doc_date)) { + $filter['t.doc_date'] = $search_doc_date; + $tmp = dol_getdate($search_doc_date); + $param .= '&doc_datemonth='.urlencode($tmp['mon']).'&doc_dateday='.urlencode($tmp['mday']).'&doc_dateyear='.urlencode($tmp['year']); + } + if (!empty($search_doc_type)) { + $filter['t.doc_type'] = $search_doc_type; + $param .= '&search_doc_type='.urlencode($search_doc_type); + } + if (!empty($search_doc_ref)) { + $filter['t.doc_ref'] = $search_doc_ref; + $param .= '&search_doc_ref='.urlencode($search_doc_ref); + } + if ($search_account_category != '-1' && !empty($search_account_category)) { + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; + $accountingcategory = new AccountancyCategory($db); + + $listofaccountsforgroup = $accountingcategory->getCptsCat(0, 'fk_accounting_category = '.((int) $search_account_category)); + $listofaccountsforgroup2 = array(); + if (is_array($listofaccountsforgroup)) { + foreach ($listofaccountsforgroup as $tmpval) { + $listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'"; + } + } + $filter['t.search_accounting_code_in'] = join(',', $listofaccountsforgroup2); + $param .= '&search_account_category='.urlencode($search_account_category); + } + if (!empty($search_accountancy_code)) { + $filter['t.numero_compte'] = $search_accountancy_code; + $param .= '&search_accountancy_code='.urlencode($search_accountancy_code); + } + if (!empty($search_accountancy_code_start)) { + $filter['t.numero_compte>='] = $search_accountancy_code_start; + $param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start); + } + if (!empty($search_accountancy_code_end)) { + $filter['t.numero_compte<='] = $search_accountancy_code_end; + $param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end); + } + if (!empty($search_accountancy_aux_code)) { + $filter['t.subledger_account'] = $search_accountancy_aux_code; + $param .= '&search_accountancy_aux_code='.urlencode($search_accountancy_aux_code); + } + if (!empty($search_accountancy_aux_code_start)) { + $filter['t.subledger_account>='] = $search_accountancy_aux_code_start; + $param .= '&search_accountancy_aux_code_start='.urlencode($search_accountancy_aux_code_start); + } + if (!empty($search_accountancy_aux_code_end)) { + $filter['t.subledger_account<='] = $search_accountancy_aux_code_end; + $param .= '&search_accountancy_aux_code_end='.urlencode($search_accountancy_aux_code_end); + } + if (!empty($search_mvt_label)) { + $filter['t.label_operation'] = $search_mvt_label; + $param .= '&search_mvt_label='.urlencode($search_mvt_label); + } + if (!empty($search_direction)) { + $filter['t.sens'] = $search_direction; + $param .= '&search_direction='.urlencode($search_direction); + } + if (!empty($search_ledger_code)) { + $filter['t.code_journal'] = $search_ledger_code; + foreach ($search_ledger_code as $code) { + $param .= '&search_ledger_code[]='.urlencode($code); + } + } + if (!empty($search_mvt_num)) { + $filter['t.piece_num'] = $search_mvt_num; + $param .= '&search_mvt_num='.urlencode($search_mvt_num); + } + if (!empty($search_date_creation_start)) { + $filter['t.date_creation>='] = $search_date_creation_start; + $tmp = dol_getdate($search_date_creation_start); + $param .= '&search_date_creation_startmonth='.urlencode($tmp['mon']).'&search_date_creation_startday='.urlencode($tmp['mday']).'&search_date_creation_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_creation_end)) { + $filter['t.date_creation<='] = $search_date_creation_end; + $tmp = dol_getdate($search_date_creation_end); + $param .= '&search_date_creation_endmonth='.urlencode($tmp['mon']).'&search_date_creation_endday='.urlencode($tmp['mday']).'&search_date_creation_endyear='.urlencode($tmp['year']); + } + if (!empty($search_date_modification_start)) { + $filter['t.tms>='] = $search_date_modification_start; + $tmp = dol_getdate($search_date_modification_start); + $param .= '&search_date_modification_startmonth='.urlencode($tmp['mon']).'&search_date_modification_startday='.urlencode($tmp['mday']).'&search_date_modification_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_modification_end)) { + $filter['t.tms<='] = $search_date_modification_end; + $tmp = dol_getdate($search_date_modification_end); + $param .= '&search_date_modification_endmonth='.urlencode($tmp['mon']).'&search_date_modification_endday='.urlencode($tmp['mday']).'&search_date_modification_endyear='.urlencode($tmp['year']); + } + if (!empty($search_date_export_start)) { + $filter['t.date_export>='] = $search_date_export_start; + $tmp = dol_getdate($search_date_export_start); + $param .= '&search_date_export_startmonth='.urlencode($tmp['mon']).'&search_date_export_startday='.urlencode($tmp['mday']).'&search_date_export_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_export_end)) { + $filter['t.date_export<='] = $search_date_export_end; + $tmp = dol_getdate($search_date_export_end); + $param .= '&search_date_export_endmonth='.urlencode($tmp['mon']).'&search_date_export_endday='.urlencode($tmp['mday']).'&search_date_export_endyear='.urlencode($tmp['year']); + } + if (!empty($search_date_validation_start)) { + $filter['t.date_validated>='] = $search_date_validation_start; + $tmp = dol_getdate($search_date_validation_start); + $param .= '&search_date_validation_startmonth='.urlencode($tmp['mon']).'&search_date_validation_startday='.urlencode($tmp['mday']).'&search_date_validation_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_validation_end)) { + $filter['t.date_validated<='] = $search_date_validation_end; + $tmp = dol_getdate($search_date_validation_end); + $param .= '&search_date_validation_endmonth='.urlencode($tmp['mon']).'&search_date_validation_endday='.urlencode($tmp['mday']).'&search_date_validation_endyear='.urlencode($tmp['year']); + } + if (!empty($search_debit)) { + $filter['t.debit'] = $search_debit; + $param .= '&search_debit='.urlencode($search_debit); + } + if (!empty($search_credit)) { + $filter['t.credit'] = $search_credit; + $param .= '&search_credit='.urlencode($search_credit); + } + if (!empty($search_lettering_code)) { + $filter['t.lettering_code'] = $search_lettering_code; + $param .= '&search_lettering_code='.urlencode($search_lettering_code); + } + if (!empty($search_not_reconciled)) { + $filter['t.reconciled_option'] = $search_not_reconciled; + $param .= '&search_not_reconciled='.urlencode($search_not_reconciled); + } + if (!empty($search_import_key)) { + $filter['t.import_key'] = $search_import_key; + $param .= '&search_import_key='.urlencode($search_import_key); + } + + if ($action == 'setreexport') { + $setreexport = GETPOST('value', 'int'); + if (!dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) { + $error++; + } + + if (!$error) { + if ($conf->global->ACCOUNTING_REEXPORT == 1) { + setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'warnings'); + } + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + } + + // Mass actions + $objectclass = 'Bookkeeping'; + $objectlabel = 'Bookkeeping'; + $permissiontoread = $user->hasRight('societe', 'lire'); + $permissiontodelete = $user->hasRight('societe', 'supprimer'); + $permissiontoadd = $user->hasRight('societe', 'creer'); + $uploaddir = $conf->societe->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; +} + +// Build and execute select (used by page and export action) +// must de set after the action that set $filter +// -------------------------------------------------------------------- + +$sql = 'SELECT'; +$sql .= ' t.rowid,'; +$sql .= " t.doc_date,"; +$sql .= " t.doc_type,"; +$sql .= " t.doc_ref,"; +$sql .= " t.fk_doc,"; +$sql .= " t.fk_docdet,"; +$sql .= " t.thirdparty_code,"; +$sql .= " t.subledger_account,"; +$sql .= " t.subledger_label,"; +$sql .= " t.numero_compte,"; +$sql .= " t.label_compte,"; +$sql .= " t.label_operation,"; +$sql .= " t.debit,"; +$sql .= " t.credit,"; +$sql .= " t.lettering_code,"; +$sql .= " t.montant as amount,"; +$sql .= " t.sens,"; +$sql .= " t.fk_user_author,"; +$sql .= " t.import_key,"; +$sql .= " t.code_journal,"; +$sql .= " t.journal_label,"; +$sql .= " t.piece_num,"; +$sql .= " t.date_creation,"; +$sql .= " t.tms as date_modification,"; +$sql .= " t.date_export,"; +$sql .= " t.date_validated as date_validation,"; +$sql .= " t.import_key"; + +$sqlfields = $sql; // $sql fields to remove for count total + +$sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t'; +// Manage filter +$sqlwhere = array(); +if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 't.doc_date') { + $sqlwhere[] = $key."='".$db->idate($value)."'"; + } elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') { + $sqlwhere[] = $key."'".$db->escape($value)."'"; + } elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') { + $sqlwhere[] = $key.'='.((int) $value); + } elseif ($key == 't.subledger_account' || $key == 't.numero_compte') { + $sqlwhere[] = $key." LIKE '".$db->escape($value)."%'"; + } elseif ($key == 't.subledger_account') { + $sqlwhere[] = natural_search($key, $value, 0, 1); + } elseif ($key == 't.date_creation>=' || $key == 't.date_creation<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.tms>=' || $key == 't.tms<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') { + $sqlwhere[] = $key."'".$db->idate($value)."'"; + } elseif ($key == 't.credit' || $key == 't.debit') { + $sqlwhere[] = natural_search($key, $value, 1, 1); + } elseif ($key == 't.reconciled_option') { + $sqlwhere[] = 't.lettering_code IS NULL'; + } elseif ($key == 't.code_journal' && !empty($value)) { + if (is_array($value)) { + $sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1); + } else { + $sqlwhere[] = natural_search("t.code_journal", $value, 3, 1); + } + } elseif ($key == 't.search_accounting_code_in' && !empty($value)) { + $sqlwhere[] = 't.numero_compte IN ('.$db->sanitize($value, 1).')'; + } else { + $sqlwhere[] = natural_search($key, $value, 0, 1); + } + } +} +$sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')'; +if (!empty($conf->global->ACCOUNTING_REEXPORT)) { + $sql .= " AND t.date_export IS NULL"; +} +if (count($sqlwhere) > 0) { + $sql .= ' AND '.implode(' AND ', $sqlwhere); +} +//print $sql; + + +// Export into a file with format defined into setup (FEC, CSV, ...) +// Must be after definition of $sql +if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements', 'export')) { + // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It currently consumes too much memory on large export. + // Replace this with the query($sql) and loop on each line to export them. + $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); + + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + // Export files then exit + $accountancyexport = new AccountancyExport($db); + + $formatexport = GETPOST('formatexport', 'int'); + $notexportlettering = GETPOST('notexportlettering', 'alpha'); + + if (!empty($notexportlettering)) { + if (is_array($object->lines)) { + foreach ($object->lines as $k => $movement) { + unset($object->lines[$k]->lettering_code); + unset($object->lines[$k]->date_lettering); + } + } + } + + $notifiedexportdate = GETPOST('notifiedexportdate', 'alpha'); + $notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha'); + $withAttachment = !empty(trim(GETPOST('notifiedexportfull', 'alphanohtml'))) ? 1 : 0; + + // Output data on screen or download + $result = $accountancyexport->export($object->lines, $formatexport, $withAttachment); + + $error = 0; + if ($result < 0) { + $error++; + } else { + if (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) { + if (is_array($object->lines)) { + dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG); + + // Specify as export : update field date_export or date_validated + $db->begin(); + + // TODO Merge update for each line into one global using rowid IN (list of movement ids) + foreach ($object->lines as $movement) { + $now = dol_now(); + + $setfields = ''; + if (!empty($notifiedexportdate) && empty($movement->date_export)) { + $setfields .= ($setfields ? "," : "")." date_export = '".$db->idate($now)."'"; + } + if (!empty($notifiedvalidationdate) && empty($movement->date_validation)) { + $setfields .= ($setfields ? "," : "")." date_validated = '".$db->idate($now)."'"; + } + + if ($setfields) { + $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; + $sql .= " SET ".$setfields; + $sql .= " WHERE rowid = ".((int) $movement->id); + + $result = $db->query($sql); + if (!$result) { + $error++; + break; + } + } + } + + if (!$error) { + $db->commit(); + } else { + $error++; + $accountancyexport->errors[] = $langs->trans('NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated'); + $db->rollback(); + } + } + } + } + + if ($error) { + setEventMessages('', $accountancyexport->errors, 'errors'); + header('Location: '.$_SERVER['PHP_SELF']); + } + exit(); // download or show errors + } +} + + +/* + * View + */ + +$formother = new FormOther($db); +$formfile = new FormFile($db); + +$title_page = $langs->trans("Operations").' - '.$langs->trans("ExportAccountancy"); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + $page = 0; + $offset = 0; + } + $db->free($resql); +} + +// Complete request and execute it with limit +$sql .= $db->order($sortfield, $sortorder); +if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); +} + +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + +$arrayofselected = is_array($toselect) ? $toselect : array(); + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title_page); + +$formconfirm = ''; + +if ($action == 'export_file') { + $form_question = array(); + + $form_question['formatexport'] = array( + 'name' => 'formatexport', + 'type' => 'select', + 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo + 'values' => $listofformat, + 'default' => $formatexportset, + 'morecss' => 'minwidth200 maxwidth200' + ); + + $form_question['separator0'] = array('name'=>'separator0', 'type'=>'separator'); + + if (getDolGlobalInt("ACCOUNTING_ENABLE_LETTERING")) { + // If 1, we check by default. + $checked = !empty($conf->global->ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING) ? 'true' : 'false'; + $form_question['notexportlettering'] = array( + 'name' => 'notexportlettering', + 'type' => 'checkbox', + 'label' => $langs->trans('NotExportLettering'), + 'value' => $checked, + ); + + $form_question['separator1'] = array('name'=>'separator1', 'type'=>'separator'); + } + + // If 1 or not set, we check by default. + $checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE)); + $form_question['notifiedexportdate'] = array( + 'name' => 'notifiedexportdate', + 'type' => 'checkbox', + 'label' => $langs->trans('NotifiedExportDate'), + 'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'), + ); + + $form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator'); + + if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { + // If 0 or not set, we NOT check by default. + $checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE)); + $form_question['notifiedvalidationdate'] = array( + 'name' => 'notifiedvalidationdate', + 'type' => 'checkbox', + 'label' => $langs->trans('NotifiedValidationDate', $langs->transnoentitiesnoconv("MenuAccountancyClosure")), + 'value' => $checked, + ); + + $form_question['separator3'] = array('name'=>'separator3', 'type'=>'separator'); + } + + // add documents in an archive for accountancy export (Quadratus) + if (getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV') == AccountancyExport::$EXPORT_TYPE_QUADRATUS) { + $form_question['notifiedexportfull'] = array( + 'name' => 'notifiedexportfull', + 'type' => 'checkbox', + 'label' => $langs->trans('NotifiedExportFull'), + 'value' => 'false', + ); + } + + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600); +} + +// Print form confirm +print $formconfirm; + +//$param=''; param started before +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} + +// List of mass actions available +$arrayofmassactions = array(); +$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions); + +print '
'; +print ''; +print ''; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; + +if (count($filter)) { + $buttonLabel = $langs->trans("ExportFilteredList"); +} else { + $buttonLabel = $langs->trans("ExportList"); +} + +$parameters = array('param' => $param); +$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; + +if (empty($reshook)) { + // Button re-export + if (!empty($conf->global->ACCOUNTING_REEXPORT)) { + $newcardbutton .= ''.img_picto($langs->trans("ClickToShowAlreadyExportedLines"), 'switch_off', 'class="small size15x valignmiddle"'); + $newcardbutton .= ''.$langs->trans("ClickToShowAlreadyExportedLines").''; + $newcardbutton .= ''; + } else { + $newcardbutton .= ''.img_picto($langs->trans("DocsAlreadyExportedAreIncluded"), 'switch_on', 'class="warning size15x valignmiddle"'); + $newcardbutton .= ''.$langs->trans("DocsAlreadyExportedAreIncluded").''; + $newcardbutton .= ''; + } + + if ($user->hasRight('accounting', 'mouvements', 'export')) { + $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : '').'&sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder), $user->hasRight('accounting', 'mouvements', 'export')); + } +} + +print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); + +print info_admin($langs->trans("WarningDataDisappearsWhenDataIsExported"), 0, 0, 0); +print '
'; + +//$topicmail = "Information"; +//$modelmail = "accountingbookkeeping"; +//$objecttmp = new BookKeeping($db); +//$trackid = 'bk'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields +if ($massactionbutton && $contextpage != 'poslist') { + $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); +} + +$moreforfilter = ''; +$moreforfilter .= '
'; +$moreforfilter .= $langs->trans('AccountingCategory').': '; +$moreforfilter .= '
'; +$moreforfilter .= $formaccounting->select_accounting_category($search_account_category, 'search_account_category', 1, 0, 0, 0); +$moreforfilter .= '
'; +$moreforfilter .= '
'; + +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; +} else { + $moreforfilter = $hookmanager->resPrint; +} + +print '
'; +print $moreforfilter; +print '
'; + +print '
'; +print ''; + +// Filters lines +print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +// Movement number +if (!empty($arrayfields['t.piece_num']['checked'])) { + print ''; +} +// Code journal +if (!empty($arrayfields['t.code_journal']['checked'])) { + print ''; +} +// Date document +if (!empty($arrayfields['t.doc_date']['checked'])) { + print ''; +} +// Ref document +if (!empty($arrayfields['t.doc_ref']['checked'])) { + print ''; +} +// Accountancy account +if (!empty($arrayfields['t.numero_compte']['checked'])) { + print ''; +} +// Subledger account +if (!empty($arrayfields['t.subledger_account']['checked'])) { + print ''; +} +// Label operation +if (!empty($arrayfields['t.label_operation']['checked'])) { + print ''; +} +// Debit +if (!empty($arrayfields['t.debit']['checked'])) { + print ''; +} +// Credit +if (!empty($arrayfields['t.credit']['checked'])) { + print ''; +} +// Lettering code +if (!empty($arrayfields['t.lettering_code']['checked'])) { + print ''; +} + +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +// Date creation +if (!empty($arrayfields['t.date_creation']['checked'])) { + print ''; +} +// Date modification +if (!empty($arrayfields['t.tms']['checked'])) { + print ''; +} +// Date export +if (!empty($arrayfields['t.date_export']['checked'])) { + print ''; +} +// Date validation +if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; +} +if (!empty($arrayfields['t.import_key']['checked'])) { + print ''; +} +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} +print "\n"; + +print ''; +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');} +if (!empty($arrayfields['t.piece_num']['checked'])) { + print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.code_journal']['checked'])) { + print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.doc_date']['checked'])) { + print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.doc_ref']['checked'])) { + print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.numero_compte']['checked'])) { + print_liste_field_titre($arrayfields['t.numero_compte']['label'], $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.subledger_account']['checked'])) { + print_liste_field_titre($arrayfields['t.subledger_account']['label'], $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.label_operation']['checked'])) { + print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['t.debit']['checked'])) { + print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['t.credit']['checked'])) { + print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['t.lettering_code']['checked'])) { + print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center '); +} +// Hook fields +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +if (!empty($arrayfields['t.date_creation']['checked'])) { + print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.tms']['checked'])) { + print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.date_export']['checked'])) { + print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.date_validated']['checked'])) { + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['t.import_key']['checked'])) { + print_liste_field_titre($arrayfields['t.import_key']['label'], $_SERVER["PHP_SELF"], "t.import_key", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); +} +print "\n"; + + +$line = new BookKeepingLine(); + +// Loop on record +// -------------------------------------------------------------------- +$i = 0; +$totalarray = array(); +$totalarray['nbfield'] = 0; +$total_debit = 0; +$total_credit = 0; +$totalarray['val'] = array (); +$totalarray['val']['totaldebit'] = 0; +$totalarray['val']['totalcredit'] = 0; + +while ($i < min($num, $limit)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + $line->id = $obj->rowid; + $line->doc_date = $db->jdate($obj->doc_date); + $line->doc_type = $obj->doc_type; + $line->doc_ref = $obj->doc_ref; + $line->fk_doc = $obj->fk_doc; + $line->fk_docdet = $obj->fk_docdet; + $line->thirdparty_code = $obj->thirdparty_code; + $line->subledger_account = $obj->subledger_account; + $line->subledger_label = $obj->subledger_label; + $line->numero_compte = $obj->numero_compte; + $line->label_compte = $obj->label_compte; + $line->label_operation = $obj->label_operation; + $line->debit = $obj->debit; + $line->credit = $obj->credit; + $line->montant = $obj->amount; // deprecated + $line->amount = $obj->amount; + $line->sens = $obj->sens; + $line->lettering_code = $obj->lettering_code; + $line->fk_user_author = $obj->fk_user_author; + $line->import_key = $obj->import_key; + $line->code_journal = $obj->code_journal; + $line->journal_label = $obj->journal_label; + $line->piece_num = $obj->piece_num; + $line->date_creation = $db->jdate($obj->date_creation); + $line->date_modification = $db->jdate($obj->date_modification); + $line->date_export = $db->jdate($obj->date_export); + $line->date_validation = $db->jdate($obj->date_validation); + + $total_debit += $line->debit; + $total_credit += $line->credit; + + print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Piece number + if (!empty($arrayfields['t.piece_num']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Journal code + if (!empty($arrayfields['t.code_journal']['checked'])) { + $accountingjournal = new AccountingJournal($db); + $result = $accountingjournal->fetch('', $line->code_journal); + $journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Document date + if (!empty($arrayfields['t.doc_date']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Document ref + if (!empty($arrayfields['t.doc_ref']['checked'])) { + if ($line->doc_type == 'customer_invoice') { + $langs->loadLangs(array('bills')); + + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $objectstatic = new Facture($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'facture'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id; + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + } elseif ($line->doc_type == 'supplier_invoice') { + $langs->loadLangs(array('bills')); + + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $objectstatic = new FactureFournisseur($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'invoice_supplier'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); + $subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref); + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir); + } elseif ($line->doc_type == 'expense_report') { + $langs->loadLangs(array('trips')); + + require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; + $objectstatic = new ExpenseReport($db); + $objectstatic->fetch($line->fk_doc); + //$modulepart = 'expensereport'; + + $filename = dol_sanitizeFileName($line->doc_ref); + $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref); + $urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id; + $documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); + } elseif ($line->doc_type == 'bank') { + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + $objectstatic = new AccountLine($db); + $objectstatic->fetch($line->fk_doc); + } else { + // Other type + } + + $labeltoshow = ''; + $labeltoshowalt = ''; + if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') { + $labeltoshow .= $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); + $labeltoshow .= $documentlink; + $labeltoshowalt .= $objectstatic->ref; + } elseif ($line->doc_type == 'bank') { + $labeltoshow .= $objectstatic->getNomUrl(1); + $labeltoshowalt .= $objectstatic->ref; + $bank_ref = strstr($line->doc_ref, '-'); + $labeltoshow .= " " . $bank_ref; + $labeltoshowalt .= " " . $bank_ref; + } else { + $labeltoshow .= $line->doc_ref; + $labeltoshowalt .= $line->doc_ref; + } + + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Account number + if (!empty($arrayfields['t.numero_compte']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Subledger account + if (!empty($arrayfields['t.subledger_account']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Label operation + if (!empty($arrayfields['t.label_operation']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Amount debit + if (!empty($arrayfields['t.debit']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit'; + } + $totalarray['val']['totaldebit'] += $line->debit; + } + + // Amount credit + if (!empty($arrayfields['t.credit']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit'; + } + $totalarray['val']['totalcredit'] += $line->credit; + } + + // Lettering code + if (!empty($arrayfields['t.lettering_code']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Creation operation date + if (!empty($arrayfields['t.date_creation']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Modification operation date + if (!empty($arrayfields['t.tms']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Exported operation date + if (!empty($arrayfields['t.date_export']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Validated operation date + if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['t.import_key']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + + 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 ''; +} + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print "
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; + print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth75'); + 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 '
'; + print '
'; + print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth150', 'account'); + print '
'; + print '
'; + print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth150', 'account'); + print '
'; + print '
'; + // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not + // use setup of keypress to select thirdparty and this hang browser on large database. + if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + print '
'; + //print $langs->trans('From').' '; + print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', $langs->trans('From'), 'maxwidth250', 'subledgeraccount'); + print '
'; + print '
'; + print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount'); + print '
'; + } else { + print ''; + } + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("NotReconciled").''; + print '
'; + print '
'; + print $form->selectDate($search_date_creation_start, 'search_date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_creation_end, 'search_date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print '
'; + print '
'; + print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print '
'; + print ''; + print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
'; + if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // 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($line->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''; + $object->id = $line->id; + $object->piece_num = $line->piece_num; + print $object->getNomUrl(1, '', 0, '', 1); + print ''.$journaltoshow.''.dol_print_date($line->doc_date, 'day').''; + print $labeltoshow; + print "'.length_accountg($line->numero_compte).''.length_accounta($line->subledger_account).''.dol_escape_htmltag($line->label_operation).''.($line->debit != 0 ? price($line->debit) : '').''.($line->credit != 0 ? price($line->credit) : '').''.$line->lettering_code.''.dol_print_date($line->date_creation, 'dayhour', 'tzuserrel').''.dol_print_date($line->date_modification, 'dayhour', 'tzuserrel').''.dol_print_date($line->date_export, 'dayhour', 'tzuserrel').''.dol_print_date($line->date_validation, 'dayhour', 'tzuserrel').''.$obj->import_key."'; + if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // 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($line->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
'.$langs->trans("NoRecordFound").'
"; +print '
'; + +print '
'; + +// End of page +llxFooter(); + +$db->close(); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 217474db0c9..c1874476fbc 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2022 Alexandre Spangaro + * Copyright (C) 2013-2023 Alexandre Spangaro * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2021 Frédéric France @@ -29,7 +29,6 @@ // Load Dolibarr environment require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; @@ -96,14 +95,6 @@ $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_star $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); -//var_dump($search_date_start);exit; -if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { - $action = 'delbookkeepingyear'; -} -if (GETPOST("button_export_file_x") || GETPOST("button_export_file.x") || GETPOST("button_export_file")) { - $action = 'export_file'; -} - $search_account_category = GETPOST('search_account_category', 'int'); $search_accountancy_code = GETPOST("search_accountancy_code", 'alpha'); @@ -159,7 +150,7 @@ $hookmanager->initHooks(array('bookkeepinglist')); $formaccounting = new FormAccounting($db); $form = new Form($db); -if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { +if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; @@ -201,8 +192,8 @@ $arrayfields = array( 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), - 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), - 't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), + 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>0), + 't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>0, 'enabled'=>!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")), 't.import_key'=>array('label'=>$langs->trans("ImportId"), 'checked'=>0, 'position'=>1100), ); @@ -210,13 +201,6 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { unset($arrayfields['t.lettering_code']); } -$accountancyexport = new AccountancyExport($db); -$listofformat = $accountancyexport->getType(); -$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'); -if (empty($listofformat[$formatexportset])) { - $formatexportset = 1; -} - $error = 0; if (!isModEnabled('accounting')) { @@ -457,49 +441,6 @@ if (empty($reshook)) { $param .= '&search_import_key='.urlencode($search_import_key); } - //if ($action == 'delbookkeepingyearconfirm' && !$user->hasRight('accounting', 'mouvements', 'supprimer_tous')) { - // $delmonth = GETPOST('delmonth', 'int'); - // $delyear = GETPOST('delyear', 'int'); - // if ($delyear == -1) { - // $delyear = 0; - // } - // $deljournal = GETPOST('deljournal', 'alpha'); - // if ($deljournal == -1) { - // $deljournal = 0; - // } - // - // if (!empty($delmonth) || !empty($delyear) || !empty($deljournal)) { - // $result = $object->deleteByYearAndJournal($delyear, $deljournal, '', ($delmonth > 0 ? $delmonth : 0)); - // if ($result < 0) { - // setEventMessages($object->error, $object->errors, 'errors'); - // } else { - // setEventMessages("RecordDeleted", null, 'mesgs'); - // } - // - // // Make a redirect to avoid to launch the delete later after a back button - // header("Location: list.php".($param ? '?'.$param : '')); - // exit; - // } else { - // setEventMessages("NoRecordDeleted", null, 'warnings'); - // } - //} - if ($action == 'setreexport') { - $setreexport = GETPOST('value', 'int'); - if (!dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) { - $error++; - } - - if (!$error) { - if ($conf->global->ACCOUNTING_REEXPORT == 1) { - setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsEnable"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("ExportOfPiecesAlreadyExportedIsDisable"), null, 'warnings'); - } - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } - } - // Mass actions $objectclass = 'Bookkeeping'; $objectlabel = 'Bookkeeping'; @@ -707,103 +648,12 @@ if (count($filter) > 0) { } } $sql .= ' WHERE t.entity IN ('.getEntity('accountancy').')'; -if (empty($conf->global->ACCOUNTING_REEXPORT)) { - $sql .= " AND t.date_export IS NULL"; -} + if (count($sqlwhere) > 0) { $sql .= ' AND '.implode(' AND ', $sqlwhere); } //print $sql; - -// Export into a file with format defined into setup (FEC, CSV, ...) -// Must be after definition of $sql -if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements', 'export')) { - // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It currently consumes too much memory on large export. - // Replace this with the query($sql) and loop on each line to export them. - $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); - - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } else { - // Export files then exit - $accountancyexport = new AccountancyExport($db); - - $formatexport = GETPOST('formatexport', 'int'); - $notexportlettering = GETPOST('notexportlettering', 'alpha'); - - if (!empty($notexportlettering)) { - if (is_array($object->lines)) { - foreach ($object->lines as $k => $movement) { - unset($object->lines[$k]->lettering_code); - unset($object->lines[$k]->date_lettering); - } - } - } - - $notifiedexportdate = GETPOST('notifiedexportdate', 'alpha'); - $notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha'); - $withAttachment = !empty(trim(GETPOST('notifiedexportfull', 'alphanohtml'))) ? 1 : 0; - - // Output data on screen or download - $result = $accountancyexport->export($object->lines, $formatexport, $withAttachment); - - $error = 0; - if ($result < 0) { - $error++; - } else { - if (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) { - if (is_array($object->lines)) { - dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported", LOG_DEBUG); - - // Specify as export : update field date_export or date_validated - $db->begin(); - - // TODO Merge update for each line into one gloacl using rowid IN (list of movement ids) - foreach ($object->lines as $movement) { - $now = dol_now(); - - $setfields = ''; - if (!empty($notifiedexportdate) && empty($movement->date_export)) { - $setfields .= ($setfields ? "," : "")." date_export = '".$db->idate($now)."'"; - } - if (!empty($notifiedvalidationdate) && empty($movement->date_validation)) { - $setfields .= ($setfields ? "," : "")." date_validated = '".$db->idate($now)."'"; - } - - if ($setfields) { - $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; - $sql .= " SET ".$setfields; - $sql .= " WHERE rowid = ".((int) $movement->id); - - $result = $db->query($sql); - if (!$result) { - $error++; - break; - } - } - } - - if (!$error) { - $db->commit(); - } else { - $error++; - $accountancyexport->errors[] = $langs->trans('NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated'); - $db->rollback(); - } - } - } - } - - if ($error) { - setEventMessages('', $accountancyexport->errors, 'errors'); - header('Location: '.$_SERVER['PHP_SELF']); - } - exit(); // download or show errors - } -} - - /* * View */ @@ -857,111 +707,6 @@ llxHeader('', $title_page); $formconfirm = ''; -if ($action == 'export_file') { - $form_question = array(); - - $form_question['formatexport'] = array( - 'name' => 'formatexport', - 'type' => 'select', - 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo - 'values' => $listofformat, - 'default' => $formatexportset, - 'morecss' => 'minwidth200 maxwidth200' - ); - - $form_question['separator0'] = array('name'=>'separator0', 'type'=>'separator'); - - if (getDolGlobalInt("ACCOUNTING_ENABLE_LETTERING")) { - // If 1, we check by default. - $checked = !empty($conf->global->ACCOUNTING_DEFAULT_NOT_EXPORT_LETTERING) ? 'true' : 'false'; - $form_question['notexportlettering'] = array( - 'name' => 'notexportlettering', - 'type' => 'checkbox', - 'label' => $langs->trans('NotExportLettering'), - 'value' => $checked, - ); - - $form_question['separator1'] = array('name'=>'separator1', 'type'=>'separator'); - } - - // If 1 or not set, we check by default. - $checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE)); - $form_question['notifiedexportdate'] = array( - 'name' => 'notifiedexportdate', - 'type' => 'checkbox', - 'label' => $langs->trans('NotifiedExportDate'), - 'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'), - ); - - $form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator'); - - if (!getDolGlobalString("ACCOUNTANCY_DISABLE_CLOSURE_LINE_BY_LINE")) { - // If 0 or not set, we NOT check by default. - $checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE)); - $form_question['notifiedvalidationdate'] = array( - 'name' => 'notifiedvalidationdate', - 'type' => 'checkbox', - 'label' => $langs->trans('NotifiedValidationDate', $langs->transnoentitiesnoconv("MenuAccountancyClosure")), - 'value' => $checked, - ); - - $form_question['separator3'] = array('name'=>'separator3', 'type'=>'separator'); - } - - // add documents in an archive for accountancy export (Quadratus) - if (getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV') == AccountancyExport::$EXPORT_TYPE_QUADRATUS) { - $form_question['notifiedexportfull'] = array( - 'name' => 'notifiedexportfull', - 'type' => 'checkbox', - 'label' => $langs->trans('NotifiedExportFull'), - 'value' => 'false', - ); - } - - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 420, 600); -} - -//if ($action == 'delbookkeepingyear') { -// $form_question = array(); -// $delyear = GETPOST('delyear', 'int'); -// $deljournal = GETPOST('deljournal', 'alpha'); -// -// if (empty($delyear)) { -// $delyear = dol_print_date(dol_now(), '%Y'); -// } -// $month_array = array(); -// for ($i = 1; $i <= 12; $i++) { -// $month_array[$i] = $langs->trans("Month".sprintf("%02d", $i)); -// } -// $year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array'); -// $journal_array = $formaccounting->select_journal($deljournal, 'deljournal', '', 1, 1, 1, '', 0, 1); -// -// $form_question['delmonth'] = array( -// 'name' => 'delmonth', -// 'type' => 'select', -// 'label' => $langs->trans('DelMonth'), -// 'values' => $month_array, -// 'morecss' => 'minwidth150', -// 'default' => '' -// ); -// $form_question['delyear'] = array( -// 'name' => 'delyear', -// 'type' => 'select', -// 'label' => $langs->trans('DelYear'), -// 'values' => $year_array, -// 'default' => $delyear -// ); -// $form_question['deljournal'] = array( -// 'name' => 'deljournal', -// 'type' => 'other', // We don't use select here, the journal_array is already a select html component -// 'label' => $langs->trans('DelJournal'), -// 'value' => $journal_array, -// 'default' => $deljournal -// ); -// -// $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 320); -//} - // Print form confirm print $formconfirm; @@ -1015,21 +760,6 @@ if ($reshook < 0) { $newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint; if (empty($reshook)) { - // Button re-export - if (!empty($conf->global->ACCOUNTING_REEXPORT)) { - $newcardbutton .= ''.img_picto($langs->trans("ClickToHideAlreadyExportedLines"), 'switch_off', 'class="small size15x valignmiddle"'); - $newcardbutton .= ''.$langs->trans("ClickToHideAlreadyExportedLines").''; - $newcardbutton .= ''; - } else { - $newcardbutton .= ''.img_picto($langs->trans("DocsAlreadyExportedAreExcluded"), 'switch_on', 'class="warning size15x valignmiddle"'); - $newcardbutton .= ''.$langs->trans("DocsAlreadyExportedAreExcluded").''; - $newcardbutton .= ''; - } - - if ($user->hasRight('accounting', 'mouvements', 'export')) { - $newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : '').'&sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder), $user->hasRight('accounting', 'mouvements', 'export')); - } - $newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly')); $newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?type=sub'.$param, '', 1, array('morecss' => 'marginleftonly')); @@ -1608,13 +1338,6 @@ print $hookmanager->resPrint; print ""; print ''; -// TODO Replace this with mass delete action -//if ($user->rights->accounting->mouvements->supprimer_tous) { -// print '
'."\n"; -// print ''.$langs->trans("DeleteMvt").''; -// print '
'; -//} - print ''; // End of page diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 8be5531965c..450c77b0e13 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -335,13 +335,16 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 10, __ENTITY__); -- General Ledger -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __ENTITY__); -- Journals -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2434__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookeeping', 'Journals', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2433__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'Journals', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 13, __ENTITY__); + +-- Export accountancy +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'MenuExportAccountancy', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__); -- Closure -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->rights->accounting->fiscalyear->write', '', 0, 17, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->rights->accounting->fiscalyear->write', '', 0, 16, __ENTITY__); -- Reports insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7c51180fe68..68417602475 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1773,6 +1773,9 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Account Balance $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); + // Export accountancy + $newmenu->add("/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("MenuExportAccountancy"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); + // Closure $newmenu->add("/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure", $langs->trans("MenuAccountancyClosure"), 1, $user->hasRight('accounting', 'fiscalyear', 'write'), '', $mainmenu, 'closure'); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index f189c96939d..9f7726018ea 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -52,6 +52,8 @@ AccountantFiles=Export source documents ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). ExportAccountingSourceDocHelp2=To export your journals, use the menu entry %s - %s. ExportAccountingProjectHelp=Specify a project if you need an accounting report only for a specific project. Expense reports and loan payments are not included in project reports. +ExportAccountancy=Export accountancy +WarningDataDisappearsWhenDataIsExportedReport=Warning, this list contains only the accounting entries that have not been exported. If you want to display the accounting entries already exported to re-export them, click on the button above. VueByAccountAccounting=View by accounting account VueBySubAccountAccounting=View by accounting subaccount @@ -113,6 +115,7 @@ MenuLoanAccounts=Loan accounts MenuProductsAccounts=Product accounts MenuClosureAccounts=Closure accounts MenuAccountancyClosure=Closure +MenuExportAccountancy=Export accountancy MenuAccountancyValidationMovements=Validate movements ProductsBinding=Products accounts TransferInAccounting=Transfer in accounting @@ -479,7 +482,7 @@ FECFormatMulticurrencyCode=Multicurrency code (Idevise) DateExport=Date export WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manually in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate. ExpenseReportJournal=Expense Report Journal -DocsAlreadyExportedAreExcluded=Docs already exported are excluded -ClickToHideAlreadyExportedLines=Click to hide already exported lines +DocsAlreadyExportedAreIncluded=Docs already exported are included +ClickToShowAlreadyExportedLines=Click to show already exported lines NAccounts=%s accounts From dc96eeedf347cda7ff382f66d3c72640b09d4b2a Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 5 Apr 2023 11:06:06 +0200 Subject: [PATCH 007/156] Fix language --- htdocs/langs/en_US/accountancy.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 9f7726018ea..bfd428e869e 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -53,7 +53,7 @@ ExportAccountingSourceDocHelp=With this tool, you can search and export the sour ExportAccountingSourceDocHelp2=To export your journals, use the menu entry %s - %s. ExportAccountingProjectHelp=Specify a project if you need an accounting report only for a specific project. Expense reports and loan payments are not included in project reports. ExportAccountancy=Export accountancy -WarningDataDisappearsWhenDataIsExportedReport=Warning, this list contains only the accounting entries that have not been exported. If you want to display the accounting entries already exported to re-export them, click on the button above. +WarningDataDisappearsWhenDataIsExported=Warning, this list contains only the accounting entries that have not been exported. If you want to display the accounting entries already exported to re-export them, click on the button above. VueByAccountAccounting=View by accounting account VueBySubAccountAccounting=View by accounting subaccount From 2c90f7335ea26149688d21977372e76f87b52649 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 5 Apr 2023 11:42:50 +0200 Subject: [PATCH 008/156] FIX : Travis --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 7745d05d71a..97075ddd440 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -638,8 +638,8 @@ class Mo extends CommonObject $oldQty = $this->oldQty; $newQty = $this->qty; - if($newQty != $oldQty) { - $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . $this->id; + if($newQty != $oldQty && !empty($this->oldQty)) { + $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . (int) $this->id; $resql = $this->db->query($sql); if($resql) { while ($obj = $this->db->fetch_object($resql)) { From 14560c1de818f45c86f82baac72aff2eb5931ba2 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 5 Apr 2023 15:37:35 +0200 Subject: [PATCH 009/156] FIX : Travis --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 5d971c0e440..ecb82507738 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -639,7 +639,7 @@ class Mo extends CommonObject $oldQty = $this->oldQty; $newQty = $this->qty; if ($newQty != $oldQty && !empty($this->oldQty)) { - $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'mrp_production WHERE fk_mo = ' . (int) $this->id; + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "mrp_production WHERE fk_mo = " . (int) $this->id; $resql = $this->db->query($sql); if ($resql) { while ($obj = $this->db->fetch_object($resql)) { From 8463bce9f5c45176a06625ea970f3e8ef3e6c9b9 Mon Sep 17 00:00:00 2001 From: FLIO Date: Wed, 5 Apr 2023 16:02:50 +0200 Subject: [PATCH 010/156] fix. the were 3 lines down after the additional amount --- htdocs/comm/propal/card.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index fb2ec070b3c..5496f02173f 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2755,37 +2755,32 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency); + print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - print ''; - print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency); + print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - print ''; print ''; if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency); + print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency); + print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - print ''; print ''; } } From 3760f0696147fc0430c870483b81f55afc25e77b Mon Sep 17 00:00:00 2001 From: hystepik Date: Thu, 6 Apr 2023 15:50:34 +0200 Subject: [PATCH 011/156] add remove of lines for reception --- htdocs/fourn/commande/card.php | 2 +- htdocs/fourn/commande/dispatch.php | 35 +++++++++++++++++++++-------- htdocs/fourn/js/lib_dispatch.js.php | 15 +++++++++++++ 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index f79c9fe49b4..f99809d4091 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -133,7 +133,7 @@ if ($id > 0 || !empty($ref)) { // Security check $isdraft = (isset($object->statut) && ($object->statut == $object::STATUS_DRAFT) ? 1 : 0); -$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande', 'fk_soc', 'rowid', $isdraft); +$result = restrictedArea($user, 'fournisseur', $object, 'commande_fournisseur', 'commande', 'fk_soc', 'rowid', $isdraft); // Common permissions $usercanread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 50508f171df..fc07217846f 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -94,7 +94,7 @@ if (empty($conf->reception->enabled)) { } // $id is id of a purchase order. -$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); +$result = restrictedArea($user, 'fournisseur', $object, 'commande_fournisseur', 'commande'); if (!isModEnabled('stock')) { accessforbidden(); @@ -978,7 +978,8 @@ if ($id > 0 || !empty($ref)) { // Qty to dispatch print ''; - print ''; + print ''.img_picto($langs->trans("Reset"), 'eraser', 'class="pictofixedwidth opacitymedium"').''; + print ''; print ''; print ''; @@ -1115,14 +1116,30 @@ if ($id > 0 || !empty($ref)) { $("select[name^=entrepot_]").val(fk_default_warehouse).change(); }); - jQuery("#autoreset").click(function() {'; - $i = 0; - while ($i < $nbproduct) { - print ' jQuery("#qty_0_'.$i.'").val("");'; - $i++; - } - print ' + $("#autoreset").click(function() { + $(".qtydispatchinput").each(function(){ + id = $(this).attr("id"); + idtab = id.split("_"); + if(idtab[1] == 0){ + console.log(idtab); + $(this).val(""); + $("#qty_dispatched_0_"+idtab[2]).val("0"); + } else { + obj = $(this).parent().parent(); + nameobj = obj.attr("name"); + nametab = nameobj.split("_"); + obj.remove(); + $("tr[name^=\'"+nametab[0]+"_\'][name$=\'_"+nametab[2]+"\']:last .splitbutton").show(); + } + }); }); + + $(".resetline").click(function(){ + id = $(this).attr("id"); + id = id.split("reset_"); + console.log("Reset trigger for id = qty_"+id[1]); + $("#qty_"+id[1]).val(""); + }); }); '; diff --git a/htdocs/fourn/js/lib_dispatch.js.php b/htdocs/fourn/js/lib_dispatch.js.php index ff822543ddb..7d711d3a19a 100644 --- a/htdocs/fourn/js/lib_dispatch.js.php +++ b/htdocs/fourn/js/lib_dispatch.js.php @@ -133,6 +133,21 @@ function addDispatchLine(index, type, mode) $("tr[name^='"+type+"_'][name$='_"+index+"'] .splitbutton").hide(); $("tr[name^='"+type+"_'][name$='_"+index+"']:last .splitbutton").show(); + $("#reset_"+(nbrTrs)+"_"+index).click(function(){ + id = $(this).attr("id"); + id = id.split("reset_"); + idrow = id[1]; + idlast = $("tr[name^='"+type+"_'][name$='_"+index+"']:last .qtydispatchinput").attr("id"); + if (idlast == $("#qty_"+idrow).attr("id")) { + console.log("Remove trigger for tr name = "+type+"_"+idrow); + $('tr[name="'+type+'_'+idrow+'"').remove(); + $("tr[name^='"+type+"_'][name$='_"+index+"']:last .splitbutton").show(); + } else { + console.log("Reset trigger for id = #qty_"+idrow); + $("#qty_"+idrow).val(""); + } + });; + if (mode === 'lessone') { qty = 1; // keep 1 in old line From 5e3409936379ceb22aceff06214244dfe57a309b Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 11 Apr 2023 12:48:44 +0200 Subject: [PATCH 012/156] Fix to correspond to the requested table --- htdocs/comm/propal/card.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 5496f02173f..501fb6ab51c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2759,9 +2759,11 @@ if ($action == 'create') { if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } + print ''; + print ''; print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } @@ -2770,14 +2772,16 @@ if ($action == 'create') { if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - + print ''; + + print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } From 74c1bcf4e8b0dffd8087aedbd2902da009bcb067 Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 11 Apr 2023 12:58:00 +0200 Subject: [PATCH 013/156] Fix to correspond to the requested table --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 501fb6ab51c..d8f4889bbaa 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2777,7 +2777,7 @@ if ($action == 'create') { print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; - + print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; From ed848753201930e0450facaa26f3f5e14dc19cf4 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 12 Apr 2023 01:38:38 +0300 Subject: [PATCH 014/156] Update master.inc.php --- htdocs/master.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 0f10300ea98..a400b35106b 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -233,7 +233,14 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { // This is very problematic during a fiscal control. $conf->global->INVOICE_DISABLE_REPLACEMENT = 1; } - + if ($mysoc->country_code == 'GR' && !isset($conf->global->INVOICE_DISABLE_REPLACEMENT)) { + // The replacement invoice type is not allowed in Greece. + $conf->global->INVOICE_DISABLE_REPLACEMENT = 1; + } + if ($mysoc->country_code == 'GR' && !isset($conf->global->INVOICE_DISABLE_DEPOSIT)) { + // The deposit invoice type is not allowed in Greece. + $conf->global->INVOICE_DISABLE_DEPOSIT = 1; + } if (($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) && !isset($conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX)) { // For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account). // Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set. From f5ac52bd01762cb0f88dbc5ea21f8c9177240fbc Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 11 Apr 2023 23:37:03 +0000 Subject: [PATCH 015/156] Fixing style errors. --- htdocs/master.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index a400b35106b..17fcc123a2b 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -236,11 +236,11 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { if ($mysoc->country_code == 'GR' && !isset($conf->global->INVOICE_DISABLE_REPLACEMENT)) { // The replacement invoice type is not allowed in Greece. $conf->global->INVOICE_DISABLE_REPLACEMENT = 1; - } + } if ($mysoc->country_code == 'GR' && !isset($conf->global->INVOICE_DISABLE_DEPOSIT)) { // The deposit invoice type is not allowed in Greece. $conf->global->INVOICE_DISABLE_DEPOSIT = 1; - } + } if (($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) && !isset($conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX)) { // For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account). // Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set. From f9ed6ff4f3b1630c5a4a38f5199e5e8c4b24a0a6 Mon Sep 17 00:00:00 2001 From: Oarces DEV Date: Thu, 13 Apr 2023 16:54:26 +0200 Subject: [PATCH 016/156] Update card.php This code generates two rows of a table to display the total duration of an employee, one in time format (DD HH:MM) and the other in hour format (HH). The first row (original code) displays the title "TotalDurationTime" using the "trans" method of the $langs object to translate the string. The total time is converted to HH:MM:SS format using the "convertSecondToTime" function, which takes into account the daily work time duration specified in the global variable $conf->global->MAIN_DURATION_OF_WORKDAY. The second row displays the title "TotalDurationHour" using the "trans" method of the $langs object to translate the string. The total duration is converted to hours using the "convertDurationtoHour" function, specifying "s" as the time unit (seconds). --- htdocs/fichinter/card.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index a4244195bfa..23ef7371ec0 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -9,6 +9,7 @@ * Copyright (C) 2015-2016 Abbes Bahfir * Copyright (C) 2018-2022 Philippe Grand * Copyright (C) 2020 Frédéric France + * Copyright (C) 2023 Benjamin Grembi * * 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 @@ -1275,10 +1276,14 @@ if ($action == 'create') { print ''; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { - // Duration - print ''; + // Duration in time + print ''; print ''; print ''; + // Duration in hour format + print ''; + print ''; + print ''; } print "
'.$langs->trans("TotalDuration").'
'.$langs->trans("TotalDurationTime").''.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'
'.$langs->trans("TotalDurationHour").''.convertDurationtoHour($object->duration, "s").' '.$langs->trans("h").'
"; From 04bfbb572343d09329a4e7006154865e773827da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 18 Apr 2023 21:11:48 +0200 Subject: [PATCH 017/156] property and doc --- htdocs/bom/class/bom.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index e10139f3711..07acb99189f 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -216,6 +216,11 @@ class BOM extends CommonObject */ public $lines = array(); + /** + * @var BOMLine Bom line + */ + public $line; + /** * @var int Calculated cost for the BOM */ From 8776c6dcd95db3d973c5f5632f8432474be246aa Mon Sep 17 00:00:00 2001 From: Oarces DEV Date: Wed, 19 Apr 2023 00:57:32 +0200 Subject: [PATCH 018/156] Update card.php --- htdocs/fichinter/card.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 23ef7371ec0..fa983a24514 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1277,12 +1277,8 @@ if ($action == 'create') { if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { // Duration in time - print ''.$langs->trans("TotalDurationTime").''; - print ''.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).''; - print ''; - // Duration in hour format - print ''.$langs->trans("TotalDurationHour").''; - print ''.convertDurationtoHour($object->duration, "s").' '.$langs->trans("h").''; + print ''.$langs->trans("TotalDuration").''; + print ''.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).' ('.convertDurationtoHour($object->duration, "s").' '.$langs->trans("h").')'; print ''; } From 2582866fbe96f8d4b4725b78c533f79747127210 Mon Sep 17 00:00:00 2001 From: x Date: Wed, 19 Apr 2023 12:08:12 +0200 Subject: [PATCH 019/156] Add bom and mo line : add fk_defauult_workstation info --- htdocs/bom/bom_card.php | 9 ++++++++- htdocs/bom/class/bom.class.php | 4 +++- htdocs/mrp/class/mo.class.php | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index e27cd0a2e1c..14a165315f4 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -170,6 +170,13 @@ if (empty($reshook)) { $disable_stock_change = GETPOST('disable_stock_change', 'int'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); + + if(!empty($idprod)){ + $product = new Product($db); + $res = $product->fetch($idprod); + if($res > 0 && $product->type == Product::TYPE_SERVICE) $fk_default_workstation = $product->fk_default_workstation; + } + if ($qty == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; @@ -206,7 +213,7 @@ if (empty($reshook)) { } } - $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options); + $result = $object->addLine($idprod, $qty, $qty_frozen, $disable_stock_change, $efficiency, -1, $bom_child_id, null, $fk_unit, $array_options, $fk_default_workstation); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index e10139f3711..397537b8612 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -572,7 +572,7 @@ class BOM extends CommonObject * @param array $array_options extrafields array * @return int <0 if KO, Id of created object if OK */ - public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '', $array_options = 0) + public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '', $array_options = 0, $fk_default_workstation = null) { global $mysoc, $conf, $langs, $user; @@ -641,6 +641,7 @@ class BOM extends CommonObject $this->line->import_key = $import_key; $this->line->position = $rankToUse; $this->line->fk_unit = $fk_unit; + $this->line->fk_default_workstation = $fk_default_workstation; if (is_array($array_options) && count($array_options) > 0) { $this->line->array_options = $array_options; @@ -1670,6 +1671,7 @@ class BOMLine extends CommonObjectLine 'fk_unit' => array('type'=>'integer', 'label'=>'Unit', 'enabled'=>1, 'visible'=>1, 'position'=>120, 'notnull'=>-1,), 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), + 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>25) ); /** diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index f7587daf331..20eb3a94704 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -741,6 +741,7 @@ class Mo extends CommonObject $moline->position = $line->position; $moline->qty_frozen = $line->qty_frozen; $moline->disable_stock_change = $line->disable_stock_change; + if(!empty($line->fk_default_workstation)) $moline->fk_default_workstation = $line->fk_default_workstation; $resultline = $moline->create($user, false); // Never use triggers here if ($resultline <= 0) { @@ -1720,6 +1721,7 @@ class MoLine extends CommonObjectLine 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>170), 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>-1, 'position'=>175), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>180), + 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), ); public $rowid; From ff33e3c367b1fbb53ea4df3400422ecdc8b2524c Mon Sep 17 00:00:00 2001 From: x Date: Wed, 19 Apr 2023 12:17:04 +0200 Subject: [PATCH 020/156] Add line mo : fk_default_workstation --- htdocs/mrp/mo_production.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index ac0aa60a647..a6f4a241f2f 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -169,6 +169,12 @@ if (empty($reshook)) { $moline->origin_type = 'free'; // free consume line $moline->position = 0; + if(!empty($moline->fk_product)){ + $product = new Product($db); + $product->fetch($moline->fk_product); + if($product->type == Product::TYPE_SERVICE) $moline->fk_default_workstation = $product->fk_default_workstation; + } + $resultline = $moline->create($user, false); // Never use triggers here if ($resultline <= 0) { $error++; From fde16f42c9a7483be4cff6745c78ae5e11ee804d Mon Sep 17 00:00:00 2001 From: x Date: Wed, 19 Apr 2023 12:23:48 +0200 Subject: [PATCH 021/156] Clean fields mo and bom fk_default_workstation --- htdocs/bom/class/bom.class.php | 2 +- htdocs/mrp/class/mo.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 397537b8612..933d27e3f6a 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1671,7 +1671,7 @@ class BOMLine extends CommonObjectLine 'fk_unit' => array('type'=>'integer', 'label'=>'Unit', 'enabled'=>1, 'visible'=>1, 'position'=>120, 'notnull'=>-1,), 'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'default'=>0, 'position'=>200, 'notnull'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), - 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>25) + 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'position'=>1050) ); /** diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 20eb3a94704..fd0559c3d34 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1721,7 +1721,7 @@ class MoLine extends CommonObjectLine 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>170), 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>-1, 'position'=>175), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>180), - 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), + 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'position'=>185) ); public $rowid; From a5c4ec5dcfc221c6e73f3768dec6b7731a1a0fca Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 19 Apr 2023 16:22:47 +0000 Subject: [PATCH 022/156] Fixing style errors. --- htdocs/bom/bom_card.php | 4 ++-- htdocs/mrp/class/mo.class.php | 4 ++-- htdocs/mrp/mo_production.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 14a165315f4..dde7789f840 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -171,10 +171,10 @@ if (empty($reshook)) { $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); - if(!empty($idprod)){ + if (!empty($idprod)) { $product = new Product($db); $res = $product->fetch($idprod); - if($res > 0 && $product->type == Product::TYPE_SERVICE) $fk_default_workstation = $product->fk_default_workstation; + if ($res > 0 && $product->type == Product::TYPE_SERVICE) $fk_default_workstation = $product->fk_default_workstation; } if ($qty == '') { diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index fd0559c3d34..5892c34f72f 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -741,7 +741,7 @@ class Mo extends CommonObject $moline->position = $line->position; $moline->qty_frozen = $line->qty_frozen; $moline->disable_stock_change = $line->disable_stock_change; - if(!empty($line->fk_default_workstation)) $moline->fk_default_workstation = $line->fk_default_workstation; + if (!empty($line->fk_default_workstation)) $moline->fk_default_workstation = $line->fk_default_workstation; $resultline = $moline->create($user, false); // Never use triggers here if ($resultline <= 0) { @@ -1721,7 +1721,7 @@ class MoLine extends CommonObjectLine 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>170), 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>-1, 'position'=>175), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>180), - 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'position'=>185) + 'fk_default_workstation' =>array('type'=>'integer', 'label'=>'DefaultWorkstation', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'position'=>185) ); public $rowid; diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index a6f4a241f2f..49a094b89e4 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -169,10 +169,10 @@ if (empty($reshook)) { $moline->origin_type = 'free'; // free consume line $moline->position = 0; - if(!empty($moline->fk_product)){ + if (!empty($moline->fk_product)) { $product = new Product($db); $product->fetch($moline->fk_product); - if($product->type == Product::TYPE_SERVICE) $moline->fk_default_workstation = $product->fk_default_workstation; + if ($product->type == Product::TYPE_SERVICE) $moline->fk_default_workstation = $product->fk_default_workstation; } $resultline = $moline->create($user, false); // Never use triggers here From dd5c61d9f2adeced4cf761583f589ca220b657d2 Mon Sep 17 00:00:00 2001 From: x Date: Thu, 20 Apr 2023 09:57:49 +0200 Subject: [PATCH 023/156] Bom : Display workstation of line --- htdocs/bom/bom_card.php | 2 +- htdocs/bom/tpl/objectline_view.tpl.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 14a165315f4..001d5fa3c05 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -171,7 +171,7 @@ if (empty($reshook)) { $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); - if(!empty($idprod)){ + if(!empty($idprod) && $conf->workstation->enabled){ $product = new Product($db); $res = $product->fetch($idprod); if($res > 0 && $product->type == Product::TYPE_SERVICE) $fk_default_workstation = $product->fk_default_workstation; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index d000118e1b9..cfe63286339 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -158,9 +158,10 @@ if ($filtertype != 1) { // Work station if (isModEnabled('workstation')) { $workstation = new Workstation($object->db); - $res = $workstation->fetch($tmpproduct->fk_default_workstation); + $fk_default_workstation = (!empty($line->fk_default_workstation)) ? $line->fk_default_workstation : $tmpproduct->fk_default_workstation; + $res = $workstation->fetch($fk_default_workstation); - print ''; + print ''; $coldisplay++; if ($res > 0) echo $workstation->getNomUrl(); print ''; From 8643495361c1ffaf95c8edde5d8484cffc8c5d55 Mon Sep 17 00:00:00 2001 From: x Date: Thu, 20 Apr 2023 10:19:43 +0200 Subject: [PATCH 024/156] BOM : Display only Default Workstation of line --- htdocs/bom/tpl/objectline_view.tpl.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index cfe63286339..6463f45fbb0 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -158,8 +158,7 @@ if ($filtertype != 1) { // Work station if (isModEnabled('workstation')) { $workstation = new Workstation($object->db); - $fk_default_workstation = (!empty($line->fk_default_workstation)) ? $line->fk_default_workstation : $tmpproduct->fk_default_workstation; - $res = $workstation->fetch($fk_default_workstation); + $res = $workstation->fetch($line->fk_default_workstation); print ''; $coldisplay++; From 1410565b83a4a39cab1ffcbb5e7216275066125e Mon Sep 17 00:00:00 2001 From: antonin_tdj <50403308+ibuiv@users.noreply.github.com> Date: Thu, 20 Apr 2023 19:55:31 +0200 Subject: [PATCH 025/156] Fix ref_client on Project Overview for propale The ref_customer in the propal object is name ref_client. I just added another check if nothing is found. --- htdocs/projet/element.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 1b002ba5688..23d72b18d4c 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1259,6 +1259,10 @@ foreach ($listofreferent as $key => $value) { if (!empty($element->ref_customer)) { print ' - '.$element->ref_customer; } + // Compatibility propale + if (empty($element->ref_customer) && !empty($element->ref_client)){ + print ' - '.$element->ref_client; + } } print "\n"; From 69f6685971630927b401ec6881b63daf0005c6d9 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 Apr 2023 18:23:40 +0000 Subject: [PATCH 026/156] Fixing style errors. --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 23d72b18d4c..09f952cb631 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1260,7 +1260,7 @@ foreach ($listofreferent as $key => $value) { print ' - '.$element->ref_customer; } // Compatibility propale - if (empty($element->ref_customer) && !empty($element->ref_client)){ + if (empty($element->ref_customer) && !empty($element->ref_client)) { print ' - '.$element->ref_client; } } From 002c2b0abed818b21c45000017a437d5ae55bf3e Mon Sep 17 00:00:00 2001 From: Gerhard Stephan Date: Mon, 24 Apr 2023 14:11:06 +0200 Subject: [PATCH 027/156] Prevent PHP Warning in error log file, when the generated doc file does not exists. This is the case when we create a PDF file out of a ODT file and automatically delete the ODT. The indexed file will then be the ODT, which can't be found on drive (because it has been deleted when converting to PDF) and therefore creates an error log entry. --- htdocs/core/class/commonobject.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index de8f758d8e4..aedabc79cc6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5671,7 +5671,11 @@ abstract class CommonObject $update_main_doc_field = 1; } - $this->indexFile($destfull, $update_main_doc_field); + // Check that the file exists, before indexing it. + // Hint: It does not exist, if we create a PDF and auto delete the ODT File + if (file_exists($destfull)) { + $this->indexFile($destfull, $update_main_doc_field); + } } else { dol_syslog('Method ->write_file was called on object '.get_class($obj).' and return a success but the return array ->result["fullpath"] was not set.', LOG_WARNING); } From 63a02083b87287602fbdf2d61d44477984ccbe09 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Mon, 24 Apr 2023 17:37:44 +0200 Subject: [PATCH 028/156] PHP8 compatibility --- htdocs/core/lib/bank.lib.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 2 +- .../includes/stripe/stripe-php/lib/Collection.php | 8 +++++--- .../stripe/stripe-php/lib/StripeObject.php | 12 ++++++------ .../stripe-php/lib/Util/CaseInsensitiveArray.php | 14 ++++++++------ htdocs/includes/stripe/stripe-php/lib/Util/Set.php | 3 ++- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 736b200bea3..4e8d9969c3c 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -318,7 +318,7 @@ function getIbanHumanReadable(Account $account) { if ($account->getCountryCode() == 'FR') { require_once DOL_DOCUMENT_ROOT.'/includes/php-iban/oophp-iban.php'; - $ibantoprint = preg_replace('/[^a-zA-Z0-9]/', '', $account->iban); + $ibantoprint = preg_replace('/[^a-zA-Z0-9]/', '', empty($account->iban)?'':$account->iban); $iban = new PHP_IBAN\IBAN($ibantoprint); return $iban->HumanFormat(); } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 153773a6519..182f15b5aa5 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -414,7 +414,7 @@ if ($outputalsopricetotalwithtax) { if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') { $situationinvoicelinewithparent = 0; - if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if (isset($line->fk_prev_id) && in_array($object->element, array('facture', 'facturedet'))) { if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice // Set constant to disallow editing during a situation cycle $situationinvoicelinewithparent = 1; diff --git a/htdocs/includes/stripe/stripe-php/lib/Collection.php b/htdocs/includes/stripe/stripe-php/lib/Collection.php index 899299d3dad..ab4536041d6 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Collection.php +++ b/htdocs/includes/stripe/stripe-php/lib/Collection.php @@ -2,6 +2,8 @@ namespace Stripe; +use Traversable; + /** * Class Collection. * @@ -47,7 +49,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate $this->filters = $filters; } - public function offsetGet($k) + public function offsetGet($k): mixed { if (\is_string($k)) { return parent::offsetGet($k); @@ -107,7 +109,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate /** * @return int the number of objects in the current page */ - public function count() + public function count(): int { return \count($this->data); } @@ -116,7 +118,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @return \ArrayIterator an iterator that can be used to iterate * across objects in the current page */ - public function getIterator() + public function getIterator(): Traversable { return new \ArrayIterator($this->data); } diff --git a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php index eca01a00e90..8bb146138b1 100644 --- a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php +++ b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php @@ -194,28 +194,28 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } // ArrayAccess methods - public function offsetSet($k, $v) + public function offsetSet($k, $v): void { $this->{$k} = $v; } - public function offsetExists($k) + public function offsetExists($k): bool { return \array_key_exists($k, $this->_values); } - public function offsetUnset($k) + public function offsetUnset($k): void { unset($this->{$k}); } - public function offsetGet($k) + public function offsetGet($k): mixed { return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; } // Countable method - public function count() + public function count(): int { return \count($this->_values); } @@ -419,7 +419,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } } - public function jsonSerialize() + public function jsonSerialize(): mixed { return $this->toArray(); } diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php index 670ab0b6a7e..c1aad379438 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php @@ -2,6 +2,8 @@ namespace Stripe\Util; +use Traversable; + /** * CaseInsensitiveArray is an array-like class that ignores case for keys. * @@ -21,17 +23,17 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega $this->container = \array_change_key_case($initial_array, \CASE_LOWER); } - public function count() + public function count(): int { return \count($this->container); } - public function getIterator() + public function getIterator(): Traversable { return new \ArrayIterator($this->container); } - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $offset = static::maybeLowercase($offset); if (null === $offset) { @@ -41,20 +43,20 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega } } - public function offsetExists($offset) + public function offsetExists($offset): bool { $offset = static::maybeLowercase($offset); return isset($this->container[$offset]); } - public function offsetUnset($offset) + public function offsetUnset($offset): void { $offset = static::maybeLowercase($offset); unset($this->container[$offset]); } - public function offsetGet($offset) + public function offsetGet($offset): mixed { $offset = static::maybeLowercase($offset); diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php index 017f9297856..54b363cd4b3 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php @@ -4,6 +4,7 @@ namespace Stripe\Util; use ArrayIterator; use IteratorAggregate; +use Traversable; class Set implements IteratorAggregate { @@ -37,7 +38,7 @@ class Set implements IteratorAggregate return \array_keys($this->_elts); } - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->toArray()); } From 847870f29f820f362c51ec84f548c721c020cc90 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Mon, 24 Apr 2023 18:07:44 +0200 Subject: [PATCH 029/156] more warning corrected --- htdocs/margin/agentMargins.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index e68576edd81..c209fb1f957 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -347,6 +347,12 @@ if ($result) { } // Show total margin + if (!isset($cumul_achat)) { + $cumul_achat = 0; + } + if (!isset($cumul_vente)) { + $cumul_vente = 0; + } $totalMargin = $cumul_vente - $cumul_achat; $marginRate = ($cumul_achat != 0) ? (100 * $totalMargin / $cumul_achat) : ''; From 799f8c5d125ec867c3e530e447a08ad7c8254b68 Mon Sep 17 00:00:00 2001 From: Gerhard Stephan Date: Mon, 24 Apr 2023 18:35:43 +0200 Subject: [PATCH 030/156] Remove whitespace at the end of the line --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index aedabc79cc6..a214c98d0ce 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5671,7 +5671,7 @@ abstract class CommonObject $update_main_doc_field = 1; } - // Check that the file exists, before indexing it. + // Check that the file exists, before indexing it. // Hint: It does not exist, if we create a PDF and auto delete the ODT File if (file_exists($destfull)) { $this->indexFile($destfull, $update_main_doc_field); From ceb3ab077cf037bb95701d073e8dec820fa3b967 Mon Sep 17 00:00:00 2001 From: Maximilien Rozniecki Date: Tue, 25 Apr 2023 09:37:03 +0200 Subject: [PATCH 031/156] remove includes from modification --- .../includes/stripe/stripe-php/lib/Collection.php | 8 +++----- .../stripe/stripe-php/lib/StripeObject.php | 12 ++++++------ .../stripe-php/lib/Util/CaseInsensitiveArray.php | 14 ++++++-------- htdocs/includes/stripe/stripe-php/lib/Util/Set.php | 3 +-- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/htdocs/includes/stripe/stripe-php/lib/Collection.php b/htdocs/includes/stripe/stripe-php/lib/Collection.php index ab4536041d6..899299d3dad 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Collection.php +++ b/htdocs/includes/stripe/stripe-php/lib/Collection.php @@ -2,8 +2,6 @@ namespace Stripe; -use Traversable; - /** * Class Collection. * @@ -49,7 +47,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate $this->filters = $filters; } - public function offsetGet($k): mixed + public function offsetGet($k) { if (\is_string($k)) { return parent::offsetGet($k); @@ -109,7 +107,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate /** * @return int the number of objects in the current page */ - public function count(): int + public function count() { return \count($this->data); } @@ -118,7 +116,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate * @return \ArrayIterator an iterator that can be used to iterate * across objects in the current page */ - public function getIterator(): Traversable + public function getIterator() { return new \ArrayIterator($this->data); } diff --git a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php index 8bb146138b1..eca01a00e90 100644 --- a/htdocs/includes/stripe/stripe-php/lib/StripeObject.php +++ b/htdocs/includes/stripe/stripe-php/lib/StripeObject.php @@ -194,28 +194,28 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } // ArrayAccess methods - public function offsetSet($k, $v): void + public function offsetSet($k, $v) { $this->{$k} = $v; } - public function offsetExists($k): bool + public function offsetExists($k) { return \array_key_exists($k, $this->_values); } - public function offsetUnset($k): void + public function offsetUnset($k) { unset($this->{$k}); } - public function offsetGet($k): mixed + public function offsetGet($k) { return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; } // Countable method - public function count(): int + public function count() { return \count($this->_values); } @@ -419,7 +419,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable } } - public function jsonSerialize(): mixed + public function jsonSerialize() { return $this->toArray(); } diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php index c1aad379438..670ab0b6a7e 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php @@ -2,8 +2,6 @@ namespace Stripe\Util; -use Traversable; - /** * CaseInsensitiveArray is an array-like class that ignores case for keys. * @@ -23,17 +21,17 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega $this->container = \array_change_key_case($initial_array, \CASE_LOWER); } - public function count(): int + public function count() { return \count($this->container); } - public function getIterator(): Traversable + public function getIterator() { return new \ArrayIterator($this->container); } - public function offsetSet($offset, $value): void + public function offsetSet($offset, $value) { $offset = static::maybeLowercase($offset); if (null === $offset) { @@ -43,20 +41,20 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega } } - public function offsetExists($offset): bool + public function offsetExists($offset) { $offset = static::maybeLowercase($offset); return isset($this->container[$offset]); } - public function offsetUnset($offset): void + public function offsetUnset($offset) { $offset = static::maybeLowercase($offset); unset($this->container[$offset]); } - public function offsetGet($offset): mixed + public function offsetGet($offset) { $offset = static::maybeLowercase($offset); diff --git a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php index 54b363cd4b3..017f9297856 100644 --- a/htdocs/includes/stripe/stripe-php/lib/Util/Set.php +++ b/htdocs/includes/stripe/stripe-php/lib/Util/Set.php @@ -4,7 +4,6 @@ namespace Stripe\Util; use ArrayIterator; use IteratorAggregate; -use Traversable; class Set implements IteratorAggregate { @@ -38,7 +37,7 @@ class Set implements IteratorAggregate return \array_keys($this->_elts); } - public function getIterator(): Traversable + public function getIterator() { return new ArrayIterator($this->toArray()); } From 6657a34ff09eb8c28f254b703f66caef43e77e6a Mon Sep 17 00:00:00 2001 From: BitKFu Date: Tue, 25 Apr 2023 19:07:35 +0200 Subject: [PATCH 032/156] use dol_is_file instead of file_exists --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a214c98d0ce..7d2e90f593e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5673,7 +5673,7 @@ abstract class CommonObject // Check that the file exists, before indexing it. // Hint: It does not exist, if we create a PDF and auto delete the ODT File - if (file_exists($destfull)) { + if (dol_is_file($destfull)) { $this->indexFile($destfull, $update_main_doc_field); } } else { From c238791900117e3f71fbfe418168079997c01579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 Apr 2023 20:17:54 +0200 Subject: [PATCH 033/156] add missing init hook value --- htdocs/societe/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 669f4349247..e79a28310f2 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -73,7 +73,7 @@ if (!$sortorder) { $object = new Societe($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('agendathirdparty')); +$hookmanager->initHooks(array('agendathirdparty', 'globalcard')); // Security check $socid = GETPOST('socid', 'int'); From 697d36c7d199ac9f8abe2c02d9c44c27616a45eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 Apr 2023 20:31:49 +0200 Subject: [PATCH 034/156] fix warning --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7f051a1672e..20a4ffdafc1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1040,7 +1040,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); + 'enabled'=>(abs((int) $extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); } } } From 6ab9b5d68e0f6fcc14be9f8b187116fda38c2d58 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 26 Apr 2023 07:18:00 +0200 Subject: [PATCH 035/156] Not display message to explain document are not included when we are in mode all includes --- htdocs/accountancy/bookkeeping/export.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index a9dcb76ce53..91efdf29aec 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -2,10 +2,10 @@ /* Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2013-2023 Alexandre Spangaro - * Copyright (C) 2022 Lionel Vessiller + * Copyright (C) 2022 Lionel Vessiller * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2021 Frédéric France - * Copyright (C) 2022 Progiseize + * Copyright (C) 2022 Progiseize * * 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 @@ -835,7 +835,10 @@ if (empty($reshook)) { print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); -print info_admin($langs->trans("WarningDataDisappearsWhenDataIsExported"), 0, 0, 0); +// Not display message when all the list of docs are included +if (empty($conf->global->ACCOUNTING_REEXPORT)) { + print info_admin($langs->trans("WarningDataDisappearsWhenDataIsExported"), 0, 0, 0); +} print '
'; //$topicmail = "Information"; From 8cb877c118b52a49ffb68a52468608fba255e2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 08:43:11 +0200 Subject: [PATCH 036/156] can setup max extrafields to show in tooltip --- htdocs/core/class/commonobject.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 32802660e73..39a24f830b2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -731,13 +731,14 @@ abstract class CommonObject { global $action, $extrafields, $langs, $hookmanager; - $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP = 5; // If there is too much extrafields, we do not include them into tooltip + // If there is too much extrafields, we do not include them into tooltip + $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP = getDolGlobalInt('MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP', 5); $datas = $this->getTooltipContentArray($params); // Add extrafields if (!empty($extrafields->attributes[$this->table_element]['label'])) { - if (count($extrafields->attributes[$this->table_element]['label']) < $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP) { + if ($extrafields->attributes[$this->table_element]['count'] < $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP) { foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); From 61b58e8234e3f273d061595644f096432fbd2cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 09:21:27 +0200 Subject: [PATCH 037/156] Doc --- htdocs/core/class/commonobject.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 32802660e73..ba35760d66d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -107,6 +107,11 @@ abstract class CommonObject */ public $table_element_line = ''; + /** + * @var int 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged; + /** * @var string Key value used to track if data is coming from import wizard */ From 74ff77d8b237f566cd79647584b7874d394c34f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 09:23:38 +0200 Subject: [PATCH 038/156] add doc --- htdocs/core/class/commonobject.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index de8f758d8e4..6d759b977a1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -117,6 +117,11 @@ abstract class CommonObject */ public $array_options = array(); + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array(); + /** * @var mixed Array to store alternative languages values of object */ @@ -2637,6 +2642,8 @@ abstract class CommonObject switch ($this->element) { case 'propal': + /** @var Propal $this */ + /** @var PropaleLigne $line */ $this->updateline( $line->id, $line->subprice, @@ -2663,6 +2670,8 @@ abstract class CommonObject ); break; case 'commande': + /** @var Commande $this */ + /** @var OrderLine $line */ $this->updateline( $line->id, ($line->description ? $line->description : $line->desc), @@ -2689,6 +2698,8 @@ abstract class CommonObject ); break; case 'facture': + /** @var Facture $this */ + /** @var FactureLigne $line */ $this->updateline( $line->id, ($line->description ? $line->description : $line->desc), From 93ed2621d9fd0ff7cc58c5598992d4e2b2f38fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 09:24:24 +0200 Subject: [PATCH 039/156] add doc --- htdocs/core/class/commonobject.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6d759b977a1..b618a9049ac 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2727,6 +2727,8 @@ abstract class CommonObject ); break; case 'supplier_proposal': + /** @var SupplierProposal $this */ + /** @var SupplierProposalLine $line */ $this->updateline( $line->id, $line->subprice, @@ -2751,6 +2753,8 @@ abstract class CommonObject ); break; case 'order_supplier': + /** @var CommandeFournisseur $this */ + /** @var CommandeFournisseurLigne $line */ $this->updateline( $line->id, ($line->description ? $line->description : $line->desc), @@ -2773,6 +2777,8 @@ abstract class CommonObject ); break; case 'invoice_supplier': + /** @var FactureFournisseur $this */ + /** @var SupplierInvoiceLine $line */ $this->updateline( $line->id, ($line->description ? $line->description : $line->desc), From 6e5abdc4628ff0f7a12386160fc2d50a9c1c2091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 09:48:02 +0200 Subject: [PATCH 040/156] add hook init context --- htdocs/adherents/agenda.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 6bf2a084563..867f4f47025 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -73,7 +73,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $objcanvas = null; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('memberagenda')); +$hookmanager->initHooks(array('memberagenda', 'globalcard')); // Security check $result = restrictedArea($user, 'adherent', $id); From a93cb8b5727d1f211e37b02643d2762d2011818d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 10:56:52 +0200 Subject: [PATCH 041/156] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 29 +++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 39a24f830b2..a101181d7cb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -735,21 +735,24 @@ abstract class CommonObject $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP = getDolGlobalInt('MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP', 5); $datas = $this->getTooltipContentArray($params); - + $count = 0; // Add extrafields if (!empty($extrafields->attributes[$this->table_element]['label'])) { - if ($extrafields->attributes[$this->table_element]['count'] < $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP) { - foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { - $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); - } - $labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]); - if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { - $datas[$key]= '
'. $labelextra . ''; - } else { - $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]); - $datas[$key]= '
'. $labelextra . ': ' . $extrafields->showOutputField($key, $value, '', $this->table_element); - } + foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { + if ($count >= $MAX_EXTRAFIELDS_TO_SHOW_IN_TOOLTIP) { + $datas['more_extrafields'] = '
.../...'; + break; + } + if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { + $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); + } + $labelextra = $langs->trans((string) $extrafields->attributes[$this->table_element]['label'][$key]); + if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') { + $datas[$key]= '
'. $labelextra . ''; + } else { + $value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]); + $datas[$key]= '
'. $labelextra . ': ' . $extrafields->showOutputField($key, $value, '', $this->table_element); + $count++; } } } From cf9ce353c36b271aa5cb68ce0adb66e77ba942da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 10:58:19 +0200 Subject: [PATCH 042/156] Update ajaxtooltip.php --- htdocs/core/ajax/ajaxtooltip.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/ajax/ajaxtooltip.php b/htdocs/core/ajax/ajaxtooltip.php index 33cdfb4831f..06bd008cd5b 100644 --- a/htdocs/core/ajax/ajaxtooltip.php +++ b/htdocs/core/ajax/ajaxtooltip.php @@ -80,6 +80,7 @@ $html = ''; if (is_object($object)) { if ($object->id > 0 || !empty($object->ref)) { + /** @var CommonObject $object */ $html = $object->getTooltipContent($params); } elseif ($res == 0) { $html = $langs->trans('Deleted'); From a665e69b2d9c468100197a97e8bd6e79cc2274b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 11:08:04 +0200 Subject: [PATCH 043/156] Fix getElementProperties for usergroup --- htdocs/core/lib/functions.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 88fe167b73d..e7e903007d0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11358,6 +11358,9 @@ function getElementProperties($element_type) $classpath = 'adherents/class'; $module = 'adherent'; $subelement = 'adherent'; + } elseif ($element_type == 'usergroup') { + $classpath = 'user/class'; + $module = 'user'; } elseif ($element_type == 'mo') { $classpath = 'mrp/class'; $classfile = 'mo'; From b4d4b96dc434ecac10565245c82494a003803cfc Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 26 Apr 2023 09:10:37 +0000 Subject: [PATCH 044/156] Fixing style errors. --- htdocs/bom/bom_card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 5eaec818d0f..b1db4a5c824 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -171,7 +171,7 @@ if (empty($reshook)) { $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); - if(!empty($idprod) && $conf->workstation->enabled){ + if (!empty($idprod) && $conf->workstation->enabled) { $product = new Product($db); $res = $product->fetch($idprod); if ($res > 0 && $product->type == Product::TYPE_SERVICE) $fk_default_workstation = $product->fk_default_workstation; From a5a55b37c57f541f32c91b7887d5eef5d25b3838 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 11:28:05 +0200 Subject: [PATCH 045/156] Add column subtype --- htdocs/install/mysql/migration/17.0.0-18.0.0.sql | 2 ++ htdocs/install/mysql/tables/llx_facture.sql | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index cf71f0a02e4..d47e84a255d 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -397,3 +397,5 @@ ALTER TABLE llx_mailing ADD COLUMN name_from varchar(128) AFTER email_from; ALTER TABLE llx_bom_bomline ADD COLUMN fk_default_workstation integer DEFAULT NULL; ALTER TABLE llx_mrp_production ADD COLUMN fk_default_workstation integer DEFAULT NULL; + +ALTER TABLE llx_facture ADD COLUMN subtype smallint DEFAULT NULL; diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index e1c82e62f2d..ff0ff2ce129 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -33,13 +33,15 @@ create table llx_facture ref_client varchar(255), -- reference for customer type smallint DEFAULT 0 NOT NULL, -- type of invoice + subtype smallint DEFAULT NULL, -- subtype of invoice (some countries need a subtype to classify invoices) fk_soc integer NOT NULL, + datec datetime, -- date de creation de la facture datef date, -- date invoice date_pointoftax date DEFAULT NULL, -- date point of tax (for GB) date_valid date, -- date validation tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date - date_closing datetime, -- date de cloture + date_closing datetime, -- date de cloture paye smallint DEFAULT 0 NOT NULL, remise_percent real DEFAULT 0, -- remise relative From 2f3cefcc09f57cf6c34b6549061a682c084f02d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 11:41:02 +0200 Subject: [PATCH 046/156] Clean code --- htdocs/comm/propal/class/propal.class.php | 4 +++- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 6 +++--- htdocs/core/class/commoninvoice.class.php | 10 ++++++++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1dd1a797494..9c826a4bb61 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -122,6 +122,7 @@ class Propal extends CommonObject /** * Status of the quote * @var int + * @deprecated Try to use $status now * @see Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED */ public $statut; @@ -1606,7 +1607,8 @@ class Propal extends CommonObject $this->ref = $obj->ref; $this->ref_client = $obj->ref_client; - $this->ref_ext = $obj->ref_ext; + $this->ref_customer = $obj->ref_client; + $this->ref_ext = $obj->ref_ext; $this->remise = $obj->remise; // TODO deprecated $this->remise_percent = $obj->remise_percent; // TODO deprecated diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 67eb5190425..f6d11eed0fd 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1899,7 +1899,7 @@ class Commande extends CommonOrder $this->ref = $obj->ref; $this->ref_client = $obj->ref_client; $this->ref_customer = $obj->ref_client; - $this->ref_ext = $obj->ref_ext; + $this->ref_ext = $obj->ref_ext; $this->socid = $obj->fk_soc; $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 18de3c14b64..4750c9af54c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -177,9 +177,6 @@ class Facture extends CommonInvoice */ public $ref_customer; - //Check constants for types - public $type = self::TYPE_STANDARD; - // Warning: Do not set default value into property defintion. it must stay null. // For example to avoid to have substition done when object is generic and not yet defined. public $remise_absolue; @@ -302,6 +299,7 @@ class Facture extends CommonInvoice public $retained_warranty_fk_cond_reglement; + /** * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" @@ -492,7 +490,9 @@ class Facture extends CommonInvoice if (empty($this->type)) { $this->type = self::TYPE_STANDARD; } + $this->ref_client = trim($this->ref_client); + $this->note = (isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated $this->note_private = (isset($this->note_private) ? trim($this->note_private) : trim($this->note_private)); $this->note_public = trim($this->note_public); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 055cb58e84f..d93f25522ae 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -33,6 +33,16 @@ abstract class CommonInvoice extends CommonObject { use CommonIncoterm; + /** + * @var int Type of invoice (See TYPE_XXX constants) + */ + public $type = self::TYPE_STANDARD; + + /** + * @var int Sub type of invoice (A subtype code coming from llx_invoice_subtype table. May be used by some countries like Greece) + */ + public $subtype; + /** * Standard invoice */ From b31dbdc5ea5e2fb425c7fa871011b1d276f4d574 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 11:48:43 +0200 Subject: [PATCH 047/156] Add dictionary table for invoice subtypes (country specific) --- .../install/mysql/migration/17.0.0-18.0.0.sql | 12 +++++++++ .../tables/llx_c_invoice_subtype.key.sql | 19 +++++++++++++ .../mysql/tables/llx_c_invoice_subtype.sql | 27 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_c_invoice_subtype.key.sql create mode 100644 htdocs/install/mysql/tables/llx_c_invoice_subtype.sql diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index d47e84a255d..64ede43cf9f 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -399,3 +399,15 @@ ALTER TABLE llx_bom_bomline ADD COLUMN fk_default_workstation integer DEFAULT NU ALTER TABLE llx_mrp_production ADD COLUMN fk_default_workstation integer DEFAULT NULL; ALTER TABLE llx_facture ADD COLUMN subtype smallint DEFAULT NULL; + +CREATE TABLE llx_c_invoice_subtype ( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1, + fk_country integer NOT NULL, + code varchar(3) NOT NULL, + label varchar(100), + active tinyint DEFAULT 1 NOT NULL +) ENGINE=innodb; + +ALTER TABLE llx_c_invoice_subtype ADD UNIQUE INDEX uk_c_invoice_subtype (entity, code); + diff --git a/htdocs/install/mysql/tables/llx_c_invoice_subtype.key.sql b/htdocs/install/mysql/tables/llx_c_invoice_subtype.key.sql new file mode 100644 index 00000000000..a362755358a --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_invoice_subtype.key.sql @@ -0,0 +1,19 @@ +-- ======================================================================== +-- Copyright (C) 2023 Laurent Destailleur +-- +-- 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 . +-- +-- ======================================================================== + +ALTER TABLE llx_c_invoice_subtype ADD UNIQUE INDEX uk_c_invoice_subtype (entity, code); diff --git a/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql b/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql new file mode 100644 index 00000000000..0bdc10fc69d --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_invoice_subtype.sql @@ -0,0 +1,27 @@ +-- ======================================================================== +-- Copyright (C) 2023 Laurent Destailleur +-- +-- 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 . +-- +-- ======================================================================== + +CREATE TABLE llx_c_invoice_subtype ( + rowid integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 1, + fk_country integer NOT NULL, + code varchar(3) NOT NULL, + label varchar(100), + active tinyint DEFAULT 1 NOT NULL +) ENGINE=innodb; + From e375252a8303a9df811037c4d359b65b521ebf2e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 12:45:02 +0200 Subject: [PATCH 048/156] Clean code of dictionnary page --- htdocs/admin/dict.php | 246 ++++++++++++++++++++++++++---------------- 1 file changed, 153 insertions(+), 93 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 98b9f120a6d..210413b87f2 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -101,7 +101,7 @@ $hookmanager->initHooks(array('admin', 'dictionaryadmin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder = array(9, 15, 30, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 24, 0, 29, 0, 33, 34, 32, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 37, 42, 0, 43, 0, 25, 0, 44, 0); +$taborder = array(9, 15, 30, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 24, 0, 29, 0, 33, 34, 32, 28, 17, 35, 36, 0, 10, 31, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 37, 42, 0, 43, 0, 25, 0, 44, 0); // Name of SQL tables of dictionaries $tabname = array(); @@ -135,7 +135,7 @@ $tabname[27] = "c_stcomm"; $tabname[28] = "c_holiday_types"; $tabname[29] = "c_lead_status"; $tabname[30] = "c_format_cards"; -//$tabname[31]= "accounting_system"; +$tabname[31] = "c_invoice_subtype"; $tabname[32] = "c_hrm_public_holiday"; $tabname[33] = "c_hrm_department"; $tabname[34] = "c_hrm_function"; @@ -182,7 +182,7 @@ $tablib[27] = "DictionaryProspectStatus"; $tablib[28] = "DictionaryHolidayTypes"; $tablib[29] = "DictionaryOpportunityStatus"; $tablib[30] = "DictionaryFormatCards"; -//$tablib[31]= "DictionaryAccountancysystem"; +$tablib[31] = "DictionaryInvoiceSubtype"; $tablib[32] = "DictionaryPublicHolidays"; $tablib[33] = "DictionaryDepartment"; $tablib[34] = "DictionaryFunction"; @@ -205,10 +205,10 @@ $tabsql[3] = "SELECT r.rowid as rowid, r.code_region as state_code, r.nom as lib $tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite, c.eec FROM ".MAIN_DB_PREFIX."c_country AS c"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; -$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1"; +$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays = c.rowid and c.active = 1"; $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid"; $tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c"; -$tabsql[10] = "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; +$tabsql[10] = "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays = c.rowid"; $tabsql[11] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = ".getEntity($tabname[12]); $tabsql[13] = "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = ".getEntity($tabname[13]); @@ -229,7 +229,7 @@ $tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN $tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.sortorder, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; $tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; -//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s"; +$tabsql[31] = "SELECT t.rowid, t.code, t.label, c.label as country, c.code as country_code, t.fk_country as country_id, t.active FROM ".MAIN_DB_PREFIX."c_invoice_subtype as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_country = c.rowid"; $tabsql[32] = "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.dayrule, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country=c.rowid AND c.active=1"; $tabsql[33] = "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department"; $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function"; @@ -276,7 +276,7 @@ $tabsqlsort[27] = "code ASC"; $tabsqlsort[28] = "sortorder ASC, country ASC, code ASC"; $tabsqlsort[29] = "position ASC"; $tabsqlsort[30] = "code ASC"; -//$tabsqlsort[31]="pcg_version ASC"; +$tabsqlsort[31] = "country ASC, code ASC"; $tabsqlsort[32] = "country, year ASC, month ASC, day ASC"; $tabsqlsort[33] = "code ASC"; $tabsqlsort[34] = "code ASC"; @@ -323,7 +323,7 @@ $tabfield[27] = "code,libelle,picto"; $tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country,block_if_negative,sortorder"; $tabfield[29] = "code,label,percent,position"; $tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; -//$tabfield[31]= "pcg_version,label"; +$tabfield[31] = "country_id,country,code,label"; $tabfield[32] = "code,dayrule,year,month,day,country_id,country"; $tabfield[33] = "code,label"; $tabfield[34] = "code,label"; @@ -370,7 +370,7 @@ $tabfieldvalue[27] = "code,libelle,picto"; $tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country,block_if_negative,sortorder"; $tabfieldvalue[29] = "code,label,percent,position"; $tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; -//$tabfieldvalue[31]= "pcg_version,label"; +$tabfieldvalue[31] = "country,code,label"; $tabfieldvalue[32] = "code,dayrule,day,month,year,country"; $tabfieldvalue[33] = "code,label"; $tabfieldvalue[34] = "code,label"; @@ -417,8 +417,7 @@ $tabfieldinsert[27] = "code,libelle,picto"; $tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder"; $tabfieldinsert[29] = "code,label,percent,position"; $tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; -//$tabfieldinsert[31]= "pcg_version,label"; -//$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; +$tabfieldinsert[31] = "fk_country,code,label"; $tabfieldinsert[32] = "code,dayrule,day,month,year,fk_country"; $tabfieldinsert[33] = "code,label"; $tabfieldinsert[34] = "code,label"; @@ -467,7 +466,7 @@ $tabrowid[27] = "id"; $tabrowid[28] = ""; $tabrowid[29] = ""; $tabrowid[30] = ""; -//$tabrowid[31]= ""; +$tabrowid[31]= ""; $tabrowid[32] = "id"; $tabrowid[33] = "rowid"; $tabrowid[34] = "rowid"; @@ -514,7 +513,7 @@ $tabcond[27] = isModEnabled("societe"); $tabcond[28] = isModEnabled('holiday'); $tabcond[29] = isModEnabled('project'); $tabcond[30] = (isModEnabled('label') || isModEnabled('barcode') || isModEnabled('adherent')); // stickers format dictionary -//$tabcond[31]= isModEnabled('accounting'); +$tabcond[31] = ((isModEnabled('facture') || isModEnabled('supplier_invoice')) && $mysoc->country_code == 'GR'); $tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm')); $tabcond[33] = isModEnabled('hrm'); $tabcond[34] = isModEnabled('hrm'); @@ -576,6 +575,7 @@ $tabcomplete = array( 'c_product_nature'=>array('picto'=>'product', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))), 'c_productbatch_qcstatus'=>array('picto'=>'lot', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))), 'c_asset_disposal_type'=>array('picto'=>'asset', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))), + 'c_invoice_subtype'=>array('picto'=>'bill', 'help'=>array('code'=>$langs->trans("EnterAnyCode"))), ); @@ -714,7 +714,7 @@ if (empty($reshook)) { $ok = 1; foreach ($listfield as $f => $value) { // Discard check of mandatory fields for country for some tables - if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryVAT', 'DictionaryRegion', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp', 'DictionaryAccountancysystem', 'DictionaryAccountancyCategory'))) { + if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryVAT', 'DictionaryInvoiceSubtype', 'DictionaryRegion', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp', 'DictionaryAccountancysystem', 'DictionaryAccountancyCategory'))) { continue; // For some pages, country is not mandatory } if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryCanton', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp'))) { @@ -1201,7 +1201,7 @@ if ($search_country_id > 0) { $param .= '&search_country_id='.urlencode($search_country_id); } if ($search_code != '') { - $param .= '&search_code='.urlencode($search_country_id); + $param .= '&search_code='.urlencode($search_code); } if ($entity != '') { $param .= '&entity='.(int) $entity; @@ -1580,7 +1580,9 @@ if ($id > 0) { } print ''; if ($action != 'edit') { - print ''; + print ''; + } else { + print ''; } print ''; @@ -1614,13 +1616,44 @@ if ($id > 0) { print '
'; } + $filterfound = 0; + foreach ($fieldlist as $field => $value) { + if ($value == 'entity') { + continue; + } + + $showfield = 1; // By default + if ($value == 'region_id' || $value == 'country_id') { + $showfield = 0; + } + + if ($showfield) { + if ($value == 'country') { + $filterfound++; + } elseif ($value == 'code') { + $filterfound++; + } + } + } + print '
'; print ''; // Title line with search input fields print ''."\n"; print ''; - $filterfound = 0; + + // Action button + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + $colspan++; + } + $colspan = 0; foreach ($fieldlist as $field => $value) { if ($value == 'entity') { @@ -1628,7 +1661,6 @@ if ($id > 0) { } $showfield = 1; // By default - if ($value == 'region_id' || $value == 'country_id') { $showfield = 0; } @@ -1638,13 +1670,11 @@ if ($id > 0) { print ''; - $filterfound++; $colspan++; } elseif ($value == 'code') { print ''; - $filterfound++; $colspan++; } else { print ''; $colspan++; } + print ''; $colspan++; - print ''; + $colspan++; } - print ''; - $colspan+=2; + print ''; // Title of lines print ''."\n"; print ''; + + // Action button + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList(''); + } + foreach ($fieldlist as $field => $value) { if ($value == 'entity') { continue; @@ -1904,9 +1946,13 @@ if ($id > 0) { print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder); } + // Status print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder); - print getTitleFieldOfList(''); - print getTitleFieldOfList(''); + + // Action button + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList(''); + } print ''; if ($num) { @@ -1914,9 +1960,76 @@ if ($id > 0) { while ($i < $num) { $obj = $db->fetch_object($resql); + // Can an entry be erased or disabled ? + // all true by default + $iserasable = 1; + $canbedisabled = 1; + $canbemodified = 1; + if (isset($obj->code) && $id != 10 && $id != 42) { + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { + $iserasable = 0; $canbedisabled = 0; + } elseif ($obj->code == 'RECEP') { + $iserasable = 0; $canbedisabled = 0; + } elseif ($obj->code == 'EF0') { + $iserasable = 0; $canbedisabled = 0; + } + } + if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page'))) { + $iserasable = 0; $canbedisabled = 0; + if (in_array($obj->code, array('banner'))) { + $canbedisabled = 1; + } + } + if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { + $iserasable = 0; + } + if (in_array(empty($obj->code) ? '' : $obj->code, array('AC_OTH', 'AC_OTH_AUTO')) || in_array(empty($obj->type) ? '' : $obj->type, array('systemauto'))) { + $canbedisabled = 0; $canbedisabled = 0; + } + $canbemodified = $iserasable; + + if (!empty($obj->code) && $obj->code == 'RECEP') { + $canbemodified = 1; + } + if ($tabname[$id] == "c_actioncomm") { + $canbemodified = 1; + } + + // Build Url. The table is id=, the id of line is rowid= + $rowidcol = $tabrowid[$id]; + // If rowidcol not defined + if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) { + $rowidcol = 'rowid'; + } + $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(isset($obj->{$rowidcol}) ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); + if (!empty($param)) { + $url .= '&'.$param; + } + if (!is_null($withentity)) { + $url .= '&entity='.$withentity; + } + $url .= '&'; + + //print_r($obj); print ''; + // Action button + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } + if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { $tmpaction = 'edit'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); @@ -2151,56 +2264,6 @@ if ($id > 0) { } } - // Can an entry be erased or disabled ? - // all true by default - $iserasable = 1; - $canbedisabled = 1; - $canbemodified = 1; - if (isset($obj->code) && $id != 10 && $id != 42) { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { - $iserasable = 0; $canbedisabled = 0; - } elseif ($obj->code == 'RECEP') { - $iserasable = 0; $canbedisabled = 0; - } elseif ($obj->code == 'EF0') { - $iserasable = 0; $canbedisabled = 0; - } - } - if ($id == 25 && in_array($obj->code, array('banner', 'blogpost', 'other', 'page'))) { - $iserasable = 0; $canbedisabled = 0; - if (in_array($obj->code, array('banner'))) { - $canbedisabled = 1; - } - } - if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { - $iserasable = 0; - } - if (in_array(empty($obj->code) ? '' : $obj->code, array('AC_OTH', 'AC_OTH_AUTO')) || in_array(empty($obj->type) ? '' : $obj->type, array('systemauto'))) { - $canbedisabled = 0; $canbedisabled = 0; - } - $canbemodified = $iserasable; - - if (!empty($obj->code) && $obj->code == 'RECEP') { - $canbemodified = 1; - } - if ($tabname[$id] == "c_actioncomm") { - $canbemodified = 1; - } - - // Build Url. The table is id=, the id of line is rowid= - $rowidcol = $tabrowid[$id]; - // If rowidcol not defined - if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27, 32))) { - $rowidcol = 'rowid'; - } - $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(isset($obj->{$rowidcol}) ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); - if (!empty($param)) { - $url .= '&'.$param; - } - if (!is_null($withentity)) { - $url .= '&entity='.$withentity; - } - $url .= '&'; - // Favorite & EEC // Only activated on country dictionary if ($id == 4) { @@ -2239,23 +2302,20 @@ if ($id > 0) { } print ""; - // Modify link - if ($canbemodified) { - print ''; - } else { - print ''; - } - - // Delete link - if ($iserasable) { - print ''; - } else { - print ''; } print "\n"; From 00d4e09c68ebb7475ef7b82a8d3522e703ea8e92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 13:20:28 +0200 Subject: [PATCH 049/156] Fix filter lost --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index c19777c9007..3db5a95dc3f 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1201,7 +1201,7 @@ if ($search_country_id > 0) { $param .= '&search_country_id='.urlencode($search_country_id); } if ($search_code != '') { - $param .= '&search_code='.urlencode($search_country_id); + $param .= '&search_code='.urlencode($search_code); } if ($entity != '') { $param .= '&entity='.(int) $entity; From fcb139cbd56950d0848a65bcd1a4a68c310891db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 13:25:47 +0200 Subject: [PATCH 050/156] Code comment --- htdocs/core/class/conf.class.php | 4 ++-- htdocs/main.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 855b8aae2a9..7b00ade88e6 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -952,8 +952,8 @@ class Conf if (!isset($this->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) { // Value 1 makes CSRF check for all POST parameters only // Value 2 makes also CSRF check for GET requests with action = a sensitive requests like action=del, action=remove... - // Value 3 makes also CSRF check for all GET requests with a param action or massaction - $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2; + // Value 3 makes also CSRF check for all GET requests with a param action or massaction (except some sensitive values) + $this->global->MAIN_SECURITY_CSRF_WITH_TOKEN = 2; // TODO Switch value to 3 // Note: Set MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL=1 to have a renewal of token at each page call instead of each session (not recommended) } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4405d650aec..dc65c49d9a3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -533,7 +533,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude some action that are legitimate $sensitiveget = true; } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { From b6235c29d017cdff77dc429f9e8f794dd8f963e6 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Thu, 13 Apr 2023 20:25:07 +0200 Subject: [PATCH 051/156] phpunit: use $db instead of $this->savdb The global variables are stored in $this, and in particular $db is used through this mean. But $this->savdb is supposed to be the immutable global state that is stored at the test class instantiation and restored at the beginning of each test. For $this->savdb, I don't think any consequences are created by this, since the object is saved by each test anyway and the $db object is mostly a query object within a transaction, but future change could use this to inject a different stateful $db object to trace some behaviour in the test for instance, so make sure the correct one is used. --- test/phpunit/AccountingAccountTest.php | 6 +- test/phpunit/ActionCommTest.php | 6 +- test/phpunit/AdherentTest.php | 12 ++-- test/phpunit/BOMTest.php | 4 +- test/phpunit/BankAccountTest.php | 8 +-- test/phpunit/BonPrelevementTest.php | 4 +- test/phpunit/BuildDocTest.php | 18 +++--- test/phpunit/CategorieTest.php | 18 +++--- test/phpunit/ChargeSocialesTest.php | 6 +- test/phpunit/CommandeFournisseurTest.php | 4 +- test/phpunit/CommandeTest.php | 6 +- test/phpunit/CommonInvoiceTest.php | 2 +- test/phpunit/CommonObjectTest.php | 6 +- test/phpunit/CompanyBankAccountTest.php | 4 +- test/phpunit/ContactTest.php | 8 +-- test/phpunit/ContratTest.php | 6 +- test/phpunit/DiscountTest.php | 6 +- test/phpunit/EmailCollectorTest.php | 4 +- test/phpunit/EntrepotTest.php | 6 +- test/phpunit/ExpenseReportTest.php | 4 +- test/phpunit/FactureFournisseurTest.php | 6 +- test/phpunit/FactureRecTest.php | 6 +- test/phpunit/FactureTest.php | 10 ++-- test/phpunit/FactureTestRounding.php | 20 +++---- test/phpunit/FichinterTest.php | 6 +- test/phpunit/FormAdminTest.php | 2 +- test/phpunit/FormTest.php | 2 +- test/phpunit/FunctionsLibTest.php | 12 ++-- test/phpunit/HolidayTest.php | 18 +++--- test/phpunit/InventoryTest.php | 4 +- test/phpunit/KnowledgeRecordTest.php | 6 +- test/phpunit/LoanTest.php | 6 +- test/phpunit/MouvementStockTest.php | 2 +- test/phpunit/NumberingModulesTest.php | 72 ++++++++++++------------ test/phpunit/PdfDocTest.php | 6 +- test/phpunit/PricesTest.php | 8 +-- test/phpunit/ProductTest.php | 6 +- test/phpunit/ProjectTest.php | 6 +- test/phpunit/PropalTest.php | 6 +- test/phpunit/SocieteTest.php | 10 ++-- test/phpunit/SupplierProposalTest.php | 6 +- test/phpunit/TargetTest.php | 6 +- test/phpunit/TicketTest.php | 8 +-- test/phpunit/UserGroupTest.php | 6 +- test/phpunit/UserTest.php | 10 ++-- test/phpunit/UtilsTest.php | 4 +- 46 files changed, 198 insertions(+), 194 deletions(-) diff --git a/test/phpunit/AccountingAccountTest.php b/test/phpunit/AccountingAccountTest.php index 97b067ff454..bf34616563a 100644 --- a/test/phpunit/AccountingAccountTest.php +++ b/test/phpunit/AccountingAccountTest.php @@ -143,7 +143,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new AccountingAccount($this->savdb); + $localobject=new AccountingAccount($db); $localobject->fk_pcg_version = 'PCG99-ABREGE'; $localobject->account_category = 0; $localobject->pcg_type = 'XXXXX'; @@ -177,7 +177,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new AccountingAccount($this->savdb); + $localobject=new AccountingAccount($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -229,7 +229,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new AccountingAccount($this->savdb); + $localobject=new AccountingAccount($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php index 12be63af3e4..d3c0a02a656 100644 --- a/test/phpunit/ActionCommTest.php +++ b/test/phpunit/ActionCommTest.php @@ -145,7 +145,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase $now = dol_now(); - $localobject=new ActionComm($this->savdb); + $localobject=new ActionComm($db); $localobject->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) $localobject->code = 'AC_PHPUNITTEST'; @@ -196,7 +196,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new ActionComm($this->savdb); + $localobject=new ActionComm($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -246,7 +246,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new ActionComm($this->savdb); + $localobject=new ActionComm($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index a3e55063cd4..ce7c44e01c6 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -150,7 +150,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new AdherentType($this->savdb); + $localobject=new AdherentType($db); $localobject->statut=1; $localobject->label='Adherent type test'; $localobject->subscription=1; @@ -181,7 +181,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Adherent($this->savdb); + $localobject=new Adherent($db); $localobject->initAsSpecimen(); $localobject->typeid=$fk_adherent_type; $result=$localobject->create($user); @@ -211,7 +211,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Adherent($this->savdb); + $localobject=new Adherent($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -235,7 +235,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $newobject = new Adherent($this->savdb); + $newobject = new Adherent($db); $result = $newobject->fetch_login($localobject->login); $this->assertEquals($newobject, $localobject); @@ -291,7 +291,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); - $newobject=new Adherent($this->savdb); + $newobject=new Adherent($db); $result=$newobject->fetch($localobject->id); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -579,7 +579,7 @@ class AdherentTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobjectat=new AdherentType($this->savdb); + $localobjectat=new AdherentType($db); $result=$localobjectat->fetch($localobject->typeid); $result=$localobjectat->delete(); print __METHOD__." result=".$result."\n"; diff --git a/test/phpunit/BOMTest.php b/test/phpunit/BOMTest.php index c56afb7efa8..c331c3cd4e2 100644 --- a/test/phpunit/BOMTest.php +++ b/test/phpunit/BOMTest.php @@ -139,7 +139,7 @@ class BOMTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new BOM($this->savdb); + $localobject=new BOM($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -166,7 +166,7 @@ class BOMTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new BOM($this->savdb); + $localobject=new BOM($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index 8f1169b6cbd..4e879be7c0a 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -141,7 +141,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Account($this->savdb); + $localobject=new Account($db); $localobject->initAsSpecimen(); $localobject->date_solde=dol_now(); $result=$localobject->create($user); @@ -169,7 +169,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Account($this->savdb); + $localobject=new Account($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -212,7 +212,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase $this->assertTrue($result); // Test checkIbanForAccount for CI account - $localobject2=new Account($this->savdb); + $localobject2=new Account($db); $localobject2->country = 'CI'; $localobject2->iban = 'CI77A12312341234123412341234'; $result = checkIbanForAccount($localobject2); @@ -239,7 +239,7 @@ class BankAccountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Account($this->savdb); + $localobject=new Account($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php index ce5a4ae1bd8..1adf938a906 100644 --- a/test/phpunit/BonPrelevementTest.php +++ b/test/phpunit/BonPrelevementTest.php @@ -150,7 +150,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase // Create withdraw record and generate SEPA file - $localobject=new BonPrelevement($this->savdb); + $localobject=new BonPrelevement($db); //$localobject->date_solde=dol_now(); $result=$localobject->Create(0, 0, 'simu'); @@ -180,7 +180,7 @@ class BonPrelevementTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new BonPrelevement($this->savdb); + $localobject=new BonPrelevement($db); $result=$localobject->fetch($id); $result=$localobject->delete($id); diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index ff29cea109a..82fe9c43ee6 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -192,10 +192,10 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $conf->facture->dir_output.='/temp'; - $localobjectcom=new Commande($this->savdb); + $localobjectcom=new Commande($db); $localobjectcom->initAsSpecimen(); - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->createFromOrder($localobjectcom, $user); $localobject->date_lim_reglement = dol_now() + 3600 * 24 *30; @@ -270,7 +270,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $db=$this->savdb; $conf->fournisseur->facture->dir_output.='/temp'; - $localobject=new FactureFournisseur($this->savdb); + $localobject=new FactureFournisseur($db); $localobject->initAsSpecimen(); // Canelle @@ -297,7 +297,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $db=$this->savdb; $conf->commande->dir_output.='/temp'; - $localobject=new Commande($this->savdb); + $localobject=new Commande($db); $localobject->initAsSpecimen(); // Einstein @@ -325,7 +325,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $db=$this->savdb; $conf->fournisseur->commande->dir_output.='/temp'; - $localobject=new CommandeFournisseur($this->savdb); + $localobject=new CommandeFournisseur($db); $localobject->initAsSpecimen(); // Muscadet @@ -352,7 +352,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $db=$this->savdb; $conf->propal->dir_output.='/temp'; - $localobject=new Propal($this->savdb); + $localobject=new Propal($db); $localobject->initAsSpecimen(); // Azur @@ -378,7 +378,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; $conf->project->dir_output.='/temp'; - $localobject=new Project($this->savdb); + $localobject=new Project($db); $localobject->initAsSpecimen(); // Baleine @@ -405,7 +405,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $db=$this->savdb; $conf->ficheinter->dir_output.='/temp'; - $localobject=new Fichinter($this->savdb); + $localobject=new Fichinter($db); $localobject->initAsSpecimen(); // Soleil @@ -432,7 +432,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $db=$this->savdb; $conf->expedition->dir_output.='/temp'; - $localobject=new Expedition($this->savdb); + $localobject=new Expedition($db); $localobject->initAsSpecimen(); // Merou diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index 1faab723bb2..763be9cca65 100644 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -140,7 +140,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase // We create a category - $localobject=new Categorie($this->savdb); + $localobject=new Categorie($db); $localobject->initAsSpecimen(); // Check it does not exist (return 0) @@ -154,7 +154,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase $this->assertGreaterThan(0, $resultFirstCreate); // We try to create another one with same ref - $localobject2=new Categorie($this->savdb); + $localobject2=new Categorie($db); $localobject2->initAsSpecimen(); // Check it does exist (return 1) @@ -186,7 +186,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobjecttmp=new Categorie($this->savdb); + $localobjecttmp=new Categorie($db); $localobjecttmp->initAsSpecimen(); $localobjecttmp->label='Specimen Category for product'; $localobjecttmp->type=0; // product category @@ -196,12 +196,12 @@ class CategorieTest extends PHPUnit\Framework\TestCase $this->assertGreaterThan(0, $catid); // Try to create product linked to category - $localobject2=new Product($this->savdb); + $localobject2=new Product($db); $localobject2->initAsSpecimen(); $localobject2->ref.='-CATEG'; $localobject2->tva_npr=1; $result=$localobject2->create($user); - $cat = new Categorie($this->savdb); + $cat = new Categorie($db); $cat->id = $catid; $cat->type = 0; $result=$cat->add_type($localobject2, "product"); @@ -210,7 +210,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase $this->assertGreaterThan(0, $result); // Get list of categories for product - $localcateg=new Categorie($this->savdb); + $localcateg=new Categorie($db); $listofcateg=$localcateg->containing($localobject2->id, Categorie::TYPE_PRODUCT, 'label'); $this->assertTrue(in_array('Specimen Category for product', $listofcateg), 'Categ not found linked to product when it should'); @@ -234,7 +234,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Categorie($this->savdb); + $localobject=new Categorie($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -314,7 +314,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Categorie($this->savdb); + $localobject=new Categorie($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); @@ -338,7 +338,7 @@ class CategorieTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Categorie($this->savdb); + $localobject=new Categorie($db); $retarray=$localobject->get_full_arbo(3); print __METHOD__." retarray size=".count($retarray)."\n"; diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index 14a9fabc9ae..2feaccd497b 100644 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -137,7 +137,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new ChargeSociales($this->savdb); + $localobject=new ChargeSociales($db); $localobject->initAsSpecimen(); $result=$localobject->create($user, $langs, $conf); print __METHOD__." result=".$result."\n"; @@ -163,7 +163,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new ChargeSociales($this->savdb); + $localobject=new ChargeSociales($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -240,7 +240,7 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new ChargeSociales($this->savdb); + $localobject=new ChargeSociales($db); $result=$localobject->fetch($id); $result=$localobject->delete($id); diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 7d00f464665..7282fb1a88e 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -261,7 +261,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new CommandeFournisseur($this->savdb); + $localobject=new CommandeFournisseur($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -389,7 +389,7 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new CommandeFournisseur($this->savdb); + $localobject=new CommandeFournisseur($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 196ec351d2f..fa3fe3ac843 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -143,7 +143,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Commande($this->savdb); + $localobject=new Commande($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -169,7 +169,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Commande($this->savdb); + $localobject=new Commande($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -296,7 +296,7 @@ class CommandeTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Commande($this->savdb); + $localobject=new Commande($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/CommonInvoiceTest.php b/test/phpunit/CommonInvoiceTest.php index 1aed7c4326b..a5b93720ede 100644 --- a/test/phpunit/CommonInvoiceTest.php +++ b/test/phpunit/CommonInvoiceTest.php @@ -138,7 +138,7 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->fetch(1); $localobject->date = dol_mktime(12, 0, 0, 1, 1, 2010); diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index 97711832291..bf68954227c 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -139,7 +139,7 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Commande($this->savdb); + $localobject=new Commande($db); $localobject->fetch(1); $result=$localobject->fetch_user(1); @@ -162,7 +162,7 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Commande($this->savdb); + $localobject=new Commande($db); $localobject->fetch(1); $result=$localobject->fetch_projet(); @@ -184,7 +184,7 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Commande($this->savdb); + $localobject=new Commande($db); $localobject->fetch(1); $result=$localobject->fetch_thirdparty(); diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index afdc040493e..05f0abd136d 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -138,7 +138,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new CompanyBankAccount($this->savdb); + $localobject=new CompanyBankAccount($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -164,7 +164,7 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new CompanyBankAccount($this->savdb); + $localobject=new CompanyBankAccount($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; $this->assertLessThan($result, 0); diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index e3f76ad57d0..c28db01d579 100644 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -145,7 +145,7 @@ class ContactTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Contact($this->savdb); + $localobject=new Contact($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -171,7 +171,7 @@ class ContactTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Contact($this->savdb); + $localobject=new Contact($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -228,7 +228,7 @@ class ContactTest extends PHPUnit\Framework\TestCase print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Contact::update_note (public) error'); - $newobject=new Contact($this->savdb); + $newobject=new Contact($db); $result=$newobject->fetch($localobject->id); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Contact::fetch error'); @@ -322,7 +322,7 @@ class ContactTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Contact($this->savdb); + $localobject=new Contact($db); $result=$localobject->fetch($id); $result=$localobject->delete(0); diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index e834255ab9a..17d302fcf82 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -137,7 +137,7 @@ class ContratTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Contrat($this->savdb); + $localobject=new Contrat($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -164,7 +164,7 @@ class ContratTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Contrat($this->savdb); + $localobject=new Contrat($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -219,7 +219,7 @@ class ContratTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Contrat($this->savdb); + $localobject=new Contrat($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php index ec761a14316..b7e4297f490 100644 --- a/test/phpunit/DiscountTest.php +++ b/test/phpunit/DiscountTest.php @@ -138,7 +138,7 @@ class DiscountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new DiscountAbsolute($this->savdb); + $localobject=new DiscountAbsolute($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -164,7 +164,7 @@ class DiscountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new DiscountAbsolute($this->savdb); + $localobject=new DiscountAbsolute($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -189,7 +189,7 @@ class DiscountTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new DiscountAbsolute($this->savdb); + $localobject=new DiscountAbsolute($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/EmailCollectorTest.php b/test/phpunit/EmailCollectorTest.php index 08652ffd2be..8ad06dc1f23 100644 --- a/test/phpunit/EmailCollectorTest.php +++ b/test/phpunit/EmailCollectorTest.php @@ -175,7 +175,7 @@ class EmailCollectorTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new EmailCollector($this->savdb); + $localobject=new EmailCollector($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -224,7 +224,7 @@ class EmailCollectorTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new EmailCollector($this->savdb); + $localobject=new EmailCollector($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index d3cdd2d52d4..9bf237374ef 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -143,7 +143,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Entrepot($this->savdb); + $localobject=new Entrepot($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -170,7 +170,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Entrepot($this->savdb); + $localobject=new Entrepot($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -243,7 +243,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Entrepot($this->savdb); + $localobject=new Entrepot($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index 6b2bb319385..689c88d1313 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -184,7 +184,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new ExpenseReport($this->savdb); + $localobject=new ExpenseReport($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -305,7 +305,7 @@ class ExpenseReportTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new ExpenseReport($this->savdb); + $localobject=new ExpenseReport($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index e6ec6683253..4b0c41d5f82 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -138,7 +138,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new FactureFournisseur($this->savdb); + $localobject=new FactureFournisseur($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -164,7 +164,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new FactureFournisseur($this->savdb); + $localobject=new FactureFournisseur($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0, $localobject->errorsToString()); @@ -267,7 +267,7 @@ class FactureFournisseurTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new FactureFournisseur($this->savdb); + $localobject=new FactureFournisseur($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 5d7c99813e2..d5d9a164daa 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -140,13 +140,13 @@ class FactureRecTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobjectinv=new Facture($this->savdb); + $localobjectinv=new Facture($db); $localobjectinv->initAsSpecimen(); $result = $localobjectinv->create($user); print __METHOD__." result=".$result."\n"; - $localobject=new FactureRec($this->savdb); + $localobject=new FactureRec($db); $localobject->initAsSpecimen(); $result = $localobject->create($user, $localobjectinv->id); @@ -173,7 +173,7 @@ class FactureRecTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new FactureRec($this->savdb); + $localobject=new FactureRec($db); $result = $localobject->fetch($id); print __METHOD__." result=".$result."\n"; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 6f1dacf0aab..004fc18725e 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -147,7 +147,7 @@ class FactureTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); $this->assertLessThan($result, 0); @@ -172,7 +172,7 @@ class FactureTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -228,7 +228,7 @@ class FactureTest extends PHPUnit\Framework\TestCase $this->assertLessThan($result, 0); // Test everything are still same than specimen - $newlocalobject=new Facture($this->savdb); + $newlocalobject=new Facture($db); $newlocalobject->initAsSpecimen(); $this->changeProperties($newlocalobject); @@ -308,11 +308,11 @@ class FactureTest extends PHPUnit\Framework\TestCase unset($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED); unset($conf->global->INVOICE_CAN_NEVER_BE_REMOVED); - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $result=$localobject->fetch($id); // Create another invoice and validate it after $localobject - $localobject2=new Facture($this->savdb); + $localobject2=new Facture($db); $result=$localobject2->initAsSpecimen(); $result=$localobject2->create($user); $result=$localobject2->validate($user); diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index 822311cb0e9..d5d502d0697 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -143,7 +143,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=0; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->lines=array(); unset($localobject->total_ht); @@ -156,7 +156,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase $localobject->addline('Description '.$i, 1.24, 1, 10); } - $newlocalobject=new Facture($this->savdb); + $newlocalobject=new Facture($db); $newlocalobject->fetch($result); //var_dump($newlocalobject); @@ -185,7 +185,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=0; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->lines=array(); unset($localobject->total_ht); @@ -198,7 +198,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase $localobject->addline('Description '.$i, 1.24, 1, 10); } - $newlocalobject=new Facture($this->savdb); + $newlocalobject=new Facture($db); $newlocalobject->fetch($result); //var_dump($newlocalobject); @@ -225,7 +225,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 0 $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=0; - $localobject1a=new Facture($this->savdb); + $localobject1a=new Facture($db); $localobject1a->initAsSpecimen('nolines'); $facid=$localobject1a->create($user); $localobject1a->addline('Line 1', 6.36, 15, 21); // This include update_price @@ -237,7 +237,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1 $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=1; - $localobject1b=new Facture($this->savdb); + $localobject1b=new Facture($db); $localobject1b->initAsSpecimen('nolines'); $facid=$localobject1b->create($user); $localobject1b->addline('Line 1', 6.36, 15, 21); // This include update_price @@ -266,7 +266,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 0 $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=0; - $localobject2=new Facture($this->savdb); + $localobject2=new Facture($db); $localobject2->initAsSpecimen('nolines'); $facid=$localobject2->create($user); $localobject2->addline('Line 1', 6.36, 5, 21); @@ -280,7 +280,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1 $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=1; - $localobject2=new Facture($this->savdb); + $localobject2=new Facture($db); $localobject2->initAsSpecimen('nolines'); $facid=$localobject2->create($user); $localobject2->addline('Line 1', 6.36, 5, 21); @@ -311,7 +311,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 0 $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=0; - $localobject3=new Facture($this->savdb); + $localobject3=new Facture($db); $localobject3->initAsSpecimen('nolines'); $facid=$localobject3->create($user); $localobject3->addline('Line 1', 6.36, 3, 21); @@ -327,7 +327,7 @@ class FactureTestRounding extends PHPUnit\Framework\TestCase // With option MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND = 1 $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=1; - $localobject3=new Facture($this->savdb); + $localobject3=new Facture($db); $localobject3->initAsSpecimen('nolines'); $facid=$localobject3->create($user); $localobject3->addline('Line 1', 6.36, 3, 21); diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index 58c750c7b86..8fb2ee736cc 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -137,7 +137,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Fichinter($this->savdb); + $localobject=new Fichinter($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -164,7 +164,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Fichinter($this->savdb); + $localobject=new Fichinter($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -243,7 +243,7 @@ class FichinterTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Fichinter($this->savdb); + $localobject=new Fichinter($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/FormAdminTest.php b/test/phpunit/FormAdminTest.php index 7b492a4d8ec..e9beea8a5c6 100644 --- a/test/phpunit/FormAdminTest.php +++ b/test/phpunit/FormAdminTest.php @@ -138,7 +138,7 @@ class FormAdminTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new FormAdmin($this->savdb); + $localobject=new FormAdmin($db); $result=$localobject->select_paper_format('', 'paperformat_id', 'A4', 0, 1); $this->assertEquals($result, ''); diff --git a/test/phpunit/FormTest.php b/test/phpunit/FormTest.php index 41f79ffb749..429ae296152 100644 --- a/test/phpunit/FormTest.php +++ b/test/phpunit/FormTest.php @@ -138,7 +138,7 @@ class FormTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Form($this->savdb); + $localobject=new Form($db); $result=$localobject->select_produits_list('', 'productid', '', 5, 0, '', 1, 2, 1); $this->assertEquals(count($result), 5); diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index c361698a501..dd31bf74868 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -205,18 +205,20 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase */ public function testDolClone() { - $newproduct1 = new Product($this->savdb); + global $db; - print __METHOD__." this->savdb has type ".(is_resource($this->savdb->db) ? get_resource_type($this->savdb->db) : (is_object($this->savdb->db) ? 'object' : 'unknown'))."\n"; + $newproduct1 = new Product($db); + + print __METHOD__." this->savdb has type ".(is_resource($db->db) ? get_resource_type($db->db) : (is_object($db->db) ? 'object' : 'unknown'))."\n"; print __METHOD__." newproduct1->db->db has type ".(is_resource($newproduct1->db->db) ? get_resource_type($newproduct1->db->db) : (is_object($newproduct1->db->db) ? 'object' : 'unknown'))."\n"; - $this->assertEquals($this->savdb->connected, 1, 'Savdb is connected'); + $this->assertEquals($db->connected, 1, 'Savdb is connected'); $this->assertNotNull($newproduct1->db->db, 'newproduct1->db is not null'); $newproductcloned1 = dol_clone($newproduct1); - print __METHOD__." this->savdb has type ".(is_resource($this->savdb->db) ? get_resource_type($this->savdb->db) : (is_object($this->savdb->db) ? 'object' : 'unknown'))."\n"; + print __METHOD__." this->savdb has type ".(is_resource($db->db) ? get_resource_type($db->db) : (is_object($db->db) ? 'object' : 'unknown'))."\n"; print __METHOD__." newproduct1->db->db has type ".(is_resource($newproduct1->db->db) ? get_resource_type($newproduct1->db->db) : (is_object($newproduct1->db->db) ? 'object' : 'unknown'))."\n"; - $this->assertEquals($this->savdb->connected, 1, 'Savdb is connected'); + $this->assertEquals($db->connected, 1, 'Savdb is connected'); $this->assertNotNull($newproduct1->db->db, 'newproduct1->db is not null'); $newproductcloned2 = dol_clone($newproduct1, 2); diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index 8e2e8aaaf8b..d6ebd6425e4 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -140,7 +140,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Holiday($this->savdb); + $localobject=new Holiday($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -166,7 +166,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Holiday($this->savdb); + $localobject=new Holiday($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -224,7 +224,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase $this->assertLessThan($result, 0, 'Holiday::update_note (public) error'); - $newobject=new Holiday($this->savdb); + $newobject=new Holiday($db); $result=$newobject->fetch($localobject->id); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Holiday::fetch error'); @@ -286,7 +286,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Holiday($this->savdb); + $localobject=new Holiday($db); $result=$localobject->fetch($id); $result=$localobject->delete(0); @@ -310,7 +310,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase $db=$this->savdb; // Create a leave request the 1st morning only - $localobjecta=new Holiday($this->savdb); + $localobjecta=new Holiday($db); $localobjecta->initAsSpecimen(); $localobjecta->date_debut = dol_mktime(0, 0, 0, 1, 1, 2020); $localobjecta->date_fin = dol_mktime(0, 0, 0, 1, 1, 2020); @@ -318,7 +318,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase $result=$localobjecta->create($user); // Create a leave request the 2 afternoon only - $localobjectb=new Holiday($this->savdb); + $localobjectb=new Holiday($db); $localobjectb->initAsSpecimen(); $localobjectb->date_debut = dol_mktime(0, 0, 0, 1, 2, 2020); $localobjectb->date_fin = dol_mktime(0, 0, 0, 1, 2, 2020); @@ -328,7 +328,7 @@ class HolidayTest extends PHPUnit\Framework\TestCase $date_debut = dol_mktime(0, 0, 0, 1, 1, 2020); $date_fin = dol_mktime(0, 0, 0, 1, 2, 2020); - $localobjectc=new Holiday($this->savdb); + $localobjectc=new Holiday($db); $result=$localobjectc->verifDateHolidayCP($user->id, $date_debut, $date_debut, 0); $this->assertFalse($result, 'result should be false, there is overlapping, full day is not available.'); @@ -362,7 +362,9 @@ class HolidayTest extends PHPUnit\Framework\TestCase */ public function testUpdateBalance() { - $localobjecta=new Holiday($this->savdb); + global $db; + + $localobjecta=new Holiday($db); $localobjecta->updateConfCP('lastUpdate', '20100101120000'); $result = $localobjecta->updateBalance(); diff --git a/test/phpunit/InventoryTest.php b/test/phpunit/InventoryTest.php index a879c91b70e..c4b415885d3 100644 --- a/test/phpunit/InventoryTest.php +++ b/test/phpunit/InventoryTest.php @@ -165,7 +165,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Inventory($this->savdb); + $localobject=new Inventory($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -337,7 +337,7 @@ class InventoryTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Inventory($this->savdb); + $localobject=new Inventory($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); print __METHOD__." id=".$id." result=".$result."\n"; diff --git a/test/phpunit/KnowledgeRecordTest.php b/test/phpunit/KnowledgeRecordTest.php index d071ea7b024..8dab9846435 100644 --- a/test/phpunit/KnowledgeRecordTest.php +++ b/test/phpunit/KnowledgeRecordTest.php @@ -144,7 +144,7 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase $langs = $this->savlangs; $db = $this->savdb; - $localobject = new KnowledgeRecord($this->savdb); + $localobject = new KnowledgeRecord($db); $localobject->initAsSpecimen(); $result = $localobject->create($user); @@ -171,7 +171,7 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new KnowledgeRecord($this->savdb); + $localobject=new KnowledgeRecord($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -221,7 +221,7 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase $langs = $this->savlangs; $db = $this->savdb; - $localobject = new KnowledgeRecord($this->savdb); + $localobject = new KnowledgeRecord($db); print __METHOD__." id=".$id."\n"; $result = $localobject->fetch($id); print __METHOD__." result=".$result."\n"; diff --git a/test/phpunit/LoanTest.php b/test/phpunit/LoanTest.php index 58f4b6f0041..2eaaa221183 100644 --- a/test/phpunit/LoanTest.php +++ b/test/phpunit/LoanTest.php @@ -138,7 +138,7 @@ class LoanTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Loan($this->savdb); + $localobject=new Loan($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -164,7 +164,7 @@ class LoanTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Loan($this->savdb); + $localobject=new Loan($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -213,7 +213,7 @@ class LoanTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Loan($this->savdb); + $localobject=new Loan($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index da3afc0d070..68eacd466bf 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -186,7 +186,7 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase $warehouse2->description.=' phpunit 2'; $warehouse2id=$warehouse2->create($user); - $localobject=new MouvementStock($this->savdb); + $localobject=new MouvementStock($db); $datetest1 = dol_mktime(0, 0, 0, 1, 1, 2000); $datetest2 = dol_mktime(0, 0, 0, 1, 2, 2000); diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index e5d31df1cf7..9134ad3e0d5 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -150,7 +150,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_REPLACEMENT='{yyyy}-{0000}'; $conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED=0; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -168,7 +168,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." is_erasable=".$result."\n"; $this->assertGreaterThanOrEqual(1, $result, 'Test for is_erasable, 1st invoice'); // Can be deleted - $localobject2=new Facture($this->savdb); + $localobject2=new Facture($db); $localobject2->initAsSpecimen(); $localobject2->fetch_thirdparty(); @@ -196,7 +196,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000@1}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000@1}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -208,7 +208,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('1910-0001', $result, 'Test for {yyyy}-{0000@1} 1st invoice'); // counter must start to 1 - $localobject2=new Facture($this->savdb); + $localobject2=new Facture($db); $localobject2->initAsSpecimen(); $localobject2->fetch_thirdparty(); @@ -218,7 +218,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('1910-0002', $result, 'Test for {yyyy}-{0000@1} 2nd invoice, same day'); // counter must be now 2 - $localobject3=new Facture($this->savdb); + $localobject3=new Facture($db); $localobject3->initAsSpecimen(); $localobject3->fetch_thirdparty(); @@ -232,7 +232,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@1}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@1}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -247,7 +247,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." is_erasable=".$result."\n"; $this->assertGreaterThanOrEqual(1, $result); // Can be deleted - $localobject2=new Facture($this->savdb); + $localobject2=new Facture($db); $localobject2->initAsSpecimen(); $localobject2->fetch_thirdparty(); @@ -268,7 +268,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase // Same but we add month before year and use a year on 2 digits $conf->global->FACTURE_MERCURE_MASK_CREDIT='[mm}{yy}-{0000@1}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{mm}{yy}-{0000@1}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1925); // we use year 1925 to be sure to not have existing invoice for this year @@ -282,7 +282,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." is_erasable=".$result."\n"; $this->assertGreaterThanOrEqual(1, $result); // Can be deleted - $localobject2=new Facture($this->savdb); + $localobject2=new Facture($db); $localobject2->initAsSpecimen(); $localobject2->fetch_thirdparty(); $localobject2->date=dol_mktime(12, 0, 0, 1, 1, 1925); // we use same year 1925 for second invoice (and there is a reset required) @@ -299,7 +299,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." is_erasable=".$result."\n"; $this->assertLessThanOrEqual(0, $result); // Case 1 can not be deleted (because there is an invoice 2) - $localobject3=new Facture($this->savdb); + $localobject3=new Facture($db); $localobject3->initAsSpecimen(); $localobject3->fetch_thirdparty(); $localobject3->date=dol_mktime(12, 0, 0, 1, 1, 1926); // we use following year for third invoice (and there is a reset required) @@ -317,7 +317,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@6}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@6}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -335,7 +335,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result for last=".$result."\n"; $this->assertEquals('193001-0001', $result); // last ref into reset range should be same than last created - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -350,7 +350,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('193012-0001', $result); // counter must be reset to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -362,7 +362,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('193101-0002', $result); // counter must be 2 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -378,7 +378,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@0}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@0}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -390,7 +390,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('194001-0001', $result); // counter must start to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -402,7 +402,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('194012-0001', $result); // counter must be reset to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -414,7 +414,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('194101-0002', $result); // counter must be 2 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -430,7 +430,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@=}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@=}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -442,7 +442,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('195001-0001', $result); // counter must start to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -454,7 +454,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('195012-0001', $result); // counter must be reset to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -466,7 +466,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('195101-0002', $result); // counter must be 2 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -482,7 +482,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@-}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@-}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -494,7 +494,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('195901-0001', $result); // counter must start to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -506,7 +506,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('196012-0001', $result); // counter must be reset to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -518,7 +518,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('196001-0002', $result); // counter must be 2 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -534,7 +534,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@+}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@+}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -546,7 +546,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('197001-0001', $result); // counter must start to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -558,7 +558,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('197112-0001', $result); // counter must be reset to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -570,7 +570,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('197101-0002', $result); // counter must be 2 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -585,7 +585,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@99}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@99}'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -597,7 +597,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('198001-0001', $result); // counter must start to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -609,7 +609,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('198001-0002', $result); // counter must start to 2 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -621,7 +621,7 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('198002-0001', $result); // counter must start to 1 - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); @@ -638,11 +638,11 @@ class NumberingModulesTest extends PHPUnit\Framework\TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{t}{yyyy}{mm}-{0000}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{t}{yyyy}{mm}-{0000}'; - $tmpthirdparty=new Societe($this->savdb); + $tmpthirdparty=new Societe($db); $tmpthirdparty->initAsSpecimen(); $tmpthirdparty->typent_code = 'TE_ABC'; - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->fetch_thirdparty(); diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index 595930225c9..238830ac1a0 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -140,7 +140,7 @@ class PdfDocTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localproduct=new Product($this->savdb); + $localproduct=new Product($db); $result = $localproduct->fetch(0, 'PINKDRESS'); if ($result < 0) { print "\n".__METHOD__." Failed to make the fetch of product PINKDRESS. ".$localproduct->error; die(1); @@ -150,10 +150,10 @@ class PdfDocTest extends PHPUnit\Framework\TestCase print "\n".__METHOD__." A product with ref PINKDRESS must exists into database. Create it manually before running the test"; die(1); } - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen(); $localobject->lines=array(); - $localobject->lines[0]=new FactureLigne($this->savdb); + $localobject->lines[0]=new FactureLigne($db); $localobject->lines[0]->fk_product=$product_id; $localobject->lines[0]->label='Label 1'; $localobject->lines[0]->desc="This is a description with a é accent\n(Country of origin: France)"; diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 7d88fa69897..cab19d715f5 100644 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -324,14 +324,14 @@ class PricesTest extends PHPUnit\Framework\TestCase $conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND=0; // Two lines of 1.24 give 2.48 HT and 2.72 TTC with standard vat rounding mode - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen('nolines'); $invoiceid=$localobject->create($user); $localobject->addline('Desc', 1.24, 1, 10, 0, 0, 0, 0, '', '', 0, 0, 0, 'HT'); $localobject->addline('Desc', 1.24, 1, 10, 0, 0, 0, 0, '', '', 0, 0, 0, 'HT'); - $newlocalobject=new Facture($this->savdb); + $newlocalobject=new Facture($db); $newlocalobject->fetch($invoiceid); $this->assertEquals(2.48, $newlocalobject->total_ht, "testUpdatePrice test1"); @@ -340,14 +340,14 @@ class PricesTest extends PHPUnit\Framework\TestCase // Two lines of 1.24 give 2.48 HT and 2.73 TTC with global vat rounding mode - $localobject=new Facture($this->savdb); + $localobject=new Facture($db); $localobject->initAsSpecimen('nolines'); $invoiceid=$localobject->create($user); $localobject->addline('Desc', 1.24, 1, 10, 0, 0, 0, 0, '', '', 0, 0, 0, 'HT'); $localobject->addline('Desc', 1.24, 1, 10, 0, 0, 0, 0, '', '', 0, 0, 0, 'HT'); - $newlocalobject=new Facture($this->savdb); + $newlocalobject=new Facture($db); $newlocalobject->fetch($invoiceid); $this->assertEquals(2.48, $newlocalobject->total_ht, "testUpdatePrice test4"); diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 93a5e4787ba..4f237a90314 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -143,7 +143,7 @@ class ProductTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Product($this->savdb); + $localobject=new Product($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -170,7 +170,7 @@ class ProductTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Product($this->savdb); + $localobject=new Product($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -243,7 +243,7 @@ class ProductTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Product($this->savdb); + $localobject=new Product($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/ProjectTest.php b/test/phpunit/ProjectTest.php index f49fd5857e2..ee2f4ed92c2 100644 --- a/test/phpunit/ProjectTest.php +++ b/test/phpunit/ProjectTest.php @@ -139,7 +139,7 @@ class ProjectTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Project($this->savdb); + $localobject=new Project($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -165,7 +165,7 @@ class ProjectTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Project($this->savdb); + $localobject=new Project($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -238,7 +238,7 @@ class ProjectTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Project($this->savdb); + $localobject=new Project($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 493d99257a6..833812bfb4b 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -138,7 +138,7 @@ class PropalTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Propal($this->savdb); + $localobject=new Propal($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -164,7 +164,7 @@ class PropalTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Propal($this->savdb); + $localobject=new Propal($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -292,7 +292,7 @@ class PropalTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Propal($this->savdb); + $localobject=new Propal($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index ff24614e090..415212c64cb 100644 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -152,7 +152,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Societe($this->savdb); + $localobject=new Societe($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -179,7 +179,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Societe($this->savdb); + $localobject=new Societe($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -237,7 +237,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Holiday::update_note (public) error'); - $newobject=new Societe($this->savdb); + $newobject=new Societe($db); $result=$newobject->fetch($localobject->id); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -395,7 +395,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Societe($this->savdb); + $localobject=new Societe($db); $localobject->fetch($id); $result=$localobject->getOutstandingBills(); @@ -424,7 +424,7 @@ class SocieteTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Societe($this->savdb); + $localobject=new Societe($db); $result=$localobject->fetch($id); $result=$localobject->delete($id, $user); diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index 11bd6c1e598..81917e34d9e 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -150,7 +150,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new SupplierProposal($this->savdb); + $localobject=new SupplierProposal($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -176,7 +176,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new SupplierProposal($this->savdb); + $localobject=new SupplierProposal($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -286,7 +286,7 @@ class SupplierProposalTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new SupplierProposal($this->savdb); + $localobject=new SupplierProposal($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/TargetTest.php b/test/phpunit/TargetTest.php index b2a42003bad..3a96ceba3b2 100644 --- a/test/phpunit/TargetTest.php +++ b/test/phpunit/TargetTest.php @@ -141,7 +141,7 @@ class TargetTest extends PHPUnit\Framework\TestCase $langs = $this->savlangs; $db = $this->savdb; - $localobject = new Target($this->savdb); + $localobject = new Target($db); $localobject->initAsSpecimen(); $result = $localobject->create($user); @@ -168,7 +168,7 @@ class TargetTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Target($this->savdb); + $localobject=new Target($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -218,7 +218,7 @@ class TargetTest extends PHPUnit\Framework\TestCase $langs = $this->savlangs; $db = $this->savdb; - $localobject = new Target($this->savdb); + $localobject = new Target($db); $result = $localobject->fetch($id); $result = $localobject->delete($user); diff --git a/test/phpunit/TicketTest.php b/test/phpunit/TicketTest.php index 09745d86e8e..5d05f7839f4 100644 --- a/test/phpunit/TicketTest.php +++ b/test/phpunit/TicketTest.php @@ -139,7 +139,7 @@ class TicketTest extends PHPUnit\Framework\TestCase $db=$this->savdb; // Try to create one with bad values - $localobject=new Ticket($this->savdb); + $localobject=new Ticket($db); $localobject->initAsSpecimen(); $localobject->ref = ''; $result=$localobject->create($user); @@ -148,7 +148,7 @@ class TicketTest extends PHPUnit\Framework\TestCase $this->assertEquals(-3, $result, $localobject->error.join(',', $localobject->errors)); // Try to create one with correct values - $localobject=new Ticket($this->savdb); + $localobject=new Ticket($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -175,7 +175,7 @@ class TicketTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Ticket($this->savdb); + $localobject=new Ticket($db); $result=$localobject->fetch($id); print __METHOD__." id=".$id." result=".$result."\n"; @@ -382,7 +382,7 @@ class TicketTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Ticket($this->savdb); + $localobject=new Ticket($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index b20bccb9b24..8ca21384002 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -138,7 +138,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new UserGroup($this->savdb); + $localobject=new UserGroup($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -163,7 +163,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new UserGroup($this->savdb); + $localobject=new UserGroup($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -280,7 +280,7 @@ class UserGroupTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new UserGroup($this->savdb); + $localobject=new UserGroup($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 9963007af15..625c4df7ef7 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -145,7 +145,7 @@ class UserTest extends PHPUnit\Framework\TestCase print __METHOD__." USER_PASSWORD_GENERATED=".getDolGlobalString('USER_PASSWORD_GENERATED')."\n"; - $localobject=new User($this->savdb); + $localobject=new User($db); $localobject->initAsSpecimen(); $result=$localobject->create($user); @@ -170,7 +170,7 @@ class UserTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new User($this->savdb); + $localobject=new User($db); $result=$localobject->fetch($id); $this->assertLessThan($result, 0); @@ -201,7 +201,7 @@ class UserTest extends PHPUnit\Framework\TestCase $this->assertLessThan($result, 0); // Test everything are still same than specimen - $newlocalobject=new User($this->savdb); + $newlocalobject=new User($db); $newlocalobject->initAsSpecimen(); $this->changeProperties($newlocalobject); $this->assertEquals($this->objCompare($localobject, $newlocalobject, true, array('id','socid','societe_id','specimen','note','ref','pass','pass_indatabase','pass_indatabase_crypted','pass_temp','datec','datem','datelastlogin','datepreviouslogin','flagdelsessionsbefore','iplastlogin','ippreviouslogin','trackid')), array()); // Actual, Expected @@ -418,7 +418,7 @@ class UserTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new User($this->savdb); + $localobject=new User($db); $result=$localobject->fetch($id); $result=$localobject->delete($user); @@ -443,7 +443,7 @@ class UserTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new User($this->savdb); + $localobject=new User($db); $result=$localobject->fetch(1); // Other tests use the user id 1 $result=$localobject->addrights(0, 'supplier_proposal'); diff --git a/test/phpunit/UtilsTest.php b/test/phpunit/UtilsTest.php index 94679546350..5c34df81ea4 100644 --- a/test/phpunit/UtilsTest.php +++ b/test/phpunit/UtilsTest.php @@ -139,14 +139,14 @@ class UtilsTest extends PHPUnit\Framework\TestCase $langs=$this->savlangs; $db=$this->savdb; - $localobject=new Utils($this->savdb); + $localobject=new Utils($db); $result = $localobject->executeCLI('ls', $conf->admin->dir_temp.'/out.tmp', 1); print var_export($result, true); $this->assertEquals($result['result'], 0); $this->assertEquals($result['error'], ''); //$this->assertEquals(preg_match('/phpunit/', $result['output']), 1); - $localobject=new Utils($this->savdb); + $localobject=new Utils($db); $result = $localobject->executeCLI('ls', $conf->admin->dir_temp.'/out.tmp', 2); print var_export($result, true); $this->assertEquals($result['result'], 0); From 40212eb1fa5d7e65210ce98f7a68baaaea5c081c Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 26 Apr 2023 16:54:31 +0200 Subject: [PATCH 052/156] FIX - init menu auguria isModEnabled --- htdocs/core/menus/init_menu_auguria.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index d77ed72c8db..4507a5b6607 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -12,7 +12,7 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__; -- Top-Menu -- old: (module, enabled, rowid, ...) insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 1__+MAX_llx_menu__, '', '1', __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '(isModEnabled("societe") && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || isModeEnabled('supplier_order') || isModEnabled('supplier_invoice')))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '(isModEnabled("societe") && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); From f99da75a9f79ab30ee3ab8c383d94fc1e4f1399b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 17:40:36 +0200 Subject: [PATCH 053/156] Fix use ref instead of empty field in unstructured data sepa field --- htdocs/admin/paymentbybanktransfer.php | 2 +- .../prelevement/class/bonprelevement.class.php | 16 ++++++++-------- htdocs/compta/prelevement/create.php | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index f86f6d5c27f..7893b271d06 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -188,7 +188,7 @@ print ''; //USTRD print ''; print ''; +print ''; print ''; */ diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 3c2fb078746..79c7484aa06 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -868,7 +868,7 @@ class BonPrelevement extends CommonObject $error = 0; $datetimeprev = dol_now('gmt'); - //Choice the date of the execution direct debit + // Choice the date of the execution direct debit if (!empty($executiondate)) { $datetimeprev = $executiondate; } @@ -1539,7 +1539,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT soc.rowid as socid, soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql .= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; - $sql .= " f.ref as fac, pf.fk_facture as idfac,"; + $sql .= " f.ref as reffac, pf.fk_facture as idfac,"; $sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum"; $sql .= " FROM"; $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; @@ -1575,7 +1575,7 @@ class BonPrelevement extends CommonObject $cachearraytotestduplicate[$obj->idfac] = $obj->rowid; $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); $this->total = $this->total + $obj->somme; $i++; } @@ -1655,7 +1655,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT soc.rowid as socid, soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql .= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; - $sql .= " f.ref as fac, pf.fk_facture_fourn as idfac, f.ref_supplier as fac_ref_supplier,"; + $sql .= " f.ref as reffac, pf.fk_facture_fourn as idfac, f.ref_supplier as fac_ref_supplier,"; $sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum"; $sql .= " FROM"; $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; @@ -1691,7 +1691,7 @@ class BonPrelevement extends CommonObject $cachearraytotestduplicate[$obj->idfac] = $obj->rowid; $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); - $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac_ref_supplier, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); + $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); $this->total = $this->total + $obj->somme; $i++; } @@ -1922,7 +1922,7 @@ class BonPrelevement extends CommonObject * @param string $row_cg pl.code_guichet AS cg, Not used for SEPA * @param string $row_cc pl.number AS cc, Not used for SEPA * @param string $row_somme pl.amount AS somme, - * @param string $row_ref f.ref + * @param string $row_ref Invoice ref (f.ref) * @param string $row_idfac pf.fk_facture AS idfac, * @param string $row_iban rib.iban_prefix AS iban, * @param string $row_bic rib.bic AS bic, @@ -1992,7 +1992,7 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; // A string with some information on payment - 140 max - $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_USTRD != "") ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135, 'right', 'UTF-8', 1)).''.$CrLf; // 140 max + $XML_DEBITOR .= ' '.getDolGlobalString('PRELEVEMENT_USTRD', dol_trunc($row_ref, 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstuctured data - 140 max $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; return $XML_DEBITOR; @@ -2061,7 +2061,7 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; // A string with some information on payment - 140 max - $XML_CREDITOR .= ' '.(($conf->global->PRELEVEMENT_USTRD != "") ? $conf->global->PRELEVEMENT_USTRD : dol_trunc($row_ref, 135, 'right', 'UTF-8', 1)).''.$CrLf; // 140 max + $XML_CREDITOR .= ' '.getDolGlobalString('CREDITTRANSFER_USTRD', dol_trunc($row_ref, 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstructured data - 140 max $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; return $XML_CREDITOR; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 39c48e0767e..b6099b6fddf 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -96,7 +96,7 @@ if (empty($reshook)) { // Change customer bank information to withdraw if ($action == 'modify') { for ($i = 1; $i < 9; $i++) { - dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, GETPOST("nom".$i), GETPOST("value".$i), 'chaine', 0, '', $conf->entity); } } if ($action == 'create') { @@ -104,7 +104,7 @@ if (empty($reshook)) { //var_dump($default_account);var_dump($conf->global->$default_account);var_dump($id_bankaccount);exit; - if ($id_bankaccount != $conf->global->$default_account) { + if ($id_bankaccount != getDolGlobalInt($default_account)) { $res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); // Set as default } From 871610d4a15729a91e64939e07725f99a5985dc6 Mon Sep 17 00:00:00 2001 From: Florent Poinsaut Date: Wed, 26 Apr 2023 17:41:35 +0200 Subject: [PATCH 054/156] Fix notification templates --- htdocs/core/class/notify.class.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 5e12a30ba0e..7511d4ada7b 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -478,35 +478,30 @@ class Notify $link = ''.$newref.''; $dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice'); $object_type = 'facture'; - $labeltouse = $conf->global->BILL_VALIDATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $link); break; case 'BILL_PAYED': $link = ''.$newref.''; $dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice'); $object_type = 'facture'; - $labeltouse = $conf->global->BILL_PAYED_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $link); break; case 'ORDER_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->commande->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'commande'); $object_type = 'order'; - $labeltouse = $conf->global->ORDER_VALIDATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $link); break; case 'PROPAL_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal'); $object_type = 'propal'; - $labeltouse = $conf->global->PROPAL_VALIDATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $link); break; case 'PROPAL_CLOSE_SIGNED': $link = ''.$newref.''; $dir_output = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal'); $object_type = 'propal'; - $labeltouse = $conf->global->PROPAL_CLOSE_SIGNED_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $link); break; case 'FICHINTER_ADD_CONTACT': @@ -549,49 +544,42 @@ class Notify $link = ''.$newref.''; $dir_output = $conf->expedition->dir_output."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment'); $object_type = 'shipping'; - $labeltouse = $conf->global->SHIPPING_VALIDATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link); break; case 'EXPENSE_REPORT_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $labeltouse = $conf->global->EXPENSE_REPORT_VALIDATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $link); break; case 'EXPENSE_REPORT_APPROVE': $link = ''.$newref.''; $dir_output = $conf->expensereport->dir_output; $object_type = 'expensereport'; - $labeltouse = $conf->global->EXPENSE_REPORT_APPROVE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $link); break; case 'HOLIDAY_VALIDATE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $labeltouse = $conf->global->HOLIDAY_VALIDATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $link); break; case 'HOLIDAY_APPROVE': $link = ''.$newref.''; $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; - $labeltouse = $conf->global->HOLIDAY_APPROVE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link); break; case 'ACTION_CREATE': $link = ''.$newref.''; $dir_output = $conf->agenda->dir_output; $object_type = 'action'; - $labeltouse = $conf->global->ACTION_CREATE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextActionAdded", $link); break; default: $object_type = $object->element; $dir_output = $conf->$object_type->multidir_output[$object->entity ? $object->entity : $conf->entity]."/".get_exdir(0, 0, 0, 1, $object, $object_type); $template = $notifcode.'_TEMPLATE'; - $labeltouse = $conf->global->$template; $mesg = $outputlangs->transnoentitiesnoconv('Notify_'.$notifcode).' '.$newref.' '.$dir_output; break; } @@ -600,6 +588,8 @@ class Notify $formmail = new FormMail($this->db); $arraydefaultmessage = null; + $template = $notifcode.'_TEMPLATE'; + $labeltouse = $conf->global->$template; if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($this->db, $object_type.'_send', $user, $outputlangs, 0, 1, $labeltouse); if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); From a3bd4a8cfd30927b9574a51d5343ce72f64f1008 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 26 Apr 2023 17:48:09 +0200 Subject: [PATCH 055/156] fix: cron sendEmailsRemindersOnInvoiceDueDate if contact exists and email exists the is an error --- htdocs/compta/facture/class/facture.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index af8caa73b12..6e61a62b9d0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5550,7 +5550,8 @@ class Facture extends CommonInvoice } if (empty($to) && !empty($recipient->email)) { $to[] = $recipient->email; - } else { + } + if (empty($to)) { $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for user."; $error++; } From 0d830aef89208022d5972702ec69c55e080ff65c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 26 Apr 2023 17:50:59 +0200 Subject: [PATCH 056/156] fix: cron sendEmailsRemindersOnInvoiceDueDate if contact exists and mail on thridparty exists there is an error --- htdocs/compta/facture/class/facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6e61a62b9d0..fbb86a4a29f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5552,7 +5552,7 @@ class Facture extends CommonInvoice $to[] = $recipient->email; } if (empty($to)) { - $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for user."; + $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for invoice or customer."; $error++; } } else { From 9c4dc9a3d60457c3e10cd8954678cdadc0b40527 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 18:04:51 +0200 Subject: [PATCH 057/156] Add more date in ustrd field for credit transfer SEPA files --- .../prelevement/class/bonprelevement.class.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 79c7484aa06..dbae962cd2f 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1575,7 +1575,9 @@ class BonPrelevement extends CommonObject $cachearraytotestduplicate[$obj->idfac] = $obj->rowid; $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); + $this->total = $this->total + $obj->somme; $i++; } @@ -1691,7 +1693,9 @@ class BonPrelevement extends CommonObject $cachearraytotestduplicate[$obj->idfac] = $obj->rowid; $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); - $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); + + $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->reffac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type, $obj->fac_ref_supplier); + $this->total = $this->total + $obj->somme; $i++; } @@ -1910,7 +1914,7 @@ class BonPrelevement extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Write recipient of request (customer) + * Write recipient (thirdparty concerned by request) * * @param string $row_code_client soc.code_client as code, * @param string $row_nom pl.client_nom AS name, @@ -1930,10 +1934,11 @@ class BonPrelevement extends CommonObject * @param string $row_drum rib.rowid used to generate rum * @param string $row_rum rib.rum Rum defined on company bank account * @param string $type 'direct-debit' or 'bank-transfer' + * @param string $row_comment A free text string for the Unstructured data field * @return string Return string with SEPA part DrctDbtTxInf * @see EnregDestinataire() */ - public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum, $type = 'direct-debit') + public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum, $type = 'direct-debit', $row_comment = '') { // phpcs:enable global $conf; @@ -1992,7 +1997,7 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; // A string with some information on payment - 140 max - $XML_DEBITOR .= ' '.getDolGlobalString('PRELEVEMENT_USTRD', dol_trunc($row_ref, 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstuctured data - 140 max + $XML_DEBITOR .= ' '.getDolGlobalString('PRELEVEMENT_USTRD', dol_trunc($row_ref.($row_comment ? ' - '.$row_comment : ''), 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstuctured data - 140 max $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; return $XML_DEBITOR; @@ -2061,7 +2066,7 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; // A string with some information on payment - 140 max - $XML_CREDITOR .= ' '.getDolGlobalString('CREDITTRANSFER_USTRD', dol_trunc($row_ref, 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstructured data - 140 max + $XML_CREDITOR .= ' '.getDolGlobalString('CREDITTRANSFER_USTRD', dol_trunc($row_ref.($row_comment ? ' - '.$row_comment : ''), 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstructured data - 140 max $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; return $XML_CREDITOR; From f45c4dc867b790a8ef97115da4c3d19feaca5613 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 18:13:23 +0200 Subject: [PATCH 058/156] Fix invalid char into ustrd sepa field --- htdocs/compta/prelevement/class/bonprelevement.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index dbae962cd2f..022bb3f6c03 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1997,7 +1997,7 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; // A string with some information on payment - 140 max - $XML_DEBITOR .= ' '.getDolGlobalString('PRELEVEMENT_USTRD', dol_trunc($row_ref.($row_comment ? ' - '.$row_comment : ''), 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstuctured data - 140 max + $XML_DEBITOR .= ' '.getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), ''), 135, 'right', 'UTF-8', 1))).''.$CrLf; // Free unstuctured data - 140 max $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; return $XML_DEBITOR; @@ -2066,7 +2066,7 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; // A string with some information on payment - 140 max - $XML_CREDITOR .= ' '.getDolGlobalString('CREDITTRANSFER_USTRD', dol_trunc($row_ref.($row_comment ? ' - '.$row_comment : ''), 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstructured data - 140 max + $XML_CREDITOR .= ' '.getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '')), 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstructured data - 140 max $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; return $XML_CREDITOR; From 86456e299c281df6e8b5864912e51df7e46a10a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 18:25:56 +0200 Subject: [PATCH 059/156] NEW add option keepspace into dol_string_nospecialchar() --- .../prelevement/class/bonprelevement.class.php | 4 ++-- htdocs/core/lib/functions.lib.php | 8 ++++++-- test/phpunit/FunctionsLibTest.php | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 022bb3f6c03..131d55bee63 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1997,7 +1997,7 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; // A string with some information on payment - 140 max - $XML_DEBITOR .= ' '.getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), ''), 135, 'right', 'UTF-8', 1))).''.$CrLf; // Free unstuctured data - 140 max + $XML_DEBITOR .= ' '.getDolGlobalString('PRELEVEMENT_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '', '', '', 1), 135, 'right', 'UTF-8', 1))).''.$CrLf; // Free unstuctured data - 140 max $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; return $XML_DEBITOR; @@ -2066,7 +2066,7 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; // A string with some information on payment - 140 max - $XML_CREDITOR .= ' '.getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '')), 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstructured data - 140 max + $XML_CREDITOR .= ' '.getDolGlobalString('CREDITTRANSFER_USTRD', dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($row_ref.($row_comment ? ' - '.$row_comment : '')), '', '', '', 1)), 135, 'right', 'UTF-8', 1)).''.$CrLf; // Free unstructured data - 140 max $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; return $XML_CREDITOR; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 88fe167b73d..db8ebc57c70 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1447,13 +1447,17 @@ function dol_string_unaccent($str) * @param string $newstr String to replace forbidden chars with * @param array|string $badcharstoreplace Array of forbidden characters to replace. Use '' to keep default list. * @param array|string $badcharstoremove Array of forbidden characters to remove. Use '' to keep default list. + * @param int $keepspaces 1=Do not treat space as a special char to replace or remove * @return string Cleaned string * * @see dol_sanitizeFilename(), dol_string_unaccent(), dol_string_nounprintableascii() */ -function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '', $badcharstoremove = '') +function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '', $badcharstoremove = '', $keepspaces = 0) { - $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°', '$', ';'); // more complete than dol_sanitizeFileName + $forbidden_chars_to_replace = array("'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°', '$', ';'); // more complete than dol_sanitizeFileName + if (empty($keepspaces)) { + $forbidden_chars_to_replace[] = " "; + } $forbidden_chars_to_remove = array(); //$forbidden_chars_to_remove=array("(",")"); diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index c361698a501..bf2ab232ec4 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -673,6 +673,24 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase } + /** + * testDolStringNoSpecial + * + * @return boolean + */ + public function testDolStringNoSpecial() + { + $text="A string with space and special char like ' or ° and more...\n"; + $after=dol_string_nospecial($text, '_', '', '', 0); + $this->assertEquals("A_string_with_space_and_special_char_like___or___and_more...\n", $after, "testDolStringNoSpecial 1"); + + $text="A string with space and special char like ' or ° and more...\n"; + $after=dol_string_nospecial($text, '_', '', '', 1); + $this->assertEquals("A string with space and special char like _ or _ and more...\n", $after, "testDolStringNoSpecial 2"); + + return true; + } + /** * testDolStringNohtmltag * From dbe95db38a382c174ecab429bf6a3d643eb29abf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 18:46:27 +0200 Subject: [PATCH 060/156] Look and feel v18 --- htdocs/admin/company.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 7b2708e1906..7390e2e5fbe 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -404,7 +404,7 @@ print ''; print ''; print '
'; + if ($filterfound) { + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + } + print ''; print $form->select_country($search_country_id, 'search_country_id', '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone'); print ''; print ''; print ''; @@ -1659,20 +1689,32 @@ if ($id > 0) { print ''; - if ($filterfound) { - $searchpicto = $form->showFilterAndCheckAddButtons(0); - print $searchpicto; + + // Action button + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if ($filterfound) { + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + } + print '
'; + // Modify link + if ($canbemodified) { + print ''.img_edit().''; + } + // Delete link + if ($iserasable) { + if ($user->admin) { + print ''.img_delete().''; + } + } + print ''.img_edit().' '; - if ($user->admin) { - print ''.img_delete().''; + // Action button + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + // Modify link + if ($canbemodified) { + print ''.img_edit().''; + } + // Delete link + if ($iserasable) { + if ($user->admin) { + print ''.img_delete().''; + } } - //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ' 
'.$langs->trans("USTRD").''; -print '
'; -print ''."\n"; +print ''."\n"; // Name print ''; print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").'
'; @@ -572,12 +572,14 @@ print '
'; + print '
'; + // IDs of the company (country-specific) print '
'; print ''; -print ''; +print ''; $langs->load("companies"); @@ -688,7 +690,7 @@ print ''; print '
'; print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->trans("CompanyIds").'
'; print ''; -print ''; +print ''; print "\n"; print ''; print "\n"; + $num = $db->num_rows($resql); + while ($objp = $db->fetch_object($resql)) { $checkdepositstatic->id = $objp->rowid; $checkdepositstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid); @@ -152,6 +154,10 @@ if ($resql) { print ''; } + if (empty($num)) { + print ''; + } + print "
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").''.$langs->trans("FiscalYearInformation").'
'; @@ -703,7 +705,7 @@ print load_fiche_titre($langs->trans("TypeOfSaleTaxes"), '', 'object_payment'); print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -733,7 +735,7 @@ print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").''.$langs->trans("VATManagement").' 
"; print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -777,7 +779,7 @@ print "
'.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).''.$langs->trans("Description").''.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).' 
"; print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; @@ -821,7 +823,7 @@ print "
'.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).''.$langs->trans("Description").''.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).' 
"; print '
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; if ($mysoc->useRevenueStamp()) { From d7c654665f415dc8f0444ecc454cd49c8d23f258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 20:56:11 +0200 Subject: [PATCH 061/156] fix display extrafields in tooltip --- htdocs/core/class/commonobject.class.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a101181d7cb..c276f4febc3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -743,6 +743,26 @@ abstract class CommonObject $datas['more_extrafields'] = '
.../...'; break; } + $enabled = 1; + if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) { + $enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); + } + if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) { + $enabled = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); + } + $perms = 1; + if ($perms && isset($extrafields->attributes[$this->table_element]['perms'][$key])) { + $perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); + } + if (empty($enabled)) { + continue; // 0 = Never visible field + } + if (abs($enabled) != 1 && abs($enabled) != 3 && abs($enabled) != 5 && abs($enabled) != 4) { + continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list <> 4 = not visible at the creation + } + if (empty($perms)) { + continue; // 0 = Not visible + } if (!empty($extrafields->attributes[$this->table_element]['langfile'][$key])) { $langs->load($extrafields->attributes[$this->table_element]['langfile'][$key]); } From 56c16379b37e0e65a30012248f6e75e6c5df657c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 21:02:00 +0200 Subject: [PATCH 062/156] Update init_menu_auguria.sql --- htdocs/core/menus/init_menu_auguria.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index a05f49db4f1..c854b370d60 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -14,15 +14,15 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__; -- old: (module, enabled, rowid, ...) insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 1__+MAX_llx_menu__, '', '1', __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '(isModEnabled("societe") && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', 'isModEnabled("product") || isModEnabled("service")', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire || ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire', '', 2, 50, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 13__+MAX_llx_menu__, 'adherent', '$conf->adherent->enabled', __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 19, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 13__+MAX_llx_menu__, 'adherent', 'isModEnabled("adherent")', __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 19, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 15__+MAX_llx_menu__, 'hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->user->user->lire || $user->rights->holiday->read || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__); From 447f992b92a6fdedd4dfe211a3891e778be97445 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 21:07:14 +0200 Subject: [PATCH 063/156] Fix warning --- htdocs/core/class/notify.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 8fd4f493eb3..1b40486adad 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -618,8 +618,10 @@ class Notify $arraydefaultmessage = null; $template = $notifcode.'_TEMPLATE'; - $labeltouse = $conf->global->$template; - if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($this->db, $object_type.'_send', $user, $outputlangs, 0, 1, $labeltouse); + $labeltouse = getDolGlobalString($template); + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($this->db, $object_type.'_send', $user, $outputlangs, 0, 1, $labeltouse); + } if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object); From e52742ab4b26186342673b603b049f3a9a5f8ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 22:05:12 +0200 Subject: [PATCH 064/156] clean code use isModEnabled --- htdocs/core/menus/init_menu_auguria.sql | 598 ++++++++++++------------ 1 file changed, 299 insertions(+), 299 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index c854b370d60..dc02a2c4b5f 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -13,17 +13,17 @@ delete from llx_menu where menu_handler=__HANDLER__ and entity=__ENTITY__; -- Top-Menu -- old: (module, enabled, rowid, ...) insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 1__+MAX_llx_menu__, '', '1', __HANDLER__, 'top', 'home', '', 0, '/index.php?mainmenu=home&leftmenu=', 'Home', -1, '', '', '', 2, 10, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '(isModEnabled("societe") && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', 'isModEnabled("product") || isModEnabled("service")', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire || ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire', '', 2, 50, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '(isModEnabled("societe") && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->hasRight("societe","lire") || $user->hasRight("societe","contact","lire")', '', 2, 20, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', 'isModEnabled("product") || isModEnabled("service")', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->hasRight("service","lire")', '', 0, 30, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', 'isModEnabled("bom") || isModEnabled("mrp")', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->hasRight("bom","read")||$user->hasRight("mrp","read")', '', 0, 31, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->hasRight("projet","lire")', '', 2, 32, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', 'isModEnabled("propal") || isModEnabled("commande") || isModEnabled("supplier_order") || isModEnabled("contrat") || isModEnabled("ficheinter")', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->hasRight("societe","lire") || $user->hasRight("societe","contact","lire")', '', 2, 40, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->hasRight("banque","lire") || ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire', '', 2, 50, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->hasRight("banque","lire") || $user->hasRight("prelevement","bons","lire")', '', 0, 52, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("asset")', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire") || $user->hasRight("asset","read")', '', 2, 54, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 13__+MAX_llx_menu__, 'adherent', 'isModEnabled("adherent")', __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 19, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 15__+MAX_llx_menu__, 'hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->user->user->lire || $user->rights->holiday->read || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 13__+MAX_llx_menu__, 'adherent', 'isModEnabled("adherent")', __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->hasRight("adherent","lire")', '', 2, 19, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 15__+MAX_llx_menu__, 'hrm|holiday|deplacement|expensereport', 'isModEnabled("hrm") || isModEnabled("holiday") || isModEnabled("deplacement") || isModEnabled("expensereport")', __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->hasRight("user","user","lire") || $user->hasRight("holiday","read") || $user->hasRight("deplacement","lire") || $user->hasRight("expensereport","lire")', '', 0, 80, __ENTITY__); -- Sub-Menus @@ -74,432 +74,432 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Home - Menu users and groups insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?mainmenu=home&leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/list.php?mainmenu=home&leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?mainmenu=home&leftmenu=users&action=create', 'NewUser', 2, 'users', '($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/list.php?mainmenu=home&leftmenu=users', 'Users', 1, 'users', '$user->hasRight("user","user","lire") || $user->admin', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?mainmenu=home&leftmenu=users&action=create', 'NewUser', 2, 'users', '($user->hasRight("user","user","creer") || $user->admin) && !(isModEnabled("multicompany") && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/hierarchy.php?mainmenu=home&leftmenu=users', 'HierarchicView', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 405__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/categories/index.php?mainmenu=home&leftmenu=users&type=7', 'UsersCategoriesShort', 1, 'categories', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/hierarchy.php?mainmenu=home&leftmenu=users', 'HierarchicView', 1, 'users', '$user->hasRight("user","user","lire") || $user->admin', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 405__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/categories/index.php?mainmenu=home&leftmenu=users&type=7', 'UsersCategoriesShort', 1, 'categories', '$user->hasRight("user","user","lire") || $user->admin', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 407__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/list.php?mainmenu=home&leftmenu=users', 'Groups', 1, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 408__+MAX_llx_menu__, 'home', '', 407__+MAX_llx_menu__, '/user/group/card.php?mainmenu=home&leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 407__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/list.php?mainmenu=home&leftmenu=users', 'Groups', 1, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->hasRight("user","user","lire")) || $user->admin) && !(isModEnabled("multicompany") && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 408__+MAX_llx_menu__, 'home', '', 407__+MAX_llx_menu__, '/user/group/card.php?mainmenu=home&leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->hasRight("user","user","creer")) || $user->admin) && !(isModEnabled("multicompany") && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); -- Third parties -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&leftmenu=thirdparties', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=c&leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->hasRight("societe","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&leftmenu=thirdparties', 'List', 1, 'companies', '$user->hasRight("societe","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->hasRight("societe","lire") && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->hasRight("societe","lire")', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 507__+MAX_llx_menu__, 'companies', '', 506__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=prospects&action=create&type=p', 'MenuNewProspect', 2, 'companies', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 509__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=c&leftmenu=customers', 'ListCustomersShort', 1, 'companies', '$user->hasRight("societe","lire")', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 510__+MAX_llx_menu__, 'companies', '', 509__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=customers&action=create&type=c', 'MenuNewCustomer', 2, 'companies', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__); -- Third parties - Contacts -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/card.php?mainmenu=companies&leftmenu=contacts&action=create', 'NewContactAddress', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=p', 'ThirdPartyProspects', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=c', 'ThirdPartyCustomers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=f', 'ThirdPartySuppliers', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->rights->societe->contact->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 600__+MAX_llx_menu__, 'companies', 'contacts', 2__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'ContactsAddresses', 0, 'companies', '$user->hasRight("societe","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 601__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/card.php?mainmenu=companies&leftmenu=contacts&action=create', 'NewContactAddress', 1, 'companies', '$user->hasRight("societe","creer")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 602__+MAX_llx_menu__, 'companies', '', 600__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts', 'List', 1, 'companies', '$user->hasRight("societe","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 604__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=p', 'ThirdPartyProspects', 2, 'companies', '$user->hasRight("societe","contact","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 605__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=c', 'ThirdPartyCustomers', 2, 'companies', '$user->hasRight("societe","contact","lire")', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && (isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))', __HANDLER__, 'left', 606__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=f', 'ThirdPartySuppliers', 2, 'companies', '$user->hasRight("societe","contact","lire")', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe")', __HANDLER__, 'left', 607__+MAX_llx_menu__, 'companies', '', 602__+MAX_llx_menu__, '/contact/list.php?mainmenu=companies&leftmenu=contacts&type=o', 'Others', 2, 'companies', '$user->hasRight("societe","contact","lire")', '', 2, 4, __ENTITY__); -- Third parties - Category customer -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 651__+MAX_llx_menu__, 'companies', '', 650__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=1', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && isModEnabled("categorie")', __HANDLER__, 'left', 650__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=1', 'SuppliersCategoriesShort', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && isModEnabled("categorie")', __HANDLER__, 'left', 651__+MAX_llx_menu__, 'companies', '', 650__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=1', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Third parties - Category supplier -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $conf->categorie->enabled', __HANDLER__, 'left', 660__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=2', 'CustomersProspectsCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $conf->categorie->enabled', __HANDLER__, 'left', 661__+MAX_llx_menu__, 'companies', '', 660__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=2', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && isModEnabled("categorie")', __HANDLER__, 'left', 660__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=2', 'CustomersProspectsCategoriesShort', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && isModEnabled("categorie")', __HANDLER__, 'left', 661__+MAX_llx_menu__, 'companies', '', 660__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=2', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Third parties - Category contact -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 670__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=4', 'ContactCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && $conf->categorie->enabled', __HANDLER__, 'left', 671__+MAX_llx_menu__, 'companies', '', 670__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=4', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && isModEnabled("categorie")', __HANDLER__, 'left', 670__+MAX_llx_menu__, 'companies', 'cat', 2__+MAX_llx_menu__, '/categories/index.php?mainmenu=companies&leftmenu=cat&type=4', 'ContactCategoriesShort', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("societe") && isModEnabled("categorie")', __HANDLER__, 'left', 671__+MAX_llx_menu__, 'companies', '', 670__+MAX_llx_menu__, '/categories/card.php?mainmenu=companies&action=create&type=4', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Product - Product insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2800__+MAX_llx_menu__, 'products', 'product', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=product&type=0', 'Products', 0, 'products', '$user->rights->produit->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2801__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=product&action=create&type=0', 'NewProduct', 1, 'products', '$user->rights->produit->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2802__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=product&type=0', 'List', 1, 'products', '$user->rights->produit->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("product")', __HANDLER__, 'left', 2803__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassort.php?mainmenu=products&type=0', 'MenuStocks', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0&search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->productbatch->enabled', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("productbatch")', __HANDLER__, 'left', 2805__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/reassortlot.php?mainmenu=products&type=0&search_subjecttolotserial=1', 'StocksByLotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("productbatch")', __HANDLER__, 'left', 2806__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stock/productlot_list.php?mainmenu=products', 'LotSerial', 1, 'products', '$user->rights->produit->lire && $user->rights->stock->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->variants->enabled', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("variants")', __HANDLER__, 'left', 2807__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/variants/list.php?mainmenu=products', 'VariantAttributes', 1, 'products', '$user->rights->produit->lire', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 2804__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=0', 'Statistics', 1, 'main', '$user->rights->produit->lire', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal")', __HANDLER__, 'left', 2804__+MAX_llx_menu__, 'products', '', 2800__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=0', 'Statistics', 1, 'main', '$user->rights->produit->lire', '', 2, 8, __ENTITY__); -- Product - Services -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2900__+MAX_llx_menu__, 'products', 'service', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=service&type=1', 'Services', 0, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2900__+MAX_llx_menu__, 'products', 'service', 3__+MAX_llx_menu__, '/product/index.php?mainmenu=products&leftmenu=service&type=1', 'Services', 0, 'products', '$user->hasRight("service","lire")', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2901__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/card.php?mainmenu=products&leftmenu=service&action=create&type=1', 'NewService', 1, 'products', '$user->rights->service->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2902__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=service&type=1', 'List', 1, 'products', '$user->rights->service->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 2903__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=1', 'Statistics', 1, 'main', '$user->rights->service->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("service")', __HANDLER__, 'left', 2902__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/list.php?mainmenu=products&leftmenu=service&type=1', 'List', 1, 'products', '$user->hasRight("service","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal")', __HANDLER__, 'left', 2903__+MAX_llx_menu__, 'products', '', 2900__+MAX_llx_menu__, '/product/stats/card.php?mainmenu=products&id=all&leftmenu=stats&type=1', 'Statistics', 1, 'main', '$user->hasRight("service","lire")', '', 2, 5, __ENTITY__); -- Product - Stocks -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3100__+MAX_llx_menu__, 'products', 'stock', 3__+MAX_llx_menu__, '/product/stock/index.php?mainmenu=products&leftmenu=stock', 'Stock', 0, 'stocks', '$user->rights->stock->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3101__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/card.php?mainmenu=products&action=create', 'MenuNewWarehouse', 1, 'stocks', '$user->rights->stock->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/list.php?mainmenu=products', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/movement_list.php?mainmenu=products', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled && $conf->supplier_order->enabled', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php?mainmenu=products', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->stock->enabled', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php?init=1&mainmenu=products', 'MassStockTransferShort', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3100__+MAX_llx_menu__, 'products', 'stock', 3__+MAX_llx_menu__, '/product/stock/index.php?mainmenu=products&leftmenu=stock', 'Stock', 0, 'stocks', '$user->rights->stock->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3101__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/card.php?mainmenu=products&action=create', 'MenuNewWarehouse', 1, 'stocks', '$user->rights->stock->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3102__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/list.php?mainmenu=products', 'List', 1, 'stocks', '$user->rights->stock->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3104__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/movement_list.php?mainmenu=products', 'Movements', 1, 'stocks', '$user->rights->stock->mouvement->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("stock") && isModEnabled("supplier_order")', __HANDLER__, 'left', 3105__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/replenish.php?mainmenu=products', 'Replenishments', 1, 'stocks', '$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("stock")', __HANDLER__, 'left', 3106__+MAX_llx_menu__, 'products', '', 3100__+MAX_llx_menu__, '/product/stock/massstockmove.php?init=1&mainmenu=products', 'MassStockTransferShort', 1, 'stocks', '$user->rights->stock->mouvement->creer', '', 2, 5, __ENTITY__); -- Product - Categories -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?mainmenu=products&leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3201__+MAX_llx_menu__, 'products', '', 3200__+MAX_llx_menu__, '/categories/card.php?mainmenu=products&action=create&type=0', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3200__+MAX_llx_menu__, 'products', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?mainmenu=products&leftmenu=cat&type=0', 'Categories', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3201__+MAX_llx_menu__, 'products', '', 3200__+MAX_llx_menu__, '/categories/card.php?mainmenu=products&action=create&type=0', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Product - Shipment -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expedition->enabled', __HANDLER__, 'left', 1300__+MAX_llx_menu__, 'commercial', 'sendings', 3__+MAX_llx_menu__, '/expedition/index.php?mainmenu=commercial&leftmenu=sendings', 'Shipments', 0, 'sendings', '$user->rights->expedition->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1301__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/card.php?mainmenu=commercial&action=create2&leftmenu=sendings', 'NewSending', 1, 'sendings', '$user->rights->expedition->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1302__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/list.php?mainmenu=commercial&leftmenu=sendings', 'List', 1, 'sendings', '$user->rights->expedition->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expedition->enabled && $leftmenu=="sendings"', __HANDLER__, 'left', 1303__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/stats/index.php?mainmenu=commercial&leftmenu=sendings', 'Statistics', 1, 'sendings', '$user->rights->expedition->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expedition")', __HANDLER__, 'left', 1300__+MAX_llx_menu__, 'commercial', 'sendings', 3__+MAX_llx_menu__, '/expedition/index.php?mainmenu=commercial&leftmenu=sendings', 'Shipments', 0, 'sendings', '$user->rights->expedition->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expedition") && $leftmenu=="sendings"', __HANDLER__, 'left', 1301__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/card.php?mainmenu=commercial&action=create2&leftmenu=sendings', 'NewSending', 1, 'sendings', '$user->rights->expedition->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expedition") && $leftmenu=="sendings"', __HANDLER__, 'left', 1302__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/list.php?mainmenu=commercial&leftmenu=sendings', 'List', 1, 'sendings', '$user->rights->expedition->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expedition") && $leftmenu=="sendings"', __HANDLER__, 'left', 1303__+MAX_llx_menu__, 'commercial', '', 1300__+MAX_llx_menu__, '/expedition/stats/index.php?mainmenu=commercial&leftmenu=sendings', 'Statistics', 1, 'sendings', '$user->rights->expedition->lire', '', 2, 2, __ENTITY__); -- Product - Reception -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled', __HANDLER__, 'left', 1350__+MAX_llx_menu__, 'commercial', 'receptions', 3__+MAX_llx_menu__, '/reception/index.php?mainmenu=commercial&leftmenu=receptions', 'Receptions', 0, 'receptions', '$user->rights->reception->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1351__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/card.php?mainmenu=commercial&action=create2&leftmenu=receptions', 'NewSending', 1, 'receptions', '$user->rights->reception->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1352__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/list.php?mainmenu=commercial&leftmenu=receptions', 'List', 1, 'receptions', '$user->rights->reception->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("reception")', __HANDLER__, 'left', 1350__+MAX_llx_menu__, 'commercial', 'receptions', 3__+MAX_llx_menu__, '/reception/index.php?mainmenu=commercial&leftmenu=receptions', 'Receptions', 0, 'receptions', '$user->rights->reception->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("reception") && $leftmenu=="receptions"', __HANDLER__, 'left', 1351__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/card.php?mainmenu=commercial&action=create2&leftmenu=receptions', 'NewSending', 1, 'receptions', '$user->rights->reception->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("reception") && $leftmenu=="receptions"', __HANDLER__, 'left', 1352__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/list.php?mainmenu=commercial&leftmenu=receptions', 'List', 1, 'receptions', '$user->rights->reception->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("reception") && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->lire', '', 2, 2, __ENTITY__); -- Commercial - Proposals -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal")', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal")', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal")', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal") && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("propal")', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -- Commercial - Customer's orders -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1205__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=2', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1206__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=3', 'StatusOrderToBill', 1, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1201__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders', 'NewOrder', 1, 'orders', '$user->rights->commande->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1202__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders', 'List', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1203__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=0', 'StatusOrderDraftShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1204__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=1', 'StatusOrderValidated', 1, 'orders', '$user->rights->commande->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1205__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=2', 'StatusOrderOnProcessShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1206__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=3', 'StatusOrderToBill', 1, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->rights->commande->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->rights->commande->lire', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders', 'Statistics', 1, 'orders', '$user->rights->commande->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->rights->commande->lire', '', 2, 1, __ENTITY__); -- Commercial - Supplier's proposals -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1650__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1651__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals', 'SupplierProposalNew', 1, 'supplier_proposal', '$user->rights->supplier_proposal->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1652__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/list.php?leftmenu=supplier_proposals', 'List', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1650__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1651__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals', 'SupplierProposalNew', 1, 'supplier_proposal', '$user->rights->supplier_proposal->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1652__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/supplier_proposal/list.php?leftmenu=supplier_proposals', 'List', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__); -- Commercial - Supplier's orders -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewSupplierOrderShort', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=2', 'StatusOrderApprovedShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->creer)', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=5', 'StatusOrderReceivedAll', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=6,7', 'StatusOrderCanceled', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 8, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=9', 'StatusOrderRefused', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order")', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order")', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewSupplierOrderShort', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order")', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5105__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=2', 'StatusOrderApprovedShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5106__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=3', 'StatusOrderOnProcessShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5107__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=4', 'StatusOrderReceivedPartiallyShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->creer)', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5108__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=5', 'StatusOrderReceivedAll', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5109__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=6,7', 'StatusOrderCanceled', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order") && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5110__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=9', 'StatusOrderRefused', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_order")', __HANDLER__, 'left', 5111__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders_suppliers&mode=supplier', 'Statistics', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 7, __ENTITY__); -- Commercial - Contracts -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/list.php?mainmenu=commercial&leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1405__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4', 'MenuRunningServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1406__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4&filter=expired', 'MenuExpiredServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->contrat->enabled && $leftmenu=="contracts"', __HANDLER__, 'left', 1407__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=5', 'MenuClosedServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("contrat")', __HANDLER__, 'left', 1400__+MAX_llx_menu__, 'commercial', 'contracts', 5__+MAX_llx_menu__, '/contrat/index.php?mainmenu=commercial&leftmenu=contracts', 'Contracts', 0, 'contracts', '$user->rights->contrat->lire', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("contrat")', __HANDLER__, 'left', 1401__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/card.php?mainmenu=commercial&action=create&leftmenu=contracts', 'NewContract', 1, 'contracts', '$user->rights->contrat->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("contrat")', __HANDLER__, 'left', 1402__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/list.php?mainmenu=commercial&leftmenu=contracts', 'List', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("contrat")', __HANDLER__, 'left', 1403__+MAX_llx_menu__, 'commercial', '', 1400__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts', 'MenuServices', 1, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("contrat") && $leftmenu=="contracts"', __HANDLER__, 'left', 1404__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=0', 'MenuInactiveServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("contrat") && $leftmenu=="contracts"', __HANDLER__, 'left', 1405__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4', 'MenuRunningServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("contrat") && $leftmenu=="contracts"', __HANDLER__, 'left', 1406__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=4&filter=expired', 'MenuExpiredServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("contrat") && $leftmenu=="contracts"', __HANDLER__, 'left', 1407__+MAX_llx_menu__, 'commercial', '', 1403__+MAX_llx_menu__, '/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&search_status=5', 'MenuClosedServices', 2, 'contracts', '$user->rights->contrat->lire', '', 2, 3, __ENTITY__); -- Commercial - Interventions -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1500__+MAX_llx_menu__, 'commercial', 'ficheinter', 5__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'Interventions', 0, 'interventions', '$user->rights->ficheinter->lire', '', 2, 8, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1501__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/card.php?mainmenu=commercial&action=create&leftmenu=ficheinter', 'NewIntervention', 1, 'interventions', '$user->rights->ficheinter->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1502__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'List', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->ficheinter->enabled', __HANDLER__, 'left', 1503__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/stats/index.php?mainmenu=commercial&leftmenu=ficheinter', 'Statistics', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("ficheinter")', __HANDLER__, 'left', 1500__+MAX_llx_menu__, 'commercial', 'ficheinter', 5__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'Interventions', 0, 'interventions', '$user->rights->ficheinter->lire', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("ficheinter")', __HANDLER__, 'left', 1501__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/card.php?mainmenu=commercial&action=create&leftmenu=ficheinter', 'NewIntervention', 1, 'interventions', '$user->rights->ficheinter->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("ficheinter")', __HANDLER__, 'left', 1502__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', 'List', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("ficheinter")', __HANDLER__, 'left', 1503__+MAX_llx_menu__, 'commercial', '', 1500__+MAX_llx_menu__, '/fichinter/stats/index.php?mainmenu=commercial&leftmenu=ficheinter', 'Statistics', 1, 'interventions', '$user->rights->ficheinter->lire', '', 2, 2, __ENTITY__); -- Billing - Supplier invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?mainmenu=billing&action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?mainmenu=billing&action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', 'suppliers_bills_payment', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?mainmenu=billing&leftmenu=suppliers_bills_payment', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', 'suppliers_bills_reports', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?mainmenu=billing&leftmenu=suppliers_bills_reports', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', 'suppliers_bills_payment', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?mainmenu=billing&leftmenu=suppliers_bills_payment', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', 'suppliers_bills_reports', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?mainmenu=billing&leftmenu=suppliers_bills_reports', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Customer invoice -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__); -- Billing - Orders to bill -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&leftmenu=orders&search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__); -- Donations -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?mainmenu=billing&leftmenu=donations&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?mainmenu=billing&leftmenu=donations', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); --- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&leftmenu=donations', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("don")', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("don") && $leftmenu=="donations"', __HANDLER__, 'left', 2001__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/card.php?mainmenu=billing&leftmenu=donations&action=create', 'NewDonation', 1, 'donations', '$user->rights->don->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("don") && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?mainmenu=billing&leftmenu=donations', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); +-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("don") && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&leftmenu=donations', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || isModEnabled("banque")', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&leftmenu=tax', 'MenuTaxesAndSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (isModEnabled("banque") && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&leftmenu=tax', 'MenuTaxesAndSpecialExpenses', 0, 'compta', '(isModEnabled("tax") && $user->rights->tax->charges->lire) || (isModEnabled("salaries") && ! empty($user->rights->salaries->read)) || (isModEnabled("loan") && $user->rights->loan->read) || (isModEnabled("banque") && $user->hasRight("banque","lire"))', '', 0, 6, __ENTITY__); -- Social contributions -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?mainmenu=billing&leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?mainmenu=billing&leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?mainmenu=billing&leftmenu=tax_social', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax")', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?mainmenu=billing&leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?mainmenu=billing&leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?mainmenu=billing&leftmenu=tax_social', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -- VAT/TVA/IVA -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?mainmenu=billing&leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/index.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByMonth', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByThirdparties', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2305__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?mainmenu=billing&leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/index.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByMonth', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByThirdparties', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("tax") && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2305__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 4, __ENTITY__); -- Salary -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 6__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Salaries', 0, 'salaries', '$user->rights->salaries->read', '', 0, 10, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/card.php?mainmenu=billing&leftmenu=tax_salary&action=create', 'NewPayment', 1, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Payments', 1, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/stats/index.php?mainmenu=billing&leftmenu=tax_salary', 'Statistics', 1, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("salaries")', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 6__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Salaries', 0, 'salaries', '$user->rights->salaries->read', '', 0, 10, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("salaries") && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/card.php?mainmenu=billing&leftmenu=tax_salary&action=create', 'NewPayment', 1, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("salaries") && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Payments', 1, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("salaries") && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/stats/index.php?mainmenu=billing&leftmenu=tax_salary', 'Statistics', 1, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); -- Loan -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 6__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&leftmenu=tax_loan', 'Loans', 0, 'loan', '$user->rights->loan->read', '', 0, 20, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&leftmenu=tax_loan&action=create', 'NewLoan', 1, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&leftmenu=tax_loan', 'Payments', 1, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?mainmenu=billing&leftmenu=tax_loan', 'Calculator', 1, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("loan")', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 6__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&leftmenu=tax_loan', 'Loans', 0, 'loan', '$user->rights->loan->read', '', 0, 20, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("loan") && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&leftmenu=tax_loan&action=create', 'NewLoan', 1, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("loan") && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&leftmenu=tax_loan', 'Payments', 1, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("loan") && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?mainmenu=billing&leftmenu=tax_loan', 'Calculator', 1, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); -- Various payments -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 6__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 0, 'banks', '$user->rights->banque->lire', '', 0, 30, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 1, 'various_payment', '$user->rights->banque->modifier', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 1, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 6__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 0, 'banks', '$user->hasRight("banque","lire")', '', 0, 30, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 1, 'various_payment', '$user->hasRight("banque","modifier")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 1, 'various_payment', '$user->hasRight("banque","lire")', '', 0, 3, __ENTITY__); -- Accounting (Double entries) -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', 0, 'main', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', 0, 'main', 'isModEnabled("accounting") || $user->hasRight("accounting","bind","write") || $user->hasRight("accounting","bind","write") || $user->hasRight("compta","resultat","lire")', '', 0, 7, __ENTITY__); -- Setup -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2451__+MAX_llx_menu__, 'accountancy', 'accountancy_admin', 2400__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Setup', 1, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2453__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_general', 2451__+MAX_llx_menu__, '/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'General', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 10, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2454__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_journal', 2451__+MAX_llx_menu__, '/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingJournals', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 20, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2455__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartmodel', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Pcg_version', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 30, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 40, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartsubledger',2451__+MAX_llx_menu__, '/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ChartOfSubaccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 41, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 45, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 50, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2453__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_general', 2451__+MAX_llx_menu__, '/accountancy/admin/index.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'General', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 10, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2454__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_journal', 2451__+MAX_llx_menu__, '/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingJournals', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 20, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2455__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartmodel', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Pcg_version', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 30, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2456__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart', 2451__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'Chartofaccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 40, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2457__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chartsubledger',2451__+MAX_llx_menu__, '/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ChartOfSubaccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 41, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2458__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 45, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2459__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_default', 2451__+MAX_llx_menu__, '/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuDefaultAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 50, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 51, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2460__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuBankAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 51, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 52, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 53, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 54, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 55, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2461__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_vat', 2451__+MAX_llx_menu__, '/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuVatAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 52, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2462__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_tax', 2451__+MAX_llx_menu__, '/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuTaxAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 53, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("expensereport") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2463__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_expensereport', 2451__+MAX_llx_menu__, '/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuExpenseReportAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 54, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2464__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 55, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 60, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 1', __HANDLER__, 'left', 2466__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->rights->accounting->chartofaccount', '', 0, 70, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_export', 2451__+MAX_llx_menu__, '/accountancy/admin/export.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'ExportOptions', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 60, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 1', __HANDLER__, 'left', 2466__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 70, __ENTITY__); -- Accounting period -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin" && $conf->global->MAIN_FEATURES_LEVEL > 0', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__); -- Binding -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->facture->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->expensereport->enabled && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->rights->accounting->bind->write', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("expensereport") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)', __HANDLER__, 'left', 2420__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_expensereport', 2400__+MAX_llx_menu__, '/accountancy/expensereport/index.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_expensereport', 'ExpenseReportsVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("expensereport") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2421__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("expensereport") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS) && $leftmenu=="accountancy_dispatch_expensereport"', __HANDLER__, 'left', 2422__+MAX_llx_menu__, 'accountancy', '', 2420__+MAX_llx_menu__, '/accountancy/expensereport/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 7, __ENTITY__); -- Export accounting documents -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2436__+MAX_llx_menu__, 'accountancy', 'accountancy_files', 2400__+MAX_llx_menu__, '/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files', 'AccountantFiles', 1, 'accountancy', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("comptabilite") || isModEnabled("accounting")', __HANDLER__, 'left', 2436__+MAX_llx_menu__, 'accountancy', 'accountancy_files', 2400__+MAX_llx_menu__, '/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files', 'AccountantFiles', 1, 'accountancy', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire")', '', 0, 16, __ENTITY__); -- Journals ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6', 'ExpenseReportJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 2, __ENTITY__); ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2709__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2', 'PurchasesJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 3, __ENTITY__); ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1', 'SellsJournal', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 4, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '', 'Journalization', 1, 'main', '$user->hasRight("accounting","comptarapport","lire")', '', 0, 1, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3', 'BankJournal', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 1, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6', 'ExpenseReportJournal', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 2, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2709__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2', 'PurchasesJournal', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 3, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2705__+MAX_llx_menu__, '/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1', 'SellsJournal', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 4, __ENTITY__); -- Balance -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 10, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2430__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->hasRight("accounting","mouvements","lire")', '', 0, 10, __ENTITY__); -- General Ledger -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'Bookkeeping', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2432__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'Bookkeeping', 1, 'accountancy', '$user->hasRight("accounting","mouvements","lire")', '', 0, 12, __ENTITY__); -- Journals -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2433__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'Journals', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 13, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2433__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'Journals', 1, 'accountancy', '$user->hasRight("accounting","mouvements","lire")', '', 0, 13, __ENTITY__); -- Export accountancy -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'MenuExportAccountancy', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 15, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/export.php?mainmenu=accountancy&leftmenu=accountancy_bookkeeping', 'MenuExportAccountancy', 1, 'accountancy', '$user->hasRight("accounting","mouvements","lire")', '', 0, 15, __ENTITY__); -- Closure -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->rights->accounting->fiscalyear->write', '', 0, 16, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2437__+MAX_llx_menu__, 'accountancy', 'accountancy_closure', 2400__+MAX_llx_menu__, '/accountancy/closure/index.php?mainmenu=accountancy&leftmenu=accountancy_closure', 'MenuAccountancyClosure', 1, 'accountancy', '$user->hasRight("accounting","fiscalyear","write")', '', 0, 16, __ENTITY__); -- Reports -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'MenuReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 22, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 23, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting")', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 17, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'MenuReportInOut', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 18, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 19, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 20, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 21, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2445__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByCompanies', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 22, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2446__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByUsers', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 23, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 24, __ENTITY__); -- Accounting simple -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=ca', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=ca', 'MenuReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2712__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2713__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2714__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2715__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2716__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("comptabilite")', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=ca', 'Reportings', 0, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 11, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=ca', 'MenuReportInOut', 1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2712__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=ca', 'ByCompanies', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2713__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2714__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=ca', 'ByCompanies', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2715__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=ca', 'ByUsers', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("comptabilite") && $leftmenu=="ca"', __HANDLER__, 'left', 2716__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","comptarapport","lire")', '', 0, 1, __ENTITY__); -- Assets -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled', __HANDLER__, 'left', 3000__+MAX_llx_menu__, 'accountancy', 'asset', 9__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuAssets', 1, 'assets', '$user->rights->asset->read', '', 0, 20, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3001__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/card.php?mainmenu=accountancy&leftmenu=asset&action=create', 'MenuNewAsset', 2, 'assets', '$user->rights->asset->write', '', 0, 21, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3003__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuListAssets', 2, 'assets', '$user->rights->asset->read', '', 0, 22, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3004__+MAX_llx_menu__, 'asset', 'asset_type', 3000__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&leftmenu=asset', 'MenuTypeAssets', 2, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->asset->model_advance->read:$user->rights->asset->read)', '', 0, 23, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3005__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&action=create', 'MenuNewTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->asset->model_advance->write:$user->rights->asset->write)', '', 0, 24, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->asset->enabled && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->asset->model_advance->read:$user->rights->asset->read)', '', 0, 25, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset")', __HANDLER__, 'left', 3000__+MAX_llx_menu__, 'accountancy', 'asset', 9__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuAssets', 1, 'assets', '$user->hasRight("asset","read")', '', 0, 20, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3001__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/card.php?mainmenu=accountancy&leftmenu=asset&action=create', 'MenuNewAsset', 2, 'assets', '$user->hasRight("asset","write")', '', 0, 21, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3003__+MAX_llx_menu__, 'asset', '', 3000__+MAX_llx_menu__, '/asset/list.php?mainmenu=accountancy&leftmenu=asset', 'MenuListAssets', 2, 'assets', '$user->hasRight("asset","read")', '', 0, 22, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3004__+MAX_llx_menu__, 'asset', 'asset_type', 3000__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&leftmenu=asset', 'MenuTypeAssets', 2, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","read"):$user->hasRight("asset","read"))', '', 0, 23, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3005__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy&action=create', 'MenuNewTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","write"):$user->hasRight("asset","write"))', '', 0, 24, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","read"):$user->hasRight("asset","read"))', '', 0, 25, __ENTITY__); -- Check deposit -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->rights->banque->lire', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque")pty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->rights->banque->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->rights->banque->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture")) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__); -- PaymentByDirectDebit -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2502__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=withdraw', 'NewStandingOrder', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2503__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2504__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsLines', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2506__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=withdraw', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2507__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=withdraw', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2502__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=withdraw', 'NewStandingOrder', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2503__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2504__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsLines', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2506__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=withdraw', 'Rejects', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="withdraw"', __HANDLER__, 'left', 2507__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=withdraw', 'Statistics', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 6, __ENTITY__); -- PaymentByCreditTransfer -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2510__+MAX_llx_menu__, 'accountancy', 'banktransfer', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'PaymentByBankTransfer', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2512__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'NewStandingOrder', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2513__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2514__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsLines', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2516__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2517__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2510__+MAX_llx_menu__, 'accountancy', 'banktransfer', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'PaymentByBankTransfer', 0, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2512__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'NewStandingOrder', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2513__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2514__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsLines', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2516__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Rejects', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement") && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2517__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Statistics', 1, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 6, __ENTITY__); -- Bank -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque")', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', 0, 'banks', '$user->rights->banque->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2601__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/card.php?mainmenu=bank&action=create&leftmenu=bank', 'MenuNewFinancialAccount', 1, 'banks', '$user->rights->banque->configurer', '', 0, 0, __ENTITY__); --- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2602__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/categ.php?mainmenu=bank&leftmenu=bank', 'Rubriques', 1, 'categories', '$user->rights->banque->configurer', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries_list.php?mainmenu=bank&leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->rights->banque->lire', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?mainmenu=bank&leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?mainmenu=bank&leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->rights->banque->transfer', '', 0, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque")', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', 0, 'banks', '$user->hasRight("banque","lire")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2601__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/card.php?mainmenu=bank&action=create&leftmenu=bank', 'MenuNewFinancialAccount', 1, 'banks', '$user->hasRight("banque","configurer")', '', 0, 0, __ENTITY__); +-- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2602__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/categ.php?mainmenu=bank&leftmenu=bank', 'Rubriques', 1, 'categories', '$user->hasRight("banque","configurer")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2603__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/bankentries_list.php?mainmenu=bank&leftmenu=bank', 'ListTransactions', 1, 'banks', '$user->hasRight("banque","lire")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2604__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/budget.php?mainmenu=bank&leftmenu=bank', 'ListTransactionsByCategory', 1, 'banks', '$user->hasRight("banque","lire")', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("banque") && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2606__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/transfer.php?mainmenu=bank&leftmenu=bank', 'BankTransfers', 1, 'banks', '$user->hasRight("banque","transfer")', '', 0, 5, __ENTITY__); -- Bank - Categories -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?mainmenu=bank&leftmenu=bank&type=5', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?mainmenu=bank&leftmenu=bank&action=create&type=5', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 2650__+MAX_llx_menu__, 'accountancy', 'cat', 14__+MAX_llx_menu__, '/categories/index.php?mainmenu=bank&leftmenu=bank&type=5', 'Categories', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 2651__+MAX_llx_menu__, 'accountancy', '', 2650__+MAX_llx_menu__, '/categories/card.php?mainmenu=bank&leftmenu=bank&action=create&type=5', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- Project -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project")', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project")', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->hasRight("projet","creer")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project")', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project") && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project") && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project")', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project") && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project") && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->hasRight("projet","creer")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project") && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project") && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->hasRight("projet","lire")', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project") && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 3, __ENTITY__); -- Project - Categories -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?mainmenu=project&action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("categorie")', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?mainmenu=project&action=create&type=6', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- BOM -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5400__+MAX_llx_menu__, 'mrp', 'bom', 16__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&leftmenu=bom', 'MenuBOM', 1, 'mrp', '$user->rights->bom->read', '', 0, 20, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5401__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_card.php?mainmenu=mrp&leftmenu=bom&action=create', 'NewBOM', 2, 'mrp', '$user->rights->bom->write', '', 0, 21, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5403__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&leftmenu=bom', 'List', 2, 'mrp', '$user->rights->bom->read', '', 0, 22, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5400__+MAX_llx_menu__, 'mrp', 'bom', 16__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&leftmenu=bom', 'MenuBOM', 1, 'mrp', '$user->hasRight("bom","read")', '', 0, 20, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5401__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_card.php?mainmenu=mrp&leftmenu=bom&action=create', 'NewBOM', 2, 'mrp', '$user->hasRight("bom","write")', '', 0, 21, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5403__+MAX_llx_menu__, 'mrp', '', 5400__+MAX_llx_menu__, '/bom/bom_list.php?mainmenu=mrp&leftmenu=bom', 'List', 2, 'mrp', '$user->hasRight("bom","read")', '', 0, 22, __ENTITY__); -- MRP/MO -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5450__+MAX_llx_menu__, 'mrp', 'mrp', 16__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&leftmenu=mrp', 'MenuMRP', 1, 'mrp', '$user->rights->mrp->read', '', 0, 20, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5451__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_card.php?mainmenu=mrp&leftmenu=mrp&action=create', 'NewMO', 2, 'mrp', '$user->rights->mrp->write', '', 0, 21, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->bom->enabled', __HANDLER__, 'left', 5453__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&leftmenu=mrp', 'List', 2, 'mrp', '$user->rights->mrp->read', '', 0, 22, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5450__+MAX_llx_menu__, 'mrp', 'mrp', 16__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&leftmenu=mrp', 'MenuMRP', 1, 'mrp', '$user->hasRight("mrp","read")', '', 0, 20, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5451__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_card.php?mainmenu=mrp&leftmenu=mrp&action=create', 'NewMO', 2, 'mrp', '$user->hasRight("mrp","write")', '', 0, 21, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("bom")', __HANDLER__, 'left', 5453__+MAX_llx_menu__, 'mrp', '', 5450__+MAX_llx_menu__, '/mrp/mo_list.php?mainmenu=mrp&leftmenu=mrp', 'List', 2, 'mrp', '$user->hasRight("mrp","read")', '', 0, 22, __ENTITY__); -- Tools insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($user->socid)', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'email_templates', 8__+MAX_llx_menu__, '/admin/mails_templates.php?mainmenu=tools&leftmenu=email_templates', 'EMailTemplates', 0, '', '', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3910__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?mainmenu=tools&leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3911__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/card.php?mainmenu=tools&leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3912__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/list.php?mainmenu=tools&leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->export->enabled', __HANDLER__, 'left', 4100__+MAX_llx_menu__, 'tools', 'export', 8__+MAX_llx_menu__, '/exports/index.php?mainmenu=tools&leftmenu=export', 'FormatedExport', 0, 'exports', '$user->rights->export->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->export->enabled', __HANDLER__, 'left', 4101__+MAX_llx_menu__, 'tools', '', 4100__+MAX_llx_menu__, '/exports/export.php?mainmenu=tools&leftmenu=export', 'NewExport', 1, 'exports', '$user->rights->export->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->import->enabled', __HANDLER__, 'left', 4130__+MAX_llx_menu__, 'tools', 'import', 8__+MAX_llx_menu__, '/imports/index.php?mainmenu=tools&leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->run', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->import->enabled', __HANDLER__, 'left', 4131__+MAX_llx_menu__, 'tools', '', 4130__+MAX_llx_menu__, '/imports/import.php?mainmenu=tools&leftmenu=import', 'NewImport', 1, 'exports', '$user->rights->import->run', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3910__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?mainmenu=tools&leftmenu=mailing', 'EMailings', 0, 'mails', '$user->hasRight("mailing","lire")', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3911__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/card.php?mainmenu=tools&leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->hasRight("mailing","creer")', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("mailing")', __HANDLER__, 'left', 3912__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/list.php?mainmenu=tools&leftmenu=mailing', 'List', 1, 'mails', '$user->hasRight("mailing","lire")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("export")', __HANDLER__, 'left', 4100__+MAX_llx_menu__, 'tools', 'export', 8__+MAX_llx_menu__, '/exports/index.php?mainmenu=tools&leftmenu=export', 'FormatedExport', 0, 'exports', '$user->rights->export->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("export")', __HANDLER__, 'left', 4101__+MAX_llx_menu__, 'tools', '', 4100__+MAX_llx_menu__, '/exports/export.php?mainmenu=tools&leftmenu=export', 'NewExport', 1, 'exports', '$user->rights->export->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("import")', __HANDLER__, 'left', 4130__+MAX_llx_menu__, 'tools', 'import', 8__+MAX_llx_menu__, '/imports/index.php?mainmenu=tools&leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->run', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("import")', __HANDLER__, 'left', 4131__+MAX_llx_menu__, 'tools', '', 4130__+MAX_llx_menu__, '/imports/import.php?mainmenu=tools&leftmenu=import', 'NewImport', 1, 'exports', '$user->rights->import->run', '', 2, 0, __ENTITY__); -- Members -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4200__+MAX_llx_menu__, 'members', 'members', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&leftmenu=members', 'Members', 0, 'members', '$user->rights->adherent->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4201__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/card.php?mainmenu=members&leftmenu=members&action=create', 'NewMember', 1, 'members', '$user->rights->adherent->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4202__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/list.php', 'List', 1, 'members', '$user->rights->adherent->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4203__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=-1', 'MenuMembersToValidate', 2, 'members', '$user->rights->adherent->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4204__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1', 'MenuMembersValidated', 2, 'members', '$user->rights->adherent->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4205__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=waitingsubscription', 'WaitingSubscription', 2, 'members', '$user->rights->adherent->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4206__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=outofdate', 'UpToDate', 2, 'members', '$user->rights->adherent->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4207__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=uptodate', 'OutOfDate', 2, 'members', '$user->rights->adherent->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4208__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=0', 'MenuMembersResiliated', 2, 'members', '$user->rights->adherent->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4209__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/stats/geo.php?mainmenu=members&leftmenu=members&mode=memberbycountry', 'MenuMembersStats', 1, 'members', '$user->rights->adherent->lire', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && $conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/htpasswd.php?mainmenu=members&leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 9, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/cartes/carte.php?mainmenu=members&leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 10, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4200__+MAX_llx_menu__, 'members', 'members', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&leftmenu=members', 'Members', 0, 'members', '$user->hasRight("adherent","lire")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4201__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/card.php?mainmenu=members&leftmenu=members&action=create', 'NewMember', 1, 'members', '$user->hasRight("adherent","creer")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4202__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/list.php', 'List', 1, 'members', '$user->hasRight("adherent","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4203__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=-1', 'MenuMembersToValidate', 2, 'members', '$user->hasRight("adherent","lire")', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4204__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1', 'MenuMembersValidated', 2, 'members', '$user->hasRight("adherent","lire")', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4205__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=waitingsubscription', 'WaitingSubscription', 2, 'members', '$user->hasRight("adherent","lire")', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4206__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=outofdate', 'UpToDate', 2, 'members', '$user->hasRight("adherent","lire")', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4207__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=uptodate', 'OutOfDate', 2, 'members', '$user->hasRight("adherent","lire")', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4208__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=0', 'MenuMembersResiliated', 2, 'members', '$user->hasRight("adherent","lire")', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4209__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/stats/geo.php?mainmenu=members&leftmenu=members&mode=memberbycountry', 'MenuMembersStats', 1, 'members', '$user->hasRight("adherent","lire")', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && isModEnabled("adherent")', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/htpasswd.php?mainmenu=members&leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->hasRight("adherent","export")', '', 2, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/cartes/carte.php?mainmenu=members&leftmenu=export', 'MembersCards', 1, 'members', '$user->hasRight("adherent","export")', '', 2, 10, __ENTITY__); -- Members - Subscriptions -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4300__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&leftmenu=members', 'Subscriptions', 0, 'compta', '$user->rights->adherent->cotisation->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4301__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&statut=-1&leftmenu=accountancy', 'NewSubscription', 1, 'compta', '$user->rights->adherent->cotisation->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4302__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/subscription/list.php?mainmenu=members&leftmenu=members', 'List', 1, 'compta', '$user->rights->adherent->cotisation->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4303__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/stats/index.php?mainmenu=members&leftmenu=members', 'MenuMembersStats', 1, 'members', '$user->rights->adherent->lire', '', 2, 7, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', 'setup', 13__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup', 'MembersTypes', 0, 'members', '$user->rights->adherent->configurer', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup&action=create', 'New', 1, 'members', '$user->rights->adherent->configurer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup', 'List', 1, 'members', '$user->rights->adherent->configurer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4300__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?mainmenu=members&leftmenu=members', 'Subscriptions', 0, 'compta', '$user->hasRight("adherent","cotisation","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4301__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&statut=-1&leftmenu=accountancy', 'NewSubscription', 1, 'compta', '$user->hasRight("adherent","cotisation","creer")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4302__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/subscription/list.php?mainmenu=members&leftmenu=members', 'List', 1, 'compta', '$user->hasRight("adherent","cotisation","lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4303__+MAX_llx_menu__, 'members', '', 4300__+MAX_llx_menu__, '/adherents/stats/index.php?mainmenu=members&leftmenu=members', 'MenuMembersStats', 1, 'members', '$user->hasRight("adherent","lire")', '', 2, 7, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', 'setup', 13__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup', 'MembersTypes', 0, 'members', '$user->hasRight("adherent","configurer")', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup&action=create', 'New', 1, 'members', '$user->hasRight("adherent","configurer")', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent")', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?mainmenu=members&leftmenu=setup', 'List', 1, 'members', '$user->hasRight("adherent","configurer")', '', 2, 1, __ENTITY__); -- Members - Category member -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?mainmenu=members&leftmenu=cat&type=3', 'MembersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?mainmenu=members&action=create&type=3', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent") && isModEnabled("categorie")', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?mainmenu=members&leftmenu=cat&type=3', 'MembersCategoriesShort', 0, 'categories', '$user->hasRight("categorie","lire")', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("adherent") && isModEnabled("categorie")', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?mainmenu=members&action=create&type=3', 'NewCategory', 1, 'categories', '$user->hasRight("categorie","creer")', '', 2, 0, __ENTITY__); -- HRM - Employee -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->user->user->creer', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("hrm")', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'Employees', 0, 'hrm', '$user->hasRight("user","user","lire")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("hrm")', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->hasRight("user","user","creer")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("hrm")', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'List', 1, 'hrm', '$user->hasRight("user","user","lire")', '', 0, 2, __ENTITY__); -- HRM - Holiday -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?mainmenu=hrm&action=create', 'New', 1, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card_group.php?mainmenu=hrm&action=create', 'NewHolidayForGroup', 1, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'List', 1, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&search_statut=2&leftmenu=hrm', 'ListToApprove', 2, 'trips', '$user->rights->holiday->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?mainmenu=hrm', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5006__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?mainmenu=hrm', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->hasRight("holiday","read")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?mainmenu=hrm&action=create', 'New', 1, 'holiday', '$user->hasRight("holiday","write")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card_group.php?mainmenu=hrm&action=create', 'NewHolidayForGroup', 1, 'holiday', '$user->hasRight("holiday","write")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'List', 1, 'holiday', '$user->hasRight("holiday","read")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&search_statut=2&leftmenu=hrm', 'ListToApprove', 2, 'trips', '$user->hasRight("holiday","read")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?mainmenu=hrm', 'MenuConfCP', 1, 'holiday', '$user->hasRight("holiday","define_holiday")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("holiday")', __HANDLER__, 'left', 5006__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?mainmenu=hrm', 'MenuLogCP', 1, 'holiday', '$user->hasRight("holiday","define_holiday")', '', 0, 3, __ENTITY__); -- HRM - Trips and expenses (old module) -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->rights->deplacement->lire', '', 0, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?mainmenu=accountancy&action=create&leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->rights->deplacement->creer', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2103__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/stats/index.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'Statistics', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("deplacement")', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->hasRight("deplacement","lire")', '', 0, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("deplacement")', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?mainmenu=accountancy&action=create&leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->hasRight("deplacement","creer")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("deplacement")', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->hasRight("deplacement","lire")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("deplacement")', __HANDLER__, 'left', 2103__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/stats/index.php?mainmenu=accountancy&leftmenu=tripsandexpenses', 'Statistics', 1, 'trips', '$user->hasRight("deplacement","lire")', '', 0, 2, __ENTITY__); -- HRM - Expense reports -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5300__+MAX_llx_menu__, 'hrm', 'expensereport', 15__+MAX_llx_menu__, '/expensereport/index.php?mainmenu=hrm&leftmenu=expensereport', 'TripsAndExpenses', 0, 'trips', '$user->rights->expensereport->lire', '', 0, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5301__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/card.php?mainmenu=hrm&action=create&leftmenu=expensereport', 'New', 1, 'trips', '$user->rights->expensereport->creer', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5302__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', 'List', 1, 'trips', '$user->rights->expensereport->lire', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5303__+MAX_llx_menu__, 'hrm', '', 5302__+MAX_llx_menu__, '/expensereport/list.php?mainmenu=hrm&search_status=2&leftmenu=expensereport', 'ListToApprove', 2, 'trips', '$user->rights->expensereport->approve', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5304__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/stats/index.php?mainmenu=hrm&leftmenu=expensereport', 'Statistics', 1, 'trips', '$user->rights->expensereport->lire', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5300__+MAX_llx_menu__, 'hrm', 'expensereport', 15__+MAX_llx_menu__, '/expensereport/index.php?mainmenu=hrm&leftmenu=expensereport', 'TripsAndExpenses', 0, 'trips', '$user->hasRight("expensereport","lire")', '', 0, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5301__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/card.php?mainmenu=hrm&action=create&leftmenu=expensereport', 'New', 1, 'trips', '$user->hasRight("expensereport","creer")', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5302__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', 'List', 1, 'trips', '$user->hasRight("expensereport","lire")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5303__+MAX_llx_menu__, 'hrm', '', 5302__+MAX_llx_menu__, '/expensereport/list.php?mainmenu=hrm&search_status=2&leftmenu=expensereport', 'ListToApprove', 2, 'trips', '$user->hasRight("expensereport","approve")', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("expensereport")', __HANDLER__, 'left', 5304__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/stats/index.php?mainmenu=hrm&leftmenu=expensereport', 'Statistics', 1, 'trips', '$user->hasRight("expensereport","lire")', '', 0, 2, __ENTITY__); From a2c78bcec7eb84bc0eb5fd1505b2ebdcb37df0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 Apr 2023 22:33:26 +0200 Subject: [PATCH 065/156] add ajax tooltip for cronjobs --- htdocs/core/lib/functions.lib.php | 3 ++ htdocs/cron/class/cronjob.class.php | 84 +++++++++++++++++++---------- 2 files changed, 60 insertions(+), 27 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bedb62c1162..e3dad8c0386 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -11288,6 +11288,9 @@ function getElementProperties($element_type) $classpath = 'comm/action/class'; $subelement = 'Actioncomm'; $module = 'agenda'; + } elseif ($element_type == 'cronjob') { + $classpath = 'cron/class'; + $module = 'cron'; } elseif ($element_type == 'adherent_type') { $classpath = 'adherents/class'; $classfile = 'adherent_type'; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 010ea7b6f32..70ecfb0bf55 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -969,6 +969,49 @@ class Cronjob extends CommonObject } + /** + * getTooltipContentArray + * @param array $params params to construct tooltip data + * @since v18 + * @return array + */ + public function getTooltipContentArray($params) + { + global $langs; + + $langs->load('cron'); + $datas = []; + + $datas['picto'] = img_picto('', 'object_'.$this->picto).' '.$langs->trans("CronTask").''; + if (isset($this->status)) { + $datas['picto'] .= ' '.$this->getLibStatut(5); + } + $datas['ref'] = '
'.$langs->trans('Ref').': '.dol_escape_htmltag($this->ref); + $datas['label'] = '
'.$langs->trans('Title').': '.$langs->trans($this->label); + if ($this->label != $langs->trans($this->label)) { + $datas['label'] .= ' ('.$this->label.')'; + } + if (!empty($this->params)) { + $datas['params'] = '
'.$langs->trans('Parameters').': '.dol_escape_htmltag($this->params); + } + $datas['space'] = '
'; + + if (!empty($this->datestart)) { + $datas['crondtstart'] = '
'.$langs->trans('CronDtStart').': '.dol_print_date($this->datestart, 'dayhour', 'tzuserrel'); + } + if (!empty($this->dateend)) { + $datas['crondtend'] = '
'.$langs->trans('CronDtEnd').': '.dol_print_date($this->dateend, 'dayhour', 'tzuserrel'); + } + if (!empty($this->datelastrun)) { + $datas['cronlastlaunch'] = '
'.$langs->trans('CronDtLastLaunch').': '.dol_print_date($this->datelastrun, 'dayhour', 'tzuserrel'); + } + if (!empty($this->datenextrun)) { + $datas['crondtnextlaunch'] = '
'.$langs->trans('CronDtNextLaunch').': '.dol_print_date($this->datenextrun, 'dayhour', 'tzuserrel'); + } + + return $datas; + } + /** * Return a link to the object card (with optionaly the picto) * @@ -991,31 +1034,18 @@ class Cronjob extends CommonObject $result = ''; - $label = img_picto('', 'object_'.$this->picto).' '.$langs->trans("CronTask").''; - if (isset($this->status)) { - $label .= ' '.$this->getLibStatut(5); - } - $label .= '
'.$langs->trans('Ref').': '.dol_escape_htmltag($this->ref); - $label .= '
'.$langs->trans('Title').': '.$langs->trans($this->label); - if ($this->label != $langs->trans($this->label)) { - $label .= ' ('.$this->label.')'; - } - if (!empty($this->params)) { - $label .= '
'.$langs->trans('Parameters').': '.dol_escape_htmltag($this->params); - } - $label .= '
'; - - if (!empty($this->datestart)) { - $label .= '
'.$langs->trans('CronDtStart').': '.dol_print_date($this->datestart, 'dayhour', 'tzuserrel'); - } - if (!empty($this->dateend)) { - $label .= '
'.$langs->trans('CronDtEnd').': '.dol_print_date($this->dateend, 'dayhour', 'tzuserrel'); - } - if (!empty($this->datelastrun)) { - $label .= '
'.$langs->trans('CronDtLastLaunch').': '.dol_print_date($this->datelastrun, 'dayhour', 'tzuserrel'); - } - if (!empty($this->datenextrun)) { - $label .= '
'.$langs->trans('CronDtNextLaunch').': '.dol_print_date($this->datenextrun, 'dayhour', 'tzuserrel'); + $params = [ + 'id' => $this->id, + 'objecttype' => $this->element, + ]; + $classfortooltip = 'classfortooltip'; + $dataparams = ''; + if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { + $classfortooltip = 'classforajaxtooltip'; + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } $url = DOL_URL_ROOT.'/cron/card.php?id='.$this->id; @@ -1038,7 +1068,7 @@ class Cronjob extends CommonObject $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } @@ -1049,7 +1079,7 @@ class Cronjob extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { $result .= $this->ref; From 99ba7353273bdf34ac1f01ca7a8f55264079420a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 22:49:33 +0200 Subject: [PATCH 066/156] Fix message --- htdocs/langs/en_US/admin.lang | 1 - htdocs/langs/en_US/mails.lang | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 051c0462851..9c5d62fc38b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2138,7 +2138,6 @@ EmailCollectorExampleToCollectJobCandidaturesDesc=Collect emails applying to job EmailCollectorExampleToCollectJobCandidatures=Example collecting job candidatures received by e-mail NoNewEmailToProcess=No new email (matching filters) to process NothingProcessed=Nothing done -XEmailsDoneYActionsDone=%s emails pre-qualified, %s emails successfully processed (for %s record/actions done) RecordEvent=Record an event in agenda (with type Email sent or received) CreateLeadAndThirdParty=Create a lead (and a third party if necessary) CreateTicketAndThirdParty=Create a ticket (linked to a third party if the third party was loaded by a previous operation or was guessed from a tracker in email header, without third party otherwise) diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 4c217677375..2e60d8549aa 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -182,4 +182,5 @@ WarningLimitSendByDay=WARNING: The setup or contract of your instance limits you NoMoreRecipientToSendTo=No more recipient to send the email to EmailOptedOut=Email owner has requested to not contact him with this email anymore EvenUnsubscribe=Include opt-out emails -EvenUnsubscribeDesc=Include opt-out emails when you select emails as targets. Usefull for mandatory service emails for example. \ No newline at end of file +EvenUnsubscribeDesc=Include opt-out emails when you select emails as targets. Usefull for mandatory service emails for example. +XEmailsDoneYActionsDone=%s emails pre-qualified, %s emails successfully processed (for %s record/actions done) From e09e6ffe2cf452a015053fbd94a94bc4c7f1a9b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Apr 2023 22:57:43 +0200 Subject: [PATCH 067/156] Fix error message --- htdocs/emailcollector/class/emailcollector.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index cb06609562d..682c539b784 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -2838,6 +2838,8 @@ class EmailCollector extends CommonObject if (empty($projecttocreate->ref) || (is_numeric($projecttocreate->ref) && $projecttocreate->ref <= 0)) { $errorforactions++; $this->error = 'Failed to create project: Can\'t get a valid value for the field ref with numbering template = '.$modele.', thirdparty id = '.$thirdpartystatic->id; + + $operationslog .= '
'.$this->error; } else { // Create project $result = $projecttocreate->create($user); @@ -2845,6 +2847,8 @@ class EmailCollector extends CommonObject $errorforactions++; $this->error = 'Failed to create project: '.$langs->trans($projecttocreate->error); $this->errors = $projecttocreate->errors; + + $operationslog .= '
'.$this->error; } else { if ($attachments) { $destdir = $conf->project->dir_output.'/'.$projecttocreate->ref; From 5b90302bf85cec4f1d809da65a11e3bff25651ac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 00:00:36 +0200 Subject: [PATCH 068/156] Update scope for security report --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 3c89a2f38e1..1c281099885 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,8 +6,8 @@ This file contains some policies about the security reports on Dolibarr ERP CRM | Version | Supported | | ---------- | ---------------------- | -| <= 16.0.2 | :x: | -| >= 16.0.3 | :white_check_mark: | +| <= 17.0.0 | :x: | +| >= 17.0.1 | :white_check_mark: | | >= develop | :white_check_mark: | ## Reporting a Vulnerability From 7126ff7b1f2b1f37d149753721f02e0b1da0190e Mon Sep 17 00:00:00 2001 From: VMR Global Solutions Date: Thu, 27 Apr 2023 09:16:17 +0200 Subject: [PATCH 069/156] Update api_receptions.class.php Change made in _private function validate in reception/class/api_receptions.class.php:709 replaced line 712 foreach (Shipments::$FIELDS as $field) { => foreach (Receptions::$FIELDS as $field) { --- htdocs/reception/class/api_receptions.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/class/api_receptions.class.php b/htdocs/reception/class/api_receptions.class.php index c9f4cba44cc..b24a8dbef11 100644 --- a/htdocs/reception/class/api_receptions.class.php +++ b/htdocs/reception/class/api_receptions.class.php @@ -709,7 +709,7 @@ class Receptions extends DolibarrApi private function _validate($data) { $reception = array(); - foreach (Shipments::$FIELDS as $field) { + foreach (Receptions::$FIELDS as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); } From 244a986baf74e7be662055ac8c0d822c9786987f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Apr 2023 09:21:56 +0200 Subject: [PATCH 070/156] fix eval --- htdocs/core/lib/company.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 20a4ffdafc1..0a10d195e06 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1038,9 +1038,10 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) { $arrayfields["ef.".$key] = array( 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key] < 0) ? 0 : 1), + 'checked'=>((dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1, 1, '1') < 0) ? 0 : 1), 'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key], - 'enabled'=>(abs((int) $extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); + 'enabled' => (abs((int) dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1)) != 3 && dol_eval($extrafields->attributes[$contactstatic->table_element]['perms'][$key], 1, 1, '1')) + ); } } } From 0d3fdbe408074e397d62a01b0dd5aedad55dc603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Apr 2023 09:42:54 +0200 Subject: [PATCH 071/156] clean code --- htdocs/bom/class/bom.class.php | 68 +++++++++++++++------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 07acb99189f..a1a7ced7caf 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -216,11 +216,6 @@ class BOM extends CommonObject */ public $lines = array(); - /** - * @var BOMLine Bom line - */ - public $line; - /** * @var int Calculated cost for the BOM */ @@ -232,7 +227,6 @@ class BOM extends CommonObject public $unit_cost = 0; - /** * Constructor * @@ -632,33 +626,33 @@ class BOM extends CommonObject } // Insert line - $this->line = new BOMLine($this->db); + $line = new BOMLine($this->db); - $this->line->context = $this->context; + $line->context = $this->context; - $this->line->fk_bom = $this->id; - $this->line->fk_product = $fk_product; - $this->line->qty = $qty; - $this->line->qty_frozen = $qty_frozen; - $this->line->disable_stock_change = $disable_stock_change; - $this->line->efficiency = $efficiency; - $this->line->fk_bom_child = $fk_bom_child; - $this->line->import_key = $import_key; - $this->line->position = $rankToUse; - $this->line->fk_unit = $fk_unit; + $line->fk_bom = $this->id; + $line->fk_product = $fk_product; + $line->qty = $qty; + $line->qty_frozen = $qty_frozen; + $line->disable_stock_change = $disable_stock_change; + $line->efficiency = $efficiency; + $line->fk_bom_child = $fk_bom_child; + $line->import_key = $import_key; + $line->position = $rankToUse; + $line->fk_unit = $fk_unit; if (is_array($array_options) && count($array_options) > 0) { - $this->line->array_options = $array_options; + $line->array_options = $array_options; } - $result = $this->line->create($user); + $result = $line->create($user); if ($result > 0) { $this->calculateCosts(); $this->db->commit(); return $result; } else { - $this->error = $this->line->error; + $this->error = $line->error; dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -727,8 +721,7 @@ class BOM extends CommonObject $staticLine = clone $line; $line->oldcopy = $staticLine; - $this->line = $line; - $this->line->context = $this->context; + $line->context = $this->context; // Rank to use $rankToUse = (int) $position; @@ -746,32 +739,32 @@ class BOM extends CommonObject } - $this->line->fk_bom = $this->id; - $this->line->qty = $qty; - $this->line->qty_frozen = $qty_frozen; - $this->line->disable_stock_change = $disable_stock_change; - $this->line->efficiency = $efficiency; - $this->line->import_key = $import_key; - $this->line->position = $rankToUse; + $line->fk_bom = $this->id; + $line->qty = $qty; + $line->qty_frozen = $qty_frozen; + $line->disable_stock_change = $disable_stock_change; + $line->efficiency = $efficiency; + $line->import_key = $import_key; + $line->position = $rankToUse; if (!empty($fk_unit)) { - $this->line->fk_unit = $fk_unit; + $line->fk_unit = $fk_unit; } if (is_array($array_options) && count($array_options) > 0) { // We replace values in this->line->array_options only for entries defined into $array_options foreach ($array_options as $key => $value) { - $this->line->array_options[$key] = $array_options[$key]; + $line->array_options[$key] = $array_options[$key]; } } - $result = $this->line->update($user); + $result = $line->update($user); if ($result > 0) { $this->calculateCosts(); $this->db->commit(); return $result; } else { - $this->error = $this->line->error; + $this->error = $line->error; dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -806,10 +799,9 @@ class BOM extends CommonObject $staticLine = clone $line; $line->oldcopy = $staticLine; - $this->line = $line; - $this->line->context = $this->context; + $line->context = $this->context; - $result = $this->line->delete($user, $notrigger); + $result = $line->delete($user, $notrigger); //Positions (rank) reordering foreach ($this->lines as $bl) { @@ -824,7 +816,7 @@ class BOM extends CommonObject $this->db->commit(); return $result; } else { - $this->error = $this->line->error; + $this->error = $line->error; dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; From 1d8c7f934f7d011711da4eb3aac8033f7a74458f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Apr 2023 09:47:00 +0200 Subject: [PATCH 072/156] clean code --- htdocs/bom/class/bom.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index a1a7ced7caf..b9d485820a5 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -652,7 +652,7 @@ class BOM extends CommonObject $this->db->commit(); return $result; } else { - $this->error = $line->error; + $this->setErrorsFromObject($line); dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -764,7 +764,7 @@ class BOM extends CommonObject $this->db->commit(); return $result; } else { - $this->error = $line->error; + $this->setErrorsFromObject($line); dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; @@ -816,7 +816,7 @@ class BOM extends CommonObject $this->db->commit(); return $result; } else { - $this->error = $line->error; + $this->setErrorsFromObject($line); dol_syslog(get_class($this)."::addLine error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; From 53d2757a8fb0ec17e78866ff014c29e697405a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Apr 2023 09:54:40 +0200 Subject: [PATCH 073/156] clean code --- htdocs/modulebuilder/template/class/myobject.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index dac32970ae6..9be0ad173ed 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -368,8 +368,7 @@ class MyObject extends CommonObject $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } if (!$error) { @@ -1056,8 +1055,7 @@ class MyObject extends CommonObject $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_myobject = '.((int) $this->id))); if (is_numeric($result)) { - $this->error = $objectline->error; - $this->errors = $objectline->errors; + $this->setErrorsFromObject($objectline); return $result; } else { $this->lines = $result; From a11d8a5589c345ff9f5fdaf3ea84726917c48d27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 11:55:49 +0200 Subject: [PATCH 074/156] Fix field must never be empty --- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7bf8f87d0f0..0eaefbf7c0f 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1582,7 +1582,7 @@ class BonPrelevement extends CommonObject $cachearraytotestduplicate[$obj->idfac] = $obj->rowid; $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); - $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac_ref_supplier, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); + $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac.($obj->fac_ref_supplier ? ' '.$obj->fac_ref_supplier : ''), $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); $this->total = $this->total + $obj->somme; $i++; } From fa832e8a0df70ba9734bff4f2dd423d64325d971 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 12:37:42 +0200 Subject: [PATCH 075/156] Fix missing date in popup --- htdocs/compta/paymentbybanktransfer/index.php | 8 ++++++-- htdocs/fourn/class/fournisseur.facture.class.php | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 7331aee48fa..adab830546a 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -101,7 +101,7 @@ print '
'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).''.$langs->trans("Description").''.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).' 

'; /* * Invoices waiting for withdraw */ -$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,"; +$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type, f.datef, f.date_lim_reglement,"; $sql .= " pfd.date_demande, pfd.amount,"; $sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,"; @@ -141,9 +141,13 @@ if ($resql) { $invoicestatic->id = $obj->rowid; $invoicestatic->ref = $obj->ref; - $invoicestatic->statut = $obj->fk_statut; + $invoicestatic->status = $obj->fk_statut; + $invoicestatic->statut = $obj->fk_statut; // For backward comaptibility $invoicestatic->paye = $obj->paye; $invoicestatic->type = $obj->type; + $invoicestatic->date = $db->jdate($obj->datef); + $invoicestatic->date_echeance = $db->jdate($obj->date_lim_reglement); + $invoicestatic->total_ttc = $obj->total_ttc; $alreadypayed = $invoicestatic->getSommePaiement(); $thirdpartystatic->id = $obj->socid; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index bc0c7b9e232..ca81a778fee 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2782,6 +2782,9 @@ class FactureFournisseur extends CommonInvoice if (!empty($this->date)) { $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->date, 'day'); } + if (!empty($this->date_echeance)) { + $label .= '
'.$langs->trans('DateDue').': '.dol_print_date($this->date_echeance, 'day'); + } if (!empty($this->total_ht)) { $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); } From 44b5b4fde951b7475c6552c23a43daf6d86d293d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 12:53:50 +0200 Subject: [PATCH 076/156] Fix look and feel v17 --- htdocs/compta/paiement/cheque/index.php | 6 ++++++ htdocs/compta/paymentbybanktransfer/index.php | 2 +- htdocs/compta/prelevement/create.php | 20 +++++-------------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 394de095104..33c4d37c45d 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -127,6 +127,8 @@ if ($resql) { print '
'.$langs->trans("Status").'
'.$langs->trans("None").'
"; print '
'; diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index adab830546a..ab26fe4c498 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -134,7 +134,7 @@ if ($resql) { print '
'; print ''; print ''; - print ''; + print ''; if ($num) { while ($i < $num && $i < 20) { $obj = $db->fetch_object($resql); diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 7c91bfcca8e..deb48fd98e9 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -183,8 +183,6 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -llxHeader('', $langs->trans("NewStandingOrder")); - if (prelevement_check_config($type) < 0) { $langs->load("errors"); $modulenametoshow = "Withdraw"; @@ -195,21 +193,13 @@ if (prelevement_check_config($type) < 0) { } -/*$h=0; -$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/create.php'; -$head[$h][1] = $langs->trans("NewStandingOrder"); -$head[$h][2] = 'payment'; -$hselected = 'payment'; -$h++; - -print dol_get_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment'); -*/ - $title = $langs->trans("NewStandingOrder"); if ($type == 'bank-transfer') { $title = $langs->trans("NewPaymentByBankTransfer"); } +llxHeader('', $title); + print load_fiche_titre($title); print dol_get_fiche_head(); @@ -221,12 +211,12 @@ if ($nb < 0) { } print '
'.$langs->trans("SupplierInvoiceWaitingWithdraw").' ('.$num.')
'.$langs->trans("SupplierInvoiceWaitingWithdraw").' ('.$num.')
'; -$title = $langs->trans("NbOfInvoiceToWithdraw"); +$labeltoshow = $langs->trans("NbOfInvoiceToWithdraw"); if ($type == 'bank-transfer') { - $title = $langs->trans("NbOfInvoiceToPayByBankTransfer"); + $labeltoshow = $langs->trans("NbOfInvoiceToPayByBankTransfer"); } -print ''; +print ''; print ''; From 302c6a0ab993d767eb097cb8f846ca987fcb435f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 14:02:59 +0200 Subject: [PATCH 077/156] Fix serious regression in creating MO. --- htdocs/bom/bom_card.php | 4 +- htdocs/bom/class/bom.class.php | 21 +++- htdocs/bom/tpl/objectline_view.tpl.php | 15 ++- htdocs/langs/en_US/mrp.lang | 2 +- htdocs/mrp/class/mo.class.php | 132 +++++++++++++++++++++++-- htdocs/mrp/mo_production.php | 5 + 6 files changed, 158 insertions(+), 21 deletions(-) diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 9aa7d084ef1..64681ea098c 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -566,7 +566,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (!empty($object->table_element_line)) { // Products - $res = $object->fetchLinesbytypeproduct(0); + $res = $object->fetchLinesbytypeproduct(0); // Load all lines products into ->lines $object->calculateCosts(); print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMProductsList'), '', 'product'); @@ -615,7 +615,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Services $filtertype = 1; - $res = $object->fetchLinesbytypeproduct(1); + $res = $object->fetchLinesbytypeproduct(1); // Load all lines services into ->lines $object->calculateCosts(); print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service'); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 1edf20c4472..5bc09528026 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1391,21 +1391,32 @@ class BOM extends CommonObject } } } else { - //Convert qty to hour - $unit = measuringUnitString($line->fk_unit, '', '', 1); - $qty = convertDurationtoHour($line->qty, $unit); + // Convert qty of line into hours + $unitforline = measuringUnitString($line->fk_unit, '', '', 1); + $qtyhourforline = convertDurationtoHour($line->qty, $unitforline); if (isModEnabled('workstation') && !empty($tmpproduct->fk_default_workstation)) { $workstation = new Workstation($this->db); $res = $workstation->fetch($tmpproduct->fk_default_workstation); - if ($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); + if ($res > 0) $line->total_cost = price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT'); else { $this->error = $workstation->error; return -3; } } else { - $line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT'); + $defaultdurationofservice = $tmpproduct->duration; + $reg = array(); + $qtyhourservice = 0; + if (preg_match('/^(\d+)([a-z]+)$/', $defaultdurationofservice, $reg)) { + $qtyhourservice = convertDurationtoHour($reg[1], $reg[2]); + } + + if ($qtyhourservice) { + $line->total_cost = price2num($qtyhourforline / $qtyhourservice * $tmpproduct->cost_price, 'MT'); + } else { + $line->total_cost = price2num($line->qty * $tmpproduct->cost_price, 'MT'); + } } $this->total_cost += $line->total_cost; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 95bbed79784..b921e23d64d 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -78,10 +78,14 @@ $objectline = new BOMLine($object->db); $coldisplay = 0; print "\n"; print ''; + +// Line nb if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print ''; $coldisplay++; } + +// Product print ''; +// Qty print ''; } else { - //Unité + // Unit print ''; } } + +// Cost $total_cost = 0; $tmpbom->calculateCosts(); print ''; $this->total_cost += $line->total_cost; } elseif ($sub_bom_product->cost_price > 0) { - print ''; + print ''; $total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty; } elseif ($sub_bom_product->pmp > 0) { // PMP if cost price isn't defined - print ''; + print ''; $total_cost.= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty; } else { // Minimum purchase price if cost price and PMP aren't defined $sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index fffb9e571da..f8ee50b341b 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -83,7 +83,7 @@ ProductsToProduce=Products to produce UnitCost=Unit cost TotalCost=Total cost BOMTotalCost=The cost to produce this BOM based on cost of each quantity and product to consume (use Cost price if defined, else Average Weighted Price if defined, else the Best purchase price) -BOMTotalCostService=If the "Workstation" module is activated and a workstation is defined by default on the line, then the calculation is "quantity (converted into hours) x workstation ahr", otherwise "quantity (converted into hours) x cost price of the service" +BOMTotalCostService=If the "Workstation" module is activated and a workstation is defined by default on the line, then the calculation is "quantity (converted into hours) x workstation ahr", otherwise "quantity x cost price of the service" GoOnTabProductionToProduceFirst=You must first have started the production to close a Manufacturing Order (See tab '%s'). But you can Cancel it. ErrorAVirtualProductCantBeUsedIntoABomOrMo=A kit can't be used into a BOM or a MO Workstation=Workstation diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index ecb82507738..096a1afe906 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -101,7 +101,7 @@ class Mo extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>'1', 'noteditable'=>1), - 'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:(t.status:=:1)', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>'$conf->bom->enabled', 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth300', 'csslist'=>'nowraponall', 'picto'=>'bom'), + 'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:(t.status:=:1)', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>'$conf->bom->enabled', 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'bom'), 'mrptype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>34, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>'$conf->product->enabled', 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax100', 'picto'=>'product'), 'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1), @@ -255,26 +255,23 @@ class Mo extends CommonObject */ public function create(User $user, $notrigger = false) { - global $conf; - $error = 0; $idcreated = 0; - $this->db->begin(); - - // Check that product is not a kit/virtual product - if (empty($conf->global->ALLOW_USE_KITS_INTO_BOM_AND_MO) && $this->fk_product > 0) { + // If kits feature is enabled and we don't allow kits into BOM and MO, we check that the product is not a kit/virtual product + if (getDolGlobalString('PRODUIT_SOUSPRODUITS') && !getDolGlobalString('ALLOW_USE_KITS_INTO_BOM_AND_MO') && $this->fk_product > 0) { include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $tmpproduct = new Product($this->db); $tmpproduct->fetch($this->fk_product); if ($tmpproduct->hasFatherOrChild(1) > 0) { $this->error = 'ErrorAVirtualProductCantBeUsedIntoABomOrMo'; $this->errors[] = $this->error; - $this->db->rollback(); return -1; } } + $this->db->begin(); + if ($this->fk_bom > 0) { // If there is a nown BOM, we force the type of MO to the type of BOM include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; @@ -292,7 +289,7 @@ class Mo extends CommonObject } if (!$error) { - $result = $this->updateProduction($user, $notrigger); // Insert lines from BOM + $result = $this->createProduction($user, $notrigger); // Insert lines from BOM if ($result <= 0) { $error++; } @@ -612,6 +609,121 @@ class Mo extends CommonObject $error++; } + // Update the lines (the qty) to consume or to produce + $result = $this->updateProduction($user, $notrigger); + if ($result <= 0) { + $error++; + } + + if (!$error) { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return -1; + } + } + + + /** + * Erase and update the line to consume and to produce. + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function createProduction(User $user, $notrigger = true) + { + $error = 0; + $role = ""; + + if ($this->status != self::STATUS_DRAFT) { + return -1; + } + + $this->db->begin(); + + // Insert lines in mrp_production table from BOM data + if (!$error) { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'mrp_production WHERE fk_mo = '.((int) $this->id); + $this->db->query($sql); + + $moline = new MoLine($this->db); + + // Line to produce + $moline->fk_mo = $this->id; + $moline->qty = $this->qty; + $moline->fk_product = $this->fk_product; + $moline->position = 1; + + if ($this->fk_bom > 0) { // If a BOM is defined, we know what to produce. + include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; + $bom = new Bom($this->db); + $bom->fetch($this->fk_bom); + if ($bom->bomtype == 1) { + $role = 'toproduce'; + $moline->role = 'toconsume'; + } else { + $role = 'toconsume'; + $moline->role = 'toproduce'; + } + } else { + if ($this->mrptype == 1) { + $moline->role = 'toconsume'; + } else { + $moline->role = 'toproduce'; + } + } + + $resultline = $moline->create($user, false); // Never use triggers here + if ($resultline <= 0) { + $error++; + $this->error = $moline->error; + $this->errors = $moline->errors; + dol_print_error($this->db, $moline->error, $moline->errors); + } + + if ($this->fk_bom > 0) { // If a BOM is defined, we know what to consume. + if ($bom->id > 0) { + // Lines to consume + if (!$error) { + foreach ($bom->lines as $line) { + $moline = new MoLine($this->db); + + $moline->fk_mo = $this->id; + $moline->origin_id = $line->id; + $moline->origin_type = 'bomline'; + if ($line->qty_frozen) { + $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce + } else { + $moline->qty = price2num(($line->qty / ( !empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( !empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition + } + if ($moline->qty <= 0) { + $error++; + $this->error = "BadValueForquantityToConsume"; + break; + } else { + $moline->fk_product = $line->fk_product; + $moline->role = $role; + $moline->position = $line->position; + $moline->qty_frozen = $line->qty_frozen; + $moline->disable_stock_change = $line->disable_stock_change; + + $resultline = $moline->create($user, false); // Never use triggers here + if ($resultline <= 0) { + $error++; + $this->error = $moline->error; + $this->errors = $moline->errors; + dol_print_error($this->db, $moline->error, $moline->errors); + break; + } + } + } + } + } + } + } + if (!$error) { $this->db->commit(); return 1; @@ -622,7 +734,7 @@ class Mo extends CommonObject } /** - * Erase and update the line to consume and to produce. + * Update quantities in lines to consume and to produce. * * @param User $user User that modifies * @param bool $notrigger false=launch triggers after, true=disable triggers diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 49bafee23c3..894a7156a13 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -168,6 +168,11 @@ if (empty($reshook)) { $moline->origin_type = 'free'; // free consume line $moline->position = 0; + // Is it a product or a service ? + $tmpproduct = new Product($db); + $tmpproduct->fetch($moline->fk_product); + $moline->disable_stock_change = ($tmpproduct->type == Product::TYPE_SERVICE ? 1 : 0); + $resultline = $moline->create($user, false); // Never use triggers here if ($resultline <= 0) { $error++; From 8642791dce3153ec7f5be35499e729687c49d362 Mon Sep 17 00:00:00 2001 From: bahfir abbes Date: Thu, 27 Apr 2023 12:09:01 +0100 Subject: [PATCH 078/156] Unused variable --- htdocs/takepos/invoice.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index fec43a23599..6b55ecd532e 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -54,7 +54,6 @@ $hookmanager->initHooks(array('takeposinvoice')); $langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks", "banks")); -$id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $idproduct = GETPOST('idproduct', 'int'); $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant From ca815ff9c6e03be4869e06f6b1306f44b535fb23 Mon Sep 17 00:00:00 2001 From: hystepik Date: Thu, 27 Apr 2023 14:56:27 +0200 Subject: [PATCH 079/156] working dispatchcard reception --- htdocs/core/lib/reception.lib.php | 7 + .../class/fournisseur.commande.class.php | 7 +- htdocs/fourn/js/lib_dispatch.js.php | 123 +- htdocs/langs/en_US/receptions.lang | 4 +- htdocs/reception/dispatch.php | 1135 +++++++++++++++++ 5 files changed, 1213 insertions(+), 63 deletions(-) create mode 100644 htdocs/reception/dispatch.php diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php index e697908e8cb..16e036991f9 100644 --- a/htdocs/core/lib/reception.lib.php +++ b/htdocs/core/lib/reception.lib.php @@ -46,6 +46,13 @@ function reception_prepare_head(Reception $object) $head[$h][2] = 'reception'; $h++; + if ($object->statut == Reception::STATUS_DRAFT) { + $head[$h][0] = DOL_URL_ROOT."/reception/dispatch.php?id=".$object->id; + $head[$h][1] = $langs->trans("DispatchCard"); + $head[$h][2] = 'dispatch'; + $h++; + } + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { $objectsrc = $object; if ($object->origin == 'supplier_order' && $object->origin_id > 0) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e3f8e3c5f81..738b7eb3dc2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2110,9 +2110,10 @@ class CommandeFournisseur extends CommonOrder * @param string $batch Lot number * @param int $fk_commandefourndet Id of supplier order line * @param int $notrigger 1 = notrigger + * @param int $fk_reception Id of reception to link * @return int <0 if KO, >0 if OK */ - public function dispatchProduct($user, $product, $qty, $entrepot, $price = 0, $comment = '', $eatby = '', $sellby = '', $batch = '', $fk_commandefourndet = 0, $notrigger = 0) + public function dispatchProduct($user, $product, $qty, $entrepot, $price = 0, $comment = '', $eatby = '', $sellby = '', $batch = '', $fk_commandefourndet = 0, $notrigger = 0, $fk_reception = 0) { global $conf, $langs; @@ -2142,9 +2143,9 @@ class CommandeFournisseur extends CommonOrder $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur_dispatch"; - $sql .= " (fk_commande, fk_product, qty, fk_entrepot, fk_user, datec, fk_commandefourndet, status, comment, eatby, sellby, batch) VALUES"; + $sql .= " (fk_commande, fk_product, qty, fk_entrepot, fk_user, datec, fk_commandefourndet, status, comment, eatby, sellby, batch, fk_reception) VALUES"; $sql .= " ('".$this->id."','".$product."','".$qty."',".($entrepot > 0 ? "'".$entrepot."'" : "null").",'".$user->id."','".$this->db->idate($now)."','".$fk_commandefourndet."', ".$dispatchstatus.", '".$this->db->escape($comment)."', "; - $sql .= ($eatby ? "'".$this->db->idate($eatby)."'" : "null").", ".($sellby ? "'".$this->db->idate($sellby)."'" : "null").", ".($batch ? "'".$this->db->escape($batch)."'" : "null"); + $sql .= ($eatby ? "'".$this->db->idate($eatby)."'" : "null").", ".($sellby ? "'".$this->db->idate($sellby)."'" : "null").", ".($batch ? "'".$this->db->escape($batch)."'" : "null").", ".($fk_reception > 0 ? "'".$fk_reception."'" : "null"); $sql .= ")"; dol_syslog(get_class($this)."::dispatchProduct", LOG_DEBUG); diff --git a/htdocs/fourn/js/lib_dispatch.js.php b/htdocs/fourn/js/lib_dispatch.js.php index 7d711d3a19a..44a4df1161e 100644 --- a/htdocs/fourn/js/lib_dispatch.js.php +++ b/htdocs/fourn/js/lib_dispatch.js.php @@ -65,39 +65,36 @@ if (empty($dolibarr_nocache)) { * @param type string type of dispatch (batch = batch dispatch, dispatch = non batch dispatch) * @param mode string 'qtymissing' will create new line with qty missing, 'lessone' will keep 1 in old line and the rest in new one */ -function addDispatchLine(index, type, mode) -{ +function addDispatchLine(index, type, mode) { mode = mode || 'qtymissing' - console.log("fourn/js/lib_dispatch.js.php Split line type="+type+" index="+index+" mode="+mode); - var $row0 = $("tr[name='"+type+'_0_'+index+"']"); + console.log("fourn/js/lib_dispatch.js.php Split line type=" + type + " index=" + index + " mode=" + mode); + var $row0 = $("tr[name='" + type + '_0_' + index + "']"); var $dpopt = $row0.find('.hasDatepicker').first().datepicker('option', 'all'); // get current datepicker options to apply the same to the cloned datepickers var $row = $row0.clone(true); // clone first batch line to jQuery object - var nbrTrs = $("tr[name^='"+type+"_'][name$='_"+index+"']").length; // position of line for batch - var qtyOrdered = parseFloat($("#qty_ordered_0_"+index).val()); // Qty ordered is same for all rows - var qty = parseFloat($("#qty_"+(nbrTrs - 1)+"_"+index).val()); - var qtyDispatched; + var nbrTrs = $("tr[name^='" + type + "_'][name$='_" + index + "']").length; // position of line for batch + var qtyOrdered = parseFloat($("#qty_ordered_0_" + index).val()); // Qty ordered is same for all rows + var qty = parseFloat($("#qty_" + (nbrTrs - 1) + "_" + index).val()); + var qtyDispatched; - if (mode === 'lessone') - { - qtyDispatched = parseFloat($("#qty_dispatched_0_"+index).val()) + 1; + if (mode === 'lessone') { + qtyDispatched = parseFloat($("#qty_dispatched_0_" + index).val()) + 1; } - else - { - qtyDispatched = parseFloat($("#qty_dispatched_0_"+index).val()) + qty; + else { + qtyDispatched = parseFloat($("#qty_dispatched_0_" + index).val()) + qty; // If user did not reduced the qty to dispatch on old line, we keep only 1 on old line and the rest on new line if (qtyDispatched == qtyOrdered && qtyDispatched > 1) { - qtyDispatched = parseFloat($("#qty_dispatched_0_"+index).val()) + 1; + qtyDispatched = parseFloat($("#qty_dispatched_0_" + index).val()) + 1; mode = 'lessone'; } } - console.log("qtyDispatched="+qtyDispatched+" qtyOrdered="+qtyOrdered); + console.log("qtyDispatched=" + qtyDispatched + " qtyOrdered=" + qtyOrdered); if (qtyDispatched >= qtyOrdered || qtyOrdered <= 1) { window.alert("Remain quantity to dispatch is too low to be split"); } else if (qtyDispatched < qtyOrdered) { //replace tr suffix nbr - $row.html($row.html().replace(/_0_/g,"_"+nbrTrs+"_")); + $row.html($row.html().replace(/_0_/g, "_" + nbrTrs + "_")); // jquery's deep clone is incompatible with date pickers (the clone shares data with the original) // so we destroy and rebuild the new date pickers @@ -111,57 +108,63 @@ function addDispatchLine(index, type, mode) }, 0); //create new select2 to avoid duplicate id of cloned one - $row.find("select[name='"+'entrepot_'+nbrTrs+'_'+index+"']").select2(); + $row.find("select[name='" + 'entrepot_' + nbrTrs + '_' + index + "']").select2(); // TODO find solution to copy selected option to new select // TODO find solution to keep new tr's after page refresh //clear value $row.find("input[name^='qty']").val(''); //change name of new row - $row.attr('name',type+'_'+nbrTrs+'_'+index); + $row.attr('name', type + '_' + nbrTrs + '_' + index); //insert new row before last row - $("tr[name^='"+type+"_'][name$='_"+index+"']:last").after($row); + $("tr[name^='" + type + "_'][name$='_" + index + "']:last").after($row); //remove cloned select2 with duplicate id. - $("#s2id_entrepot_"+nbrTrs+'_'+index).detach(); // old way to find duplicated select2 component - $(".csswarehouse_"+nbrTrs+"_"+index+":first-child").parent("span.selection").parent(".select2").detach(); + $("#s2id_entrepot_" + nbrTrs + '_' + index).detach(); // old way to find duplicated select2 component + $(".csswarehouse_" + nbrTrs + "_" + index + ":first-child").parent("span.selection").parent(".select2").detach(); /* Suffix of lines are: _ trs.length _ index */ - $("#qty_"+nbrTrs+"_"+index).focus(); - $("#qty_dispatched_0_"+index).val(qtyDispatched); + $("#qty_" + nbrTrs + "_" + index).focus(); + $("#qty_dispatched_0_" + index).val(qtyDispatched); //hide all buttons then show only the last one - $("tr[name^='"+type+"_'][name$='_"+index+"'] .splitbutton").hide(); - $("tr[name^='"+type+"_'][name$='_"+index+"']:last .splitbutton").show(); + $("tr[name^='" + type + "_'][name$='_" + index + "'] .splitbutton").hide(); + $("tr[name^='" + type + "_'][name$='_" + index + "']:last .splitbutton").show(); - $("#reset_"+(nbrTrs)+"_"+index).click(function(){ + $("#reset_" + (nbrTrs) + "_" + index).click(function () { id = $(this).attr("id"); id = id.split("reset_"); idrow = id[1]; - idlast = $("tr[name^='"+type+"_'][name$='_"+index+"']:last .qtydispatchinput").attr("id"); - if (idlast == $("#qty_"+idrow).attr("id")) { - console.log("Remove trigger for tr name = "+type+"_"+idrow); - $('tr[name="'+type+'_'+idrow+'"').remove(); - $("tr[name^='"+type+"_'][name$='_"+index+"']:last .splitbutton").show(); + idlast = $("tr[name^='" + type + "_'][name$='_" + index + "']:last .qtydispatchinput").attr("id"); + if (idlast == $("#qty_" + idrow).attr("id")) { + console.log("Remove trigger for tr name = " + type + "_" + idrow); + $('tr[name="' + type + '_' + idrow + '"').remove(); + $("tr[name^='" + type + "_'][name$='_" + index + "']:last .splitbutton").show(); } else { - console.log("Reset trigger for id = #qty_"+idrow); - $("#qty_"+idrow).val(""); + console.log("Reset trigger for id = #qty_" + idrow); + $("#qty_" + idrow).val(""); } - });; + }); - if (mode === 'lessone') - { - qty = 1; // keep 1 in old line - $("#qty_"+(nbrTrs-1)+"_"+index).val(qty); - } - $("#qty_"+nbrTrs+"_"+index).val(qtyOrdered - qtyDispatched); + if (mode === 'lessone') + { + qty = 1; // keep 1 in old line + $("#qty_"+(nbrTrs-1)+"_"+index).val(qty); + } + $("#qty_" + nbrTrs + "_" + index).val(qtyOrdered - qtyDispatched); // Store arbitrary data for dispatch qty input field change event - $("#qty_"+(nbrTrs-1)+"_"+index).data('qty', qty); - $("#qty_"+(nbrTrs-1)+"_"+index).data('type', type); - $("#qty_"+(nbrTrs-1)+"_"+index).data('index', index); + $("#qty_" + (nbrTrs - 1) + "_" + index).data('qty', qty); + $("#qty_" + (nbrTrs - 1) + "_" + index).data('type', type); + $("#qty_" + (nbrTrs - 1) + "_" + index).data('index', index); // Update dispatched qty when value dispatch qty input field changed - $("#qty_"+(nbrTrs-1)+"_"+index).change(this.onChangeDispatchLineQty); + //$("#qty_" + (nbrTrs - 1) + "_" + index).change(this.onChangeDispatchLineQty); //set focus on lot of new line (if it exists) - $("#lot_number_"+(nbrTrs)+"_"+index).focus(); + $("#lot_number_" + (nbrTrs) + "_" + index).focus(); + //Clean bad values + $("tr[name^='" + type + "_'][name$='_" + index + "']:last").data("remove", "remove"); + $("#lot_number_" + (nbrTrs) + "_" + index).val("") + $("#idline_" + (nbrTrs) + "_" + index).val("-1") + $("#qty_" + (nbrTrs) + "_" + index).data('expected', "0"); + $("#lot_number_" + (nbrTrs) + "_" + index).removeAttr("disabled"); } } @@ -175,26 +178,28 @@ function addDispatchLine(index, type, mode) * element requires arbitrary data qty (value before change), type (type of dispatch) and index (index of product line) */ -function onChangeDispatchLineQty() { - var index = $(this).data('index'), - type = $(this).data('type'), - qty = parseFloat($(this).data('qty')), +function onChangeDispatchLineQty(element) { + var type = $(element).data('type'), + qty = parseFloat($(element).data('expected')), changedQty, nbrTrs, dispatchingQty, qtyOrdered, qtyDispatched; + id = $(element).attr("id"); + id = id.split("_"); + index = id[2]; if (index >= 0 && type && qty >= 0) { - nbrTrs = $("tr[name^='"+type+"_'][name$='_"+index+"']").length; - qtyChanged = parseFloat($(this).val()) - qty; // qty changed - qtyDispatching = parseFloat($("#qty_"+(nbrTrs-1)+"_"+index).val()); // qty currently being dispatched - qtyOrdered = parseFloat($("#qty_ordered_0_"+index).val()); // qty ordered - qtyDispatched = parseFloat($("#qty_dispatched_0_"+index).val()); // qty already dispatched + nbrTrs = $("tr[name^='" + type + "_'][name$='_" + index + "']").length; + qtyChanged = parseFloat($(element).val()) - qty; // qty changed + qtyDispatching = parseFloat($(element).val()); // qty currently being dispatched + qtyOrdered = parseFloat($("#qty_ordered_0_" + index).val()); // qty ordered + qtyDispatched = parseFloat($("#qty_dispatched_0_" + index).val()); // qty already dispatched - console.log("onChangeDispatchLineQty qtyChanged: " + qtyChanged + " qtyDispatching: " + qtyDispatching + " qtyOrdered: " + qtyOrdered + " qtyDispatched: "+ qtyDispatched); + console.log("onChangeDispatchLineQty qtyChanged: " + qtyChanged + " qtyDispatching: " + qtyDispatching + " qtyOrdered: " + qtyOrdered + " qtyDispatched: " + qtyDispatched); if ((qtyChanged) <= (qtyOrdered - (qtyDispatched + qtyDispatching))) { - $("#qty_dispatched_0_"+index).val(qtyDispatched + qtyChanged); + $("#qty_dispatched_0_" + index).val(qtyDispatched + qtyChanged); } else { - $(this).val($(this).data('qty')); + $(element).val($(element).data('expected')); } - $(this).data('qty', $(this).val()); + $(element).data('expected', $(element).val()); } } diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index 7324f14f2e0..43f1512ecef 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -51,4 +51,6 @@ NoMorePredefinedProductToDispatch=No more predefined products to dispatch ReceptionExist=A reception exists ReceptionBackToDraftInDolibarr=Reception %s back to draft ReceptionClassifyClosedInDolibarr=Reception %s classified Closed -ReceptionUnClassifyCloseddInDolibarr=Reception %s re-open \ No newline at end of file +ReceptionUnClassifyCloseddInDolibarr=Reception %s re-open +ResetQtyToDispatch=Reset all quantities to dispatch +ReceptionUpdated=Reception sucessfully updated \ No newline at end of file diff --git a/htdocs/reception/dispatch.php b/htdocs/reception/dispatch.php new file mode 100644 index 00000000000..a9c6c91d675 --- /dev/null +++ b/htdocs/reception/dispatch.php @@ -0,0 +1,1135 @@ + + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2005 Eric Seigne + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010-2021 Juanjo Menent + * Copyright (C) 2014 Cedric Gross + * Copyright (C) 2016 Florian Henry + * Copyright (C) 2017-2022 Ferran Marcet + * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2019-2020 Christophe Battarel + * + * 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/fourn/commande/dispatch.php + * \ingroup commande + * \brief Page to dispatch receiving + */ + +// Load Dolibarr environment +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefournisseur.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; + + +if (isModEnabled('project')) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +} + +// Load translation files required by the page +$langs->loadLangs(array("bills", "orders", "sendings", "companies", "deliveries", "products", "stocks", "receptions")); + +if (isModEnabled('productbatch')) { + $langs->load('productbatch'); +} + + // Security check +$id = GETPOST("id", 'int'); +$ref = GETPOST('ref'); +$lineid = GETPOST('lineid', 'int'); +$action = GETPOST('action', 'aZ09'); +$fk_default_warehouse = GETPOST('fk_default_warehouse', 'int'); +$cancel = GETPOST('cancel', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); + +if ($user->socid) { + $socid = $user->socid; +} + +$hookmanager->initHooks(array('ordersupplierdispatch')); + +// Recuperation de l'id de projet +$projectid = 0; +if (GETPOSTISSET("projectid")) { + $projectid = GETPOST("projectid", 'int'); +} + +$object = new Reception($db); + +if ($id > 0 || !empty($ref)) { + $result = $object->fetch($id, $ref); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + $result = $object->fetch_thirdparty(); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + if (!empty($object->origin)) { + $origin = $object->origin; + + $object->fetch_origin(); + $typeobject = $object->origin; + } + if ($origin == 'order_supplier' && $object->$typeobject->id && (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order"))) { + $origin_id = $object->$typeobject->id; + $objectsrc = new CommandeFournisseur($db); + $objectsrc->fetch($object->$typeobject->id); + } +} + +if (empty($conf->reception->enabled)) { + $permissiontoreceive = $user->rights->fournisseur->commande->receptionner; + $permissiontocontrol = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande_advance->check))); +} else { + $permissiontoreceive = $user->rights->reception->creer; + $permissiontocontrol = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))); +} + +// $id is id of a purchase order. +$result = restrictedArea($user, 'fournisseur', $object, 'reception'); + +if (!isModEnabled('stock')) { + accessforbidden(); +} + +$usercancreate = $user->rights->reception->creer; +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php + + +/* + * Actions + */ + +$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'); +} + +// Update a dispatched line +if ($action == 'updatelines' && $permissiontoreceive) { + $db->begin(); + $error = 0; + + $supplierorderdispatch = new CommandeFournisseurDispatch($db); + $pos = 0; + + foreach ($_POST as $key => $value) { + // without batch module enabled + $reg = array(); + if (preg_match('/^product_.*([0-9]+)_([0-9]+)$/i', $key, $reg)) { + $pos++; + if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { + $modebatch = "barcode"; + } elseif (preg_match('/^product_batch_([0-9]+)_([0-9]+)$/i', $key, $reg)) { // With batchmode enabled + $modebatch = "batch"; + } + + $numline = $pos; + if ($modebatch == "barcode") { + $prod = "product_".$reg[1].'_'.$reg[2]; + } else { + $prod = 'product_batch_'.$reg[1].'_'.$reg[2]; + } + $qty = "qty_".$reg[1].'_'.$reg[2]; + $ent = "entrepot_".$reg[1].'_'.$reg[2]; + $pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount + $fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2]; + $idline = GETPOST("idline_".$reg[1].'_'.$reg[2]); + $lot = ''; + $dDLUO = ''; + $dDLC = ''; + if ($modebatch == "batch") { + $lot = GETPOST('lot_number_'.$reg[1].'_'.$reg[2]); + $dDLUO = dol_mktime(12, 0, 0, GETPOST('dluo_'.$reg[1].'_'.$reg[2].'month', 'int'), GETPOST('dluo_'.$reg[1].'_'.$reg[2].'day', 'int'), GETPOST('dluo_'.$reg[1].'_'.$reg[2].'year', 'int')); + $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc_'.$reg[1].'_'.$reg[2].'month', 'int'), GETPOST('dlc_'.$reg[1].'_'.$reg[2].'day', 'int'), GETPOST('dlc_'.$reg[1].'_'.$reg[2].'year', 'int')); + } + + if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { + $dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'); + if (!empty($dto)) { + $unit_price = price2num(GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU'); + } + $saveprice = "saveprice_".$reg[1].'_'.$reg[2]; + } + } + + // We ask to move a qty + if (($modebatch == "batch" && GETPOST($qty) > 0) || ($modebatch == "barcode" && GETPOST($qty) != 0)) { + if (!(GETPOST($ent, 'int') > 0)) { + dol_syslog('No dispatch for line '.$key.' as no warehouse was chosen.'); + $text = $langs->transnoentities('Warehouse').', '.$langs->transnoentities('Line').' '.($numline); + setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors'); + $error++; + } + + if (!$error) { + if ($idline > 0) { + $result = $supplierorderdispatch->fetch($idline); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error++; + } else { + $qtystart = $supplierorderdispatch->qty; + $supplierorderdispatch->qty = GETPOST($qty); + $supplierorderdispatch->fk_entrepot = GETPOST($ent, 'int'); + if ($modebatch == "batch") { + $supplierorderdispatch->eatby = $dDLUO; + $supplierorderdispatch->sellby = $dDLC; + } + + $result = $supplierorderdispatch->update($user); + if ($result < 0) { + setEventMessages($supplierorderdispatch->error, $supplierorderdispatch->errors, 'errors'); + $error++; + } + + // If module stock is enabled and the stock increase is done on purchase order dispatching + if (!$error && GETPOST($ent, 'int') > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { + $mouv = new MouvementStock($db); + $product = GETPOST($prod, 'int'); + $entrepot = GETPOST($ent, 'int'); + $qtymouv = GETPOST($qty) - $qtystart; + $price = GETPOST($pu); + $comment = GETPOST('comment'); + $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); + $now = dol_now(); + $eatby = ''; + $sellby = ''; + $batch = ''; + if ($modebatch == "batch") { + $eatby = $dDLUO; + $sellby = $dDLC; + $batch = $supplierorderdispatch->batch; + } + if ($product > 0) { + // $price should take into account discount (except if option STOCK_EXCLUDE_DISCOUNT_FOR_PMP is on) + $mouv->origin = $objectsrc; + $mouv->setOrigin($objectsrc->element, $objectsrc->id); + + // Method change if qty < 0 + if (!empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN) && $qtymouv < 0) { + $result = $mouv->livraison($user, $product, $entrepot, $qtymouv*(-1), $price, $comment, $now, $eatby, $sellby, $batch, 0, $inventorycode); + } else { + $result = $mouv->reception($user, $product, $entrepot, $qtymouv, $price, $comment, $eatby, $sellby, $batch, '', 0, $inventorycode); + } + + if ($result < 0) { + setEventMessages($mouv->error, $mouv->errors, 'errors'); + $error++; + } + } + } + } + } else { + $result = $objectsrc->dispatchProduct($user, GETPOST($prod, 'int'), GETPOST($qty), GETPOST($ent, 'int'), GETPOST($pu), GETPOST('comment'), $dDLUO, $dDLC, $lot, GETPOST($fk_commandefourndet, 'int'), 0, $object->id); + if ($result < 0) { + setEventMessages($objectsrc->error, $objectsrc->errors, 'errors'); + $error++; + } + } + + if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { + $dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'), ''); + if (empty($dto)) { + $dto = 0; + } + + //update supplier price + if (GETPOSTISSET($saveprice)) { + // TODO Use class + $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; + $sql .= " SET unitprice='".price2num(GETPOST($pu), 'MU')."'"; + $sql .= ", price=".price2num(GETPOST($pu), 'MU')."*quantity"; + $sql .= ", remise_percent = ".((float) $dto); + $sql .= " WHERE fk_soc=".((int) $object->socid); + $sql .= " AND fk_product=".((int) GETPOST($prod, 'int')); + + $resql = $db->query($sql); + } + } + } + } + } + } + } + if ($error > 0) { + $db->rollback(); + setEventMessages($error, $errors, 'errors'); + } else { + $db->commit(); + setEventMessages($langs->trans("ReceptionUpdated"), null); + } +} + + +/* + * View + */ + +$now = dol_now(); + +$form = new Form($db); +$formproduct = new FormProduct($db); +$warehouse_static = new Entrepot($db); +$supplierorderdispatch = new CommandeFournisseurDispatch($db); + +$title = $object->ref." - ".$langs->trans('OrderDispatch'); +$help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; +$morejs = array('/fourn/js/lib_dispatch.js.php'); + +llxHeader('', $title, $help_url, '', 0, 0, $morejs); + +if ($id > 0 || !empty($ref)) { + if (!empty($object->origin) && $object->origin_id > 0) { + $object->origin = 'CommandeFournisseur'; + $typeobject = $object->origin; + $origin = $object->origin; + $origin_id = $object->origin_id; + $object->fetch_origin(); // Load property $object->commande, $object->propal, ... + } + $soc = new Societe($db); + $soc->fetch($object->socid); + + $author = new User($db); + $author->fetch($object->user_author_id); + + $head = reception_prepare_head($object); + + $title = $langs->trans("SupplierOrder"); + print dol_get_fiche_head($head, 'dispatch', $langs->trans("Reception"), -1, 'dollyrevert'); + + + $formconfirm = ''; + + // Confirmation to delete line + if ($action == 'ask_deleteline') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); + } + + // Call Hook formConfirm + $parameters = array('lineid' => $lineid); + // Note that $action and $object may be modified by hook + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; + } + + // Print form confirm + print $formconfirm; + + // Reception card + $linkback = ''.$langs->trans("BackToList").''; + $morehtmlref = '
'; + // Ref customer reception + + $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); + + // Thirdparty + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); + // Project + if (!empty($conf->project->enabled)) { + $langs->load("projects"); + $morehtmlref .= '
'; + if (0) { // Do not change on reception + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; + } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300'); + } else { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { + $proj = new Project($db); + $proj->fetch($objectsrc->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } + } + } + $morehtmlref .= '
'; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + + print '
'.$title.'
'.$labeltoshow.''; print $nb; print '
'.($i + 1).''; print '
'; $coldisplay++; @@ -113,6 +117,7 @@ if (!empty($extrafields)) { print '
'; $coldisplay++; echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price @@ -142,7 +147,7 @@ if ($filtertype != 1) { echo $line->efficiency; print ''; $coldisplay++; @@ -166,6 +171,8 @@ if ($filtertype != 1) { print ''; @@ -312,10 +319,12 @@ if ($resql) { print ''.price(price2num($sub_bom_line->total_cost, 'MT')).''.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).''; + print ''.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).''.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty, 'MT')).''; + print ''.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty, 'MT')).'
'; + + // Linked documents + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + print ''; + print '\n"; + print ''; + } + if ($typeobject == 'propal' && $object->$typeobject->id && isModEnabled("propal")) { + print ''; + print '\n"; + print ''; + } + if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && isModEnabled("propal")) { + print ''; + print '\n"; + print ''; + } + + // Date creation + print ''; + print '\n"; + print ''; + + // Delivery date planned + print ''; + print ''; + print '
'; + print $langs->trans("RefOrder").''; + print $objectsrc->getNomUrl(1, 'commande'); + print "
'; + print $langs->trans("RefProposal").''; + print $objectsrc->getNomUrl(1, 'reception'); + print "
'; + print $langs->trans("SupplierOrder").''; + print $objectsrc->getNomUrl(1, 'reception'); + print "
'.$langs->trans("DateCreation").''.dol_print_date($object->date_creation, "dayhour", "tzuserrel")."
'; + print ''; + print '
'; + print $langs->trans('DateDeliveryPlanned'); + print '
'; + print '
'; + print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; + print '
'; + print '
'; + print ''.img_picto("", 'eraser', 'class="pictofixedwidth"').$langs->trans("ResetQtyToDispatch").''; + print ''.img_picto("", 'eraser', 'class="pictofixedwidth"').$langs->trans("Reset").''; + print '
'; + + print '
'; + $disabled = 0; // This is used to disable or not the bulk selection of target warehouse. No reason to have it disabled so forced to 0. + + if ($object->statut == Reception::STATUS_DRAFT) { + require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; + $formproduct = new FormProduct($db); + $formproduct->loadWarehouses(); + $entrepot = new Entrepot($db); + $listwarehouses = $entrepot->list_array(1); + + + print '
'; + + + print ''; + print ''; + print ''; + + + print '
'; + print ''; + + // Set $products_dispatched with qty dispatched for each product id + $products_dispatched = array(); + $sql = "SELECT l.rowid, cfd.fk_product, sum(cfd.qty) as qty"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseurdet as l on l.rowid = cfd.fk_commandefourndet"; + $sql .= " WHERE cfd.fk_reception = ".((int) $object->id); + $sql .= " GROUP BY l.rowid, cfd.fk_product"; + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + + if ($num) { + while ($i < $num) { + $objd = $db->fetch_object($resql); + $products_dispatched[$objd->rowid] = price2num($objd->qty, 5); + $i++; + } + } + $db->free($resql); + } + + //$sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, SUM(l.qty) as qty,"; + $sql = "SELECT l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref AS sref, l.qty as qty,"; + $sql .= " p.ref, p.label, p.tobatch, p.fk_default_warehouse"; + + // Enable hooks to alter the SQL query (SELECT) + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldListSelect', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + $sql .= $hookmanager->resPrint; + + $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product=p.rowid"; + $sql .= " WHERE l.fk_commande = ".((int) $objectsrc->id); + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) { + $sql .= " AND l.product_type = 0"; + } + + // Enable hooks to alter the SQL query (WHERE) + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldListWhere', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + $sql .= $hookmanager->resPrint; + + //$sql .= " GROUP BY p.ref, p.label, p.tobatch, p.fk_default_warehouse, l.rowid, l.fk_product, l.subprice, l.remise_percent, l.ref"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product + $sql .= " ORDER BY l.rang, p.ref, p.label"; + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + + if ($num) { + print ''; + + print ''; + if (isModEnabled('productbatch')) { + print ''; + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + print ''; + } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } + } else { + print ''; + print ''; + print ''; + } + print ''; + print ''; + print ''; + print ' '; + + if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { + print ''; + print ''; + print ''; + } + } + + print ''; + + // Enable hooks to append additional columns + $parameters = array(); + $reshook = $hookmanager->executeHooks( + 'printFieldListTitle', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + print $hookmanager->resPrint; + + print "\n"; + } + + $nbfreeproduct = 0; // Nb of lins of free products/services + $nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default) + // or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on. + + $conf->cache['product'] = array(); + + while ($i < $num) { + $objp = $db->fetch_object($resql); + + // On n'affiche pas les produits libres + if (!$objp->fk_product > 0) { + $nbfreeproduct++; + } else { + $alreadydispatched = isset($products_dispatched[$objp->rowid])?$products_dispatched[$objp->rowid]:0; + $remaintodispatch = price2num($objp->qty, 5); // Calculation of dispatched + if ($remaintodispatch < 0 && empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN)) { + $remaintodispatch = 0; + } + + if ($remaintodispatch || empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED)) { + $nbproduct++; + + // To show detail cref and description value, we must make calculation by cref + // print ($objp->cref?' ('.$objp->cref.')':''); + // if ($objp->description) print '
'.nl2br($objp->description); + $suffix = '_0_'.$i; + + print "\n"; + print ''."\n"; + // hidden fields for js function + print ''; + print ''; + print ''; + + if (empty($conf->cache['product'][$objp->fk_product])) { + $tmpproduct = new Product($db); + $tmpproduct->fetch($objp->fk_product); + $conf->cache['product'][$objp->fk_product] = $tmpproduct; + } else { + $tmpproduct = $conf->cache['product'][$objp->fk_product]; + } + + $linktoprod = $tmpproduct->getNomUrl(1); + $linktoprod .= ' - '.$objp->label."\n"; + + if (isModEnabled('productbatch')) { + if ($objp->tobatch) { + // Product + print '"; + print ''; + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + print ''; + } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } + } else { + // Product + print '"; + print ''; + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + print ''; + } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } + } + } else { + print '"; + } + + // Define unit price for PMP calculation + $up_ht_disc = $objp->subprice; + if (!empty($objp->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP)) { + $up_ht_disc = price2num($up_ht_disc * (100 - $objp->remise_percent) / 100, 'MU'); + } + + // Supplier ref + print ''; + + // Qty ordered + print ''; + + // Already dispatched + print ''; + + print ''; // Qty to dispatch + print ''; // Dispatch column + print ''; // Warehouse column + + $sql = "SELECT cfd.rowid, cfd.qty, cfd.fk_entrepot, cfd.batch, cfd.eatby, cfd.sellby, cfd.fk_product"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; + $sql .= " WHERE cfd.fk_commandefourndet = ".(int) $objp->rowid; + $resultsql = $db->query($sql); + $j = 0; + if ($resultsql) { + $numd = $db->num_rows($resultsql); + + while ($j < $numd) { + $suffix = "_".$j."_".$i; + $objd = $db->fetch_object($resultsql); + if (isModEnabled('productbatch') && !empty($objd->batch)) { + $type = 'batch'; + + // Enable hooks to append additional columns + $parameters = array( + // allows hook to distinguish between the rows with information and the rows with dispatch form input + 'is_information_row' => true, + 'j' => $j, + 'suffix' => $suffix, + 'objd' => $objd, + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + print $hookmanager->resPrint; + + print ''; + + print ''; + print ''; + + print ''; + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + print ''; + } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } + print ''; // Supplier ref + Qty ordered + qty already dispatched + } else { + $type = 'dispatch'; + $colspan = 7; + $colspan = (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) ? --$colspan : $colspan; + $colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan; + + // Enable hooks to append additional columns + $parameters = array( + // allows hook to distinguish between the rows with information and the rows with dispatch form input + 'is_information_row' => true, + 'j' => $j, + 'suffix' => $suffix, + 'objd' => $objd, + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + print $hookmanager->resPrint; + + print ''; + + print ''; + print ''; + } + // Qty to dispatch + print ''; + print ''; + + if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { + // Price + print ''; + + // Discount + print ''; + + // Save price + print ''; + } + } + + // Warehouse + print '\n"; + + // Enable hooks to append additional columns + $parameters = array( + 'is_information_row' => false, // this is a dispatch form row + 'i' => $i, + 'suffix' => $suffix, + 'objp' => $objp, + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + print $hookmanager->resPrint; + + print "\n"; + $j++; + } + $suffix = "_".$j."_".$i; + } + if ($j == 0) { + if (isModEnabled('productbatch') && !empty($objp->batch)) { + $type = 'batch'; + + // Enable hooks to append additional columns + $parameters = array( + // allows hook to distinguish between the rows with information and the rows with dispatch form input + 'is_information_row' => true, + 'j' => $j, + 'suffix' => $suffix, + 'objp' => $objp, + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + print $hookmanager->resPrint; + + print ''; + + print ''; + print ''; + + print ''; + if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { + print ''; + } + if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { + print ''; + } + print ''; // Supplier ref + Qty ordered + qty already dispatched + } else { + $type = 'dispatch'; + $colspan = 7; + $colspan = (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) ? --$colspan : $colspan; + $colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan; + + // Enable hooks to append additional columns + $parameters = array( + // allows hook to distinguish between the rows with information and the rows with dispatch form input + 'is_information_row' => true, + 'j' => $j, + 'suffix' => $suffix, + 'objp' => $objp, + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + print $hookmanager->resPrint; + + print ''; + + print ''; + print ''; + } + // Qty to dispatch + print ''; + print ''; + + if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { + // Price + print ''; + + // Discount + print ''; + + // Save price + print ''; + } + } + + // Warehouse + print '\n"; + + // Enable hooks to append additional columns + $parameters = array( + 'is_information_row' => false, // this is a dispatch form row + 'i' => $i, + 'suffix' => $suffix, + 'objp' => $objp, + ); + $reshook = $hookmanager->executeHooks( + 'printFieldListValue', + $parameters, + $object, + $action + ); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } + print $hookmanager->resPrint; + print "\n"; + } + } + } + $i++; + } + $db->free($resql); + } else { + dol_print_error($db); + } + + print "
'.$langs->trans("Description").''.$langs->trans("batch_number").''.$langs->trans("SellByDate").''.$langs->trans("EatByDate").''.$langs->trans("SupplierRef").''.$langs->trans("QtyOrdered").''.$langs->trans("QtyDispatchedShort").''.$langs->trans("QtyToDispatchShort"); + print ''.$langs->trans("Price").''.$langs->trans("ReductionShort").' (%)'.$langs->trans("UpdatePrice").''.$langs->trans("Warehouse"); + + // Select warehouse to force it everywhere + if (count($listwarehouses) > 1) { + print '
'.$langs->trans("ForceTo").' '.$form->selectarray('fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 1, 0, 0, '', 0, 0, $disabled, '', 'minwidth100 maxwidth300', 1); + } elseif (count($listwarehouses) == 1) { + print '
'.$langs->trans("ForceTo").' '.$form->selectarray('fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0, '', 0, 0, $disabled, '', 'minwidth100 maxwidth300', 1); + } + + print '
'; + print $linktoprod; + print "'; + print $linktoprod; + print "'; + print $langs->trans("ProductDoesNotUseBatchSerial"); + print ''; + print $linktoprod; + print "'.$objp->sref.''.$objp->qty.''.$alreadydispatched.''; + print ''; + print '
'; + print ''; + print ''; + print ''; + + print ''; + if (!empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) { // Not tested ! + print $langs->trans("BuyingPrice").': '; + } else { + print ''; + } + + print ''; + print ''; + print ''; + $dlcdatesuffix = !empty($objd->sellby) ? dol_stringtotime($objd->sellby) : dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year')); + print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, ''); + print ''; + $dluodatesuffix = !empty($objd->eatby) ? dol_stringtotime($objd->eatby) : dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year')); + print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, ''); + print ' 
'; + print ''; + print ''; + print ''; + + print ''; + if (!empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) { // Not tested ! + print $langs->trans("BuyingPrice").': '; + } else { + print ''; + } + + print ''; + print ''.img_picto($langs->trans("Reset"), 'eraser', 'class="pictofixedwidth opacitymedium"').''; + print ''; + print ''; + if (isModEnabled('productbatch') && $objp->tobatch > 0) { + $type = 'batch'; + print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j+1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"'); + } else { + $type = 'dispatch'; + print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j+1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"'); + } + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if (count($listwarehouses) > 1) { + print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : $objd->fk_entrepot, "entrepot".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix); + } elseif (count($listwarehouses) == 1) { + print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : $objd->fk_entrepot, "entrepot".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix); + } else { + $langs->load("errors"); + print $langs->trans("ErrorNoWarehouseDefined"); + } + print "
'; + print ''; + print ''; + print ''; + + print ''; + if (!empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) { // Not tested ! + print $langs->trans("BuyingPrice").': '; + } else { + print ''; + } + + print ''; + print ''; + print ''; + $dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year')); + print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, ''); + print ''; + $dluodatesuffix = dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year')); + print $form->selectDate($dluodatesuffix, 'dluo'.$suffix, '', '', 1, ''); + print ' 
'; + print ''; + print ''; + print ''; + + print ''; + if (!empty($conf->global->SUPPLIER_ORDER_EDIT_BUYINGPRICE_DURING_RECEIPT)) { // Not tested ! + print $langs->trans("BuyingPrice").': '; + } else { + print ''; + } + + print ''; + print ''.img_picto($langs->trans("Reset"), 'eraser', 'class="pictofixedwidth opacitymedium"').''; + print ''; + print ''; + if (isModEnabled('productbatch') && $objp->tobatch > 0) { + $type = 'batch'; + print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$i.', \''.$type.'\')"'); + } else { + $type = 'dispatch'; + print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.$i.', \''.$type.'\')"'); + } + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if (count($listwarehouses) > 1) { + print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 1, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix); + } elseif (count($listwarehouses) == 1) { + print $formproduct->selectWarehouses(GETPOST("entrepot".$suffix) ?GETPOST("entrepot".$suffix) : ($objp->fk_default_warehouse ? $objp->fk_default_warehouse : ''), "entrepot".$suffix, '', 0, 0, $objp->fk_product, '', 1, 0, null, 'csswarehouse'.$suffix); + } else { + $langs->load("errors"); + print $langs->trans("ErrorNoWarehouseDefined"); + } + print "
\n"; + print '
'; + + if ($nbproduct) { + $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv('StatusOrderReceivedAll')); + + print '
'; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if (empty($reshook)) { + if (empty($conf->reception->enabled)) { + print $langs->trans("Comment").' : '; + print 'trans("DispatchSupplierOrder", $object->ref); + // print ' / '.$object->ref_supplier; // Not yet available + print '" class="flat">
'; + + print ' '.$checkboxlabel; + } + + $dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive") : $langs->trans("CreateReception"); + + print '
'; + print ''; + } + print '
'; + } + + // Message if nothing to dispatch + if (!$nbproduct) { + print "
\n"; + if (empty($conf->global->SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED)) { + print '
'.$langs->trans("NoPredefinedProductToDispatch").'
'; // No predefined line at all + } else { + print '
'.$langs->trans("NoMorePredefinedProductToDispatch").'
'; // No predefined line that remain to be dispatched. + } + } + + print '
'; + } + + print dol_get_fiche_end(); + + // traitement entrepot par défaut + print ''; +} + +// End of page +llxFooter(); +$db->close(); From 5e24ef51085db3c3633b41ea97b674f671baaa81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Apr 2023 15:29:42 +0200 Subject: [PATCH 080/156] fix init_menu_auguria.sql --- htdocs/core/menus/init_menu_auguria.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index dc02a2c4b5f..1b65074a82e 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -18,7 +18,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', 'isModEnabled("bom") || isModEnabled("mrp")', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->hasRight("bom","read")||$user->hasRight("mrp","read")', '', 0, 31, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->hasRight("projet","lire")', '', 2, 32, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', 'isModEnabled("propal") || isModEnabled("commande") || isModEnabled("supplier_order") || isModEnabled("contrat") || isModEnabled("ficheinter")', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->hasRight("societe","lire") || $user->hasRight("societe","contact","lire")', '', 2, 40, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->hasRight("banque","lire") || ($user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire', '', 2, 50, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire || $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->hasRight("banque","lire") || $user->rights->fournisseur->facture->lire || $user->rights->supplier_invoice->lire', '', 2, 50, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->hasRight("banque","lire") || $user->hasRight("prelevement","bons","lire")', '', 0, 52, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("asset")', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire") || $user->hasRight("asset","read")', '', 2, 54, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__); From e979a8c97c8ec41df92f986fc31ad0d01dfc4eff Mon Sep 17 00:00:00 2001 From: hystepik Date: Thu, 27 Apr 2023 15:35:00 +0200 Subject: [PATCH 081/156] add trans --- htdocs/langs/en_US/receptions.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index 43f1512ecef..cd4c860e82f 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -53,4 +53,5 @@ ReceptionBackToDraftInDolibarr=Reception %s back to draft ReceptionClassifyClosedInDolibarr=Reception %s classified Closed ReceptionUnClassifyCloseddInDolibarr=Reception %s re-open ResetQtyToDispatch=Reset all quantities to dispatch -ReceptionUpdated=Reception sucessfully updated \ No newline at end of file +ReceptionUpdated=Reception sucessfully updated +DispatchCard=Dispatch card \ No newline at end of file From 46e3413e8ab8778d9c01f8a99598d46d84d1ad81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 15:55:21 +0200 Subject: [PATCH 082/156] Fix tooltips --- htdocs/commande/class/commande.class.php | 2 +- htdocs/core/class/commonobject.class.php | 1 + htdocs/cron/class/cronjob.class.php | 4 ++-- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- htdocs/user/class/user.class.php | 1 + htdocs/user/list.php | 4 ++-- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f6d11eed0fd..14bcd684334 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3870,7 +3870,7 @@ class Commande extends CommonOrder $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), $this->picto, (($withpicto != 2) ? 'class="paddingright"' : ''), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { $result .= $this->ref; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 19f0589518f..eff3f4b7319 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -794,6 +794,7 @@ abstract class CommonObject // Note that $action and $object may have been modified by some hooks $hookmanager->executeHooks('getTooltipContent', $parameters, $this, $action); + //var_dump($datas); $label = implode($datas); return $label; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 70ecfb0bf55..4aa6ef3a25e 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1067,7 +1067,7 @@ class Cronjob extends CommonObject $label = $langs->trans("ShowCronJob"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); @@ -1079,7 +1079,7 @@ class Cronjob extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), (($withpicto != 2) ? 'class="paddingright"' : ''), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { $result .= $this->ref; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 9be0ad173ed..911b5eb127f 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -872,7 +872,7 @@ class MyObject extends CommonObject $result .= '
'; } else { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"'), 0, 0, $notooltip ? 0 : 1); } } } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 6c011896203..5edd08db8b1 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2807,6 +2807,7 @@ class User extends CommonObject $type = ($this->socid ? $langs->trans("ExternalUser").$company : $langs->trans("InternalUser")); $datas['type'] = '
'.$langs->trans("Type").': '.$type; $datas['closediv'] = '
'; + if ($infologin > 0) { $datas['newlinelogin'] = '
'; $datas['session'] = '
'.$langs->trans("Session").''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 368b5d7856f..c935221404a 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -1281,7 +1281,7 @@ while ($i < $imaxinloop) { print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['u.datec']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; if (!$i) { @@ -1290,7 +1290,7 @@ while ($i < $imaxinloop) { } // Date modification if (!empty($arrayfields['u.tms']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; if (!$i) { From 263d315ba4e06f37340b9c3649c3c1a32a7f03c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 16:19:35 +0200 Subject: [PATCH 083/156] Debug tooltip for cron --- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/security.lib.php | 6 ++++-- htdocs/cron/class/cronjob.class.php | 4 +--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e3dad8c0386..2afd7e15fe9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -248,7 +248,7 @@ function getEntity($element, $shared = 1, $currentobject = null) $out = $mc->getEntity($element, $shared, $currentobject); } else { $out = ''; - $addzero = array('user', 'usergroup', 'c_email_templates', 'email_template', 'default_values'); + $addzero = array('user', 'usergroup', 'cronjob', 'c_email_templates', 'email_template', 'default_values'); if (in_array($element, $addzero)) { $out .= '0,'; } diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 55a516377b2..f75bb21eae9 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -989,6 +989,8 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } + //var_dump($checkonentitydone); + if (!$checkonentitydone && !in_array($feature, $nocheck) && $objectid > 0) { // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield // If external user: Check permission for external users if ($user->socid > 0) { @@ -1000,7 +1002,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " WHERE dbt.rowid IN (".$db->sanitize($objectid, 1).")"; $sql .= " AND dbt.".$dbt_keyfield." = ".((int) $user->socid); } elseif (isModEnabled("societe") && empty($user->rights->societe->client->voir)) { - // If internal user: Check permission for internal users that are restricted on their objects + // If internal user without permission to see all thirdparties: Check permission for internal users that are restricted on their objects if ($feature != 'ticket') { if (empty($dbt_keyfield)) { dol_print_error('', 'Param dbt_keyfield is required but not defined'); @@ -1022,7 +1024,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $sql .= " AND (sc.fk_user = ".((int) $user->id)." OR sc.fk_user IS NULL)"; } } elseif (isModEnabled('multicompany')) { - // If multicompany and internal users with all permissions, check user is in correct entity + // If multicompany, and user is an internal user with all permissions, check that object is in correct entity $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.".$dbt_select." IN (".$db->sanitize($objectid, 1).")"; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 4aa6ef3a25e..c1cea5abe7d 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -996,7 +996,7 @@ class Cronjob extends CommonObject } $datas['space'] = '
'; - if (!empty($this->datestart)) { + if (!empty($this->datestart) && $this->datestart >= dol_now()) { $datas['crondtstart'] = '
'.$langs->trans('CronDtStart').': '.dol_print_date($this->datestart, 'dayhour', 'tzuserrel'); } if (!empty($this->dateend)) { @@ -1025,8 +1025,6 @@ class Cronjob extends CommonObject public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $db, $conf, $langs; - global $dolibarr_main_authentication, $dolibarr_main_demo; - global $menumanager; if (!empty($conf->dol_no_mouse_hover)) { $notooltip = 1; // Force disable tooltips From d7f715cc36626dce2b3ebdce49744b6b97edfd4d Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Thu, 27 Apr 2023 13:35:34 +0200 Subject: [PATCH 084/156] Fix: install/inc: remove optional argument check htdocs/install/step2.php has two optional argv parameters: action and selectlang. It doesn't have any version indicator, and thus doesn't have any constraint on the number of parameters, so remove it from inc.php. The constraint can still be re-included in the other files including inc.php, as well as the other script-specific options. --- htdocs/install/inc.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index c0bded73cd2..dcd2462b14f 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -143,13 +143,6 @@ if (php_sapi_name() === "cli") { exit(1); } - // Currently, scripts using inc.php will require addtional arguments, - // see help above for more details. - if ($rest_index > $argc - 2) { - usage($argv[0], "Missing mandatory arguments, usage:"); - exit(1); - } - // Tricky argument list hack, should be removed someday. // Reset argv to remove the argument that were parsed. This is needed // currently because some install code, like in upgrade.php, are using From f19a36856ba8ef791a078b5585e740023e6d67a4 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Thu, 27 Apr 2023 13:35:34 +0200 Subject: [PATCH 085/156] install/inc: add some usage documentation Change the way the existing script syntax is documented and add the syntax and options for the step2.php script. --- htdocs/install/inc.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index dcd2462b14f..ed1f3f93ad2 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -93,9 +93,20 @@ $long_options = array( function usage($program, $header) { echo $header."\n"; - echo " php ".$program." [options] previous_version new_version [script options]\n"; + echo " php ".$program." [options] [script options]\n"; echo "\n"; - echo "Script options when using upgrade.php:\n"; + echo "Script syntax when using step2.php:\n"; + echo " php ".$program." [options] [action] [selectlang]\n"; + echo "\n"; + echo " action:\n"; + echo " Specify the action to execute for the file among the following ones.\n"; + echo " - set: Create tables, keys, functions and data for the instance.\n"; + echo "\n"; + echo " selectlang:\n"; + echo " Setup the default lang to use, default to 'auto'.\n"; + echo "\n"; + echo "Script syntax when using upgrade.php:\n"; + echo " php ".$program." [options] previous_version new_version [script options]\n"; echo "\n"; echo " dirmodule:\n"; echo " Specify dirmodule to provide a path for an external module\n"; @@ -105,10 +116,11 @@ function usage($program, $header) echo " Allow to run migration even if database version does\n"; echo " not match start version of migration.\n"; echo "\n"; - echo "Script options when using upgrade2.php:\n"; + echo "Script syntax when using upgrade2.php:\n"; + echo " php ".$program." [options] previous_version new_version [module list]\n"; echo "\n"; - echo " MODULE_NAME1_TO_ENABLE,MODULE_NAME2_TO_ENABLE:\n"; - echo " Specify a list of module-name to enable, joined by comma.\n"; + echo " MAIN_MODULE_NAME1,MAIN_MODULE_NAME2:\n"; + echo " Specify a list of module-name to enable, in upper case, with MAIN_MODULE_ prefix, joined by comma.\n"; echo "\n"; echo "Options:\n"; echo " -c, --config :\n"; From ef8f8d990ac741ef60298d19d1ccad5005525368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Apr 2023 20:07:36 +0200 Subject: [PATCH 086/156] Fix unknown variable in product.class.php --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c2de9c24770..c901808aaa4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -572,7 +572,7 @@ class Product extends CommonObject */ public function check() { - if (!empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS)) { + if (getDolGlobalInt('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) { $this->ref = trim($this->ref); } else { $this->ref = dol_sanitizeFileName(stripslashes($this->ref)); From ec964040e6cf92997e139ce0af24b893bf2e1755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Apr 2023 20:12:39 +0200 Subject: [PATCH 087/156] Update product.class.php --- htdocs/product/class/product.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c901808aaa4..f0b7bcaf6a2 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -608,7 +608,7 @@ class Product extends CommonObject $error = 0; // Clean parameters - if (!empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS)) { + if (getDolGlobalInt('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) { $this->ref = trim($this->ref); } else { $this->ref = dol_sanitizeFileName(dol_string_nospecial(trim($this->ref))); @@ -702,7 +702,7 @@ class Product extends CommonObject if (empty($this->ref) || $this->ref == 'auto') { // Load object modCodeProduct - $module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard'); + $module = getDolGlobalString('PRODUCT_CODEPRODUCT_ADDON', 'mod_codeproduct_leopard'); if ($module != 'mod_codeproduct_leopard') { // Do not load module file for leopard if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php') { $module = substr($module, 0, dol_strlen($module) - 4); @@ -1008,7 +1008,7 @@ class Product extends CommonObject } // Clean parameters - if (!empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS)) { + if (getDolGlobalInt('MAIN_SECURITY_ALLOW_UNSECURED_REF_LABELS')) { $this->ref = trim($this->ref); } else { $this->ref = dol_string_nospecial(trim($this->ref)); From 3065b9ca6ade988e8d7a8a8550415c0abb56b9cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 27 Apr 2023 19:30:34 +0200 Subject: [PATCH 088/156] Clean code --- htdocs/categories/viewcat.php | 6 +- htdocs/comm/propal/card.php | 6 +- htdocs/comm/propal/stats/index.php | 2 +- htdocs/commande/card.php | 6 +- htdocs/commande/stats/index.php | 1 + htdocs/compta/deplacement/stats/index.php | 3 +- htdocs/compta/facture/card.php | 6 +- htdocs/compta/facture/stats/index.php | 16 +- htdocs/compta/stats/cabyprodserv.php | 7 +- .../stats/supplier_turnover_by_prodserv.php | 2 +- htdocs/contact/card.php | 2 +- htdocs/contrat/card.php | 3 +- htdocs/core/ajax/ajaxcompanies.php | 135 ------------ htdocs/core/class/html.form.class.php | 122 ++++++----- htdocs/core/lib/functions.lib.php | 4 +- htdocs/don/card.php | 3 +- htdocs/fourn/commande/card.php | 9 +- htdocs/fourn/facture/card.php | 3 +- htdocs/margin/customerMargins.php | 3 +- htdocs/product/fournisseurs.php | 3 +- htdocs/product/price.php | 3 +- htdocs/product/stock/replenish.php | 3 +- htdocs/projet/card.php | 14 +- htdocs/societe/ajax/ajaxcompanies.php | 202 ++++++++++-------- htdocs/societe/ajax/company.php | 17 +- htdocs/societe/card.php | 7 +- htdocs/supplier_proposal/card.php | 6 +- htdocs/takepos/admin/terminal.php | 3 +- 28 files changed, 251 insertions(+), 346 deletions(-) delete mode 100644 htdocs/core/ajax/ajaxcompanies.php diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 5999865232a..84770acdaff 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -590,7 +590,8 @@ if ($type == Categorie::TYPE_CUSTOMER) { print ''; print ''; print ''; print '
'; print $langs->trans("AddCustomerIntoCategory").'  '; - print $form->select_company('', 'elemid', 's.client IN (1,3)'); + $filter = 's.client IN (1,3)'; + print $form->select_company('', 'elemid', $filter); print '
'; @@ -670,7 +671,8 @@ if ($type == Categorie::TYPE_SUPPLIER) { print ''; print ''; print ''; print '
'; print $langs->trans("AddSupplierIntoCategory").'  '; - print $form->select_company('', 'elemid', 's.fournisseur = 1'); + $filter ='s.fournisseur = 1'; + print $form->select_company('', 'elemid', $filter); print '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3a3fdfe50a0..d28753632d2 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1810,7 +1810,8 @@ if ($action == 'create') { //$warehouse_id = $soc->warehouse_id; } else { print ''; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', '((s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1)', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); + $filter = '((s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1)'; + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer informations if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print '\n"; // print the div tag that will contain the map diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 3a1a176d818..c59bb56a8f8 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -80,7 +80,7 @@ class DolibarrApi * * @param string $field Field name * @param string $value Value to check/clean - * @param stdClass $object Object + * @param Object $object Object * @return string Value cleaned */ protected function _checkValForAPI($field, $value, $object) diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index c8edc9c5d8f..4d0a553d1e6 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -645,7 +645,7 @@ if ($action == 'edit') { print getDolGlobalString($constname); } } else { - print $conf->global->{$constname}; + print getDolGlobalString($constname); } print ''; } diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 35896ef272d..f9a4f8065bb 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -144,8 +144,8 @@ class BankAccounts extends DolibarrApi /** * Create account object * - * @param array $request_data Request data - * @return int ID of account + * @param array $request_data Request data + * @return int ID of account */ public function post($request_data = null) { diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 2e7425dca98..ff0666e0d81 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -337,9 +337,9 @@ print ''; print ''; print ' '; From fc5fdc2ebd5c8bc552f5088a64fa483a00cc28d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 06:03:15 +0000 Subject: [PATCH 142/156] Bump JetBrains/qodana-action from 2022.3.4 to 2023.1.0 Bumps [JetBrains/qodana-action](https://github.com/JetBrains/qodana-action) from 2022.3.4 to 2023.1.0. - [Release notes](https://github.com/JetBrains/qodana-action/releases) - [Commits](https://github.com/JetBrains/qodana-action/compare/v2022.3.4...v2023.1.0) --- updated-dependencies: - dependency-name: JetBrains/qodana-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index f35dc90f0b8..f532dbd9e3b 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -18,7 +18,7 @@ jobs: fetch-depth: 1 #php-version: '7.1' - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2022.3.4 + uses: JetBrains/qodana-action@v2023.1.0 #with: # php-version: '7.1' env: From cd9c7ca3d712108fe12f5f76cc0b86bd82055069 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 12:43:28 +0200 Subject: [PATCH 143/156] Fix warning --- htdocs/core/class/lessc.class.php | 174 +++++++++++++++++++++++------- test/phpunit/LesscTest.php | 3 +- 2 files changed, 138 insertions(+), 39 deletions(-) diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index 0e25b9892dd..69846b46fa7 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -8,6 +8,7 @@ * Copyright 2013, Leaf Corcoran * Licensed under MIT or GPLv3, see LICENSE */ + // phpcs:disable /** * The LESS compiler and parser. @@ -457,6 +458,7 @@ class Lessc $parts = explode("$&$", $tag); $count = 0; foreach ($parts as &$part) { + $c = 0; $part = str_replace($this->parentSelector, $replace, $part, $c); $count += $c; } @@ -760,7 +762,6 @@ class Lessc $orderedArgs = array(); $keywordArgs = array(); foreach ((array) $args as $arg) { - $argval = null; switch ($arg[0]) { case "arg": if (!isset($arg[2])) { @@ -2152,6 +2153,7 @@ class Lessc { $this->pushEnv(); $parser = new lessc_parser($this, __METHOD__); + $value = null; foreach ($args as $name => $strValue) { if ($name[0] !== '@') { $name = '@'.$name; @@ -2637,6 +2639,10 @@ class lessc_parser // caches preg escaped literals protected static $literalCache = array(); + public $env; + public $count; + + public function __construct($lessc, $sourceName = null) { $this->eatWhiteDefault = true; @@ -2703,42 +2709,42 @@ class lessc_parser return $this->env; } - /** - * Parse a single chunk off the head of the buffer and append it to the - * current parse environment. - * Returns false when the buffer is empty, or when there is an error. - * - * This function is called repeatedly until the entire document is - * parsed. - * - * This parser is most similar to a recursive descent parser. Single - * functions represent discrete grammatical rules for the language, and - * they are able to capture the text that represents those rules. - * - * Consider the function lessc::keyword(). (all parse functions are - * structured the same) - * - * The function takes a single reference argument. When calling the - * function it will attempt to match a keyword on the head of the buffer. - * If it is successful, it will place the keyword in the referenced - * argument, advance the position in the buffer, and return true. If it - * fails then it won't advance the buffer and it will return false. - * - * All of these parse functions are powered by lessc::match(), which behaves - * the same way, but takes a literal regular expression. Sometimes it is - * more convenient to use match instead of creating a new function. - * - * Because of the format of the functions, to parse an entire string of - * grammatical rules, you can chain them together using &&. - * - * But, if some of the rules in the chain succeed before one fails, then - * the buffer position will be left at an invalid state. In order to - * avoid this, lessc::seek() is used to remember and set buffer positions. - * - * Before parsing a chain, use $s = $this->seek() to remember the current - * position into $s. Then if a chain fails, use $this->seek($s) to - * go back where we started. - */ + /** + * Parse a single chunk off the head of the buffer and append it to the + * current parse environment. + * Returns false when the buffer is empty, or when there is an error. + * + * This function is called repeatedly until the entire document is + * parsed. + * + * This parser is most similar to a recursive descent parser. Single + * functions represent discrete grammatical rules for the language, and + * they are able to capture the text that represents those rules. + * + * Consider the function lessc::keyword(). (all parse functions are + * structured the same) + * + * The function takes a single reference argument. When calling the + * function it will attempt to match a keyword on the head of the buffer. + * If it is successful, it will place the keyword in the referenced + * argument, advance the position in the buffer, and return true. If it + * fails then it won't advance the buffer and it will return false. + * + * All of these parse functions are powered by lessc::match(), which behaves + * the same way, but takes a literal regular expression. Sometimes it is + * more convenient to use match instead of creating a new function. + * + * Because of the format of the functions, to parse an entire string of + * grammatical rules, you can chain them together using &&. + * + * But, if some of the rules in the chain succeed before one fails, then + * the buffer position will be left at an invalid state. In order to + * avoid this, lessc::seek() is used to remember and set buffer positions. + * + * Before parsing a chain, use $s = $this->seek() to remember the current + * position into $s. Then if a chain fails, use $this->seek($s) to + * go back where we started. + */ protected function parseChunk() { if (empty($this->buffer)) { @@ -2750,6 +2756,21 @@ class lessc_parser return true; } + $key = null; + $value = null; + $mediaQueries = null; + $dirName = null; + $dirValue = null; + $importValue = null; + $guards = null; + $tag = null; + $args = null; + $isVararg = null; + $argv = null; + $suffix = null; + $var = null; + $tags = null; + // setting a property if ($this->keyword($key) && $this->assign() && $this->propertyValue($value, $key) && $this->end() @@ -2897,7 +2918,7 @@ class lessc_parser return true; } - return false; // got nothing, throw error + return false; // got nothing, throw error } protected function isDirective($dirname, $directives) @@ -2926,6 +2947,8 @@ class lessc_parser // a list of expressions protected function expressionList(&$exps) { + $exp = null; + $values = array(); while ($this->expression($exp)) { @@ -2946,6 +2969,9 @@ class lessc_parser */ protected function expression(&$out) { + $lhs = null; + $rhs = null; + if ($this->value($lhs)) { $out = $this->expHelper($lhs, 0); @@ -2971,6 +2997,9 @@ class lessc_parser */ protected function expHelper($lhs, $minP) { + $next = null; + $rhs = null; + $this->inExp = true; $ss = $this->seek(); @@ -2982,6 +3011,7 @@ class lessc_parser // whitespace after the operator for it to be an expression $needWhite = $whiteBefore && !$this->inParens; + $m = array(); if ($this->match(self::$operatorString.($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) { if (!$this->inParens && isset($this->env->currentProperty) && $m[1] == "/" && empty($this->env->supressedDivision)) { foreach (self::$supressDivisionProps as $pattern) { @@ -3022,6 +3052,7 @@ class lessc_parser // consume a list of values for a property public function propertyValue(&$value, $keyName = null) { + $v = null; $values = array(); if ($keyName !== null) { @@ -3055,6 +3086,8 @@ class lessc_parser protected function parenValue(&$out) { + $exp = null; + $s = $this->seek(); // speed shortcut @@ -3081,6 +3114,11 @@ class lessc_parser // a single value protected function value(&$value) { + $inner = null; + $word = null; + $str = null; + $var = null; + $s = $this->seek(); // speed shortcut @@ -3134,6 +3172,7 @@ class lessc_parser } // css hack: \0 + $m = array(); if ($this->literal('\\') && $this->match('([0-9]+)', $m)) { $value = array('keyword', '\\'.$m[1]); return true; @@ -3165,6 +3204,8 @@ class lessc_parser protected function mediaQueryList(&$out) { + $list = null; + if ($this->genericList($list, "mediaQuery", ",", false)) { $out = $list[2]; return true; @@ -3174,6 +3215,8 @@ class lessc_parser protected function mediaQuery(&$out) { + $mediaType = null; + $s = $this->seek(); $expressions = null; @@ -3214,6 +3257,9 @@ class lessc_parser protected function mediaExpression(&$out) { + $feature = null; + $variable = null; + $s = $this->seek(); $value = null; if ($this->literal("(") && @@ -3238,6 +3284,9 @@ class lessc_parser // an unbounded string stopped by $end protected function openString($end, &$out, $nestingOpen = null, $rejectStrs = null) { + $str = null; + $inter = null; + $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; @@ -3254,6 +3303,7 @@ class lessc_parser $nestingLevel = 0; $content = array(); + $m = array(); while ($this->match($patt, $m, false)) { if (!empty($m[1])) { $content[] = $m[1]; @@ -3308,6 +3358,8 @@ class lessc_parser protected function string(&$out) { + $inter = null; + $s = $this->seek(); if ($this->literal('"', false)) { $delim = '"'; @@ -3326,6 +3378,7 @@ class lessc_parser $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; + $m = array(); while ($this->match($patt, $m, false)) { $content[] = $m[1]; if ($m[2] == "@{") { @@ -3360,6 +3413,8 @@ class lessc_parser protected function interpolation(&$out) { + $interp = array(); + $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = true; @@ -3383,6 +3438,8 @@ class lessc_parser protected function unit(&$unit) { + $m = array(); + // speed shortcut if (isset($this->buffer[$this->count])) { $char = $this->buffer[$this->count]; @@ -3401,6 +3458,8 @@ class lessc_parser // a # color protected function color(&$out) { + $m = array(); + if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) { if (strlen($m[1]) > 7) { $out = array("string", "", array($m[1])); @@ -3420,6 +3479,9 @@ class lessc_parser // delimiter. protected function argumentDef(&$args, &$isVararg) { + $value = array(); + $rhs = null; + $s = $this->seek(); if (!$this->literal('(')) { return false; @@ -3524,6 +3586,8 @@ class lessc_parser // this accepts a hanging delimiter protected function tags(&$tags, $simple = false, $delim = ',') { + $tt = array(); + $tags = array(); while ($this->tag($tt, $simple)) { $tags[] = $tt; @@ -3542,6 +3606,8 @@ class lessc_parser // optionally separated by > (lazy, accepts extra >) protected function mixinTags(&$tags) { + $tt = array(); + $tags = array(); while ($this->tag($tt, true)) { $tags[] = $tt; @@ -3558,6 +3624,10 @@ class lessc_parser // a bracketed value (contained within in a tag definition) protected function tagBracket(&$parts, &$hasExpression) { + $str = null; + $inter = null; + $word = null; + // speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") { return false; @@ -3576,6 +3646,7 @@ class lessc_parser break; // get out early } + $m = array(); if ($this->match('\s+', $m)) { $attrParts[] = " "; continue; @@ -3629,6 +3700,9 @@ class lessc_parser // a space separated list of selectors protected function tag(&$tag, $simple = false) { + $interp = null; + $unit = null; + if ($simple) { $chars = '^@,:;{}\][>\(\) "\''; } else { @@ -3644,6 +3718,7 @@ class lessc_parser $this->eatWhiteDefault = false; while (true) { + $m =array(); if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) { $parts[] = $m[1]; if ($simple) { @@ -3698,6 +3773,11 @@ class lessc_parser { $s = $this->seek(); + $m = array(); + $value = array(); + $string = array(); + $name = null; + if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) { $fname = $m[1]; @@ -3742,6 +3822,9 @@ class lessc_parser // consume a less variable protected function variable(&$name) { + $sub = null; + $name = null; + $s = $this->seek(); if ($this->literal($this->lessc->vPrefix, false) && ($this->variable($sub) || $this->keyword($name)) @@ -3774,6 +3857,7 @@ class lessc_parser // consume a keyword protected function keyword(&$word) { + $m = array(); if ($this->match('([\w_\-\*!"][\w\-_"]*)', $m)) { $word = $m[1]; return true; @@ -3795,6 +3879,8 @@ class lessc_parser protected function guards(&$guards) { + $g = null; + $s = $this->seek(); if (!$this->literal("when")) { @@ -3824,6 +3910,8 @@ class lessc_parser // TODO rename to guardGroup protected function guardGroup(&$guardGroup) { + $guard = null; + $s = $this->seek(); $guardGroup = array(); while ($this->guard($guard)) { @@ -3844,6 +3932,8 @@ class lessc_parser protected function guard(&$guard) { + $exp = null; + $s = $this->seek(); $negate = $this->literal("not"); @@ -3884,11 +3974,14 @@ class lessc_parser self::$literalCache[$what] = lessc::preg_quote($what); } + $m = array(); return $this->match(self::$literalCache[$what], $m, $eatWhitespace); } protected function genericList(&$out, $parseItem, $delim = "", $flatten = true) { + $value = null; + $s = $this->seek(); $items = array(); while ($this->$parseItem($value)) { @@ -3925,6 +4018,7 @@ class lessc_parser } else { $validChars = $allowNewline ? "." : "[^\n]"; } + $m = array(); if (!$this->match('('.$validChars.'*?)'.lessc::preg_quote($what), $m, !$until)) { return false; } @@ -3958,6 +4052,7 @@ class lessc_parser { if ($this->writeComments) { $gotWhite = false; + $m = array(); while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) { if (isset($m[1]) && empty($this->seenComments[$this->count])) { $this->append(array("comment", $m[1])); @@ -4012,6 +4107,7 @@ class lessc_parser } // TODO this depends on $this->count + $m = array(); if ($this->peek("(.*?)(\n|$)", $m, $count)) { throw new exception("$msg: failed at `$m[1]` $loc"); } else { @@ -4090,6 +4186,7 @@ class lessc_parser $newlines = 0; switch ($min[0]) { case 'url(': + $m = array(); if (preg_match('/url\(.*?\)/', $text, $m, 0, $count)) { $count += strlen($m[0]) - strlen($min[0]); } @@ -4109,6 +4206,7 @@ class lessc_parser } break; case '/*': + $m = array(); if (preg_match('/\/\*.*?\*\//s', $text, $m, 0, $count)) { $skip = strlen($m[0]); $newlines = substr_count($m[0], "\n"); diff --git a/test/phpunit/LesscTest.php b/test/phpunit/LesscTest.php index 6bf90b4a105..e9a72d0ef4f 100644 --- a/test/phpunit/LesscTest.php +++ b/test/phpunit/LesscTest.php @@ -188,6 +188,7 @@ class LesscTest extends PHPUnit\Framework\TestCase //var_dump($contentforlessc); exit; } catch (exception $e) { //echo "failed to compile lessc"; + $result = 'Error'; dol_syslog("Failed to compile the CSS with lessc: ".$e->getMessage(), LOG_WARNING); } @@ -200,7 +201,7 @@ class LesscTest extends PHPUnit\Framework\TestCase } "; - print __METHOD__." SeparatorDecimal=".$result."\n"; + print __METHOD__." Result=".$result."\n"; $this->assertEquals(trim($result), trim($cssexpected)); return; From fe816445f5089df18cfda9c4f05a9fd9c3481bbf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 13:09:09 +0200 Subject: [PATCH 144/156] Fix warnings --- htdocs/commande/class/commande.class.php | 11 +++++++++++ htdocs/core/class/commondocgenerator.class.php | 5 +++++ htdocs/product/class/product.class.php | 5 +++++ htdocs/product/stock/class/productlot.class.php | 14 ++++++++++++++ 4 files changed, 35 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 14bcd684334..f9cb9cfb03f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -102,6 +102,11 @@ class Commande extends CommonOrder */ public $ref_client; + /** + * @var string Thirdparty ref of order + */ + public $ref_customer; + /** * @var int Contact ID */ @@ -1245,6 +1250,7 @@ class Commande extends CommonOrder $this->date_validation = ''; if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) { $this->ref_client = ''; + $this->ref_customer = ''; } // Do not clone ref_ext @@ -1383,6 +1389,7 @@ class Commande extends CommonOrder $this->fk_delivery_address = $object->fk_delivery_address; $this->contact_id = $object->contact_id; $this->ref_client = $object->ref_client; + $this->ref_customer = $object->ref_client; if (empty($conf->global->MAIN_DISABLE_PROPAGATE_NOTES_FROM_ORIGIN)) { $this->note_private = $object->note_private; @@ -2949,6 +2956,7 @@ class Commande extends CommonOrder if (!$error) { $this->oldcopy = clone $this; $this->ref_client = $ref_client; + $this->ref_customer = $ref_client; } if (!$notrigger && empty($error)) { @@ -3337,6 +3345,9 @@ class Commande extends CommonOrder if (isset($this->ref_client)) { $this->ref_client = trim($this->ref_client); } + if (isset($this->ref_customer)) { + $this->ref_customer = trim($this->ref_customer); + } if (isset($this->note) || isset($this->note_private)) { $this->note_private = (isset($this->note_private) ? trim($this->note_private) : trim($this->note)); } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index fadbc1dc62b..11f2fca8226 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -106,6 +106,11 @@ abstract class CommonDocGenerator public $emetteur; + /** + * @var array Array of columns + */ + public $cols; + /** * Constructor diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f0b7bcaf6a2..45758dc0e2e 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -390,9 +390,14 @@ class Product extends CommonObject public $stats_contrat = array(); public $stats_facture = array(); public $stats_commande_fournisseur = array(); + public $stats_expedition = array(); public $stats_reception = array(); + public $stats_mo = array(); + public $stats_bom = array(); public $stats_mrptoconsume = array(); public $stats_mrptoproduce = array(); + public $stats_facturerec = array(); + public $stats_facture_fournisseur = array(); //! Size of image public $imgWidth; diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 58328197d3f..14172ae808b 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -57,6 +57,20 @@ class Productlot extends CommonObject */ public $ismultientitymanaged = 1; + public $stats_propale; + public $stats_commande; + public $stats_contrat; + public $stats_facture; + public $stats_commande_fournisseur; + public $stats_expedition; + public $stats_reception; + public $stats_mo; + public $stats_bom; + public $stats_mrptoconsume; + public $stats_mrptoproduce; + public $stats_facturerec; + public $stats_facture_fournisseur; + /** * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') From d4fea38ae97076ce086335495f32462cd2d23302 Mon Sep 17 00:00:00 2001 From: Alexandre Boin Date: Mon, 1 May 2023 14:24:15 +0200 Subject: [PATCH 145/156] FIX: Multicurrency REST API wrong number of parameters when calling addRate() --- htdocs/multicurrency/class/api_multicurrencies.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/multicurrency/class/api_multicurrencies.class.php b/htdocs/multicurrency/class/api_multicurrencies.class.php index fed522c6e2e..cf0fd9181e4 100644 --- a/htdocs/multicurrency/class/api_multicurrencies.class.php +++ b/htdocs/multicurrency/class/api_multicurrencies.class.php @@ -218,7 +218,7 @@ class MultiCurrencies extends DolibarrApi // Add default rate if defined if (isset($request_data['rate']) && $request_data['rate'] > 0) { - if ($multicurrency->addRate(DolibarrApiAccess::$user, $request_data['rate']) < 0) { + if ($multicurrency->addRate($request_data['rate']) < 0) { throw new RestException(500, "Error adding currency rate", array_merge(array($multicurrency->error), $multicurrency->errors)); } From e2ec34e1e545ddea1471d26814b48044ee070cc8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 14:33:08 +0200 Subject: [PATCH 146/156] Clean code --- htdocs/admin/expensereport_ik.php | 2 +- .../class/assetaccountancycodes.class.php | 2 +- .../class/assetdepreciationoptions.class.php | 2 +- htdocs/core/class/evalmath.class.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/lessc.class.php | 2 +- htdocs/core/class/translate.class.php | 2 +- .../connectors/php/connector.lib.php | 2 +- htdocs/core/js/lib_head.js.php | 49 ++++++++++++------- htdocs/core/lib/barcode.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 10 ++-- .../class/expensereport.class.php | 2 +- htdocs/hrm/job_card.php | 2 +- htdocs/hrm/position.php | 2 +- htdocs/hrm/skill_card.php | 2 +- htdocs/modulebuilder/index.php | 6 +-- htdocs/product/fournisseurs.php | 4 +- .../stocktransfer/stocktransfer_card.php | 2 +- htdocs/projet/card.php | 3 +- .../eventorganization/subscriptionok.php | 2 +- htdocs/public/payment/paymentko.php | 2 +- htdocs/public/payment/paymentok.php | 4 +- .../company/actions_card_company.class.php | 4 +- htdocs/societe/card.php | 6 +-- htdocs/societe/checkvat/checkVatPopup.php | 2 +- htdocs/takepos/index.php | 10 +++- htdocs/takepos/invoice.php | 11 ++++- htdocs/takepos/pay.php | 4 ++ htdocs/variants/card.php | 2 +- .../variants/class/ProductAttribute.class.php | 2 +- qodana.yaml | 6 +++ 31 files changed, 93 insertions(+), 62 deletions(-) diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index b26cefba580..7124a24c82a 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -184,7 +184,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) { if ($range->range_active == 1) { if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) { echo ''; - echo ''; + echo ''; } else { echo ''.img_edit().''; if (!empty($range->ik->id)) { diff --git a/htdocs/asset/class/assetaccountancycodes.class.php b/htdocs/asset/class/assetaccountancycodes.class.php index 60b545ba6ce..6c33e3af901 100644 --- a/htdocs/asset/class/assetaccountancycodes.class.php +++ b/htdocs/asset/class/assetaccountancycodes.class.php @@ -174,7 +174,7 @@ class AssetAccountancyCodes extends CommonObject public function updateAccountancyCodes($user, $asset_id = 0, $asset_model_id = 0, $notrigger = 0) { global $langs, $hookmanager; - dol_syslog(__METHOD__ . " user_id={$user->id}, asset_id=$asset_id, asset_model_id=$asset_model_id, notrigger=$notrigger"); + dol_syslog(__METHOD__ . " user_id=".$user->id.", asset_id=".$asset_id.", asset_model_id=".$asset_model_id.", notrigger=".$notrigger); $error = 0; $this->errors = array(); diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index f2411ea4494..8d52fa1a6a4 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -418,7 +418,7 @@ class AssetDepreciationOptions extends CommonObject public function updateDeprecationOptions($user, $asset_id = 0, $asset_model_id = 0, $notrigger = 0) { global $langs, $hookmanager; - dol_syslog(__METHOD__ . " user_id={$user->id}, asset_id=$asset_id, asset_model_id=$asset_model_id, notrigger=$notrigger"); + dol_syslog(__METHOD__ . " user_id=".$user->id.", asset_id=".$asset_id.", asset_model_id=".$asset_model_id.", notrigger=".$notrigger); $error = 0; $this->errors = array(); diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index 24be9731df9..8ae529091af 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -248,7 +248,7 @@ class EvalMath $matches = array(); if (preg_match("/[^\w\s+*^\/()\.,-]/", $expr, $matches)) { // make sure the characters are all good - return $this->trigger(4, "illegal character '{$matches[0]}'", $matches[0]); + return $this->trigger(4, "illegal character '".$matches[0]."'", $matches[0]); } while (1) { // 1 Infinite Loop ;) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 13779fb64da..2214dc94a81 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9181,7 +9181,7 @@ class Form if (empty($conf->use_javascript_ajax)) { print ''; } else { - print ''; + print ''; } print ''; $this->db->free($resqllist); diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index 69846b46fa7..730f2c0f9e2 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -873,7 +873,7 @@ class Lessc break; default: - $this->throwError("unknown op: {$prop[0]}\n"); + $this->throwError("unknown op: $prop[0]\n"); } } diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 19cb66ad68d..5aa334600fb 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -1049,7 +1049,7 @@ class Translate if (isset($this->cache_currencies[$currency_code]) && !empty($this->cache_currencies[$currency_code]['unicode']) && is_array($this->cache_currencies[$currency_code]['unicode'])) { foreach ($this->cache_currencies[$currency_code]['unicode'] as $unicode) { - $currency_sign .= mb_convert_encoding("&#{$unicode};", "UTF-8", 'HTML-ENTITIES'); + $currency_sign .= mb_convert_encoding("&#".$unicode.";", "UTF-8", 'HTML-ENTITIES'); } } } diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php index 75c4d1e3e08..694292ef47a 100644 --- a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php +++ b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php @@ -527,7 +527,7 @@ function ServerMapFolder($resourceType, $folderPath, $sCommand) // Ensure that the directory exists. $sErrorMsg = CreateServerFolder($sResourceTypePath); if ($sErrorMsg != '') { - SendError(1, "Error creating folder \"{$sResourceTypePath}\" ({$sErrorMsg})"); + SendError(1, "Error creating folder \"$sResourceTypePath\" ($sErrorMsg)"); } // Return the resource type directory combined with the required path. diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 2e552ea605e..10f600ea349 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -565,6 +565,7 @@ function hideMessage(fieldId,message) { * @param int userid User id * @param int value Value to set * @param string token Token + * @retun boolean */ function setConstant(url, code, input, entity, strict, forcereload, userid, token, value) { var saved_url = url; /* avoid undefined url */ @@ -654,20 +655,23 @@ function setConstant(url, code, input, entity, strict, forcereload, userid, toke return false; } }).fail(function(error) { console.log("Error, we force reload"); location.reload(); }); /* When it fails, we always force reload to have setEventErrorMessages in session visible */ + + return true; } /* * Used by button to set on/off * Call url then make complementary action (like show/hide, enable/disable or set another option). * - * @param string url Url (warning: as any url called in ajax mode, the url called here must not renew the token) - * @param string code Code - * @param string intput Array of complementary actions to do if success - * @param int entity Entity - * @param int strict Strict - * @param int forcereload Force reload - * @param int userid User id - * @param string token Token + * @param {string} url Url (warning: as any url called in ajax mode, the url called here must not renew the token) + * @param {string} code Code + * @param {string} intput Array of complementary actions to do if success + * @param {int} entity Entity + * @param {int} strict Strict + * @param {int} forcereload Force reload + * @param {int} userid User id + * @param {string} token Token + * @return boolean */ function delConstant(url, code, input, entity, strict, forcereload, userid, token) { var saved_url = url; /* avoid undefined url */ @@ -747,6 +751,8 @@ function delConstant(url, code, input, entity, strict, forcereload, userid, toke return false; } }).fail(function(error) { console.log("Error, we force reload"); location.reload(); }); /* When it fails, we always force reload to have setEventErrorMessages in session visible */ + + return true; } /* @@ -764,6 +770,7 @@ function delConstant(url, code, input, entity, strict, forcereload, userid, toke * @param int strict Strict * @param int userid User id * @param string token Token + * @return boolean */ function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict, userid, token) { var boxConfirm = box; @@ -809,6 +816,8 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, if (boxConfirm.info) { $("#noButton_" + code).button().hide(); } + + return true; } @@ -931,8 +940,8 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, /** * Function to output a dialog box for copy/paste * - * @param string text Text to put into copy/paste area - * @param string text2 Text to put under the copy/paste area + * @param text Text to put into copy/paste area + * @param text2 Text to put under the copy/paste area */ function copyToClipboard(text,text2) { @@ -942,6 +951,7 @@ function copyToClipboard(text,text2) $("#dialogforpopup").html(newElem); $("#dialogforpopup").dialog(); $("#coordsforpopup").select(); + return false; } @@ -949,9 +959,9 @@ function copyToClipboard(text,text2) /** * Show a popup HTML page. Use the "window.open" function. * - * @param string url Url - * @param string title Title of popup - * @return boolean False + * @param url Url + * @param title Title of popup + * @return boolean False * @see document_preview */ function newpopup(url, title) { @@ -965,6 +975,7 @@ function newpopup(url, title) { var top = (screen.height - h)/2; var wfeatures = "directories=0,menubar=0,status=0,resizable=0,scrollbars=1,toolbar=0,width=" + l +",height=" + h + ",left=" + left + ",top=" + top; fen=window.open(tmp,title,wfeatures); + return false; } @@ -972,9 +983,9 @@ function newpopup(url, title) { * Function show document preview. It uses the "dialog" function. * The a tag around the img must have the src='', class='documentpreview', mime='image/xxx', target='_blank' from getAdvancedPreviewUrl(). * - * @param string file Url - * @param string type Mime file type ("image/jpeg", "application/pdf", "text/html") - * @param string title Title of popup + * @param file Url + * @param type Mime file type ("image/jpeg", "application/pdf", "text/html") + * @param title Title of popup * @return void * @see newpopup */ @@ -1064,9 +1075,9 @@ function document_preview(file, type, title) /* * Provide a function to get an URL GET parameter in javascript * - * @param string name Name of parameter - * @param mixed valueifnotfound Value if not found - * @return string Value + * @param name Name of parameter + * @param valueifnotfound Value if not found + * @return string Value */ function getParameterByName(name, valueifnotfound) { diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 560f4b772b4..c7d1edde3df 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -257,7 +257,7 @@ function barcode_encode_ean($ean, $encoding = "EAN-13") if ($a > 0) { $text .= " "; } - $text .= "$pos:12:{$ean[$a]}"; + $text .= $pos.":12:".$ean[$a]; if ($a == 0) { $pos += 12; } elseif ($a == 6) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bfbf0f8414e..9231eba57ae 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1837,7 +1837,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di if (empty($conf->use_javascript_ajax)) { $out .= ' href="'.DOL_URL_ROOT.$url.'" target="_blank"'; } elseif ($jsonopen) { - $out .= ' href="#" onclick="javascript:'.$jsonopen.'"'; + $out .= ' href="#" onclick="'.$jsonopen.'"'; } else { $out .= ' href="#"'; } @@ -5452,7 +5452,7 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict * Print a title with navigation controls for pagination * * @param string $titre Title to show (required) - * @param int $page Numero of page to show in navigation links (required) + * @param int|null $page Numero of page to show in navigation links (required) * @param string $file Url of page (required) * @param string $options More parameters for links ('' by default, does not include sortfield neither sortorder). Value must be 'urlencoded' before calling function. * @param string $sortfield Field to sort on ('' by default) @@ -5479,6 +5479,8 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', $savtotalnboflines = $totalnboflines; $totalnboflines = abs((int) $totalnboflines); + $page = (int) $page; + if ($picto == 'setup') { $picto = 'title_setup.png'; } @@ -5529,7 +5531,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', } // Show navigation bar $pagelist = ''; - if ($savlimit != 0 && ((int) $page > 0 || $num > $limit)) { + if ($savlimit != 0 && ($page > 0 || $num > $limit)) { if ($totalnboflines) { // If we know total nb of lines // Define nb of extra page links before and after selected page + ... + first or last $maxnbofpage = (empty($conf->dol_optimize_smallscreen) ? 4 : 0); @@ -5590,7 +5592,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '', } if ($savlimit || $morehtmlright || $morehtmlrightbeforearrow) { - print_fleche_navigation((int) $page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow, $hidenavigation); // output the div and ul for previous/last completed with page numbers into $pagelist + print_fleche_navigation($page, $file, $options, $nextpage, $pagelist, $morehtmlright, $savlimit, $totalnboflines, $hideselectlimit, $morehtmlrightbeforearrow, $hidenavigation); // output the div and ul for previous/last completed with page numbers into $pagelist } // js to autoselect page field on focus diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 3cf5d8a5003..5cb0f88e67b 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2335,7 +2335,7 @@ class ExpenseReport extends CommonObject // phpcs:enable $sql = "SELECT rowid, date_debut, date_fin"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " WHERE fk_user_author = '{$fuser->id}'"; + $sql .= " WHERE fk_user_author = ".((int) $fuser->id); dol_syslog(get_class($this)."::periode_existe sql=".$sql); $result = $this->db->query($sql); diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php index d9bc8629e9f..942b17a5193 100644 --- a/htdocs/hrm/job_card.php +++ b/htdocs/hrm/job_card.php @@ -210,7 +210,7 @@ if ($action == 'create') { print '
'; print ''; print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage + print ''; // Cancel for create does not post form if we don't know the backtopage print '
'; print ''; diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 92f3efd6fe9..29dc18aa828 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -279,7 +279,7 @@ if ($action == 'create') { print ''; print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage + print ''; // Cancel for create does not post form if we don't know the backtopage print ''; print ''; diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index d5b62b26151..bb84aeddbce 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -225,7 +225,7 @@ if ($action == 'create') { print ''; print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage + print ''; // Cancel for create does not post form if we don't know the backtopage print ''; print ''; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4a76968d43e..d5a7a7079b2 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2864,11 +2864,7 @@ if (!empty($module) && $module != 'initmodule' && $module != 'deletemodule') { dol_include_once($fullpathdirtodescriptor); $class = 'mod'.$module; - } catch (Throwable $e) { // This is called in PHP 7 only (includes Error and Exception). Never called with PHP 5.6-. - $loadclasserrormessage = $e->getMessage()."
\n"; - $loadclasserrormessage .= 'File: '.$e->getFile()."
\n"; - $loadclasserrormessage .= 'Line: '.$e->getLine()."
\n"; - } catch (Exception $e) { // This is called in PHP 5.6- because not already trapped by previous case in PHP 5.6-. + } catch (Throwable $e) { // This is called in PHP 7 only (includes Error and Exception) $loadclasserrormessage = $e->getMessage()."
\n"; $loadclasserrormessage .= 'File: '.$e->getFile()."
\n"; $loadclasserrormessage .= 'Line: '.$e->getLine()."
\n"; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 2a4217f5810..5d62485f3bc 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -537,8 +537,8 @@ if ($id > 0 || $ref) { rate_options = $.parseHTML(data.value) rate_options.forEach(opt => { if (opt.selected) { - replaceVATWithSupplierValue(opt.value) - return + replaceVATWithSupplierValue(opt.value); + return; } }) } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 2df2123d00b..171408df070 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -426,7 +426,7 @@ if ($action == 'create') { print '
'; print ''; print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage + print ''; // Cancel for create does not post form if we don't know the backtopage print '
'; print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 43c31a23776..ea7c3e51d35 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1449,8 +1449,7 @@ if ($action == 'create' && $user->rights->projet->creer) { else { console.log("oldpercent="+oldpercent+" defaultpercent="+defaultpercent); - if ((parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent))); - { + if ((parseFloat(jQuery("#opp_percent").val()) < parseFloat(defaultpercent))) { if (jQuery("#opp_percent").val() != \'\' && oldpercent != \'\') jQuery("#oldopppercent").text(\' - '.dol_escape_js($langs->transnoentities("PreviousValue")).': \'+price2numjs(oldpercent)+\' %\'); jQuery("#opp_percent").val(price2numjs(defaultpercent)); } diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index d87d231d599..5b77b5df7b3 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -98,7 +98,7 @@ dol_syslog("Callback url when a payment was done. query_string=".(dol_escape_htm $tracepost = ""; foreach ($_POST as $k => $v) { - $tracepost .= "{$k} - {$v}\n"; + $tracepost .= "$k - $v\n"; } dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 764455e073c..ea5395e7618 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -132,7 +132,7 @@ dol_syslog("Callback url when an online payment is refused or canceled. query_st $tracepost = ""; foreach ($_POST as $k => $v) { if (is_scalar($k) && is_scalar($v)) { - $tracepost .= "{$k} - {$v}\n"; + $tracepost .= "$k - $v\n"; } } dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 0c287d90a85..38891ee677d 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -177,14 +177,14 @@ dol_syslog("_SERVER[SERVER_ADDR] = ".(empty($_SERVER["SERVER_ADDR"]) ? '' : dol_ $tracepost = ""; foreach ($_POST as $k => $v) { if (is_scalar($k) && is_scalar($v)) { - $tracepost .= "{$k} - {$v}\n"; + $tracepost .= "$k - $v\n"; } } dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); $tracesession = ""; foreach ($_SESSION as $k => $v) { if (is_scalar($k) && is_scalar($v)) { - $tracesession .= "{$k} - {$v}\n"; + $tracesession .= "$k - $v\n"; } } dol_syslog("SESSION=".$tracesession, LOG_DEBUG, 0, '_payment'); diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 1e034d46322..1ee7e003b2a 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -133,7 +133,7 @@ class ActionsCardCompany extends ActionsCardCommon $s .= ' '; if ($conf->use_javascript_ajax) { - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; @@ -161,7 +161,7 @@ class ActionsCardCompany extends ActionsCardCommon $s .= '   '; if ($conf->use_javascript_ajax) { - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $this->tpl['tva_intra'] = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $this->tpl['tva_intra'] = $s.'object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index a6d904ae359..3f62deb8a98 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1722,7 +1722,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "}\n"; print ''; print "\n"; - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $s .= 'country_id).'" target="_blank" rel="noopener noreferrer">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; @@ -2494,7 +2494,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "}\n"; print ''; print "\n"; - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank" rel="noopener noreferrer">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; @@ -2962,7 +2962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "}\n"; print ''; print "\n"; - $s .= ''.$langs->trans("VATIntraCheck").''; + $s .= ''.$langs->trans("VATIntraCheck").''; $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); } else { $s .= 'country_id).'" class="hideonsmartphone" target="_blank" rel="noopener noreferrer">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index dc88baf0c28..93a4668cf7c 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -149,7 +149,7 @@ if (!$vatNumber) { print '
'; print $langs->trans("VATIntraManualCheck", $langs->trans("VATIntraCheckURL"), $langs->transnoentitiesnoconv("VATIntraCheckURL")).'
'; print '
'; -print '
'; +print '
'; if ($messagetoshow) { print '

'; diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 8399b1dc3d4..9a4e0c7b09a 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -92,6 +92,7 @@ if ($conf->browser->layout == 'phone') { } $MAXCATEG = (empty($conf->global->TAKEPOS_NB_MAXCATEG) ? $maxcategbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXCATEG); $MAXPRODUCT = (empty($conf->global->TAKEPOS_NB_MAXPRODUCT) ? $maxproductbydefaultforthisdevice : $conf->global->TAKEPOS_NB_MAXPRODUCT); +$MAXCATEG = 5; /* $constforcompanyid = 'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]; @@ -260,8 +261,11 @@ function MoreCategories(moreorless) { pagecategories=pagecategories-1; return; } + for (i = 0; i < ; i++) { if (typeof (categories[i+( * pagecategories)]) == "undefined") { + // complete with empty record + console.log("complete with empty record"); $("#catdivdesc"+i).hide(); $("#catdesc"+i).text(""); $("#catimg"+i).attr("src","genimg/empty.png"); @@ -589,8 +593,8 @@ function New() { /** * Search products * - * @param string keyCodeForEnter Key code for "enter" or '' if not - * @param int moreorless ?? + * @param keyCodeForEnter Key code for "enter" or '' if not + * @param moreorless "more" or "less" * return void */ function Search2(keyCodeForEnter, moreorless) { @@ -875,6 +879,8 @@ function MoreActions(totalactions){ else $("#action"+i).hide(); } } + + return true; } function ControlCashOpening() diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index ed01050d030..c1c5b8aeccd 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1074,16 +1074,19 @@ function SendTicket(id) { console.log("Open box to select the Print/Send form"); $.colorbox({href:"send.php?facid="+id, width:"70%", height:"30%", transition:"none", iframe:"true", title:'trans("SendTicket")); ?>'}); + return true; } function PrintBox(id, action) { console.log("Open box before printing"); $.colorbox({href:"printbox.php?facid="+id+"&action="+action+"&token=", width:"80%", height:"200px", transition:"none", iframe:"true", title:"trans("PrintWithoutDetails"); ?>"}); + return true; } function Print(id, gift){ console.log("Call Print() to generate the receipt."); $.colorbox({href:"receipt.php?facid="+id+"&gift="+gift, width:"40%", height:"90%", transition:"none", iframe:"true", title:'trans("PrintTicket")); ?>'}); + return true; } function TakeposPrinting(id){ @@ -1097,6 +1100,7 @@ function TakeposPrinting(id){ data: receipt }); }); + return true; } function TakeposConnector(id){ @@ -1108,6 +1112,7 @@ function TakeposConnector(id){ data: 'invoice='+data }); }); + return true; } function DolibarrTakeposPrinting(id) { @@ -1117,15 +1122,17 @@ function DolibarrTakeposPrinting(id) { data: { token: '' }, url: "" + id, }); + return true; } function CreditNote() { - $("#poslines").load("invoice.php?action=creditnote&token=&invoiceid="+placeid, function() { - }); + $("#poslines").load("invoice.php?action=creditnote&token=&invoiceid="+placeid, function() { }); + return true; } function SetNote() { $("#poslines").load("invoice.php?action=addnote&token=&invoiceid="+placeid+"&idline="+selectedline, { "addnote": $("#textinput").val() }); + return true; } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index b15ac8b787c..ea4a106e808 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -297,6 +297,8 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { $('.change2').addClass('colorwhite'); } } + + return true; } function reset() @@ -332,6 +334,8 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { location.reload(); } }); + + return true; } function fetchPaymentIntentClientSecret(amount, invoiceid) { diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 8daf1239deb..5eda8e9d1bc 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -186,7 +186,7 @@ if ($action == 'create') { print '
'; print ''; print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage + print ''; // Cancel for create does not post form if we don't know the backtopage print '
'; print ''; diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 194bf16b33f..4a8a02fd0bc 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -607,7 +607,7 @@ class ProductAttribute extends CommonObject public function addLine($ref, $value, $position = -1, $notrigger = 0) { global $langs, $user; - dol_syslog(__METHOD__ . " id={$this->id}, ref=$ref, value=$value, notrigger=$notrigger"); + dol_syslog(__METHOD__ . " id=".$this->id.", ref=".$ref.", value=".$value.", notrigger=".$notrigger); $error = 0; // Clean parameters diff --git a/qodana.yaml b/qodana.yaml index a9c94abadcc..64734dcc383 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -106,3 +106,9 @@ exclude: - name: JSJQueryEfficiency - name: JSDuplicatedDeclaration - name: JSUnresolvedLibraryURL + - name: UnnecessaryReturnJS + - name: UnreachableCodeJS + - name: JSUnnecessarySemicolon + - name: JSPrimitiveTypeWrapperUsage + - name: PhpFullyQualifiedNameUsageInspection + \ No newline at end of file From a4563c7ad4f0fcc819aa6374ed8d750381cc894d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 14:47:21 +0200 Subject: [PATCH 147/156] Close #24625 --- htdocs/core/class/commonpeople.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonpeople.class.php b/htdocs/core/class/commonpeople.class.php index d3b29fdb915..54180eb626c 100644 --- a/htdocs/core/class/commonpeople.class.php +++ b/htdocs/core/class/commonpeople.class.php @@ -76,13 +76,16 @@ trait CommonPeople $thirdpartyid = 0; $elementforaltlanguage = $this->element; if ($this->element == 'societe') { + /** @var Societe $this */ $thirdpartyid = $this->id; } if ($this->element == 'contact') { + /** @var Contact $this */ $contactid = $this->id; $thirdpartyid = empty($this->fk_soc) ? 0 : $this->fk_soc; } if ($this->element == 'user') { + /** @var User $this */ $contactid = $this->contact_id; $thirdpartyid = empty($object->fk_soc) ? 0 : $object->fk_soc; } @@ -90,7 +93,7 @@ trait CommonPeople $out = ''; $outdone = 0; - $coords = $this->getFullAddress(1, ', ', (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) ? $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT : 0)); + $coords = $this->getFullAddress(1, ', ', getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT')); if ($coords) { if (!empty($conf->use_javascript_ajax)) { // Add picto with tooltip on map From 4a3407aa8279013b780d4f7e3adaf1a54dfbc7a7 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Mon, 1 May 2023 16:00:58 +0200 Subject: [PATCH 148/156] FIX #24653 modulebuilder: replace /myobject/ in includes The templates view, like myobject_card.php are including the following files: dol_include_once('/mymodule/class/myobject.class.php'); dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); The mymodule value was replaced correctly, but the myobject value wasn't, leading to another classfile beind included when, for instance, creating new `myobject` objects (whatever myobject actually was, except myobject of course), and resulting in PHP errors like: Fatal error: Uncaught Error: Class "DemoObject" not found in /var/www/html/custom/demobug/demoobject_card.php:105 Stack trace: #0 {main} thrown in /var/www/html/custom/demobug/demoobject_card.php on line 105 Fixes #24653 --- htdocs/modulebuilder/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index d5a7a7079b2..20a78a21ab9 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI + * Copyright (C) 2023 Alexandre Janniaux * * 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 @@ -1334,6 +1335,11 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { setEventMessages($langs->trans("FileAlreadyExists", $destfile), null, 'warnings'); } } + $arrayreplacement = array( + '/myobject\.class\.php/' => strtolower($objectname).'.class.php', + '/myobject\.lib\.php/' => strtolower($objectname).'.lib.php', + ); + dolReplaceInFile($destdir.'/'.$destfile, $arrayreplacement, '', 0, 0, 1); } } From 759ddd2d73a82718a1d0e59ebb3ca57d5b195dd0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 15:09:43 +0200 Subject: [PATCH 149/156] Clean code --- htdocs/asterisk/wrapper.php | 2 +- htdocs/compta/sociales/card.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/core/class/lessc.class.php | 2 +- .../browser/default/browser.php | 2 +- htdocs/core/get_menudiv.php | 2 +- htdocs/core/js/dst.js | 6 +++--- htdocs/core/js/lib_head.js.php | 13 +++++++++--- htdocs/core/js/timesheet.js | 2 +- htdocs/core/lib/barcode.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/tpl/objectline_edit.tpl.php | 9 +++++---- htdocs/hrm/compare.php | 4 ++-- htdocs/install/fileconf.php | 2 +- htdocs/main.inc.php | 12 +++++------ htdocs/takepos/phone.php | 4 ++++ htdocs/takepos/reduction.php | 20 +++++++++---------- qodana.yaml | 5 ++++- 19 files changed, 56 insertions(+), 41 deletions(-) diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 2f5096f6436..433c22979da 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -188,7 +188,7 @@ if (!empty($number)) { } else { $txt = "Call Asterisk dialer for caller: ".$caller.", called: ".$called." clicktodiallogin: ".$login; dol_syslog($txt); - print ''."\n"; + print ''."\n"; print ''; fputs($oSocket, "Action: login\r\n"); fputs($oSocket, "Events: off\r\n"); diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index adb525c7d5e..4983236af4e 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -440,7 +440,7 @@ if ($action == 'create') { print '
'; print ''; print '     '; - print ''; + print ''; print '
'; print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2214dc94a81..ba6f35363b6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1115,7 +1115,7 @@ class Form $out .= ''; if ($conf->use_javascript_ajax && empty($disableautocomplete)) { - $out .= ajax_multiautocompleter('location_incoterms', '', DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; + $out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n"; $moreattrib .= ' autocomplete="off"'; } $out .= '' . "\n"; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index d2fda62ae97..737e61fa4b1 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -876,7 +876,7 @@ class FormCompany extends Form * @param string $morecss More css * @return string */ - public function select_ziptown($selected = '', $htmlname = 'zipcode', $fields = '', $fieldsize = 0, $disableautocomplete = 0, $moreattrib = '', $morecss = '') + public function select_ziptown($selected = '', $htmlname = 'zipcode', $fields = array(), $fieldsize = 0, $disableautocomplete = 0, $moreattrib = '', $morecss = '') { // phpcs:enable global $conf; diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index 730f2c0f9e2..34e187085af 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -1905,7 +1905,7 @@ class Lessc } // type based operators - $fname = "op_${ltype}_${rtype}"; + $fname = "op_".$ltype."_".$rtype; if (is_callable(array($this, $fname))) { $out = $this->$fname($op, $left, $right); if (!is_null($out)) { diff --git a/htdocs/core/filemanagerdol/browser/default/browser.php b/htdocs/core/filemanagerdol/browser/default/browser.php index 1cf6d8612c2..f97841a1231 100644 --- a/htdocs/core/filemanagerdol/browser/default/browser.php +++ b/htdocs/core/filemanagerdol/browser/default/browser.php @@ -104,7 +104,7 @@ oConnector.CurrentFolder = '/' ; var sConnUrl = GetUrlParam( 'Connector' ); // Gecko has some problems when using relative URLs (not starting with slash). -if ( sConnUrl.substr(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 ) +if ( sConnUrl.substring(0,1) != '/' && sConnUrl.indexOf( '://' ) < 0 ) sConnUrl = window.location.href.replace( /browser.php.*$/, '' ) + sConnUrl ; oConnector.ConnectorUrl = sConnUrl + ( sConnUrl.indexOf('?') != -1 ? '&' : '?' ); diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 8ce7e798c45..4dfe4cc5c75 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -225,7 +225,7 @@ $(document).ready(function(){ $(this).find("li ul").slideToggle(200); - target = $(this); + var target = $(this); $(\'html, body\').animate({ scrollTop: target.offset().top }, 300); diff --git a/htdocs/core/js/dst.js b/htdocs/core/js/dst.js index 8433ada72a9..7276e37755c 100644 --- a/htdocs/core/js/dst.js +++ b/htdocs/core/js/dst.js @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2014 Laurent Destailleur +// Copyright (C) 2011-2023 Laurent Destailleur // Copyright (C) 2011-2012 Regis Houssin // Copyright (C) 2015 Marcos García // @@ -69,7 +69,7 @@ function DisplayDstSwitchDates(firstsecond) var lastOffset = 99; // Loop through every month of the current year - for (i = 0; i < 12; i++) + for (let i = 0; i < 12; i++) { // Fetch the timezone value for the month var newDate = new Date(Date.UTC(year, i, 0, 0, 0, 0, 0)); @@ -109,7 +109,7 @@ function FindDstSwitchDate(year, month) var dstDate; // Loop to find the exact day a timezone adjust occurs - for (day = 0; day < 50; day++) + for (let day = 0; day < 50; day++) { var tmpDate = new Date(Date.UTC(year, month, day, 0, 0, 0, 0)); var tmpOffset = -1 * tmpDate.getTimezoneOffset() / 60; diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 10f600ea349..051aa2a702f 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1227,7 +1227,7 @@ function pricejs(amount, mode = 'MT', currency_code = '', force_locale = '') { * Function similar to PHP price2num() * * @param {number|string} amount The amount to convert/clean - * @return {string} The amount in universal numeric format (Example: '99.99999') + * @return {number} The amount in universal numeric format (Example: '99.99999') * @todo Implement rounding parameter */ function price2numjs(amount) { @@ -1246,20 +1246,27 @@ function price2numjs(amount) { var rounding = main_rounding_unit; var pos = amount.indexOf(dec); var decpart = ''; - if (pos >= 0) decpart = amount.substr(pos + 1).replace('/0+$/i', ''); // Remove 0 for decimal part + if (pos >= 0) { + decpart = amount.substring(pos + 1).replace('/0+$/i', ''); // Remove 0 for decimal part + } var nbdec = decpart.length; - if (nbdec > rounding) rounding = nbdec; + if (nbdec > rounding) { + rounding = nbdec; + } // If rounding higher than max shown if (rounding > main_max_dec_shown) rounding = main_max_dec_shown; if (thousand != ',' && thousand != '.') amount = amount.replace(',', '.'); amount = amount.replace(' ', ''); // To avoid spaces amount = amount.replace(thousand, ''); // Replace of thousand before replace of dec to avoid pb if thousand is . amount = amount.replace(dec, '.'); + //console.log("amount before="+amount+" rouding="+rounding) var res = Math.round10(amount, - rounding); // Other solution is // var res = dolroundjs(amount, rounding) + console.log("price2numjs text="+amount+" return="+res); + return res; } diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index 63c395a953b..bb0090b7e15 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -63,7 +63,7 @@ function regexEvent(objet,evt,type) case 'timeChar': //var regex= /^[0-9:]{1}$/; //alert(event.charCode); - var charCode = (evt.which) ? evt.which : event.keyCode; + var charCode = (evt.which) ? evt.which : evt.keyCode; if(((charCode >= 48) && (charCode <= 57)) || //num (charCode===46) || (charCode===8)||// comma & periode diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index c7d1edde3df..717ed4af1c6 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -305,7 +305,7 @@ function barcode_encode_upc($upc, $encoding = "UPC") if ($a > 1) { $text .= " "; } - $text .= "$pos:12:{$upc[$a]}"; + $text .= $pos.":12:".$upc[$a]; if ($a == 1) { $pos += 15; } elseif ($a == 6) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9231eba57ae..8e96c8f4d29 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1866,8 +1866,8 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di console.log("open popup name='.$name.', backtopagejsfields='.$backtopagejsfields.'"); }, close: function (event, ui) { - returnedid = jQuery("#varforreturndialogid'.$name.'").text(); - returnedlabel = jQuery("#varforreturndialoglabel'.$name.'").text(); + var returnedid = jQuery("#varforreturndialogid'.$name.'").text(); + var returnedlabel = jQuery("#varforreturndialoglabel'.$name.'").text(); console.log("popup has been closed. returnedid (js var defined into parent page)="+returnedid+" returnedlabel="+returnedlabel); if (returnedid != "" && returnedid != "div for returned id") { jQuery("#'.(empty($backtopagejsfieldsid)?"none":$backtopagejsfieldsid).'").val(returnedid); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index a0bf235c0eb..b7824787ab0 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -453,11 +453,12 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } var price = 0; - remisejs=price2numjs(remise.val()); + remisejs = price2numjs(remise.val()); - if (remisejs != 100) // If a discount not 100 or no discount - { - if (remisejs == '') remisejs=0; + if (remisejs != 100) { // If a discount not 100 or no discount + if (remisejs == '') { + remisejs = 0; + } bpjs=price2numjs(buying_price.val()); ratejs=price2numjs(rate.val()); diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php index 63b40cccb0e..15b03e587c7 100644 --- a/htdocs/hrm/compare.php +++ b/htdocs/hrm/compare.php @@ -86,8 +86,8 @@ print dol_get_fiche_head($head, 'compare', '', 1); } - $userl = $(this).closest('ul'); - listname = $userl.attr('name'); + var $userl = $(this).closest('ul'); + var listname = $userl.attr('name'); var TId = []; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 24afafbb83c..86cd4af0f5c 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -630,7 +630,7 @@ function jscheckparam() { console.log("Click on jscheckparam"); - ok=true; + var ok = true; if (document.forminstall.main_dir.value == '') { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index dc65c49d9a3..a910f32f54b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2837,18 +2837,18 @@ function top_menu_bookmark() jQuery("#topmenu-bookmark-dropdown .dropdown-toggle").on("click", function(event) { console.log("Click on #topmenu-bookmark-dropdown .dropdown-toggle"); - openBookMarkDropDown(); + openBookMarkDropDown(event); }); // Key map shortcut - jQuery(document).keydown(function(e){ - if( e.which === 77 && e.ctrlKey && e.shiftKey ){ - console.log(\'control + shift + m : trigger open bookmark dropdown\'); - openBookMarkDropDown(); + jQuery(document).keydown(function(event){ + if( event.which === 77 && event.ctrlKey && event.shiftKey ){ + console.log("Click on control + shift + m : trigger open bookmark dropdown"); + openBookMarkDropDown(event); } }); - var openBookMarkDropDown = function() { + var openBookMarkDropDown = function(event) { event.preventDefault(); jQuery("#topmenu-bookmark-dropdown").toggleClass("open"); jQuery("#top-bookmark-search-input").focus(); diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 4e2ddac6592..71db0177d88 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -249,6 +249,8 @@ function AddProductConfirm(placeid, productid){ });'; } ?> + + return true; } function SetQty(place, selectedline, qty){ @@ -278,6 +280,8 @@ function SetQty(place, selectedline, qty){ } ?> LoadCats(); + + return true; } function SetNote(place, selectedline){ diff --git a/htdocs/takepos/reduction.php b/htdocs/takepos/reduction.php index 5d80acb0f81..995d18599a3 100644 --- a/htdocs/takepos/reduction.php +++ b/htdocs/takepos/reduction.php @@ -212,19 +212,19 @@ if (!isset($conf->global->TAKEPOS_NUMPAD_USE_PAYMENT_ICON) || !empty($conf->glob
7'; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/qodana.yaml b/qodana.yaml index 64734dcc383..b983cfee78d 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -111,4 +111,7 @@ exclude: - name: JSUnnecessarySemicolon - name: JSPrimitiveTypeWrapperUsage - name: PhpFullyQualifiedNameUsageInspection - \ No newline at end of file + - name: PhpDocMissingThrowsInspection + - name: UnnecessaryLabelJS + + \ No newline at end of file From e9aff0f77682c0aaef94481882cb86de3c5a7b17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 16:41:28 +0200 Subject: [PATCH 150/156] Fix qodana warning --- htdocs/api/class/api.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index c59bb56a8f8..bfe6c0e3b39 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -278,7 +278,6 @@ class DolibarrApi * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) * @return bool - * @throws RestException */ protected static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid') { From 2d17e77ff74a123ecfb6fe7c0d24d2565ed3610c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 17:21:00 +0200 Subject: [PATCH 151/156] Fix warning --- htdocs/bom/tpl/objectline_view.tpl.php | 2 + .../facture/class/facture-rec.class.php | 4 ++ htdocs/core/class/html.form.class.php | 13 +++-- htdocs/core/class/html.formother.class.php | 4 +- .../connectors/php/connector.lib.php | 1 + .../asset/doc/pdf_standard_asset.modules.php | 2 +- .../commande/doc/pdf_einstein.modules.php | 1 + .../commande/doc/pdf_eratosthene.modules.php | 3 +- .../delivery/doc/pdf_storm.modules.php | 2 +- .../expedition/doc/pdf_espadon.modules.php | 2 +- .../modules/export/export_csviso.modules.php | 4 +- .../modules/export/export_csvutf8.modules.php | 4 +- .../facture/doc/pdf_sponge.modules.php | 2 +- .../modules/import/import_xlsx.modules.php | 1 + .../modules/mrp/doc/pdf_vinci.modules.php | 3 +- .../modules/propale/doc/pdf_azur.modules.php | 1 + .../modules/propale/doc/pdf_cyan.modules.php | 2 +- .../doc/pdf_eagle_proforma.modules.php | 2 +- .../supplier_order/doc/pdf_cornas.modules.php | 3 +- .../doc/pdf_muscadet.modules.php | 1 + .../doc/pdf_aurore.modules.php | 1 + .../class/fournisseur.commande.class.php | 7 +++ .../class/fournisseur.facture-rec.class.php | 48 ++++++++++--------- htdocs/user/class/user.class.php | 2 + 24 files changed, 71 insertions(+), 44 deletions(-) diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 835da0a80d8..98e79fa0416 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -34,6 +34,8 @@ * $type, $text, $description, $line */ +/** var ObjectLine $line */ + require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php'; // Protection to avoid direct call of template diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 5c24359c78b..09b2c1e6185 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1035,6 +1035,10 @@ class FactureRec extends CommonInvoice $this->error = $this->db->lasterror(); return -1; } + } else { + $this->error = 'Recurring Invoice is suspended. adding lines not allowed.'; + + return -1; } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ba6f35363b6..5e4f5490e61 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -802,18 +802,17 @@ class Form /** * Generate select HTML to choose massaction * - * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default. - * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. - * @param int $alwaysvisible 1=select button always visible - * @param string $name Name for massaction - * @param string $cssclass CSS class used to check for select - * @return string|void Select list + * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default. + * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. + * @param int $alwaysvisible 1=select button always visible + * @param string $name Name for massaction + * @param string $cssclass CSS class used to check for select + * @return string|void Select list */ public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0, $name = 'massaction', $cssclass = 'checkforselect') { global $conf, $langs, $hookmanager; - $disabled = 0; $ret = '
'; $ret .= ''; From 91f5971b016b270eeb5c154e99c102eccde19791 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 18:46:22 +0200 Subject: [PATCH 154/156] Fix alignment --- htdocs/comm/propal/card.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index a0e2aefdbeb..e31b43f5a43 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2757,35 +2757,35 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; } @@ -2793,9 +2793,9 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountTTC') . ''; - print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; From 8e0db1071ae314384480dbcf796fbebdd57c4d6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 18:49:47 +0200 Subject: [PATCH 155/156] Fix warning --- htdocs/core/class/fileupload.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 4dcfb55f781..ff7dfc622b8 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -577,7 +577,10 @@ class FileUpload } } } + // Return result in json format header('Content-type: application/json'); echo json_encode($success); + + return null; } } From f85487b758c762757eb1223b053278e88f4e1f60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 May 2023 19:16:46 +0200 Subject: [PATCH 156/156] Fix warning --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.formother.class.php | 6 +++--- htdocs/core/class/smtps.class.php | 6 ++++-- .../doc/pdf_standard.modules.php | 18 +++++++++--------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 19221febe3c..e246e8ade73 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6744,7 +6744,7 @@ abstract class CommonObject * Return HTML string to put an input field into a page * Code very similar with showInputField of extra fields * - * @param array $val Array of properties for field to show (used only if ->fields not defined) + * @param array|null $val Array of properties for field to show (used only if ->fields not defined) * @param string $key Key of attribute * @param string|array $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value, for array type must be array) * @param string $moreparam To add more parameters on html input tag diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 596df87e583..ee12b3b72fb 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -782,7 +782,7 @@ class FormOther * * @param string $color String with hex (FFFFFF) or comma RGB ('255,255,255') * @param string $textifnotdefined Text to show if color not defined - * @return void + * @return string Show color string * @see selectColor() */ public static function showColor($color, $textifnotdefined = '') @@ -796,9 +796,9 @@ class FormOther $color = colorArrayToHex(colorStringToArray($color, array()), ''); if ($color) { - print ''; + return ''; } else { - print $textifnotdefined; + return $textifnotdefined; } } diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index fe1f90dd735..dc58c54f122 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -99,8 +99,10 @@ class SMTPs /** * Message Content + * + * @var array $_msgContent Array of messages */ - private $_msgContent = null; + private array $_msgContent = array(); /** * Custom X-Headers @@ -1841,7 +1843,7 @@ class SMTPs /** * Retrieves the Message X-Header Content * - * @return string[] $_msgContent Message X-Header Content + * @return array $_msgContent Message X-Header Content */ public function getXheader() { diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 18cb0796ed0..bede0cc948e 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -603,10 +603,10 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show top header of page. * - * @param TCPDF $pdf Object PDF - * @param FactureFournisseur $object Object to show - * @param int $showaddress 0=no, 1=yes - * @param Translate $outputlangs Object lang for output + * @param TCPDF $pdf Object PDF + * @param PaiementFourn $object Object to show + * @param int $showaddress 0=no, 1=yes + * @param Translate $outputlangs Object lang for output * @return void */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) @@ -814,11 +814,11 @@ class pdf_standard extends ModelePDFSuppliersPayments /** * Show footer of page. Need this->emetteur object * - * @param TCPDF $pdf PDF - * @param FactureFournisseur $object Object to show - * @param Translate $outputlangs Object lang for output - * @param int $hidefreetext 1=Hide free text - * @return int Return height of bottom margin including footer text + * @param TCPDF $pdf PDF + * @param PaiementFourn $object Object to show + * @param Translate $outputlangs Object lang for output + * @param int $hidefreetext 1=Hide free text + * @return int Return height of bottom margin including footer text */ protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) {