From dccde49388c7385c1a9954e73e3c0a471e0278d7 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Wed, 13 Nov 2024 21:31:22 +0100 Subject: [PATCH 001/139] FIX calculate start date of cloned task from cloned project (#31799) * FIX calculate start date of cloned task from cloned project * Fix wrong strat comment --- htdocs/projet/class/task.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 94f04c401fe..d54e2080cf6 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1984,15 +1984,15 @@ class Task extends CommonObjectLine $projectstatic = new Project($this->db); $projectstatic->fetch($ori_project_id); - //Origin project strat date - $orign_project_dt_start = $projectstatic->date_start; + // Origin project start date + $orign_project_dt_start = (!isset($projectstatic->date_start) || $projectstatic->date_start == '') ? $projectstatic->date_c : $projectstatic->date_start; - //Calcultate new task start date with difference between origin proj start date and origin task start date + // Calculate new task start date with difference between origin proj start date and origin task start date if (!empty($clone_task->date_start)) { $clone_task->date_start = $now + $clone_task->date_start - $orign_project_dt_start; } - //Calcultate new task end date with difference between origin proj end date and origin task end date + // Calculate new task end date with difference between origin proj start date and origin task end date if (!empty($clone_task->date_end)) { $clone_task->date_end = $now + $clone_task->date_end - $orign_project_dt_start; } From 4feb9def4ee0f5100e2dce1c3d0a429e03ca81d5 Mon Sep 17 00:00:00 2001 From: MaximilienR-easya <122890855+MaximilienR-easya@users.noreply.github.com> Date: Wed, 13 Nov 2024 22:52:42 +0100 Subject: [PATCH 002/139] Fix Preview present even when there is no corresponding file (#30585) * Fix cas de previews de fichier non existant * another way to detect missing or missnamed file than using file_exists function --- htdocs/comm/card.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index e49beb53e0d..8b4949cd770 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -868,9 +868,9 @@ if ($object->id > 0) { $filedir = $conf->propal->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -980,9 +980,9 @@ if ($object->id > 0) { $filedir = $conf->commande->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1074,9 +1074,9 @@ if ($object->id > 0) { $filedir = $conf->expedition->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1180,9 +1180,9 @@ if ($object->id > 0) { $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1271,9 +1271,9 @@ if ($object->id > 0) { $filedir = $conf->ficheinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { @@ -1471,9 +1471,9 @@ if ($object->id > 0) { $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref); $file_list = null; if (!empty($filedir)) { - $file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); + $file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC); } - if (is_array($file_list)) { + if (is_array($file_list) && !empty($file_list)) { // Defined relative dir to DOL_DATA_ROOT $relativedir = ''; if ($filedir) { From b8f481b5795b7198b1ce4a78929229097bd9d5d1 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Thu, 14 Nov 2024 23:30:11 +0100 Subject: [PATCH 003/139] fix: php 8 warning on create object from table module builder (#31817) * fix: php 8 wrning on create object form table module builder * remove unwanted linebreak * fix: remove warning on filed type checklbst show output list --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/modulebuilder/index.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b1355bde030..89a691f0c74 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8456,7 +8456,7 @@ abstract class CommonObject $sql = "SELECT ".$keyList; $sql .= ' FROM '.$this->db->prefix().$InfoFieldList[0]; - if (strpos($InfoFieldList[4], 'extra') !== false) { + if (isset($InfoFieldList[4]) && strpos($InfoFieldList[4], 'extra') !== false) { $sql .= ' as main'; } // $sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'"; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 66df4aa33c3..377f7157689 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1259,6 +1259,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { $position = 900; } // $alwayseditable + $alwayseditable=0; if ($fieldname == 'label') { $alwayseditable = 1; } @@ -1286,7 +1287,9 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { } // type - $picto = $obj->Picto; + if (isset($obj->Picto)) { + $picto = $obj->Picto; + } if ($obj->Field == 'fk_soc') { $picto = 'company'; } From 1d4c5b61e267a7b33375d5cb94c60c57df4c0f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 Nov 2024 14:08:14 +0100 Subject: [PATCH 004/139] fix filters not compatible with Usf (#31832) --- htdocs/categories/info.php | 2 +- htdocs/categories/photos.php | 2 +- htdocs/categories/traduction.php | 2 +- htdocs/categories/viewcat.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/categories/info.php b/htdocs/categories/info.php index 59dedc1312e..036b4c55b0f 100644 --- a/htdocs/categories/info.php +++ b/htdocs/categories/info.php @@ -75,7 +75,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans($title), -1, 'category'); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.urlencode($type)); $linkback = ''.$langs->trans("BackToList").''; -$object->next_prev_filter = 'type = '.((int) $object->type); +$object->next_prev_filter = 'type:=:'.((int) $object->type); $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 4d299e86ea8..0324500d62b 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -126,7 +126,7 @@ if ($object->id) { $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.urlencode($type)); $linkback = ''.$langs->trans("BackToList").''; - $object->next_prev_filter = 'type = '.((int) $object->type); + $object->next_prev_filter = 'type:=:'.((int) $object->type); $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 8ecd22e6c19..09ea99fecb9 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -188,7 +188,7 @@ print dol_get_fiche_head($head, 'translation', $langs->trans($title), -1, 'categ $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.urlencode($type)); $linkback = ''.$langs->trans("BackToList").''; -$object->next_prev_filter = 'type = '.((int) $object->type); +$object->next_prev_filter = 'type:=:'.((int) $object->type); $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index c7a1d940bc2..772dfaaaf5e 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -261,7 +261,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans($title), -1, 'category'); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.urlencode($type)); $linkback = ''.$langs->trans("BackToList").''; -$object->next_prev_filter = 'type = '.((int) $object->type); +$object->next_prev_filter = 'type:=:'.((int) $object->type); $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); From ce9a1b36618beac106cdc4eaa9dfe83d61396096 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:10:35 +0100 Subject: [PATCH 005/139] FIX: swiftmailer: correctly set errors-to header (#31826) --- htdocs/core/class/CMailFile.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index db8b30ed249..319969bbd18 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -577,7 +577,7 @@ class CMailFile if (!empty($this->errors_to)) { try { - $headers->addTextHeader('Errors-To', $this->getArrayAddress($this->errors_to)); + $headers->addTextHeader('Errors-To', $this->getValidAddress($this->errors_to, 0)); } catch (Exception $e) { $this->errors[] = $e->getMessage(); } @@ -644,7 +644,6 @@ class CMailFile $this->errors[] = $e->getMessage(); } } - //if (!empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) { try { $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from)); From fd3482f3312af692cbee1c9d760d30b89f04a57b Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:13:05 +0200 Subject: [PATCH 006/139] fix #31798 End of month incorrect button value(clone salary) (#31827) --- htdocs/salaries/card.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index df548b3d709..e09c663b181 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -760,8 +760,18 @@ if ($id > 0) { $('#fill_end_of_month').click(function(){ var clone_date_startmonth = +$('#clone_date_startmonth').val(); var clone_date_startyear = +$('#clone_date_startyear').val(); - var end_date = new Date(clone_date_startyear, clone_date_startmonth, 0); - end_date.setMonth(clone_date_startmonth - 1); + var end_date; + if (clone_date_startmonth && clone_date_startyear) { + end_date = new Date(clone_date_startyear, clone_date_startmonth , 0); + } else { + var currentDate = new Date(); + var currentDay = currentDate.getDate(); + if (currentDay <= 15) { + end_date = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0); + } else { + end_date = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0); + } + } $('#clone_date_end').val(formatDate(end_date,'".$langs->trans("FormatDateShortJavaInput")."')); $('#clone_date_endday').val(end_date.getDate()); $('#clone_date_endmonth').val(end_date.getMonth() + 1); From cd7a6e6de03cc8cb11f4e9627ecf964dfefbb341 Mon Sep 17 00:00:00 2001 From: Expresion <67320879+Expresion@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:13:46 +0100 Subject: [PATCH 007/139] Fix php8 warnings in agenda module (#31834) * Update index.php Fix: avoid php8 warnings in the agenda module * Update index.php Fix: php8 warnings in agenda module --- htdocs/comm/action/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 6e23e6d0a93..6f24008c7ad 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1384,9 +1384,9 @@ if (count($listofextcals)) { $event->datep = $datestart + $usertime; $event->datef = $dateend + $usertime; - if ($icalevent['SUMMARY']) { + if (isset($icalevent['SUMMARY']) && $icalevent['SUMMARY']) { $event->label = dol_string_nohtmltag($icalevent['SUMMARY']); - } elseif ($icalevent['DESCRIPTION']) { + } elseif (isset($icalevent['DESCRIPTION']) && $icalevent['DESCRIPTION']) { $event->label = dol_nl2br(dol_string_nohtmltag($icalevent['DESCRIPTION']), 1); } else { $event->label = $langs->trans("ExtSiteNoLabel"); From 7e9919e6b356929a9a89840e36d002197c510603 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:01:03 +0100 Subject: [PATCH 008/139] FIX: invoice: revenue stamp wrongly converted to int (#31840) --- 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 01c52600a6b..364b22cfe4c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2511,7 +2511,7 @@ class Facture extends CommonInvoice $sql .= " localtax2=".(isset($this->total_localtax2) ? (float) $this->total_localtax2 : "null").","; $sql .= " total_ht=".(isset($this->total_ht) ? (float) $this->total_ht : "null").","; $sql .= " total_ttc=".(isset($this->total_ttc) ? (float) $this->total_ttc : "null").","; - $sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (int) $this->revenuestamp : "null").","; + $sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (float) $this->revenuestamp : "null").","; $sql .= " fk_statut=".(isset($this->status) ? (int) $this->status : "null").","; $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? (int) $this->fk_user_valid : "null").","; $sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? (int) $this->fk_facture_source : "null").","; From f408803ae074ca3ff2afce68781b4e80bafbc5ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= <85104766+Kazimir42@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:02:11 +0100 Subject: [PATCH 009/139] list contact check by module (#31845) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rémi Champlon --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 09512e9df32..7186e44a767 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1572,7 +1572,7 @@ abstract class CommonObject $tab = array(); - $sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle as type_label, tc.position, tc.element"; + $sql = "SELECT DISTINCT tc.rowid, tc.code, tc.libelle as type_label, tc.position, tc.element, tc.module"; $sql .= " FROM ".$this->db->prefix()."c_type_contact as tc"; $sqlWhere = array(); @@ -1609,7 +1609,7 @@ abstract class CommonObject $langs->loadLangs(array("propal", "orders", "bills", "suppliers", "contracts", "supplier_proposal")); while ($obj = $this->db->fetch_object($resql)) { - $modulename = $obj->element; + $modulename = $obj->module ?? $obj->element; if (strpos($obj->element, 'project') !== false) { $modulename = 'projet'; } elseif ($obj->element == 'contrat') { From 4432fa791390071f3ec8728cbdc49afc3cb05dc5 Mon Sep 17 00:00:00 2001 From: IC-Victorien Date: Fri, 15 Nov 2024 22:32:10 +0100 Subject: [PATCH 010/139] FIX warehouse list status (#31902) --- htdocs/product/stock/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index fdaa3dbad02..dad98f949c6 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -255,7 +255,7 @@ if ($separatedPMP) { } $sql .= " WHERE t.entity IN (".getEntity('stock').")"; foreach ($search as $key => $val) { - if (array_key_exists($key, $object->fields)) { + if (array_key_exists($key, $object->fields)||$key == 'status') { $class_key = $key; if ($class_key == 'status') { $class_key = 'statut'; // remove this after refactoring entrepot.class property statut to status From 206570dac5e68caa1b11b4be3d8b96ff9f6ad15e Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Fri, 15 Nov 2024 22:33:24 +0100 Subject: [PATCH 011/139] Add new check for ldap sync (#31925) Closes: https://github.com/Dolibarr/dolibarr/issues/30819 Signed-off-by: Alarig Le Lay --- .../core/triggers/interface_50_modLdap_Ldapsynchro.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 1a92bca5b66..d35e60aec30 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -512,6 +512,11 @@ class InterfaceLdapsynchro extends DolibarrTriggers $object->oldcopy = clone $object; } + if (!method_exists($object->oldcopy, '_load_ldap_info')) { + dol_syslog("Trigger ".$action." was called by a function that did not set previously the method ->_load_ldap_info onto object", LOG_WARNING); + $object->oldcopy = clone $object; + } + $oldinfo = $object->oldcopy->_load_ldap_info(); $olddn = $object->oldcopy->_load_ldap_dn($oldinfo); From ec6f5911997712fe3cad558a489d829413a50a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20PASCAL?= Date: Fri, 15 Nov 2024 22:54:57 +0100 Subject: [PATCH 012/139] fix: issue #31880 (#31919) --- htdocs/reception/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index df1f86eb272..04ab04f8332 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -399,7 +399,7 @@ if (empty($reshook)) { //var_dump(GETPOST("productl".$i, 'int').' '.GETPOST('entl'.$i, 'int').' '.GETPOST($idl, 'int').' '.GETPOST($qty, 'int').' '.GETPOST($batch, 'alpha')); //if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS')) || (GETPOST($qty, 'int') < 0 && getDolGlobalString('RECEPTION_ALLOW_NEGATIVE_QTY'))) { - if (GETPOSTINT($qty) > 0 || (GETPOSTINT($qty) == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS'))) { + if (GETPOSTFLOAT($qty) > 0 || (GETPOSTFLOAT($qty) == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS'))) { $ent = "entl".$i; $idl = "idl".$i; From d21d794e0780f21335452702468c643cc0cedaed Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Fri, 15 Nov 2024 22:56:08 +0100 Subject: [PATCH 013/139] Fix reception lines when qte is strictly between 0 and 1 (#31920) --- htdocs/reception/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 6b28afe31de..d62429ea28f 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -388,7 +388,7 @@ if (empty($reshook)) { //var_dump(GETPOST("productl".$i, 'int').' '.GETPOST('entl'.$i, 'int').' '.GETPOST($idl, 'int').' '.GETPOST($qty, 'int').' '.GETPOST($batch, 'alpha')); //if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS')) || (GETPOST($qty, 'int') < 0 && getDolGlobalString('RECEPTION_ALLOW_NEGATIVE_QTY'))) { - if (GETPOSTINT($qty) > 0 || (GETPOSTINT($qty) == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS'))) { + if (GETPOSTFLOAT($qty) > 0 || (GETPOSTFLOAT($qty) == 0 && getDolGlobalString('RECEPTION_GETS_ALL_ORDER_PRODUCTS'))) { $ent = "entl".$i; $idl = "idl".$i; From cb7d4d1ad5429c6001ee0e6a4773e667ad00bb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 Nov 2024 22:57:43 +0100 Subject: [PATCH 014/139] clean phpstan baseline (#31921) * clean phpstan baseline * clean phpstan baseline * clean phpstan baseline --- build/phpstan/phpstan-baseline.neon | 30 --------------------- htdocs/partnership/partnership_document.php | 4 +-- htdocs/projet/tasks/comment.php | 6 ++--- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index e519fa25114..7a97e63e9ee 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -11106,12 +11106,6 @@ parameters: count: 4 path: ../../htdocs/core/class/ctyperesource.class.php - - - message: '#^Property CUnits\:\:\$scale \(string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 4 - path: ../../htdocs/core/class/cunits.class.php - - message: '#^Property CUnits\:\:\$short_label \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property @@ -22308,12 +22302,6 @@ parameters: count: 1 path: ../../htdocs/fourn/commande/card.php - - - message: '#^Variable \$text might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/fourn/commande/card.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -27252,12 +27240,6 @@ parameters: count: 1 path: ../../htdocs/partnership/partnership_card.php - - - message: '#^Variable \$upload_dir might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/partnership/partnership_document.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -30432,18 +30414,6 @@ parameters: count: 1 path: ../../htdocs/projet/tasks/comment.php - - - message: '#^Variable \$mode might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/projet/tasks/comment.php - - - - message: '#^Variable \$socid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/projet/tasks/comment.php - - message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index f425aeb3181..12e84a13214 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -80,9 +80,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals -if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->partnership->multidir_output[$object->entity ? $object->entity : $conf->entity]."/partnership/".get_exdir(0, 0, 0, 1, $object); -} +$upload_dir = $conf->partnership->multidir_output[$object->entity ?: $conf->entity]."/partnership/".get_exdir(0, 0, 0, 1, $object); $permissiontoread = $user->hasRight('partnership', 'read'); $permissiontoadd = $user->hasRight('partnership', 'write'); // Used by the include of actions_addupdatedelete.inc.php diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 70bcc16d045..026eda0239f 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -56,6 +56,7 @@ $confirm = GETPOST('confirm', 'alpha'); $withproject = GETPOSTINT('withproject'); $project_ref = GETPOST('project_ref', 'alpha'); $planned_workload = ((GETPOSTINT('planned_workloadhour') != '' || GETPOSTINT('planned_workloadmin') != '') ? (GETPOSTINT('planned_workloadhour') > 0 ? GETPOSTINT('planned_workloadhour') * 3600 : 0) + (GETPOSTINT('planned_workloadmin') > 0 ? GETPOSTINT('planned_workloadmin') * 60 : 0) : ''); +$mode = GETPOST('mode', 'alpha'); // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projecttaskcommentcard', 'globalcard')); @@ -70,6 +71,8 @@ $extrafields->fetch_name_optionals_label($object->table_element); // include comment actions include DOL_DOCUMENT_ROOT.'/core/actions_comments.inc.php'; +// Security check +$socid = 0; // Retrieve First Task ID of Project if withprojet is on to allow project prev next to work if (!empty($project_ref) && !empty($withproject)) { if ($projectstatic->fetch(0, $project_ref) > 0) { @@ -87,9 +90,6 @@ if ($id > 0 || $ref) { $object->fetch($id, $ref); } -// Security check -$socid = 0; - restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); From 39d0debfd453f36ebf145900ab05c20d54eb8a76 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 15 Nov 2024 22:59:33 +0100 Subject: [PATCH 015/139] fix php warning in infobox.class (#31907) Co-authored-by: Hystepik --- htdocs/core/class/infobox.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index e7579678d18..cfec6d48773 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -231,7 +231,7 @@ class InfoBox require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - dol_syslog(get_class()."::saveboxorder zone=".$zone." userid=".$userid); + dol_syslog(self::class."::saveboxorder zone=".$zone." userid=".$userid); if (!$userid || $userid == 0) { return 0; @@ -258,7 +258,7 @@ class InfoBox $sql .= " AND fk_user = ".((int) $userid); $sql .= " AND position = ".((int) $zone); - dol_syslog(get_class()."::saveboxorder", LOG_DEBUG); + dol_syslog(self::class."::saveboxorder", LOG_DEBUG); $result = $dbs->query($sql); if ($result) { $colonnes = explode('-', $boxorder); @@ -266,7 +266,7 @@ class InfoBox $part = explode(':', $collist); $colonne = $part[0]; $list = $part[1]; - dol_syslog(get_class()."::saveboxorder column=".$colonne.' list='.$list); + dol_syslog(self::class."::saveboxorder column=".$colonne.' list='.$list); $i = 0; $listarray = explode(',', $list); From ee65f40512cb009072156e7e19f19f42c59bfb2f Mon Sep 17 00:00:00 2001 From: moreauftheobald Date: Fri, 15 Nov 2024 23:00:56 +0100 Subject: [PATCH 016/139] Tracking $conf->module->enabled part 2 (#31899) Co-authored-by: Theobald --- htdocs/comm/propal/class/propal.class.php | 4 ++-- htdocs/core/bookmarks_page.php | 2 +- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/member.lib.php | 4 ++-- htdocs/core/lib/usergroups.lib.php | 4 ++-- htdocs/core/login/functions_ldap.php | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ce3c6f96804..c42b5b22c93 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -402,8 +402,8 @@ class Propal extends CommonObject 'fk_delivery_address' => array('type' => 'integer', 'label' => 'DeliveryAddress', 'enabled' => 1, 'visible' => 0, 'position' => 200), // deprecated 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 205), 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 215), - 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 220), - 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 225), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 220), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 225), 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 1, 'visible' => -1, 'position' => 230), 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 235), 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240, 'isameasure' => 1), diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php index e59b2ef2edb..e3fcdbc8545 100644 --- a/htdocs/core/bookmarks_page.php +++ b/htdocs/core/bookmarks_page.php @@ -97,7 +97,7 @@ $bookmarkList = ''; $searchForm = ''; -if (empty($conf->bookmark->enabled)) { +if (!isModEnabled('bookmark')) { $langs->load("admin"); $bookmarkList .= '
'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).''; $bookmarkList .= '

'; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d0e6cbe8d9d..a5aae13bf76 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -507,7 +507,7 @@ class FormFile $printer = 0; // The direct print feature is implemented only for such elements if (in_array($modulepart, array('contract', 'facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) { - $printer = ($user->hasRight('printing', 'read') && !empty($conf->printing->enabled)); + $printer = ($user->hasRight('printing', 'read') && isModEnabled('printing')); } $hookmanager->initHooks(array('formfile')); diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 747a5600735..24bb66763a5 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -43,7 +43,7 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'card'; $tab++; - if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_CONTACT_ACTIVE')) + if ((isModEnabled('ldap') && getDolGlobalString('LDAP_CONTACT_ACTIVE')) && (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) { $langs->load("ldap"); diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index ce5294d3ff9..3826c28e7e3 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -43,7 +43,7 @@ function member_prepare_head(Adherent $object) $head[$h][2] = 'general'; $h++; - if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_MEMBER_ACTIVE')) + if ((isModEnabled('ldap') && getDolGlobalString('LDAP_MEMBER_ACTIVE')) && (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) { $langs->load("ldap"); @@ -193,7 +193,7 @@ function member_type_prepare_head(AdherentType $object) $h++; } - if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_MEMBER_TYPE_ACTIVE')) + if ((isModEnabled('ldap') && getDolGlobalString('LDAP_MEMBER_TYPE_ACTIVE')) && (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) { $langs->load("ldap"); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index ba1064ec249..1604ee7cc70 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -53,7 +53,7 @@ function user_prepare_head(User $object) $head[$h][2] = 'user'; $h++; - if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_SYNCHRO_ACTIVE')) + if ((isModEnabled('ldap') && getDolGlobalString('LDAP_SYNCHRO_ACTIVE')) && (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) { $langs->load("ldap"); $head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id; @@ -254,7 +254,7 @@ function group_prepare_head($object) $head[$h][2] = 'group'; $h++; - if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_SYNCHRO_ACTIVE')) + if ((isModEnabled('ldap') && getDolGlobalString('LDAP_SYNCHRO_ACTIVE')) && (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) { $langs->load("ldap"); $head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id; diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 0e190d1a31e..8864a4dc0bf 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -167,7 +167,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) // Note: Test on date validity is done later natively with isNotIntoValidityDateRange() by core after calling checkLoginPassEntity() that call this method // ldap2dolibarr synchronisation - if ($login && !empty($conf->ldap->enabled) && getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') == Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { // ldap2dolibarr synchronization + if ($login && isModEnabled('ldap') && getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') == Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { // ldap2dolibarr synchronization dol_syslog("functions_ldap::check_user_password_ldap Sync ldap2dolibarr"); // On charge les attributes du user ldap From 9dee6b56af9bc16a4c10912175c885c99c440687 Mon Sep 17 00:00:00 2001 From: moreauftheobald Date: Fri, 15 Nov 2024 23:02:26 +0100 Subject: [PATCH 017/139] Tracking conf->module->enabled 3 (#31905) * Tracking $conf->module->enabled part 2 * Tracking $conf->module->enabled part 3 * Tracking $conf->module->enabled part 3 --------- Co-authored-by: Theobald --- htdocs/core/lib/propal.lib.php | 2 +- htdocs/core/modules/modAsset.class.php | 2 +- htdocs/core/modules/modCollab.class.php | 2 +- htdocs/core/modules/modDataPolicy.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 153d8e70292..40d98c78ec8 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -43,7 +43,7 @@ function propal_prepare_head($object) $head[$h][2] = 'comm'; $h++; - if ((empty($conf->commande->enabled) && ((isModEnabled("shipping") && getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) + if ((!isModEnabled('order') && ((isModEnabled("shipping") && getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) { $langs->load("sendings"); $text = ''; diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index c63dd61e9f5..62d50a2989b 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -114,7 +114,7 @@ class modAsset extends DolibarrModules ); - if (!isset($conf->asset) || !isset($conf->asset->enabled)) { + if (!isModEnabled('asset')) { $conf->asset = new stdClass(); $conf->asset->enabled = 0; } diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php index 69599413fcc..a1cc97699c0 100644 --- a/htdocs/core/modules/modCollab.class.php +++ b/htdocs/core/modules/modCollab.class.php @@ -118,7 +118,7 @@ class modCollab extends DolibarrModules 'url' => '/collab/index.php', 'langs' => 'collab', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position' => 100, - 'enabled' => '$conf->collab->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled' => 'isModEnabled("collab")', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms' => '1', // Use 'perms'=>'$user->hasRight("mymodule","level1","level2")' if you want your menu with a permission rules 'target' => '', 'user' => 2 // 0=Menu for internal users, 1=external users, 2=both diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 82e88f06792..d147af6d037 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -129,7 +129,7 @@ class modDataPolicy extends DolibarrModules 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' ) */ - if (!isset($conf->datapolicy) || !isset($conf->datapolicy->enabled)) { + if (!isModEnabled('datapolicy')) { $conf->datapolicy = new stdClass(); $conf->datapolicy->enabled = 0; } From 4b9a5db62f0fcbd0da51707d0269b18bf0dfa6bf Mon Sep 17 00:00:00 2001 From: moreauftheobald Date: Fri, 15 Nov 2024 23:02:49 +0100 Subject: [PATCH 018/139] Tracking conf->module->enabled 1 (#31895) * Fix Php 8 warning on commande dispach * Tracking $conf->module->enabled --------- Co-authored-by: Theobald --- dev/initdemo/mysqldump_dolibarr_3.5.0.sql | 2 +- htdocs/comm/propal/class/propal.class.php | 4 ++-- htdocs/core/bookmarks_page.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 12 ++++++++++-- htdocs/fourn/commande/dispatch.php | 8 ++++++-- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql index c6d16c22e45..f94c3238db3 100644 --- a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql @@ -1150,7 +1150,7 @@ CREATE TABLE `llx_c_field_list` ( LOCK TABLES `llx_c_field_list` WRITE; /*!40000 ALTER TABLE `llx_c_field_list` DISABLE KEYS */; -INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8); +INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'isModEnabled("barcode")',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'isModEnabled("stock")',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8); /*!40000 ALTER TABLE `llx_c_field_list` ENABLE KEYS */; UNLOCK TABLES; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 93edb0d1f07..c633ac44b74 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -343,8 +343,8 @@ class Propal extends CommonObject 'fk_delivery_address' => array('type' => 'integer', 'label' => 'DeliveryAddress', 'enabled' => 1, 'visible' => 0, 'position' => 200), // deprecated 'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 205), 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 215), - 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 220), - 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 225), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 220), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 225), 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 1, 'visible' => -1, 'position' => 230), 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 235), 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240, 'isameasure' => 1), diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php index a6df90ac883..d24e62f6dd8 100644 --- a/htdocs/core/bookmarks_page.php +++ b/htdocs/core/bookmarks_page.php @@ -89,7 +89,7 @@ $bookmarkList = ''; $searchForm = ''; -if (empty($conf->bookmark->enabled)) { +if (!isModEnabled('bookmark')) { $langs->load("admin"); $bookmarkList .= '
'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).''; $bookmarkList .= '

'; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 8b9a0de6dbb..ad60b19387d 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3542,14 +3542,22 @@ class CommandeFournisseur extends CommonOrder // Build array with quantity deliverd by product foreach ($supplierorderdispatch->lines as $line) { - $qtydelivered[$line->fk_product] += $line->qty; + if (array_key_exists($line->fk_product, $qtydelivered)) { + $qtydelivered[$line->fk_product] += $line->qty; + } else { + $qtydelivered[$line->fk_product] = $line->qty; + } } foreach ($this->lines as $line) { // Exclude lines not qualified for shipment, similar code is found into interface_20_modWrokflow for customers if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES') && $line->product_type > 0) { continue; } - $qtywished[$line->fk_product] += $line->qty; + if (array_key_exists($line->fk_product, $qtywished)) { + $qtywished[$line->fk_product] += $line->qty; + } else { + $qtywished[$line->fk_product] = $line->qty; + } } //Compare array diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 4d8fc56e4dd..f74b838b97d 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1197,7 +1197,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Reception ref - if ($conf->reception->enabled) { + if (isModEnabled("reception")) { print ''.$langs->trans("Reception").''; } // Product @@ -1271,7 +1271,11 @@ if ($id > 0 || !empty($ref)) { print ''.dol_print_date($db->jdate($objp->datec), 'day').''; // Date delivery - print ''.dol_print_date($db->jdate($objp->date_delivery), 'day').''; + if (property_exists($objp, "date_delivery")) { + print '' . dol_print_date($db->jdate($objp->date_delivery), 'day') . ''; + } else { + print ''; + } // Batch / Eat by / Sell by if (isModEnabled('productbatch')) { From 2f68e94cfdb13d7425e1ef47bfb48a6c292bcbdf Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Fri, 15 Nov 2024 23:03:25 +0100 Subject: [PATCH 019/139] fix include for website library pages (#31891) --- htdocs/core/lib/website.lib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index b96ad5f8bdd..c44bb31b429 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -597,9 +597,10 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri * It outputs content of file sanitized from html and body part. * * @param string $containerref Path to file to include (must be a page from website root. Example: 'mypage.php' means 'mywebsite/mypage.php') + * @param int $once If set to 1, we use include_once. * @return void */ -function includeContainer($containerref) +function includeContainer($containerref, $once = 0) { global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers. global $includehtmlcontentopened; @@ -630,7 +631,11 @@ function includeContainer($containerref) //print preg_replace(array('/^.*]*>/ims','/<\/body>.*$/ims'), array('', ''), $content);*/ ob_start(); - $res = @include $fullpathfile; // Include because we want to execute code content + if ($once) { + $res = @include_once $fullpathfile; + } else { + $res = @include $fullpathfile; + } $tmpoutput = ob_get_contents(); ob_end_clean(); From 5b5719f0dab1debb71b56f6983fbdcc0cdea8e8f Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:04:00 +0100 Subject: [PATCH 020/139] Fix societe price warnings (#31917) * fix societe price warning * fix a fix --------- Co-authored-by: Hystepik --- htdocs/societe/price.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 60a3a5dc971..5ae56bdd3d5 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -762,9 +762,11 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], $key, '', $param, '', $sortfield, $sortorder)."\n"; } } - foreach ($extralabels as $key => $val) { - if (!empty($arrayfields['ef.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['ef.'.$key]['label'], 0, $_SERVER['PHP_SELF'], $key, '', $param, '', $sortfield, $sortorder)."\n"; + if (!empty($extralabels) && is_array($extralabels)) { + foreach ($extralabels as $key => $val) { + if (!empty($arrayfields['ef.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['ef.'.$key]['label'], 0, $_SERVER['PHP_SELF'], $key, '', $param, '', $sortfield, $sortorder)."\n"; + } } } print ''; From d8fb72a027335ddfa6f97aa89fda15daf798716a Mon Sep 17 00:00:00 2001 From: MaximilienR-easya <122890855+MaximilienR-easya@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:05:24 +0100 Subject: [PATCH 021/139] Fix a missing help (#31901) --- htdocs/admin/pdf_other.php | 2 +- htdocs/langs/en_US/admin.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 21596154a0e..493f9d4e876 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -373,7 +373,7 @@ if (isModEnabled('invoice')) { print ''.$langs->trans("Parameters").''.$langs->trans("Value").''; print ''; - print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), ''); + print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index fc741b99509..238d6185f15 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2593,3 +2593,4 @@ Decrypt=Decrypt FilesIntegrityDesc=If you want to check the integrity of files instead of database, you can do it by using this tool. AttributeCodeHelp=A code of your choice (without special char and space) to identify the property.
Note that if an object B is created from an existing object A that has a different type (for example creation of an invoice from an order), the value of the complementary attributes of A are also copied into the complementary attributes of B when the code of the attribute is the same. ThereIsMoreThanXAnswers=There is more than %s answers with your filter. Please add more filters... +PdfAddTermOfSaleHelp=Upload the condition of sales from file input at the bottom of this setup page \ No newline at end of file From 615bc3143c341ee1d40a30a8dc972d9c695306dc Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:06:16 +0100 Subject: [PATCH 022/139] fix warnings for tocktransfer/stocktransfer_agenda.php (#31893) Co-authored-by: Hystepik --- htdocs/product/stock/stocktransfer/stocktransfer_agenda.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index 0b8d0b608d9..a5d73bab604 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -64,6 +64,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); +$socid = GETPOSTINT('socid'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; @@ -89,7 +90,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->stocktransfer->multidir_output[$object->entity]."/".$object->id; + $upload_dir = (!empty($conf->stocktransfer->multidir_output[$object->entity]) ? $conf->stocktransfer->multidir_output[$object->entity] : $conf->stocktransfer->dir_output)."/".$object->id; } $permissiontoread = $user->hasRight('stocktransfer', 'stocktransfer', 'read'); From 0507db75b53dfccf71ea5e20d836bb4085893dc4 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:06:54 +0100 Subject: [PATCH 023/139] fix php warning in dolGraph class (#31911) * fix php warning in dolGraph class * remove useless test --------- Co-authored-by: Hystepik --- htdocs/core/class/dolgraph.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 49a2f02f004..ca71e0df442 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -782,6 +782,9 @@ class DolGraph { // phpcs:enable $max = $this->GetMaxValueInData(); + if (!isset($max)) { + $max = 0; + } if ($max != 0) { $max++; } @@ -792,9 +795,7 @@ class DolGraph } $res = 0; - if (is_numeric($max)) { - $res = ceil($max / $factor) * $factor; - } + $res = ceil($max / $factor) * $factor; //print "max=".$max." res=".$res; return (int) $res; From 62ba788c8f0b0a4a565537097c176a30ec350d9f Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Fri, 15 Nov 2024 23:07:37 +0100 Subject: [PATCH 024/139] fix stars extrafields on pdf (#31913) --- htdocs/core/class/commondocgenerator.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index c574c2be541..0443099f9dd 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1565,6 +1565,14 @@ abstract class CommonDocGenerator $extrafieldOutputContent = dol_string_nohtmltag($extrafieldOutputContent); } + // Display stars extrafield as simple string + if ($extrafields->attributes[$object->table_element]['type'][$extrafieldKey] == 'stars') { + $extrafieldOutputContent = ''; + for ($i = 0; $i < $object->array_options[$extrafieldOptionsKey]; $i++) { + $extrafieldOutputContent .= ' *'; + } + } + $parameters = array( 'object' => $object, 'extrafields' => $extrafields, From 4b45a2a78c3bc99df07523654bac9ee992af2fff Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:08:20 +0100 Subject: [PATCH 025/139] fix php warning modCaptchaStandard class (#31906) Co-authored-by: Hystepik --- .../core/modules/security/captcha/modCaptchaStandard.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/security/captcha/modCaptchaStandard.class.php b/htdocs/core/modules/security/captcha/modCaptchaStandard.class.php index 6b22ec7c1da..0efb00838b0 100644 --- a/htdocs/core/modules/security/captcha/modCaptchaStandard.class.php +++ b/htdocs/core/modules/security/captcha/modCaptchaStandard.class.php @@ -53,7 +53,7 @@ class modCaptchaStandard extends ModeleCaptcha */ public function __construct($db, $conf, $langs, $user) { - $this->id = strtolower(preg_replace('/^modCaptcha/i', '', get_class())); + $this->id = strtolower(preg_replace('/^modCaptcha/i', '', get_class($this))); $this->db = $db; $this->conf = $conf; From ef67a4c31b36a26a505dccfdc62dc014f1a6e4e5 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:26:05 +0100 Subject: [PATCH 026/139] fix #27534 (#31896) --- htdocs/product/stock/stocktransfer/stocktransfer_list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index 163db565a2e..2d818515796 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -44,6 +44,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'stocktransferlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) $id = GETPOST('id', 'int'); From 230eee4ead39a888c9e684bce9295a0da639eb74 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Fri, 15 Nov 2024 23:31:12 +0100 Subject: [PATCH 027/139] FIX issue #28222 Edit date extrafield diplayed on all on lines (#31914) * FIX issue #28222 Edit date extrafield diplayed on all on lines * wrong id --- 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 8c5a84c9120..905d8cbc2c5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8329,7 +8329,7 @@ abstract class CommonObject } } $datekey = $keyprefix.'options_'.$key.$keysuffix; - $value = (GETPOSTISSET($datekey)) ? dol_mktime(12, 0, 0, GETPOST($datekey.'month', 'int', 3), GETPOST($datekey.'day', 'int', 3), GETPOST($datekey.'year', 'int', 3)) : $datenotinstring; + $value = (GETPOSTISSET($datekey) && $this->id == GETPOST('elrowid', 'int')) ? dol_mktime(12, 0, 0, GETPOST($datekey.'month', 'int', 3), GETPOST($datekey.'day', 'int', 3), GETPOST($datekey.'year', 'int', 3)) : $datenotinstring; } if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('datetime'))) { $datenotinstring = null; From bab49d66c5e7a9a542cc532decc6d8e1a856379d Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 15 Nov 2024 23:36:54 +0100 Subject: [PATCH 028/139] Backported default ticket type fix (#31912) --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 47f9c6d0778..9ccf2517a52 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -753,7 +753,7 @@ class FormTicket print ' selected="selected"'; } elseif (in_array($id, $selected)) { print ' selected="selected"'; - } elseif ($arraytypes['use_default'] == "1" && !$selected && !$empty) { + } elseif ($arraytypes['use_default'] == "1" && empty($selected)) { print ' selected="selected"'; } From 2cc02024f1dd144b3b2c6f9c24a35be7a6c62ee4 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Fri, 15 Nov 2024 23:37:41 +0100 Subject: [PATCH 029/139] =?UTF-8?q?fix=20bug=20Module=20Builder=20creates?= =?UTF-8?q?=20invalid=20SQL=20when=20using=20chkbxlst=20#31545=E2=80=A6=20?= =?UTF-8?q?(#31923)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix bug Module Builder creates invalid SQL when using chkbxlst #31545 in https://github.com/Dolibarr/dolibarr/issues/31545 * Update modulebuilder.lib.php --------- Co-authored-by: abb Co-authored-by: Laurent Destailleur --- htdocs/core/lib/modulebuilder.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index 3ef1aec7997..eff2df330a2 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -348,6 +348,8 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' $type = 'double'; // html modulebuilder type is a text type in database } elseif (in_array($type, array('link', 'sellist', 'duration'))) { $type = 'integer'; + } elseif ($type == 'chkbxlst') { + $type = 'varchar(128)'; } elseif ($type == 'mail') { $type = 'varchar(128)'; } elseif (strpos($type, 'stars(') === 0) { From 038f8d5dff24376b25dbeaf1b6e127779eab965c Mon Sep 17 00:00:00 2001 From: William Mead Date: Fri, 15 Nov 2024 23:44:08 +0100 Subject: [PATCH 030/139] Backported default ticket severity fix (#31908) --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 9ccf2517a52..f30da8bc8b0 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1199,7 +1199,7 @@ class FormTicket print ' selected="selected"'; } elseif (isset($selected) && $selected == $id) { print ' selected="selected"'; - } elseif ($arrayseverities['use_default'] == "1" && !$selected && !$empty) { + } elseif ($arrayseverities['use_default'] == "1" && empty($selected)) { print ' selected="selected"'; } From e0562817d6c8a2bd7efdc09ec4b643de487c5fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 15 Nov 2024 23:45:24 +0100 Subject: [PATCH 031/139] fix usf filters (#31897) --- htdocs/eventorganization/conferenceorbooth_card.php | 2 +- htdocs/eventorganization/conferenceorbooth_contact.php | 2 +- htdocs/eventorganization/conferenceorbooth_document.php | 2 +- htdocs/eventorganization/conferenceorbooth_list.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_card.php | 2 +- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- .../product/canvas/product/actions_card_product.class.php | 2 +- .../product/canvas/service/actions_card_service.class.php | 2 +- htdocs/projet/agenda.php | 2 +- htdocs/projet/card.php | 2 +- htdocs/projet/comment.php | 2 +- htdocs/projet/contact.php | 2 +- htdocs/projet/document.php | 2 +- htdocs/projet/element.php | 2 +- htdocs/projet/ganttview.php | 2 +- htdocs/projet/messaging.php | 2 +- htdocs/projet/note.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/comment.php | 6 +++--- htdocs/projet/tasks/contact.php | 4 ++-- htdocs/projet/tasks/document.php | 4 ++-- htdocs/projet/tasks/note.php | 6 +++--- htdocs/projet/tasks/task.php | 6 +++--- htdocs/projet/tasks/time.php | 6 +++--- htdocs/societe/class/client.class.php | 2 +- htdocs/ticket/card.php | 2 +- htdocs/ticket/list.php | 2 +- 27 files changed, 37 insertions(+), 37 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index e010dd13c51..6df36447088 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -228,7 +228,7 @@ if (!empty($withproject)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('project', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 2bbab85b0c2..a393c813f6f 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -204,7 +204,7 @@ if (!empty($withproject)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('project', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index dc67d1be0fa..da723512b4f 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -178,7 +178,7 @@ if (!empty($withproject)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('project', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 9924283caa6..d03ffe9ed1b 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -342,7 +342,7 @@ if ($projectid > 0) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('project', 'all', 'lire')) { $objectsListId = $project->getProjectsAuthorizedForUser($user, 0, 0); - $project->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $project->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($project, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 9fdbda08ce0..b754f6c25d0 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -254,7 +254,7 @@ if (!empty($withproject)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index c16c8314765..e4678534f1d 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -441,7 +441,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 03d81e8a421..4ed003ed06f 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -131,7 +131,7 @@ class ActionsCardProduct $this->name = "product"; $this->definition = "Product canvas (default)"; $this->fieldListName = "product_default"; - $this->next_prev_filter = "canvas='product'"; + $this->next_prev_filter = "canvas:=:'product'"; } diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index a0e41be87fb..1baf3537cc9 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -157,7 +157,7 @@ class ActionsCardService $this->name = "service"; $this->definition = "Services canvas"; $this->fieldListName = "product_service"; - $this->next_prev_filter = "canvas='service'"; + $this->next_prev_filter = "canvas:=:'service'"; } diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index 65ffdfbdbf2..3aa654d4a65 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -157,7 +157,7 @@ $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 7456cc829e3..74f93c4505e 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1365,7 +1365,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index bcef52668b1..e02404f9838 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -128,7 +128,7 @@ $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index ac7bdaa51ac..ce89643f847 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -380,7 +380,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index ad2afcc902a..83c5416ceea 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -161,7 +161,7 @@ if ($object->id > 0) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 61c051de453..96d5b569677 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -267,7 +267,7 @@ $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "te.rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "te.rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 26d05849d15..12c99a354dc 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -139,7 +139,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php index 1b451ba2d4a..065985317fa 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -157,7 +157,7 @@ $morehtmlref .= '
'; // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index ae9965e8b5a..e80fb0ff9a6 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -126,7 +126,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 627ea71977e..632aa18b6a4 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -616,7 +616,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 026eda0239f..4359afad90f 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -155,7 +155,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -308,9 +308,9 @@ if ($id > 0 || !empty($ref)) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; } else { - $object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id); + $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); } $morehtmlref = ''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 3bc79705f8f..495d4bb5712 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -212,7 +212,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -335,7 +335,7 @@ if ($id > 0 || !empty($ref)) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; } else { $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 4f04c2674cc..c4cf270b6a7 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -169,7 +169,7 @@ if ($object->id > 0) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -293,7 +293,7 @@ if ($object->id > 0) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; } else { $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); } diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index f3704b749ea..77861e2f681 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -159,7 +159,7 @@ if ($object->id > 0) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -277,9 +277,9 @@ if ($object->id > 0) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = " fk_projet IN (".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = " fk_projet:IN:(".$db->sanitize($projectsListId).")"; } else { - $object->next_prev_filter = " fk_projet = ".((int) $projectstatic->id); + $object->next_prev_filter = " fk_projet:=:".((int) $projectstatic->id); } $morehtmlref = ''; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 29ddbe2b731..68ff3707182 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -316,7 +316,7 @@ if ($id > 0 || !empty($ref)) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); @@ -597,9 +597,9 @@ if ($id > 0 || !empty($ref)) { if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet IN (".$db->sanitize($projectsListId).")"; + $object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")"; } else { - $object->next_prev_filter = "fk_projet = ".((int) $projectstatic->id); + $object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id); } $morehtmlref = ''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index a982145f402..523f93e97e4 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -959,7 +959,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0); - $projectstatic->next_prev_filter = "rowid IN (" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0') . ")"; + $projectstatic->next_prev_filter = "rowid:IN:(" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0') . ")"; } dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); @@ -1143,9 +1143,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (!GETPOST('withproject') || empty($projectstatic->id)) { $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); - $object->next_prev_filter = "fk_projet IN (" . $db->sanitize($projectsListId) . ")"; + $object->next_prev_filter = "fk_projet:IN:(" . $db->sanitize($projectsListId) . ")"; } else { - $object->next_prev_filter = "fk_projet = " . ((int) $projectstatic->id); + $object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id); } $morehtmlref = ''; diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 090392efd70..45e47ab21b2 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -34,7 +34,7 @@ class Client extends Societe /** * @var string Used to add a filter in Form::showrefnav method */ - public $next_prev_filter = "te.client in (1,2,3)"; + public $next_prev_filter = "te.client:in:(1,2,3)"; /** * @var array diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 2f44c8fb5df..54c65999286 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -855,7 +855,7 @@ if ($action == 'create' || $action == 'presend') { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $projectstat->getProjectsAuthorizedForUser($user, $mine, 0); - $projectstat->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $projectstat->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } print $form->showrefnav($projectstat, 'ref', $linkback, 1, 'ref', 'ref', ''); print ''; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 553bebec441..ec492d67936 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -621,7 +621,7 @@ if ($projectid > 0 || $project_ref) { // Define a complementary filter for search of next/prev ref. if (!$user->hasRight('projet', 'all', 'lire')) { $objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0); - $object->next_prev_filter = "rowid IN (".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; + $object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")"; } dol_banner_tab($object, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref); From c72efea8803f574e696d3ce531ccf02056b4514d Mon Sep 17 00:00:00 2001 From: MaximilienR-easya <122890855+MaximilienR-easya@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:48:10 +0100 Subject: [PATCH 032/139] Fix signature box when rounded param is set (#31882) --- htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php | 3 ++- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 3 ++- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 53cbce641f2..d0c2e8a41b1 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -575,7 +575,8 @@ class pdf_sepamandate extends ModeleBankAccountDoc $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentitiesnoconv("Signature"), 0, 'L', 1); $pdf->SetXY($posx, $tab_top + $tab_hl); - $pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); + //$pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); + $pdf->RoundedRect($posx, $tab_top + $tab_hl + 3, $largcol, $tab_hl * 3, $this->corner_radius, '1234', 'D'); return ($tab_hl * 7); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 40f4951487c..ca8522c6d99 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1849,7 +1849,8 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1); $pdf->SetXY($posx, $tab_top + $tab_hl + 3); - $pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); + //$pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); + $pdf->RoundedRect($posx, $tab_top + $tab_hl + 3, $largcol, $tab_hl * 3, $this->corner_radius, '1234', 'D'); if (getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')) { // Can be retrieve with getSignatureAppearanceArray() // Can be also detected by putting the mouse over the area when using evince pdf reader diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 158a63f7e12..3e363c3be54 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1919,7 +1919,9 @@ class pdf_cyan extends ModelePDFPropales $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1); $pdf->SetXY($posx, $tab_top + $tab_hl + 3); - $pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); + //$pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); + $pdf->RoundedRect($posx, $tab_top + $tab_hl + 3, $largcol, $tab_hl * 3, $this->corner_radius, '1234', 'D'); + if (getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')) { // Can be retrieve with getSignatureAppearanceArray() From 0fa956ab87f382481579fb00ffdd63ba755cc8a8 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Fri, 15 Nov 2024 23:50:49 +0100 Subject: [PATCH 033/139] FIX help on PDF condition of sales for customer order (#31892) --- htdocs/admin/pdf_other.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 493f9d4e876..4c5d164c16f 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -259,7 +259,7 @@ if (isModEnabled('order')) { print ''; print ''; print ''; From 4d51d72d731cfaf8a7068d95ec9607f6fd082684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 16 Nov 2024 02:11:32 +0100 Subject: [PATCH 050/139] clean phpstan baseline (#31926) * clean phpstan baseline * clean phpstan baseline * clean phpstan baseline * clean baseline * fix --- build/phpstan/phpstan-baseline.neon | 150 ------------------ htdocs/product/stats/mo.php | 26 ++- htdocs/product/stock/productlot_list.php | 1 + .../stock/stats/commande_fournisseur.php | 21 ++- htdocs/product/stock/stats/expedition.php | 17 +- htdocs/product/stock/stats/mo.php | 18 +-- htdocs/product/stock/stats/reception.php | 17 +- 7 files changed, 44 insertions(+), 206 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 7a97e63e9ee..431b7d30d06 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -28476,24 +28476,6 @@ parameters: count: 1 path: ../../htdocs/product/stats/facturerec.php - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/product/stats/mo.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stats/mo.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stats/mo.php - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable @@ -29166,12 +29148,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/productlot_list.php - - - message: '#^Variable \$show_files might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/productlot_list.php - - message: '#^Variable \$draftchecked in isset\(\) always exists and is not nullable\.$#' identifier: isset.variable @@ -29196,114 +29172,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/replenishorders.php - - - message: '#^Variable \$morehtmlref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/commande_fournisseur.php - - - - message: '#^Variable \$option might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/commande_fournisseur.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/commande_fournisseur.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/commande_fournisseur.php - - - - message: '#^Variable \$morehtmlref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/expedition.php - - - - message: '#^Variable \$option might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/expedition.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/expedition.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/expedition.php - - - - message: '#^Variable \$batch might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$morehtmlref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$objectid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$socid might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/mo.php - - - - message: '#^Variable \$morehtmlref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/reception.php - - - - message: '#^Variable \$option might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/stats/reception.php - - - - message: '#^Variable \$sortfield in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/reception.php - - - - message: '#^Variable \$sortorder in empty\(\) always exists and is not falsy\.$#' - identifier: empty.variable - count: 1 - path: ../../htdocs/product/stock/stats/reception.php - - message: '#^Variable \$nbofmovement might not be defined\.$#' identifier: variable.undefined @@ -29412,18 +29280,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/stocktransfer/stocktransfer_card.php - - - message: '#^Variable \$sortfield might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../htdocs/product/stock/stocktransfer/stocktransfer_card.php - - - - message: '#^Variable \$sortorder might not be defined\.$#' - identifier: variable.undefined - count: 8 - path: ../../htdocs/product/stock/stocktransfer/stocktransfer_card.php - - message: '#^Variable \$text might not be defined\.$#' identifier: variable.undefined @@ -34272,12 +34128,6 @@ parameters: count: 14 path: ../../htdocs/societe/price.php - - - message: '#^Variable \$extralabels might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/societe/price.php - - message: '#^Variable \$prodcustprice might not be defined\.$#' identifier: variable.undefined diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 69603ef5bdd..23a987a6243 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -49,6 +49,8 @@ $ref = GETPOST('ref', 'alpha'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); + +$socid = 0; if ($user->socid) { $socid = $user->socid; } @@ -60,6 +62,12 @@ $hookmanager->initHooks(array('productstatsmo')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); +if (empty($sortorder)) { + $sortorder = "DESC"; +} +if (empty($sortfield)) { + $sortfield = "c.date_valid"; +} $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; @@ -67,12 +75,6 @@ if (empty($page) || $page == -1) { $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortorder) { - $sortorder = "DESC"; -} -if (!$sortfield) { - $sortfield = "c.date_valid"; -} $search_month = GETPOSTINT('search_month'); $search_year = GETPOSTINT('search_year'); @@ -82,8 +84,6 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } -$socid = 0; - $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); @@ -167,7 +167,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($search_year)) { $sql .= ' AND YEAR(c.date_valid) IN ('.$db->sanitize($search_year).')'; } - if ($socid) { + if ($socid > 0) { $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " GROUP BY c.rowid, c.ref, c.date_valid, c.status"; @@ -205,12 +205,8 @@ if ($id > 0 || !empty($ref)) { print '
'."\n"; print ''; - if (!empty($sortfield)) { - print ''; - } - if (!empty($sortorder)) { - print ''; - } + print ''; + print ''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MOs"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 95784d927cc..e6164d741d3 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -59,6 +59,7 @@ $search_batch = GETPOST('search_batch', 'alpha'); $search_fk_user_creat = GETPOSTINT('search_fk_user_creat'); $search_fk_user_modif = GETPOSTINT('search_fk_user_modif'); $search_import_key = GETPOSTINT('search_import_key'); +$show_files = GETPOSTINT('show_files'); // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; diff --git a/htdocs/product/stock/stats/commande_fournisseur.php b/htdocs/product/stock/stats/commande_fournisseur.php index 1c9e3a2d4c6..a55a9341b1c 100644 --- a/htdocs/product/stock/stats/commande_fournisseur.php +++ b/htdocs/product/stock/stats/commande_fournisseur.php @@ -48,13 +48,13 @@ $langs->loadLangs(array('companies', 'bills', 'products', 'orders')); $id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$batch = GETPOST('batch', 'alpha'); -$objectid = GETPOSTINT('productid'); +$batch = GETPOST('batch', 'alpha'); +$objectid = GETPOSTINT('productid'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -$socid = ''; +$socid = 0; if (!empty($user->socid)) { $socid = $user->socid; } @@ -75,10 +75,10 @@ if (empty($page) || $page == -1) { $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortorder) { +if (empty($sortorder)) { $sortorder = "DESC"; } -if (!$sortfield) { +if (empty($sortfield)) { $sortfield = "cf.date_commande"; } @@ -131,6 +131,7 @@ if ($id > 0 || !empty($ref)) { $head = productlot_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); $picto = 'lot'; + $morehtmlref = ''; print dol_get_fiche_head($head, 'referers', $langs->trans("Batch"), -1, $object->picto); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -271,7 +272,7 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); - $option .= '&id='.$object->id; + $option = '&id='.$object->id; if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.((int) $limit); @@ -285,12 +286,8 @@ if ($id > 0 || !empty($ref)) { print ''."\n"; print ''; - if (!empty($sortfield)) { - print ''; - } - if (!empty($sortorder)) { - print ''; - } + print ''; + print ''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); diff --git a/htdocs/product/stock/stats/expedition.php b/htdocs/product/stock/stats/expedition.php index 38ecd66d215..e6a24a0cb16 100644 --- a/htdocs/product/stock/stats/expedition.php +++ b/htdocs/product/stock/stats/expedition.php @@ -54,7 +54,7 @@ $objectid = GETPOSTINT('productid'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -$socid = ''; +$socid = 0; if (!empty($user->socid)) { $socid = $user->socid; } @@ -75,10 +75,10 @@ if (empty($page) || $page == -1) { $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortorder) { +if (empty($sortorder)) { $sortorder = "DESC"; } -if (!$sortfield) { +if (empty($sortfield)) { $sortfield = "exp.date_creation"; } @@ -131,6 +131,7 @@ if ($id > 0 || !empty($ref)) { $head = productlot_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); $picto = 'lot'; + $morehtmlref = ''; print dol_get_fiche_head($head, 'referers', $langs->trans("Batch"), -1, $object->picto); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -270,7 +271,7 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); - $option .= '&id='.$object->id; + $option = '&id='.$object->id; if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.((int) $limit); @@ -284,12 +285,8 @@ if ($id > 0 || !empty($ref)) { print ''."\n"; print ''; - if (!empty($sortfield)) { - print ''; - } - if (!empty($sortorder)) { - print ''; - } + print ''; + print ''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Shipments"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); diff --git a/htdocs/product/stock/stats/mo.php b/htdocs/product/stock/stats/mo.php index 8cc868fecc3..9a87fa83783 100644 --- a/htdocs/product/stock/stats/mo.php +++ b/htdocs/product/stock/stats/mo.php @@ -50,6 +50,7 @@ $ref = GETPOST('ref', 'alpha'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); +$socid = 0; if ($user->socid) { $socid = $user->socid; } @@ -68,10 +69,10 @@ if (empty($page) || $page == -1) { $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortorder) { +if (empty($sortorder)) { $sortorder = "DESC"; } -if (!$sortfield) { +if (empty($sortfield)) { $sortfield = "c.date_valid"; } @@ -100,6 +101,8 @@ $formother = new FormOther($db); if ($id > 0 || !empty($ref)) { $object = new Productlot($db); + $batch = ''; + $objectid = 0; if ($ref) { $tmp = explode('_', $ref); $objectid = $tmp[0]; @@ -124,6 +127,7 @@ if ($id > 0 || !empty($ref)) { $head = productlot_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); $picto = 'lot'; + $morehtmlref = ''; print dol_get_fiche_head($head, 'referers', $langs->trans("Batch"), -1, $object->picto); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $product, $action); // Note that $action and $object may have been modified by hook @@ -188,7 +192,7 @@ if ($id > 0 || !empty($ref)) { if (!empty($search_year)) { $sql .= ' AND YEAR(c.date_valid) IN ('.$db->sanitize($search_year).')'; } - if ($socid) { + if ($socid > 0) { $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " GROUP BY c.rowid, c.ref, c.date_valid, c.status"; @@ -226,12 +230,8 @@ if ($id > 0 || !empty($ref)) { print ''."\n"; print ''; - if (!empty($sortfield)) { - print ''; - } - if (!empty($sortorder)) { - print ''; - } + print ''; + print ''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("MOs"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); diff --git a/htdocs/product/stock/stats/reception.php b/htdocs/product/stock/stats/reception.php index b8257cd12c8..00f44bbf175 100644 --- a/htdocs/product/stock/stats/reception.php +++ b/htdocs/product/stock/stats/reception.php @@ -54,7 +54,7 @@ $objectid = GETPOSTINT('productid'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -$socid = ''; +$socid = 0; if (!empty($user->socid)) { $socid = $user->socid; } @@ -75,10 +75,10 @@ if (empty($page) || $page == -1) { $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortorder) { +if (empty($sortorder)) { $sortorder = "DESC"; } -if (!$sortfield) { +if (empty($sortfield)) { $sortfield = "recep.date_creation"; } @@ -131,6 +131,7 @@ if ($id > 0 || !empty($ref)) { $head = productlot_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); $picto = 'lot'; + $morehtmlref = ''; print dol_get_fiche_head($head, 'referers', $langs->trans("Batch"), -1, $object->picto); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -269,7 +270,7 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); - $option .= '&id='.$object->id; + $option = '&id='.$object->id; if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.((int) $limit); @@ -283,12 +284,8 @@ if ($id > 0 || !empty($ref)) { print ''."\n"; print ''; - if (!empty($sortfield)) { - print ''; - } - if (!empty($sortorder)) { - print ''; - } + print ''; + print ''; // @phan-suppress-next-line PhanPluginSuspiciousParamOrder print_barre_liste($langs->trans("Receptions"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1); From aff3a20aa87dd99b1ce43ae89a0b0b73d0a17e81 Mon Sep 17 00:00:00 2001 From: MB Informatique <63406589+mbinformatique68@users.noreply.github.com> Date: Sat, 16 Nov 2024 02:23:08 +0100 Subject: [PATCH 051/139] FIX #29449 Products not allowed on contracts (#31909) * FIX #31269 Bad use of GETPOSTINT * FIX #29449 Products not allowed on contracts * Update card.php --------- Co-authored-by: Laurent Destailleur --- htdocs/contrat/card.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 7fab37fabc7..1083fa5d155 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1821,7 +1821,12 @@ if ($action == 'create') { } else { $senderissupplier = 0; // @TODO Option to allow purchased products ? if (empty($senderissupplier)) { - print $form->select_produits($currentLineProductId, 'idprod', '', 0, 0, 1, 2, '', 0, array(), 0, 1, 0, 'minwidth250onall maxwidth500 widthcentpercentminusx'); + if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) { + $filtertype = ''; + } else { + $filtertype = '1'; + } + print $form->select_produits($currentLineProductId, 'idprod', $filtertype, 0, 0, 1, 2, '', 0, array(), 0, 1, 0, 'minwidth250onall maxwidth500 widthcentpercentminusx'); } else { $form->select_produits_fournisseurs($currentLineProductId, 'idprod'); } From 15d82576dea0ef84664e5031e4ccf94f3f63361c Mon Sep 17 00:00:00 2001 From: jyhere Date: Sat, 16 Nov 2024 02:45:13 +0100 Subject: [PATCH 052/139] FIX : Default values feature is broken on units field on product create (#31873) * FIX : Default values feature is broken on units field on product create * FIX: use getDolGlobalString, removed useless ternary --- htdocs/product/card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 6e9ebf57447..2c85b6b141a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1651,7 +1651,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print '
'; } @@ -1662,21 +1662,21 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ' x '; print ' x '; print ''; - print $formproduct->selectMeasuringUnits("size_units", "size", GETPOSTISSET('size_units') ? GETPOST('size_units', 'alpha') : '0', 0, 2); + print $formproduct->selectMeasuringUnits("size_units", "size", GETPOSTISSET('size_units') ? GETPOST('size_units', 'alpha') : (GETPOST('size_units', 'alpha') ?: '0'), 0, 2); print ''; } if (!getDolGlobalString('PRODUCT_DISABLE_SURFACE')) { // Brut Surface print ''; } if (!getDolGlobalString('PRODUCT_DISABLE_VOLUME')) { // Brut Volume print ''; } @@ -1684,7 +1684,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Net Measure print ''; } } From a5bd461505fa02e554b24c9686a81bc00212bfc3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 16 Nov 2024 10:33:28 +0100 Subject: [PATCH 053/139] FIX compatibility with multicompany (#31934) --- .../mysql/data/llx_c_socialnetworks.sql | 65 +-- .../data/llx_c_ticket_category-ticket.sql | 5 +- .../data/llx_c_ticket_resolution-ticket.sql | 9 +- .../data/llx_c_ticket_severity-ticket.sql | 11 +- .../mysql/data/llx_c_ticket_type-ticket.sql | 17 +- htdocs/install/mysql/data/llx_c_tva.sql | 474 +++++++++--------- .../data/llx_c_type_container-website.sql | 14 +- 7 files changed, 300 insertions(+), 295 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_socialnetworks.sql b/htdocs/install/mysql/data/llx_c_socialnetworks.sql index f581eb6322c..9975eb539e3 100644 --- a/htdocs/install/mysql/data/llx_c_socialnetworks.sql +++ b/htdocs/install/mysql/data/llx_c_socialnetworks.sql @@ -3,6 +3,7 @@ -- eldy -- frederic34 -- dolibit-ut +-- Copyright (C) 2024 Regis Houssin -- -- License @@ -28,35 +29,35 @@ -- socialnetworks -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, '500px', '500px', '{socialid}', 'fa-500px', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'dailymotion', 'Dailymotion', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'diaspora', 'Diaspora', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'discord', 'Discord', '{socialid}', 'fa-discord', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'facebook', 'Facebook', 'https://www.facebook.com/{socialid}', 'fa-facebook', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'flickr', 'Flickr', '{socialid}', 'fa-flickr', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'gifycat', 'Gificat', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'giphy', 'Giphy', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'github', 'GitHub', 'https://www.github.com/{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/in/{socialid}', 'fa-linkedin', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'mastodon', 'Mastodon', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'meetup', 'Meetup', '{socialid}', 'fa-meetup', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'periscope', 'Periscope', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'pinterest', 'Pinterest', '{socialid}', 'fa-pinterest', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'quora', 'Quora', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'reddit', 'Reddit', '{socialid}', 'fa-reddit', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'slack', 'Slack', '{socialid}', 'fa-slack', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'snapchat', 'Snapchat', '{socialid}', 'fa-snapchat', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'skype', 'Skype', 'https://www.skype.com/{socialid}', 'fa-skype', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'tripadvisor', 'Tripadvisor', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'tumblr', 'Tumblr', 'https://www.tumblr.com/{socialid}', 'fa-tumblr', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'twitch', 'Twitch', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'twitter', 'X-Twitter', 'https://www.x.com/{socialid}', 'fa-twitter', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vero', 'Vero', 'https://vero.co/{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', 'fa-viadeo', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viber', 'Viber', '{socialid}', '', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vimeo', 'Vimeo', '{socialid}', 'fa-vimeo', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'whatsapp', 'Whatsapp', 'https://web.whatsapp.com/send?phone={socialid}', 'fa-whatsapp', 1); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'wikipedia', 'Wikipedia', '{socialid}', 'fa-wikipedia-w', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'xing', 'Xing', '{socialid}', 'fa-xing', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, '500px', '500px', '{socialid}', 'fa-500px', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'dailymotion', 'Dailymotion', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'diaspora', 'Diaspora', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'discord', 'Discord', '{socialid}', 'fa-discord', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'facebook', 'Facebook', 'https://www.facebook.com/{socialid}', 'fa-facebook', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'flickr', 'Flickr', '{socialid}', 'fa-flickr', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'gifycat', 'Gificat', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'giphy', 'Giphy', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'github', 'GitHub', 'https://www.github.com/{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'instagram', 'Instagram', 'https://www.instagram.com/{socialid}', 'fa-instagram', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'linkedin', 'LinkedIn', 'https://www.linkedin.com/in/{socialid}', 'fa-linkedin', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'mastodon', 'Mastodon', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'meetup', 'Meetup', '{socialid}', 'fa-meetup', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'periscope', 'Periscope', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'pinterest', 'Pinterest', '{socialid}', 'fa-pinterest', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'quora', 'Quora', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'reddit', 'Reddit', '{socialid}', 'fa-reddit', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'slack', 'Slack', '{socialid}', 'fa-slack', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'snapchat', 'Snapchat', '{socialid}', 'fa-snapchat', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'skype', 'Skype', 'https://www.skype.com/{socialid}', 'fa-skype', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'tripadvisor', 'Tripadvisor', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'tumblr', 'Tumblr', 'https://www.tumblr.com/{socialid}', 'fa-tumblr', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'twitch', 'Twitch', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'twitter', 'X-Twitter', 'https://www.x.com/{socialid}', 'fa-twitter', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'vero', 'Vero', 'https://vero.co/{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', 'fa-viadeo', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'viber', 'Viber', '{socialid}', '', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'vimeo', 'Vimeo', '{socialid}', 'fa-vimeo', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'whatsapp', 'Whatsapp', 'https://web.whatsapp.com/send?phone={socialid}', 'fa-whatsapp', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'wikipedia', 'Wikipedia', '{socialid}', 'fa-wikipedia-w', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'xing', 'Xing', '{socialid}', 'fa-xing', 0); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1); diff --git a/htdocs/install/mysql/data/llx_c_ticket_category-ticket.sql b/htdocs/install/mysql/data/llx_c_ticket_category-ticket.sql index 7a1a6d557d8..050f8be628b 100644 --- a/htdocs/install/mysql/data/llx_c_ticket_category-ticket.sql +++ b/htdocs/install/mysql/data/llx_c_ticket_category-ticket.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2024 Regis Houssin -- -- 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 @@ -17,4 +18,4 @@ -- Contenu de la table llx_c_ticket_category -- -INSERT INTO llx_c_ticket_category (code, pos, label, active, use_default, description) VALUES('OTHER', '10', 'Other', 1, 1, NULL); +INSERT INTO llx_c_ticket_category (code, pos, label, active, use_default, description, entity) VALUES ('OTHER', '10', 'Other', 1, 1, NULL, __ENTITY__); diff --git a/htdocs/install/mysql/data/llx_c_ticket_resolution-ticket.sql b/htdocs/install/mysql/data/llx_c_ticket_resolution-ticket.sql index 2fa139b602d..cdd7fbcacab 100644 --- a/htdocs/install/mysql/data/llx_c_ticket_resolution-ticket.sql +++ b/htdocs/install/mysql/data/llx_c_ticket_resolution-ticket.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2024 Regis Houssin -- -- 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 @@ -17,6 +18,6 @@ -- Contenu de la table llx_c_ticket_resolution -- -INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('SOLVED', '10', 'Solved', 1, 0, NULL); -INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('CANCELED', '50', 'Canceled', 1, 0, NULL); -INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('OTHER', '90', 'Other', 1, 0, NULL); +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description, entity) VALUES ('SOLVED', '10', 'Solved', 1, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description, entity) VALUES ('CANCELED', '50', 'Canceled', 1, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description, entity) VALUES ('OTHER', '90', 'Other', 1, 0, NULL, __ENTITY__); diff --git a/htdocs/install/mysql/data/llx_c_ticket_severity-ticket.sql b/htdocs/install/mysql/data/llx_c_ticket_severity-ticket.sql index 0f385ab2005..00ccea37d4f 100644 --- a/htdocs/install/mysql/data/llx_c_ticket_severity-ticket.sql +++ b/htdocs/install/mysql/data/llx_c_ticket_severity-ticket.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2024 Regis Houssin -- -- 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 @@ -17,7 +18,7 @@ -- Contenu de la table llx_c_ticket_severity -- -INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('LOW', '10', 'Low', '', 1, 0, NULL); -INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('NORMAL', '20', 'Normal', '', 1, 1, NULL); -INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('HIGH', '30', 'High', '', 1, 0, NULL); -INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description) VALUES('BLOCKING', '40', 'Critical / blocking', '', 1, 0, NULL); +INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description, entity) VALUES ('LOW', '10', 'Low', '', 1, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description, entity) VALUES ('NORMAL', '20', 'Normal', '', 1, 1, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description, entity) VALUES ('HIGH', '30', 'High', '', 1, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_severity (code, pos, label, color, active, use_default, description, entity) VALUES ('BLOCKING', '40', 'Critical / blocking', '', 1, 0, NULL, __ENTITY__); diff --git a/htdocs/install/mysql/data/llx_c_ticket_type-ticket.sql b/htdocs/install/mysql/data/llx_c_ticket_type-ticket.sql index 85a85b0a63d..86f95ca04a0 100644 --- a/htdocs/install/mysql/data/llx_c_ticket_type-ticket.sql +++ b/htdocs/install/mysql/data/llx_c_ticket_type-ticket.sql @@ -1,4 +1,5 @@ --- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2018 Laurent Destailleur +-- Copyright (C) 2024 Regis Houssin -- -- 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 @@ -17,10 +18,10 @@ -- Contenu de la table llx_c_ticket_type -- -INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('COM', '10', 'Commercial question', 1, 0, NULL); -INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('HELP', '15', 'Request for functionnal help', 1, 0, NULL); -INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('ISSUE', '20', 'Issue or bug', 1, 0, NULL); -INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('PROBLEM', '22', 'Problem', 0, 0, NULL); -INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('REQUEST', '25', 'Change or enhancement request', 1, 0, NULL); -INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('PROJECT', '30', 'Project', 0, 0, NULL); -INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('OTHER', '40', 'Other', 1, 1, NULL); +INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description, entity) VALUES ('COM', '10', 'Commercial question', 1, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description, entity) VALUES ('HELP', '15', 'Request for functionnal help', 1, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description, entity) VALUES ('ISSUE', '20', 'Issue or bug', 1, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description, entity) VALUES ('PROBLEM', '22', 'Problem', 0, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description, entity) VALUES ('REQUEST', '25', 'Change or enhancement request', 1, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description, entity) VALUES ('PROJECT', '30', 'Project', 0, 0, NULL, __ENTITY__); +INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description, entity) VALUES ('OTHER', '40', 'Other', 1, 1, NULL, __ENTITY__); diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index e813b643bf3..e00828f78b7 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -3,7 +3,7 @@ -- Copyright (C) 2004-2011 Laurent Destailleur -- Copyright (C) 2004 Benoit Mortier -- Copyright (C) 2004 Guillaume Delecourt --- Copyright (C) 2005-2009 Regis Houssin +-- Copyright (C) 2005-2024 Regis Houssin -- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2010-2016 Juanjo Menent -- Copyright (C) 2012 Sebastian Neuwert @@ -40,382 +40,382 @@ -- -delete from llx_c_tva; +-- delete from llx_c_tva; -- ALGERIA (id country=13) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 131, 13, '0','0','TVA 0%', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 132, 13, '9','0','TVA 9%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 133, 13, '19','0','TVA 19%', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 131, 13, '0','0','TVA 0%', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 132, 13, '9','0','TVA 9%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 133, 13, '19','0','TVA 19%', 1,__ENTITY__); -- ANGOLA (id country=35) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 351, 35, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 353, 35, '14','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 351, 35, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 352, 35, '7','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 353, 35, '14','0','VAT rate - standard',1,__ENTITY__); -- ARGENTINA (id country=23) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (231, 23, '0','0','IVA Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (232, 23,'10.5','0','IVA reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (233, 23, '21','0','IVA standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (231, 23, '0','0','IVA Rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (232, 23,'10.5','0','IVA reduced rate',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (233, 23, '21','0','IVA standard rate',1,__ENTITY__); -- AUSTRALIA (id country=28) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (281, 28, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (282, 28, '10','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (281, 28, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (282, 28, '10','0','VAT rate - standard',1,__ENTITY__); -- AUSTRIA (id country=41) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (411, 41, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (412, 41, '10','0','VAT rate - reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '20','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (411, 41, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (412, 41, '10','0','VAT rate - reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (413, 41, '20','0','VAT rate - standard',1,__ENTITY__); -- BRASIL (id country=56) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (561, 56, '0','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (561, 56, '0','0','VAT rate - reduced',1,__ENTITY__); -- BULGARIA (id country=59) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (591, 59, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (592, 59, '7','0','VAT rate - reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (593, 59, '20','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (591, 59, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (592, 59, '7','0','VAT rate - reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (593, 59, '20','0','VAT rate - standard',1,__ENTITY__); -- BELGIUM (id country=2) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 21, 2, '0','0','VAT rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 22, 2, '6','0','VAT rate - reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 23, 2, '21','0','VAT rate - standard',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 24, 2, '12','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 21, 2, '0','0','VAT rate 0 ou non applicable',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 22, 2, '6','0','VAT rate - reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 23, 2, '21','0','VAT rate - standard',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 24, 2, '12','0','VAT rate - reduced', 1,__ENTITY__); -- CANADA (id country=14) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '7','0','VAT rate - standard',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Province',1); --- insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Quebec',1); --- insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (144, 14,'5','0','7','1','GST/TPS and PST/TVQ rate for British Columbia',1); --- insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (149, 14,'5','0',null,null,'GST/TPS and PST/TVQ rate for Yukon',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (141, 14, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (142, 14, '7','0','VAT rate - standard',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active,entity) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Province',1,__ENTITY__); +-- insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active,entity) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Quebec',1,__ENTITY__); +-- insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active,entity) values (144, 14,'5','0','7','1','GST/TPS and PST/TVQ rate for British Columbia',1,__ENTITY__); +-- insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active,entity) values (149, 14,'5','0',null,null,'GST/TPS and PST/TVQ rate for Yukon',1,__ENTITY__); -- CAMEROUN (id country=24) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (242, 24, '19.25','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (241, 24, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (242, 24, '19.25','0','VAT rate - standard',1,__ENTITY__); -- CHILE (id country=67) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '19','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (671, 67, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (672, 67, '19','0','VAT rate - standard',1,__ENTITY__); -- CHINA (id country=9) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 91, 9, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 92, 9, '13','0','VAT rate - reduced 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 93, 9, '3','0','VAT rate - super-reduced 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 94, 9, '17','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 91, 9, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 92, 9, '13','0','VAT rate - reduced 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 93, 9, '3','0','VAT rate - super-reduced 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 94, 9, '17','0','VAT rate - standard',1,__ENTITY__); -- CONGO = REPUBLIQUE DU CONGO (id country=72) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT rate 18+0.9', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (721, 72, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active,entity) values (722, 72, '18','0', '0.9', '1', 'VAT rate 18+0.9', 1,__ENTITY__); -- CROATIA (id country=76) -insert into llx_c_tva(rowid,fk_pays,taux,note,active) values (761, 76, '25','PDV 25%', 1); -insert into llx_c_tva(rowid,fk_pays,taux,note,active) values (762, 76, '13','PDV 13%', 1); -insert into llx_c_tva(rowid,fk_pays,taux,note,active) values (763, 76, '5', 'PDV 5%', 1); -insert into llx_c_tva(rowid,fk_pays,taux,note,active) values (764, 76, '0', 'PDV 0%', 1); +insert into llx_c_tva(rowid,fk_pays,taux,note,active,entity) values (761, 76, '25','PDV 25%', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,note,active,entity) values (762, 76, '13','PDV 13%', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,note,active,entity) values (763, 76, '5', 'PDV 5%', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,note,active,entity) values (764, 76, '0', 'PDV 0%', 1,__ENTITY__); -- CYPRUS (id country=78) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (781, 78, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (782, 78, '9','0','VAT rate 9',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (783, 78, '5','0','VAT rate 5',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (784, 78, '19','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (781, 78, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (782, 78, '9','0','VAT rate 9',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (783, 78, '5','0','VAT rate 5',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (784, 78, '19','0','VAT rate - standard',1,__ENTITY__); -- DANMERK (id country=80) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (801, 80, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802, 80, '25','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (801, 80, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (802, 80, '25','0','VAT rate - standard',1,__ENTITY__); -- FRANCE (id country=1) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '0','0','VAT rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 12, 1, '20','0','VAT rate - standard (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 13, 1, '10','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT rate - reduced (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '2.1','0','VAT rate - super-reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (16, 1, '8.5', '85', '0', 'VAT rate - standard (DOM sauf Guyane et Saint-Martin)',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (17, 1, '8.5', '85NPR', '1', 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (18, 1, '8.5', '85NPROM', '1', 2, 3, 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (19, 1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 11, 1, '0','0','VAT rate 0 ou non applicable',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 12, 1, '20','0','VAT rate - standard (France hors DOM-TOM)',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 13, 1, '10','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 14, 1, '5.5','0','VAT rate - reduced (France hors DOM-TOM)',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 15, 1, '2.1','0','VAT rate - super-reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active,entity) values (16, 1, '8.5', '85', '0', 'VAT rate - standard (DOM sauf Guyane et Saint-Martin)',0,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active,entity) values (17, 1, '8.5', '85NPR', '1', 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active,entity) values (18, 1, '8.5', '85NPROM', '1', 2, 3, 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active,entity) values (19, 1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0,__ENTITY__); -- GABON (id country=16) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (161, 16, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (162, 16, 'TPS95', 10, 0, '0', 0, '0', 0, 'VAT 9.5', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (163, 16, 'TPS95C', 10, 1, '1', 0, '0', 0, 'VAT 9.5+CSS', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (164, 16, 'TPS10', 10, 0, '0', 0, '0', 0, 'VAT 10', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (165, 16, 'TPS10C', 10, 1, '1', 0, '0', 0, 'VAT 10+CSS', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (166, 16, 'TPS18', 18, 0, '0', 0, '0', 0, 'VAT 18', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (167, 16, 'TPS18C', 18, 1, '1', 0, '0', 0, 'VAT 18+CSS', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (161, 16, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (162, 16, 'TPS95', 10, 0, '0', 0, '0', 0, 'VAT 9.5', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (163, 16, 'TPS95C', 10, 1, '1', 0, '0', 0, 'VAT 9.5+CSS', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (164, 16, 'TPS10', 10, 0, '0', 0, '0', 0, 'VAT 10', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (165, 16, 'TPS10C', 10, 1, '1', 0, '0', 0, 'VAT 10+CSS', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (166, 16, 'TPS18', 18, 0, '0', 0, '0', 0, 'VAT 18', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (167, 16, 'TPS18C', 18, 1, '1', 0, '0', 0, 'VAT 18+CSS', 1,__ENTITY__); -- GERMANY (id country=5) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 51, 5, '0','0','No VAT', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 52, 5, '7.0','0','ermäßigte USt.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 54, 5, '5.5','0','USt. Forst', 0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 55, 5, '10.7','0','USt. Landwirtschaft', 0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 56, 5, '19.0','0','allgemeine Ust.',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 51, 5, '0','0','No VAT', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 52, 5, '7.0','0','ermäßigte USt.', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 54, 5, '5.5','0','USt. Forst', 0,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 55, 5, '10.7','0','USt. Landwirtschaft', 0,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 56, 5, '19.0','0','allgemeine Ust.',1,__ENTITY__); -- GREECE (id country=102) -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1021, 102, 0, 0, '0', 0, '0', 0, 'Μηδενικό Φ.Π.Α.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1022, 102, 24, 0, '0', 0, '0', 0, 'Κανονικός Φ.Π.Α.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1023, 102, 13, 0, '0', 0, '0', 0, 'Μειωμένος Φ.Π.Α.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1024, 102, 6, 0, '0', 0, '0', 0, 'Υπερμειωμένος Φ.Π.Α.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1025, 102, 3, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1026, 102, 9, 0, '0', 0, '0', 0, 'Νήσων μειωμένος Φ.Π.Α.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1027, 102, 4, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1); -insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1028, 102, 17, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1021, 102, 0, 0, '0', 0, '0', 0, 'Μηδενικό Φ.Π.Α.', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1022, 102, 24, 0, '0', 0, '0', 0, 'Κανονικός Φ.Π.Α.', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1023, 102, 13, 0, '0', 0, '0', 0, 'Μειωμένος Φ.Π.Α.', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1024, 102, 6, 0, '0', 0, '0', 0, 'Υπερμειωμένος Φ.Π.Α.', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1025, 102, 3, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1026, 102, 9, 0, '0', 0, '0', 0, 'Νήσων μειωμένος Φ.Π.Α.', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1027, 102, 4, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1028, 102, 17, 0, '0', 0, '0', 0, 'Νήσων υπερμειωμένος Φ.Π.Α.', 1,__ENTITY__); -- ICELAND (id country=116) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1161, 116, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1163, 116,'25.5','0','VAT rate - standard',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1162, 116, '7','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1161, 116, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1163, 116,'25.5','0','VAT rate - standard',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1162, 116, '7','0','VAT rate - reduced',1,__ENTITY__); -- INDIA (id country=117) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '0','0','VAT rate 0', 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1171, 117, '0','0','VAT rate 0', 0,__ENTITY__); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1172, 117, 'C+S-5' , 0, 2.5, '1', 2.5, '1', 0, 'CGST+SGST - Same state sales', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1173, 117, 'I-5' , 5, 0, '0', 0, '0', 0, 'IGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1174, 117, 'C+S-12', 0, 6, '1', 6, '1', 0, 'CGST+SGST - Same state sales', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1175, 117, 'I-12' , 12, 0, '0', 0, '0', 0, 'IGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'C+S-18', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'I-18' , 18, 0, '0', 0, '0', 0, 'IGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1178, 117, 'C+S-28', 0, 14, '1', 14, '1', 0, 'CGST+SGST - Same state sales', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1179, 117, 'I-28' , 28, 0, '0', 0, '0', 0, 'IGST', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1172, 117, 'C+S-5' , 0, 2.5, '1', 2.5, '1', 0, 'CGST+SGST - Same state sales', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1173, 117, 'I-5' , 5, 0, '0', 0, '0', 0, 'IGST', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1174, 117, 'C+S-12', 0, 6, '1', 6, '1', 0, 'CGST+SGST - Same state sales', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1175, 117, 'I-12' , 12, 0, '0', 0, '0', 0, 'IGST', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1176, 117, 'C+S-18', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1177, 117, 'I-18' , 18, 0, '0', 0, '0', 0, 'IGST', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1178, 117, 'C+S-28', 0, 14, '1', 14, '1', 0, 'CGST+SGST - Same state sales', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active,entity) values (1179, 117, 'I-28' , 28, 0, '0', 0, '0', 0, 'IGST', 1,__ENTITY__); -- IRELAND (id country=8) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 81, 8, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 82, 8, '23','0','VAT rate - standard',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 83, 8, '13.5','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 84, 8, '9','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 85, 8, '4.8','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 81, 8, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 82, 8, '23','0','VAT rate - standard',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 83, 8, '13.5','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 84, 8, '9','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 85, 8, '4.8','0','VAT rate - reduced',1,__ENTITY__); -- ITALY (id country=3) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 31, 3, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 32, 3, '10','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 33, 3, '4','0','VAT rate - super-reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '22','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 31, 3, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 32, 3, '10','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 33, 3, '4','0','VAT rate - super-reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 34, 3, '22','0','VAT rate - standard',1,__ENTITY__); -- IVORY COST (id country=21) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (211, 21, '0','0',0,0,0,0,'IVA Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (212, 21, '18','0',7.5,2,0,0,'IVA standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active,entity) values (211, 21, '0','0',0,0,0,0,'IVA Rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active,entity) values (212, 21, '18','0',7.5,2,0,0,'IVA standard rate',1,__ENTITY__); -- JAPAN (id country=123) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1232, 123, '5','0','VAT rate 5',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1231, 123, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1232, 123, '5','0','VAT rate 5',1,__ENTITY__); -- LUXEMBOURG (id country=140) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1401, 140, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1402, 140, '14','0','VAT rate - intermediary',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1403, 140, '8','0','VAT rate - reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1404, 140, '3','0','VAT rate - super-reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1405, 140, '16','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1401, 140, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1402, 140, '14','0','VAT rate - intermediary',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1403, 140, '8','0','VAT rate - reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1404, 140, '3','0','VAT rate - super-reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1405, 140, '16','0','VAT rate - standard',1,__ENTITY__); -- MALI (id country=147) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1471, 147, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1472, 147, '18','0','VAT rate - standard', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1471, 147, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1472, 147, '18','0','VAT rate - standard', 1,__ENTITY__); -- MONACO (id country=27) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27, '0','0','VAT rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 272, 27, '8.5','0','VAT rate - standard (DOM sauf Guyane et Saint-Martin)',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 273, 27, '8.5','1','VAT rate - standard (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 274, 27, '5.5','0','VAT rate - reduced (France hors DOM-TOM)',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 275, 27,'19.6','0','VAT rate - standard (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 276, 27, '2.1','0','VAT rate - super-reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 277, 27, '7','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 271, 27, '0','0','VAT rate 0 ou non applicable',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 272, 27, '8.5','0','VAT rate - standard (DOM sauf Guyane et Saint-Martin)',0,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 273, 27, '8.5','1','VAT rate - standard (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 274, 27, '5.5','0','VAT rate - reduced (France hors DOM-TOM)',0,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 275, 27,'19.6','0','VAT rate - standard (France hors DOM-TOM)',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 276, 27, '2.1','0','VAT rate - super-reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 277, 27, '7','0','VAT rate - reduced',1,__ENTITY__); -- MAROCO (id country=12) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 121, 12, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 122, 12, '14','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 123, 12, '10','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 124, 12, '7','0','VAT rate - super-reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 125, 12, '20','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 121, 12, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 122, 12, '14','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 123, 12, '10','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 124, 12, '7','0','VAT rate - super-reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 125, 12, '20','0','VAT rate - standard',1,__ENTITY__); -- MALTA (id country=148) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1481, 148, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1482, 148, '7','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1483, 148, '5','0','VAT rate - super-reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1484, 148, '18','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1481, 148, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1482, 148, '7','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1483, 148, '5','0','VAT rate - super-reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1484, 148, '18','0','VAT rate - standard',1,__ENTITY__); -- NEDERLAND (id country=17) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 171, 17, '0','0','0 BTW tarief', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 172, 17, '6','0','Verlaagd BTW tarief', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 173, 17, '19','0','Algemeen BTW tarief',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 174, 17, '21','0','Algemeen BTW tarief (vanaf 1 oktober 2012)',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 171, 17, '0','0','0 BTW tarief', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 172, 17, '6','0','Verlaagd BTW tarief', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 173, 17, '19','0','Algemeen BTW tarief',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 174, 17, '21','0','Algemeen BTW tarief (vanaf 1 oktober 2012)',0,__ENTITY__); -- NEW CALEDONIA (id country=165) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1651, 165, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1652, 165, '3','0','VAT standard 3', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1653, 165, '6','0','VAT standard 6', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1654, 165, '11','0','VAT rate - standard', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1655, 165, '22','0','VAT standard high', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1651, 165, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1652, 165, '3','0','VAT standard 3', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1653, 165, '6','0','VAT standard 6', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1654, 165, '11','0','VAT rate - standard', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1655, 165, '22','0','VAT standard high', 1,__ENTITY__); -- NEW ZEALAND (id country=166) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1661, 166, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1662, 166, '15','0','VAT rate - standard', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1661, 166, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1662, 166, '15','0','VAT rate - standard', 1,__ENTITY__); -- NIGERIA (id country=169) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1691, 169, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1692, 169, '5','0','VAT rate - standard', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1691, 169, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1692, 169, '5','0','VAT rate - standard', 1,__ENTITY__); -- NORWAY (id country=173) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1732, 173, '14','0','VAT rate - reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1733, 173, '8','0','VAT rate - reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1734, 173, '25','0','VAT rate - standard', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1731, 173, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1732, 173, '14','0','VAT rate - reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1733, 173, '8','0','VAT rate - reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1734, 173, '25','0','VAT rate - standard', 1,__ENTITY__); -- PANAMA (id country=178) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1781, 178, '0','0','ITBMS Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1782, 178, '7','0','ITBMS standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1781, 178, '0','0','ITBMS Rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1782, 178, '7','0','ITBMS standard rate',1,__ENTITY__); -- PERU (id country=181) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1811, 181, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1818, 181, '18','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1811, 181, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1818, 181, '18','0','VAT rate - standard',1,__ENTITY__); -- POLAND (id country=184) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 184, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1842, 184, '8','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1843, 184, '3','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1844, 184, '23','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1841, 184, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1842, 184, '8','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1843, 184, '3','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1844, 184, '23','0','VAT rate - standard',1,__ENTITY__); -- PORTUGAL (id country=25) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 251, 25, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 252, 25, '13','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 253, 25, '23','0','VAT rate - standard',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 254, 25, '6','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 251, 25, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 252, 25, '13','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 253, 25, '23','0','VAT rate - standard',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 254, 25, '6','0','VAT rate - reduced',1,__ENTITY__); -- ROMANIA (id country=188) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1881, 188, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1882, 188, '9','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883, 188, '19','0','VAT rate - standard',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884, 188, '5','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1881, 188, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1882, 188, '9','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1883, 188, '19','0','VAT rate - standard',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1884, 188, '5','0','VAT rate - reduced',1,__ENTITY__); -- SAUDI ARABIA (id country=26) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 261, 26, '0', '0', 'VAT rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 262, 26, '5', '0', 'VAT rate 5', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES ( 261, 26, '0', '0', 'VAT rate 0', 1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES ( 262, 26, '5', '0', 'VAT rate 5', 1,__ENTITY__); -- SAN SALVADOR (id country=86) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 861, 86, '0', '0', 'SIN IVA', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 862, 86, '13', '0', 'IVA 13', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES ( 861, 86, '0', '0', 'SIN IVA', 1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES ( 862, 86, '13', '0', 'IVA 13', 1,__ENTITY__); -- SENEGAL (id country=22) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 221, 22, '0', '0', 'VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 222, 22, '10', '0', 'VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 223, 22, '18', '0', 'VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 221, 22, '0', '0', 'VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 222, 22, '10', '0', 'VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 223, 22, '18', '0', 'VAT rate - standard',1,__ENTITY__); -- SLOVAKIA (id country=201) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2011, 201, '0', '0', 'VAT rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2012, 201, '10', '0', 'VAT rate - reduced', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2013, 201, '20', '0', 'VAT rate - standard', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES (2011, 201, '0', '0', 'VAT rate 0', 1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES (2012, 201, '10', '0', 'VAT rate - reduced', 1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES (2013, 201, '20', '0', 'VAT rate - standard', 1,__ENTITY__); -- SLOVENIA (id country=202) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2021, 202, '0', '0', 'VAT rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2022, 202,'9.5', '0', 'VAT rate - reduced', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '22', '0', 'VAT rate - standard', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES (2021, 202, '0', '0', 'VAT rate 0', 1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES (2022, 202,'9.5', '0', 'VAT rate - reduced', 1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES (2023, 202, '22', '0', 'VAT rate - standard', 1,__ENTITY__); -- SOUTH AFRICA (id country=205) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051, 205, '0', '0', 'VAT rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052, 205, '15', '0', 'VAT rate - standard', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES (2051, 205, '0', '0', 'VAT rate 0', 1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES (2052, 205, '15', '0', 'VAT rate - standard', 1,__ENTITY__); -- SPAIN (id country=4) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4, '0','0', '0','3','-19:-15:-9','5','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-19:-15:-9','5','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-19:-15:-9','5','VAT rate - super-reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4,'21','0','5.2','3','-19:-15:-9','5','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active,entity) values ( 41, 4, '0','0', '0','3','-19:-15:-9','5','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active,entity) values ( 42, 4,'10','0','1.4','3','-19:-15:-9','5','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active,entity) values ( 43, 4, '4','0','0.5','3','-19:-15:-9','5','VAT rate - super-reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active,entity) values ( 44, 4,'21','0','5.2','3','-19:-15:-9','5','VAT rate - standard',1,__ENTITY__); -- SWEDEN (id country=20) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 201, 20, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 202, 20, '12','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 203, 20, '6','0','VAT rate - super-reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 204, 20, '25','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 201, 20, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 202, 20, '12','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 203, 20, '6','0','VAT rate - super-reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 204, 20, '25','0','VAT rate - standard',1,__ENTITY__); -- SWITZERLAND (id country=6) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 62, 6, '3.8','0','VAT rate - reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.6','0','VAT rate - super-reduced',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '8.1','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 61, 6, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 62, 6, '3.8','0','VAT rate - reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 63, 6, '2.6','0','VAT rate - super-reduced',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 64, 6, '8.1','0','VAT rate - standard',1,__ENTITY__); -- SRI LANKA (id country=207) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2071, 207, '0','0','VAT 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2072, 207, '15','0','VAT 15%', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2071, 207, '0','0','VAT 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2072, 207, '15','0','VAT 15%', 1,__ENTITY__); -- TAIWAN (id country=213) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2131, 213, '0','0','VAT 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2132, 213, '5','0','VAT 5%',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2131, 213, '0','0','VAT 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2132, 213, '5','0','VAT 5%',1,__ENTITY__); -- TUNISIA (id country=10) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (101,10, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (102,10, '12','0','VAT 12%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (103,10, '18','0','VAT 18%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (107,10, '6','0','VAT 6%', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (108,10,'18.18','0','VAT 18%+FODEC', 1, 1, '4', 0, 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (101,10, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (102,10, '12','0','VAT 12%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (103,10, '18','0','VAT 18%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (107,10, '6','0','VAT 6%', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type,entity) values (108,10,'18.18','0','VAT 18%+FODEC', 1, 1, '4', 0, 0,__ENTITY__); -- UKRAINE (id country=226) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '0','0','VAT rate 0',1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2262,226, '20','0','VAT standart rate',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2261,226, '0','0','VAT rate 0',1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2262,226, '20','0','VAT standart rate',1,__ENTITY__); -- UNITED OF KINGDOM (id country=7) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 71, 7, '0','0','VAT rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 72, 7, '17.5','0','VAT rate - standard before 2011',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 73, 7, '5','0','VAT rate - reduced', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 74, 7, '20','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 71, 7, '0','0','VAT rate 0', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 72, 7, '17.5','0','VAT rate - standard before 2011',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 73, 7, '5','0','VAT rate - reduced', 1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values ( 74, 7, '20','0','VAT rate - standard',1,__ENTITY__); -- UNITED STATES (id country=11) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (111,11, '0','0','No Sales Tax',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (112,11, '4','0','Sales Tax 4%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (113,11, '6','0','Sales Tax 6%',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (111,11, '0','0','No Sales Tax',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (112,11, '4','0','Sales Tax 4%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (113,11, '6','0','Sales Tax 6%',1,__ENTITY__); -- Pour les DOM-TOM, il faut utiliser le pays FRANCE (Sinon pb avec regles de TVA et autres regles propres aux pays et europe) -- SAINT PIERRE ET MIQUELON (id country=19) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1931,193, '0','0','No VAT in SPM',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1931,193, '0','0','No VAT in SPM',1,__ENTITY__); -- SAINT MARTIN (id country=24) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2461,246, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2461,246, '0','0','VAT rate 0',1,__ENTITY__); -- MAURITANIA (id country=151) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1511,151, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1512,151, '14','0','VAT rate 14',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1511,151, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1512,151, '14','0','VAT rate 14',1,__ENTITY__); -- MAURITIUS (id country=152) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1521,152, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1522,152, '15','0','VAT rate 15',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1521,152, '0','0','VAT rate 0',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1522,152, '15','0','VAT rate 15',1,__ENTITY__); -- HONDURAS (id country=114) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1141,114, '0','0','No ISV',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1142,114, '12','0','ISV 12%',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1141,114, '0','0','No ISV',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1142,114, '12','0','ISV 12%',1,__ENTITY__); -- MEXIQUE (id country=154) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1541,154, '0','0','No VAT',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1542,154, '16','0','VAT 16%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1543,154, '10','0','VAT Frontero',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1541,154, '0','0','No VAT',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1542,154, '16','0','VAT 16%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (1543,154, '10','0','VAT Frontero',1,__ENTITY__); -- BARBADOS (id country=46) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 461, 46, '0','0','No VAT',1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 462, 46, '15','0','VAT 15%',1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES ( 461, 46, '0','0','No VAT',1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES ( 462, 46, '15','0','VAT 15%',1,__ENTITY__); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1,__ENTITY__); -- VENEZUELA (id country=232) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2322,232, '12','0','VAT 12%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2323,232, '8','0','VAT 8%',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2321,232, '0','0','No VAT',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2322,232, '12','0','VAT 12%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2323,232, '8','0','VAT 8%',1,__ENTITY__); -- VIETNAM (id country=233) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2331,233, '0','0','Thuế GTGT đươc khấu trừ 0%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2332,233, '5','0','Thuế GTGT đươc khấu trừ 5%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2333,233, '8','0','Thuế GTGT đươc khấu trừ 8%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2334,233, '10','0','Thuế GTGT đươc khấu trừ 10%',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2331,233, '0','0','Thuế GTGT đươc khấu trừ 0%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2332,233, '5','0','Thuế GTGT đươc khấu trừ 5%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2333,233, '8','0','Thuế GTGT đươc khấu trừ 8%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2334,233, '10','0','Thuế GTGT đươc khấu trừ 10%',1,__ENTITY__); -- Example of code to insert a VAT rate 0 for each country -- delete from llx_c_tva where rowid = 1181; -- to delete a record that does not follow rules for rowid (fk_pays+'1') --- insert into llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) SELECT CONCAT(c.rowid, '1'), c.rowid, 0, 0, 'No VAT', 1 from llx_c_country as c where c.rowid not in (select fk_pays from llx_c_tva); +-- insert into llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active,entity) SELECT CONCAT(c.rowid, '1'), c.rowid, 0, 0, 'No VAT', 1 from llx_c_country as c where c.rowid not in (select fk_pays from llx_c_tva,__ENTITY__); -- BURUNDI (id country=61) -- https://www.objectif-import-export.fr/fr/marches-internationaux/fiche-pays/burundi/presentation-fiscalite -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2335,61, '0','0','No VAT',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2336,61, '10','0','VAT 10%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2337,61, '18','0','VAT 18%',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2335,61, '0','0','No VAT',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2336,61, '10','0','VAT 10%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (2337,61, '18','0','VAT 18%',1,__ENTITY__); -- Turkiye (Turkey) (id country=221) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (22101,221, '0','0','No VAT',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (22102,221, '1','0','VAT 1%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (22103,221, '8','0','VAT 8%',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (22104,221, '18','0','VAT 18%',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (22101,221, '0','0','No VAT',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (22102,221, '1','0','VAT 1%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (22103,221, '8','0','VAT 8%',1,__ENTITY__); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,entity) values (22104,221, '18','0','VAT 18%',1,__ENTITY__); diff --git a/htdocs/install/mysql/data/llx_c_type_container-website.sql b/htdocs/install/mysql/data/llx_c_type_container-website.sql index 87bfd807332..77ac2ff6c0b 100644 --- a/htdocs/install/mysql/data/llx_c_type_container-website.sql +++ b/htdocs/install/mysql/data/llx_c_type_container-website.sql @@ -30,11 +30,11 @@ -- Type of website page/container -- -insert into llx_c_type_container (code,label,module,active) values ('page', 'Page', 'system', 1); -insert into llx_c_type_container (code,label,module,active) values ('banner', 'Banner', 'system', 1); -insert into llx_c_type_container (code,label,module,active) values ('blogpost', 'BlogPost', 'system', 1); -insert into llx_c_type_container (code,label,module,active) values ('menu', 'Menu', 'system', 1); -insert into llx_c_type_container (code,label,module,active) values ('other', 'Other', 'system', 1); +insert into llx_c_type_container (code,label,module,active,entity) values ('page', 'Page', 'system', 1, __ENTITY__); +insert into llx_c_type_container (code,label,module,active,entity) values ('banner', 'Banner', 'system', 1, __ENTITY__); +insert into llx_c_type_container (code,label,module,active,entity) values ('blogpost', 'BlogPost', 'system', 1, __ENTITY__); +insert into llx_c_type_container (code,label,module,active,entity) values ('menu', 'Menu', 'system', 1, __ENTITY__); +insert into llx_c_type_container (code,label,module,active,entity) values ('other', 'Other', 'system', 1, __ENTITY__); -INSERT INTO llx_c_type_container(code, label, active, module, position, typecontainer) VALUES ('service', 'Service (ajax or api)', 1, 'system', 300, 'library'); -INSERT INTO llx_c_type_container(code, label, active, module, position, typecontainer) VALUES ('library', 'Library (functions)', 1, 'system', 400, 'library'); +INSERT INTO llx_c_type_container(code, label, active, module, position, typecontainer, entity) VALUES ('service', 'Service (ajax or api)', 1, 'system', 300, 'library', __ENTITY__); +INSERT INTO llx_c_type_container(code, label, active, module, position, typecontainer, entity) VALUES ('library', 'Library (functions)', 1, 'system', 400, 'library', __ENTITY__); From 4f5d3dddc7bc9b84a9ce103856aac4d89db37f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 16 Nov 2024 10:40:12 +0100 Subject: [PATCH 054/139] fix tooltip (#31933) --- htdocs/core/js/lib_foot.js.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index 06a5ecef2e9..224caed534c 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -118,8 +118,10 @@ if (empty($conf->dol_no_mouse_hover)) { success: function(response){ // Setting content option console.log("ajax success"); - elemfortooltip.tooltip("option","content",response); - elemfortooltip.tooltip("open"); + if (elemfortooltip.is(":hover")) { + elemfortooltip.tooltip("option","content",response); + elemfortooltip.tooltip("open"); + } } }); }, opendelay)); From cd6ed63768a2a0f4c7f66366db62b98f423fdd2c Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Sat, 16 Nov 2024 10:45:01 +0100 Subject: [PATCH 055/139] Fix Specimen warning in supplier admin when database has no products (#31867) --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b7c01fa4306..b50bce3bd6c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2938,7 +2938,7 @@ class CommandeFournisseur extends CommonOrder $sql .= $this->db->order("rowid", "ASC"); $sql .= $this->db->plimit(1); $resql = $this->db->query($sql); - if ($resql) { + if ($resql && $this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); $prodid = $obj->rowid; } From 1ec2b053b7959e69b2bfc1abfbddc83b9f4e7b12 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Sat, 16 Nov 2024 10:45:29 +0100 Subject: [PATCH 056/139] fix warning in html form class (#31860) Co-authored-by: Hystepik --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c471ea18b23..f33876a2f0c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7207,7 +7207,7 @@ class Form $shour = ''; $smin = ''; $ssec = ''; - if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) { // deprecated usage + if (!empty($set_time) && preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) { // deprecated usage // Date format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' $syear = (!empty($reg[1]) ? $reg[1] : ''); $smonth = (!empty($reg[2]) ? $reg[2] : ''); From b6dfc496a2d872e470d37e6378cea18facf83b87 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 16 Nov 2024 10:51:24 +0100 Subject: [PATCH 057/139] FIX: assets: division by zero when trying to calculate depreciation on assets that don't have it (#31858) * FIX: assets: division by zero when trying to calculate depreciation on assets that don't have it * FIX: assets: division by zero when trying to calculate depreciation on assets that don't have it, part 2 --- htdocs/asset/class/asset.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index eae77489859..1ff9497759f 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -814,6 +814,10 @@ class Asset extends CommonObject return -1; } + if (! empty($this->not_depreciated)) { + return 1; + } + // Get depreciation options //--------------------------- require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.php'; From 5f5fc076b50e5539deddc830e7b17384a6f228ef Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Sat, 16 Nov 2024 10:55:31 +0100 Subject: [PATCH 058/139] fix undefined property in expensereportline class (#31854) Co-authored-by: Hystepik Co-authored-by: Laurent Destailleur --- htdocs/expensereport/class/expensereportline.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/class/expensereportline.class.php b/htdocs/expensereport/class/expensereportline.class.php index 52f3ce88190..0402ebff545 100644 --- a/htdocs/expensereport/class/expensereportline.class.php +++ b/htdocs/expensereport/class/expensereportline.class.php @@ -268,7 +268,7 @@ class ExpenseReportLine extends CommonObjectLine $this->rowid = $objp->rowid; $this->id = $objp->rowid; - $this->ref = $objp->ref; + //$this->ref = $objp->ref; Undefined property $this->fk_expensereport = $objp->fk_expensereport; $this->comments = $objp->comments; $this->qty = $objp->qty; From 976399c2d9840386be879ac2e16e4e4259efbf73 Mon Sep 17 00:00:00 2001 From: "Thomas C." <56068416+Thomas905@users.noreply.github.com> Date: Sat, 16 Nov 2024 10:57:03 +0100 Subject: [PATCH 059/139] fix (#31683) --- htdocs/core/lib/company.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 82e42792144..2146f00ba66 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2193,7 +2193,7 @@ function show_subsidiaries($conf, $langs, $db, $object) $i = -1; - $sql = "SELECT s.rowid, s.client, s.fournisseur, s.nom as name, s.name_alias, s.email, s.address, s.zip, s.town, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.canvas"; + $sql = "SELECT s.rowid, s.client, s.fournisseur, s.nom as name, s.name_alias, s.email, s.address, s.zip, s.town, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.canvas, s.status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.parent = ".((int) $object->id); $sql .= " AND s.entity IN (".getEntity('societe').")"; @@ -2233,6 +2233,7 @@ function show_subsidiaries($conf, $langs, $db, $object) $socstatic->canvas = $obj->canvas; $socstatic->client = $obj->client; $socstatic->fournisseur = $obj->fournisseur; + $socstatic->status = $obj->status; print ''; From 31926333e1e316afe813bd778133b8cfb5d57bae Mon Sep 17 00:00:00 2001 From: Nicolas SILOBRE <45969285+ns-info90@users.noreply.github.com> Date: Sat, 16 Nov 2024 10:58:48 +0100 Subject: [PATCH 060/139] Update viewcat.php (#31849) * Update viewcat.php * Update viewcat.php --- htdocs/categories/viewcat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index c45c5f016e9..211e2d1f7b4 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -634,7 +634,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'; - print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), ''); + print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER'); From d0323fa27d9c704503f6d97b5679de2d5dbf64a4 Mon Sep 17 00:00:00 2001 From: kkhelifa-opendsi Date: Fri, 15 Nov 2024 23:53:04 +0100 Subject: [PATCH 034/139] FIX : Update on a sold line of bank entrie set the type to empty, now it's fixed #22539 (#31888) --- htdocs/compta/bank/line.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index d8517391e17..74fecf8ecbb 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -163,7 +163,8 @@ if ($user->rights->banque->modifier && $action == "update") { $sql .= " SET "; // Always opened if (GETPOSTISSET('value')) { - $sql .= " fk_type='".$db->escape(GETPOST('value'))."',"; + $type = GETPOST('value'); + $sql .= " fk_type='".$db->escape(empty($type) && $object->fk_type == 'SOLD' ? 'SOLD' : $type)."',"; } if (GETPOSTISSET('num_chq')) { $sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',"; From 5d9d282f1be0767e9adac33bbee5cac07e6268d1 Mon Sep 17 00:00:00 2001 From: alex10843 Date: Fri, 15 Nov 2024 23:56:14 +0100 Subject: [PATCH 035/139] FIX: Takepos: set the country of the default customer (#31915) * FIX: Takepos: set the country of the default customer * Update modTakePos.class.php --------- Co-authored-by: Alex - Solauv Co-authored-by: Laurent Destailleur --- htdocs/core/modules/modTakePos.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 06b5b79dbf3..447e43f5399 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -283,6 +283,7 @@ class modTakePos extends DolibarrModules $societe->client = 1; $societe->code_client = -1; $societe->code_fournisseur = -1; + $societe->country_id = $mysoc->country_id ? $mysoc->country_id : 1; // By default we consider the default customer is in the same country than the company $societe->note_private = "Default customer automaticaly created by Point Of Sale module activation. Can be used as the default generic customer in the Point Of Sale setup. Can also be edited or removed if you don't need a generic customer."; $searchcompanyid = $societe->create($user); From c96b9097273fda895dd2df3f7a85676affc11721 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:57:03 +0100 Subject: [PATCH 036/139] fix null vaue in stocktransfer_card (#31886) Co-authored-by: Hystepik --- htdocs/product/stock/stocktransfer/stocktransfer_card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index a8f7d3991c4..5e17dbc626e 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -69,6 +69,8 @@ $lineid = GETPOSTINT('lineid'); $label = GETPOST('label', 'alpha'); $batch = GETPOST('batch', 'alpha'); $code_inv = GETPOST('inventorycode', 'alphanohtml'); +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); // Initialize a technical objects $object = new StockTransfer($db); From be72bfa6645cfe57e5061c5fa5d0af839bbb80ad Mon Sep 17 00:00:00 2001 From: Thibault Parodi <53296763+tpi7@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:57:58 +0100 Subject: [PATCH 037/139] FIX #29424 API GET member categories (#31881) * Fix members categories when user is not found * Return empty array instead of 0 when member does not have category assigned --- htdocs/adherents/class/api_members.class.php | 6 ++++++ htdocs/categories/class/categorie.class.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 26fb38c0562..e7b26e6a3d2 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -689,6 +689,12 @@ class Members extends DolibarrApi throw new RestException(403); } + $member = new Adherent($this->db); + $result = $member->fetch($id); + if (0 === $result) { + throw new RestException(404, 'Member not found'); + } + $categories = new Categorie($this->db); $result = $categories->getListForItem($id, 'member', $sortfield, $sortorder, $limit, $page); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f0d3e729791..7ac727d576a 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1103,7 +1103,7 @@ class Categorie extends CommonObject return -1; } if (!count($categories)) { - return 0; + return []; } return $categories; From c2a7c4bbc153fa12419f11250d11c99547eccb79 Mon Sep 17 00:00:00 2001 From: Delthair <41671350+Delthair@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:59:30 +0100 Subject: [PATCH 038/139] FIX #31724 (#31885) * FIX TakePOS : Undefined variable $servicestatus in pay.php on lines 126, 368 and 392 when stripe is not enabled #31724 TakePOS : Undefined variable $servicestatus in pay.php on lines 126, 368 and 392 when stripe is not enabled #31724 * nettoyage ligne 89 whitespace --- htdocs/takepos/pay.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index c8786128687..d2ee2999100 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -82,10 +82,11 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); Date: Sat, 16 Nov 2024 00:00:05 +0100 Subject: [PATCH 039/139] Fix mod_facture_fournisseur_tulip::getExample & get_next_value if no object in parameter (#31878) --- .../modules/supplier_invoice/mod_facture_fournisseur_tulip.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index e6838b9c4c4..5454c810e8d 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -176,7 +176,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices } // Supplier invoices take invoice date instead of creation date for the mask - $numFinal = get_next_value($db, $mask, 'facture_fourn', 'ref', '', $objsoc, $object->date); + $numFinal = get_next_value($db, $mask, 'facture_fourn', 'ref', '', $objsoc, is_object($object) ?$object->date :''); return $numFinal; } From 348981a4190d12c54df4974ac59ce1a6899ea2da Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Sat, 16 Nov 2024 00:06:15 +0100 Subject: [PATCH 040/139] Fix show payment URL in massaction context when not one email per recipient (#31927) --- htdocs/core/actions_massactions.inc.php | 7 ++++++- htdocs/core/class/html.formmail.class.php | 11 ++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index ca8232c584b..5ff3a0973fd 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -464,7 +464,12 @@ if (!$error && $massaction == 'confirm_presend') { $substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ', $listofqualifiedref) : $objecttmp->ref); $substitutionarray['__EMAIL__'] = $thirdparty->email; $substitutionarray['__CHECK_READ__'] = ''; - + + if ($oneemailperrecipient) { + $substitutionarray['__ONLINE_PAYMENT_URL__'] = ''; + $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = ''; + } + $parameters = array('mode'=>'formemail'); if (!empty($listofobjectthirdparties)) { diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 21d7f071043..cc45aaa2e91 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -863,12 +863,12 @@ class FormMail extends Form // Complete substitution array with the url to make online payment $paymenturl = ''; - $validpaymentmethod = array(); + // Set the online payment url link into __ONLINE_PAYMENT_URL__ key + require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + $validpaymentmethod = getValidOnlinePaymentMethods(''); if (empty($this->substit['__REF__'])) { $paymenturl = ''; } else { - // Set the online payment url link into __ONLINE_PAYMENT_URL__ key - require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; $langs->loadLangs(array('paypal', 'other')); $typeforonlinepayment = 'free'; if ($this->param["models"] == 'order' || $this->param["models"] == 'order_send') { @@ -882,14 +882,15 @@ class FormMail extends Form } $url = getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']); $paymenturl = $url; - - $validpaymentmethod = getValidOnlinePaymentMethods(''); } if (count($validpaymentmethod) > 0 && $paymenturl) { $langs->load('other'); $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = str_replace('\n', "\n", $langs->transnoentities("PredefinedMailContentLink", $paymenturl)); $this->substit['__ONLINE_PAYMENT_URL__'] = $paymenturl; + } elseif (count($validpaymentmethod) > 0) { + $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '__ONLINE_PAYMENT_TEXT_AND_URL__'; + $this->substit['__ONLINE_PAYMENT_URL__'] = '__ONLINE_PAYMENT_URL__'; } else { $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = ''; $this->substit['__ONLINE_PAYMENT_URL__'] = ''; From a0eb5515a8d7e76ab79edd1e50901f9fddd07430 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Sat, 16 Nov 2024 00:07:47 +0100 Subject: [PATCH 041/139] FIX help on PDF condition of sales (#31879) --- htdocs/admin/pdf_other.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 4c5d164c16f..39e97b2ee70 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -227,7 +227,7 @@ if (isModEnabled('propal')) { */ print '
'; - print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), ''); + print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'); From 1637319d24750de20b897912aa93e9e28399e941 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:08:41 +0100 Subject: [PATCH 042/139] fix php warning supplier proposal class (#31872) Co-authored-by: Hystepik --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index e1a0a71f840..0aba526fa84 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1310,7 +1310,7 @@ class SupplierProposal extends CommonObject $this->cond_reglement = $obj->cond_reglement; $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; - $this->extraparams = (array) json_decode($obj->extraparams, true); + $this->extraparams = (array) (!empty($obj->extraparams) ? json_decode($obj->extraparams, true) : array()); $this->user_author_id = $obj->fk_user_author; $this->user_validation_id = $obj->fk_user_valid; From a07894a01fa88ffd8adfe039fa7c1a225816e6ee Mon Sep 17 00:00:00 2001 From: Delthair <41671350+Delthair@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:10:14 +0100 Subject: [PATCH 043/139] #31661 (#31874) Incoterm location is int/float instead of alpha (in ther most card.php) #31661 --- 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 634d4624ca9..16edbdc502e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -415,7 +415,7 @@ if (empty($reshook)) { } } elseif ($action == 'set_incoterms' && isModEnabled('incoterm') && $usercancreate) { // Set incoterm - $result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOSTINT('location_incoterms')); + $result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOST('location_incoterms')); } elseif ($action == 'add' && $usercancreate) { // Create proposal $object->socid = $socid; From 0cb9fe124177c8471733ef307d28ed00e7f031f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 16 Nov 2024 00:15:13 +0100 Subject: [PATCH 044/139] fix select unit (#31868) * fix select unit * Update html.formproduct.class.php --- htdocs/product/class/html.formproduct.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 8176e229662..bc8a42046a2 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -576,6 +576,7 @@ class FormProduct $langs->load("other"); $return = ''; + $placeholderID = ($mode == 2 ? '99999999' : '-1'); // we don't want ajaxcombobox replace clearing option in mode 2 // TODO Use a cache require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; @@ -631,7 +632,7 @@ class FormProduct $return .= ''; } - $return .= ajax_combobox($name); + $return .= ajax_combobox($name, [], 0, 0, 'resolve', $placeholderID); return $return; } From 6f6997a0176732d45e30d955587b1a9d95e7fa89 Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:15:43 +0100 Subject: [PATCH 045/139] fix projet/messaging.php warnings (#31869) Co-authored-by: Hystepik --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0b8861d2cea..04e1b9a0554 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14696,9 +14696,9 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, } $libelle = ''; - if (preg_match('/^TICKET_MSG/', $actionstatic->code)) { + if (!empty($actionstatic->code) && preg_match('/^TICKET_MSG/', $actionstatic->code)) { $out .= $langs->trans('TicketNewMessage'); - } elseif (preg_match('/^TICKET_MSG_PRIVATE/', $actionstatic->code)) { + } elseif (!empty($actionstatic->code) && preg_match('/^TICKET_MSG_PRIVATE/', $actionstatic->code)) { $out .= $langs->trans('TicketNewMessage').' ('.$langs->trans('Private').')'; } elseif (isset($histo[$key]['type'])) { if ($histo[$key]['type'] == 'action') { From aa6422ea81bae8229bca139cd9accb05445220f6 Mon Sep 17 00:00:00 2001 From: moreauftheobald Date: Sat, 16 Nov 2024 00:25:30 +0100 Subject: [PATCH 046/139] Fix Php 8 warning on commande dispach (#31871) Co-authored-by: Theobald From 01687b396b0723e29c7e54c937034676c3f5e70f Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Sat, 16 Nov 2024 00:27:22 +0100 Subject: [PATCH 047/139] fiw warning for action message display (#31865) Co-authored-by: Hystepik --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 04e1b9a0554..d2609495d49 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14605,7 +14605,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = null, $out .= ''."\n"; - $out .= '
  • '; + $out .= '
  • '; //$timelineicon = getTimelineIcon($actionstatic, $histo, $key); $typeicon = $actionstatic->getTypePicto('pictofixedwidth timeline-icon-not-applicble', $labeltype); From a2dce69dbeffb6100911a195e6982a705aee5d20 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 00:33:54 +0100 Subject: [PATCH 048/139] Fix a login is not a case sensitive data #31864 --- htdocs/webportal/class/context.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webportal/class/context.class.php b/htdocs/webportal/class/context.class.php index 352ae9e79f9..6883a525fa3 100644 --- a/htdocs/webportal/class/context.class.php +++ b/htdocs/webportal/class/context.class.php @@ -687,7 +687,7 @@ class Context $sql = "SELECT sa.rowid as id, sa.pass_crypted"; $sql .= " FROM " . $this->db->prefix() . "societe_account as sa"; - $sql .= " WHERE BINARY sa.login = '" . $this->db->escape($login) . "'"; // case sensitive + $sql .= " WHERE sa.login = '" . $this->db->escape($login) . "'"; //$sql .= " AND BINARY sa.pass_crypted = '" . $this->db->escape($pass) . "'"; // case sensitive $sql .= " AND sa.site = 'dolibarr_portal'"; $sql .= " AND sa.status = 1"; From a6b18b1f5d0e1a9045c2f51df7181d55294efa58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20PASCAL?= Date: Sat, 16 Nov 2024 01:55:35 +0100 Subject: [PATCH 049/139] fix: get file link in invoice list with multicompany (#31930) --- htdocs/compta/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 9e569f25967..dfc15d484b0 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2146,7 +2146,8 @@ if ($num > 0) { } $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($obj->ref); + $filepath = $conf->invoice->multidir_output[$obj->entity] ?? $conf->invoice->dir_output; + $filedir = $filepath.'/'.$filename; $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->id; print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print '
  • '.$langs->trans("Weight").''; print img_picto('', 'fa-balance-scale', 'class="pictofixedwidth"'); print ''; - print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ? GETPOST('weight_units', 'alpha') : (!getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT') ? 0 : getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT')), 0, 2); + print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ? GETPOST('weight_units', 'alpha') : (GETPOST('weight_units', 'alpha') ?: getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 0)), 0, 2); print '
    '.$langs->trans("Surface").''; print ''; - print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units') ? GETPOST('surface_units', 'alpha') : '0', 0, 2); + print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units') ? GETPOST('surface_units', 'alpha') : (GETPOST('surface_units', 'alpha') ?: '0'), 0, 2); print '
    '.$langs->trans("Volume").''; print ''; - print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units') ? GETPOST('volume_units', 'alpha') : '0', 0, 2); + print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units') ? GETPOST('volume_units', 'alpha') : (GETPOST('volume_units', 'alpha') ?: '0'), 0, 2); print '
    '.$langs->trans("NetMeasure").''; print ''; - print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units') ? GETPOST('net_measure_units', 'alpha') : (!getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT') ? 0 : getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT')), 0, 0); + print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units') ? GETPOST('net_measure_units', 'alpha') : (GETPOST('net_measure_units', 'alpha') ?: getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 0)), 0, 0); print '
    '; print ''; print ''; From 54891e8fa7474e4519ba924abbec76495197f6c5 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sat, 16 Nov 2024 11:34:36 +0100 Subject: [PATCH 061/139] FIX Status not correct in Public ticket list (#31922) --- htdocs/public/ticket/list.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index fcc9a00e72a..4a7bbf39a6f 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -702,7 +702,10 @@ if ($action == "view_ticketlist") { // Statut if (!empty($arrayfields['t.fk_statut']['checked'])) { print ''; } From c496df7dfeb084aedc27b773d954bd654225caf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 16 Nov 2024 11:39:55 +0100 Subject: [PATCH 062/139] test github token (#31931) * test github token * solving errors * test github token * test * test * fix * fix * fix * fix * fix --- .github/workflows/phpstan_baseline.yml | 21 +++++++++++--------- htdocs/comm/propal/stats/index.php | 16 +++++---------- htdocs/commande/stats/index.php | 5 ++--- htdocs/product/stock/productlot_document.php | 2 ++ 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.github/workflows/phpstan_baseline.yml b/.github/workflows/phpstan_baseline.yml index 618a2d26690..9503c25de77 100644 --- a/.github/workflows/phpstan_baseline.yml +++ b/.github/workflows/phpstan_baseline.yml @@ -1,9 +1,9 @@ name: 'PHPStan baseline' on: - # Every Thursday we want to refresh the baseline + # Every day we want to refresh the baseline schedule: - - cron: '0 6 * * 4' + - cron: '0 12 * * *' # We want to be able to manually refresh the baseline too workflow_dispatch: @@ -14,18 +14,21 @@ on: required: true type: string # Run PHPStan analyse on pull requests - #pull_request: + # pull_request: + +permissions: {} # none env: PHP_VERSION: '8.2' + GH_TOKEN: ${{ github.token }} gh_event: ${{ inputs.gh_event || github.event_name }} CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} jobs: phpstan: runs-on: ubuntu-latest - permissions: write-all - # contents: write - # pull-requests: write + permissions: + contents: write + pull-requests: write steps: - name: Checkout uses: actions/checkout@v4 @@ -54,7 +57,7 @@ jobs: phpstan-cache-${{ env.PHP_VERSION }}- - uses: ruudk/phpstan-baseline-refresh-create-pr-action@main with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ env.GH_TOKEN }} phpstan_path: phpstan configuration_path: phpstan.neon.dist phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php @@ -63,8 +66,8 @@ jobs: commit_email: dolibarr-bot@users.noreply.github.com commit_message: PHPStan > Update baseline target_branch: develop - pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }} - # pr_create: 1 + # pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }} + pr_create: 1 pr_title: PHPStan > Update baseline pr_reviewer: eldy pr_body: | diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 55c4d15f18f..ff88cc5e51f 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -97,18 +97,12 @@ $formother = new FormOther($db); $langs->loadLangs(array('propal', 'other', 'companies')); -$picto = null; -$dir = null; -$cat_type = null; -$cat_label = null; +$picto = 'propal'; +$title = $langs->trans("ProposalsStatistics"); +$dir = $conf->propal->dir_temp; +$cat_type = Categorie::TYPE_CUSTOMER; +$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); -if ($mode == 'customer') { - $picto = 'propal'; - $title = $langs->trans("ProposalsStatistics"); - $dir = $conf->propal->dir_temp; - $cat_type = Categorie::TYPE_CUSTOMER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); -} if ($mode == 'supplier') { $picto = 'supplier_proposal'; $title = $langs->trans("ProposalsStatisticsSuppliers"); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 555c04558e5..cc2aac53b02 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -304,9 +304,8 @@ $head[$h][1] = $langs->trans("ByMonthYear"); $head[$h][2] = 'byyear'; $h++; -if ($mode == 'customer') { - $type = 'order_stats'; -} +$type = 'order_stats'; + if ($mode == 'supplier') { $type = 'supplier_order_stats'; } diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 54813e16de1..a53aafa557f 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -88,6 +88,8 @@ if (!$sortfield) { $modulepart = 'product_batch'; $object = new Productlot($db); if ($id || $ref) { + $productid = 0; + $batch = ''; if ($ref) { $tmp = explode('_', $ref); $productid = $tmp[0]; From af6a487178012f1a9340fd17c3ef0059677bc313 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 16 Nov 2024 14:45:30 +0100 Subject: [PATCH 063/139] FIX missing check permissions for clone user action (#31944) * FIX missing check permissions for clone action * FIX missing permission for the action --- htdocs/user/card.php | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 83566e92ba2..da755e4c775 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -134,6 +134,16 @@ if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { $permissiontoeditgroup = (!empty($user->admin) || $user->hasRight("user", "group_advance", "write")); } +$permissiontoclonesuperadmin = ($permissiontoadd && empty($user->entity)); +$permissiontocloneadmin = ($permissiontoadd && !empty($user->admin)); +$permissiontocloneuser = $permissiontoadd; +// Can clone only in master entity if transverse mode is used +if (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $conf->entity > 1) { + $permissiontoclonesuperadmin = false; + $permissiontocloneadmin = false; + $permissiontocloneuser = false; +} + if ($user->id != $id && !$permissiontoread) { accessforbidden(); } @@ -774,7 +784,7 @@ if (empty($reshook)) { if ($action == 'confirm_clone' && $confirm != 'yes') { $action = ''; } - if ($action == 'confirm_clone' && $confirm == 'yes' && $user->hasRight("user", "user", "write")) { + if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontocloneuser) { if (!GETPOST('clone_name')) { setEventMessages($langs->trans('ErrorNoCloneWithoutName'), null, 'errors'); } elseif (getDolGlobalString('USER_MAIL_REQUIRED') && !GETPOST('new_email')) { @@ -786,7 +796,6 @@ if (empty($reshook)) { $clone->id = 0; $clone->email = (getDolGlobalString('USER_MAIL_REQUIRED') ? GETPOST('new_email', 'alphanohtml') : ''); - $clone->entity = 1; $clone->api_key = ''; $parts = explode(' ', GETPOST('clone_name'), 2); @@ -2132,15 +2141,18 @@ if ($action == 'create' || $action == 'adduserldap') { 'class' => 'classfortooltip' ) ); - //clone user - $cloneButtonId = ''; - $cloneUserUrl = ''; - - if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { + // Clone user + // a simple user can not clone an admin or superadmin and a simple admin can not clone a superadmin + if ((empty($object->entity) && $permissiontoclonesuperadmin) || (!empty($object->admin) && !empty($object->entity) && $permissiontocloneadmin) || ($permissiontocloneuser && empty($object->admin) && !empty($object->entity))) { + $cloneButtonId = ''; $cloneUserUrl = ''; - $cloneButtonId = 'action-clone'; - } + + if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { + $cloneUserUrl = ''; + $cloneButtonId = 'action-clone'; + } print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $cloneUserUrl, $cloneButtonId, $user->hasRight('user', 'user', 'write')); + } if (getDolGlobalString('USER_PASSWORD_GENERATED') != 'none') { if ($object->status == $object::STATUS_DISABLED) { From 31dda93490abbd585765b4720e43f93b0b99ae90 Mon Sep 17 00:00:00 2001 From: omogenot Date: Sat, 16 Nov 2024 14:47:02 +0100 Subject: [PATCH 064/139] Add missing hook context to parameters array (#31942) There is a missing context value in the parameters array passed to executeHooks. This missing parameter prevents an external hook to determine which context called and define hook behaviour. --- htdocs/product/stock/card.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 4736a24eff0..1914448023d 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -114,7 +114,7 @@ $usercandelete = $user->hasRight('stock', 'supprimer'); $error = 0; -$parameters = array('id' => $id, 'ref' => $ref); +$parameters = array('context' => 'warehousecard', 'id' => $id, 'ref' => $ref); $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'); @@ -439,7 +439,7 @@ if ($action == 'create') { } // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm); + $parameters = array('context' => 'warehousecard', 'formConfirm' => $formconfirm); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $formconfirm .= $hookmanager->resPrint; @@ -599,7 +599,7 @@ if ($action == 'create') { */ print "
    \n"; - $parameters = array(); + $parameters = array('context' => 'warehousecard'); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if (empty($action) || $action == 'classin') { @@ -634,7 +634,7 @@ if ($action == 'create') { print '
    '; print '
    '; print $langs->trans("AddCustomerIntoCategory").'  '; - $filter = '(s.client:IN:1,3)'; + $filter = '(s.client:IN:1,2,3)'; print $form->select_company('', 'elemid', $filter); print '
    '; - $object->fk_statut = $obj->fk_statut; + $object->status = $obj->fk_statut; + if (getDolGlobalString('TICKET_SHOW_PROGRESSION')) { + $object->progress = $obj->progress; + } print $object->getLibStatut(2); print '
    '; print ''; - $parameters = array('totalarray' => &$totalarray); + $parameters = array('context' => 'warehousecard', 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -680,7 +680,7 @@ if ($action == 'create') { $totalarray['nbfield']++; } // Hook fields - $parameters = array('sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); + $parameters = array('context' => 'warehousecard', 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print "\n"; @@ -714,7 +714,7 @@ if ($action == 'create') { } $sql .= ", (ps.reel * p.pmp) as svalue"; // Add fields from hooks - $parameters = array(); + $parameters = array('context' => 'warehousecard'); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook if ($reshook > 0) { //Note that $sql is replaced if reshook > 0 $sql = ""; @@ -847,7 +847,7 @@ if ($action == 'create') { print ""; } - $parameters = array('obj' => $objp, 'totalarray' => &$totalarray); + $parameters = array('context' => 'warehousecard', 'obj' => $objp, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; @@ -871,7 +871,7 @@ if ($action == 'create') { $totalarray['val']['totalvaluesell'] = price2num($totalvaluesell, 'MT'); $totalarray['val']['units'] = $langs->trans($productstatic->getLabelOfUnit()); - $parameters = array('totalarray' => &$totalarray); + $parameters = array('context' => 'warehousecard', 'totalarray' => &$totalarray); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('printFieldListTotal', $parameters, $object); if ($reshook < 0) { @@ -976,7 +976,7 @@ if ($action == 'create') { print ''; // Other attributes - $parameters = array('colspan' => ' colspan="3"', 'cols' => '3'); + $parameters = array('context' => 'warehousecard', 'colspan' => ' colspan="3"', 'cols' => '3'); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { From ee1cdd765ac7a0b2044d14a4b00a675952591062 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:48:04 +0100 Subject: [PATCH 065/139] PHPStan > Update baseline (#31940) Co-authored-by: Dolibot --- build/phpstan/phpstan-baseline.neon | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 431b7d30d06..fcd41ac896b 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -4950,12 +4950,6 @@ parameters: count: 1 path: ../../htdocs/comm/propal/note.php - - - message: '#^Variable \$title might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../htdocs/comm/propal/stats/index.php - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' identifier: argument.templateType @@ -5382,12 +5376,6 @@ parameters: count: 1 path: ../../htdocs/commande/note.php - - - message: '#^Variable \$type might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/commande/stats/index.php - - message: '#^Unable to resolve the template type T in call to function dol_sort_array$#' identifier: argument.templateType @@ -29130,18 +29118,6 @@ parameters: count: 1 path: ../../htdocs/product/stock/productlot_card.php - - - message: '#^Variable \$batch might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/productlot_document.php - - - - message: '#^Variable \$productid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../htdocs/product/stock/productlot_document.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable From fac36d2376d42e01f4e0e63a4f684f1b59c1daa3 Mon Sep 17 00:00:00 2001 From: Sami Filali <139965072+samifilali@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:51:24 +0100 Subject: [PATCH 066/139] add hook (#31938) --- htdocs/admin/mails_templates.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index b19093eeeb0..90ce91457db 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1103,6 +1103,10 @@ if ($num) { if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) { $fieldsforcontent[] = 'content_lines'; } + + $parameters = array('fieldsforcontent' => &$fieldsforcontent, 'tabname' => $tabname[$id]); + $hookmanager->executeHooks('editEmailTemplateFieldsForContent', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + foreach ($fieldsforcontent as $tmpfieldlist) { $showfield = 1; $css = "left"; From 7a84561bba6944accdb37be59883d7c317101bf9 Mon Sep 17 00:00:00 2001 From: iouston <4319513+iouston@users.noreply.github.com> Date: Sat, 16 Nov 2024 14:56:42 +0100 Subject: [PATCH 067/139] =?UTF-8?q?Fix=20issue=20n=C2=B0=2030845=20-=20Res?= =?UTF-8?q?ources=20not=20saved=20on=20new=20event=20creation=20(#31889)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * short_open_tag was always on No * Fix Bug - Return an error if SOCIETE_EMAIL_UNIQUE = 1 if SOCIETE_EMAIL_UNIQUE is on 1, this form return an error because thirdparty already exist. * fix issue n°31839 * fix wrong parameters * fix issue n°30845 * Revert "fix issue n°30845" This reverts commit cf88b7b236ffb51fb01c7564f81c1f86fbca6f53. * fix issue n°30845 * replace space by tabs for CI * fix cat statement * precommit is very ball breaker ;-) * is this the right one? * fix precommit error * Please phpstan... --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/action/card.php | 75 +++++++++++++++++++++ htdocs/public/project/new.php | 30 ++++----- htdocs/resource/class/dolresource.class.php | 2 +- 3 files changed, 91 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 5cff3073b8b..8ef1b664a29 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -367,6 +367,8 @@ if (empty($reshook) && $action == 'add' && $usercancreate) { $object->type_code = GETPOST('actioncode', 'aZ09'); } + $listofresourceid = array(); + if (!$error) { // Initialisation of object actioncomm $object->priority = GETPOSTISSET("priority") ? GETPOSTINT("priority") : 0; @@ -430,6 +432,11 @@ if (empty($reshook) && $action == 'add' && $usercancreate) { if (!empty($_SESSION['assignedtouser'])) { $listofuserid = json_decode($_SESSION['assignedtouser'], true); } + + if (!empty($_SESSION['assignedtoresource'])) { + $listofresourceid = json_decode($_SESSION['assignedtoresource'], true); + } + $i = 0; foreach ($listofuserid as $key => $value) { if ($i == 0) { // First entry @@ -541,6 +548,74 @@ if (empty($reshook) && $action == 'add' && $usercancreate) { if ($idaction > 0) { if (!$object->error) { + if (is_array($listofresourceid) && count($listofresourceid)) { + foreach ($listofresourceid as $resource_id => $val) { + $resource_type = 'dolresource'; + $busy = 1;//GETPOSTINT('busy'); + + // Resources association + if (getDolGlobalString('RESOURCE_USED_IN_EVENT_CHECK')) { + $eventDateStart = $object->datep; + $eventDateEnd = $object->datef; + $isFullDayEvent = $object->fulldayevent; + if (empty($eventDateEnd)) { + if ($isFullDayEvent) { + $eventDateStartArr = dol_getdate($eventDateStart); + $eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + } + } + + $sql = "SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label"; + $sql .= " FROM " . MAIN_DB_PREFIX . "element_resources as er"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "resource as r ON r.rowid = er.resource_id AND er.resource_type = '" . $db->escape($resource_type) . "'"; + $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "actioncomm as ac ON ac.id = er.element_id AND er.element_type = '" . $db->escape($object->element) . "'"; + $sql .= " WHERE er.resource_id = " . ((int) $resource_id); + $sql .= " AND er.busy = 1"; + $sql .= " AND ("; + + // event date start between ac.datep and ac.datep2 (if datep2 is null we consider there is no end) + $sql .= " (ac.datep <= '" . $db->idate($eventDateStart) . "' AND (ac.datep2 IS NULL OR ac.datep2 >= '" . $db->idate($eventDateStart) . "'))"; + // event date end between ac.datep and ac.datep2 + if (!empty($eventDateEnd)) { + $sql .= " OR (ac.datep <= '" . $db->idate($eventDateEnd) . "' AND (ac.datep2 >= '" . $db->idate($eventDateEnd) . "'))"; + } + // event date start before ac.datep and event date end after ac.datep2 + $sql .= " OR ("; + $sql .= "ac.datep >= '" . $db->idate($eventDateStart) . "'"; + if (!empty($eventDateEnd)) { + $sql .= " AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '" . $db->idate($eventDateEnd) . "')"; + } + $sql .= ")"; + + $sql .= ")"; + $resql = $db->query($sql); + if (!$resql) { + $error++; + $object->error = $db->lasterror(); + $object->errors[] = $object->error; + } else { + if ($db->num_rows($resql) > 0) { + // Resource already in use + $error++; + $object->error = $langs->trans('ErrorResourcesAlreadyInUse') . ' : '; + while ($obj = $db->fetch_object($resql)) { + $object->error .= '
    - ' . $langs->trans('ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label . ' [' . $obj->ac_id . ']'); + } + $object->errors[] = $object->error; + } + $db->free($resql); + } + } + + if (!$error) { + $res = $object->add_element_resource($resource_id, $resource_type, $busy, $val['mandatory']); + } + } + } + + unset($_SESSION['assignedtoresource']); + // Category association $categories = GETPOST('categories', 'array'); $object->setCategories($categories); diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index b2d2e9ba830..a794d2f5735 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -186,26 +186,26 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he $db->begin(); - if (!GETPOST("lastname")) { + if (!GETPOST('lastname', 'alpha')) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
    \n"; } - if (!GETPOST("firstname")) { + if (!GETPOST('firstname', 'alpha')) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
    \n"; } - if (!GETPOST("email")) { + if (!GETPOST('email', 'alpha')) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
    \n"; } - if (!GETPOST("description")) { + if (!GETPOST('description', 'alpha')) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Message"))."
    \n"; } - if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + if (GETPOST('email', 'alpha') && !isValidEmail(GETPOST('email', 'alpha'))) { $error++; $langs->load("errors"); - $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
    \n"; + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email', 'alpha'))."
    \n"; } // Set default opportunity status $defaultoppstatus = getDolGlobalInt('PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD'); @@ -222,21 +222,21 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he if (!$error) { // Search thirdparty and set it if found to the new created project - $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', GETPOST('email')); + $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', GETPOST('email', 'alpha')); if ($result > 0) { $proj->socid = $thirdparty->id; } else { // Create the prospect - if (GETPOST('societe')) { - $thirdparty->name = GETPOST('societe'); - $thirdparty->name_alias = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname')); + if (GETPOST('societe', 'alpha')) { + $thirdparty->name = GETPOST('societe', 'alpha'); + $thirdparty->name_alias = dolGetFirstLastname(GETPOST('firstname', 'alpha'), GETPOST('lastname', 'alpha')); } else { - $thirdparty->name = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname')); + $thirdparty->name = dolGetFirstLastname(GETPOST('firstname', 'alpha'), GETPOST('lastname', 'alpha')); } - $thirdparty->email = GETPOST('email'); - $thirdparty->address = GETPOST('address'); - $thirdparty->zip = GETPOST('zip'); - $thirdparty->town = GETPOST('town'); + $thirdparty->email = GETPOST('email', 'alpha'); + $thirdparty->address = GETPOST('address', 'alpha'); + $thirdparty->zip = GETPOST('zip', 'int'); + $thirdparty->town = GETPOST('town', 'alpha'); $thirdparty->country_id = GETPOSTINT('country_id'); $thirdparty->state_id = GETPOSTINT('state_id'); $thirdparty->client = $thirdparty::PROSPECT; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index d673e501d30..40955b2f77c 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -207,7 +207,7 @@ class Dolresource extends CommonObject $sql .= ") VALUES ("; $sql .= getEntity('resource') . ", "; foreach ($new_resource_values as $value) { - $sql .= " " . ((isset($value) && $value > 0) ? "'" . $this->db->escape($value) . "'" : 'NULL') . ","; + $sql .= " " . (!empty($value) ? "'" . $this->db->escape($value) . "'" : 'NULL') . ","; } $sql .= " '" . $this->db->idate($this->date_creation) . "',"; $sql .= " " . (!empty($user->id) ? ((int) $user->id) : "null"); From 78fde76f617fb6e6129aa0bc598cd355a26e3fbe Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 16 Nov 2024 17:59:26 +0100 Subject: [PATCH 068/139] Qual: Fix some phan notices (#31948) --- dev/tools/phan/baseline.txt | 16 +++++----------- htdocs/compta/cashcontrol/cashcontrol_card.php | 5 ++++- htdocs/compta/charges/index.php | 6 +++--- htdocs/compta/deplacement/stats/index.php | 1 + htdocs/compta/facture/agenda-rec.php | 17 +++++++++-------- htdocs/compta/facture/contact.php | 5 +++-- htdocs/compta/facture/invoicetemplate_list.php | 2 +- htdocs/compta/facture/list.php | 14 +++++++++----- 8 files changed, 35 insertions(+), 31 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 85e1a4e33c7..a9d07010f51 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -10,9 +10,9 @@ return [ // # Issue statistics: // PhanUndeclaredProperty : 560+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 500+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 490+ occurrences // PhanUndeclaredGlobalVariable : 350+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 270+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 260+ occurrences // PhanPluginUnknownArrayMethodReturnType : 180+ occurrences // PhanTypeMismatchProperty : 140+ occurrences // PhanPluginUnknownPropertyType : 130+ occurrences @@ -21,7 +21,7 @@ return [ // PhanPluginUndeclaredVariableIsset : 65+ occurrences // PhanRedefineFunction : 45+ occurrences // PhanTypeExpectedObjectPropAccess : 45+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 45+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 40+ occurrences // PhanTypeInvalidDimOffset : 35+ occurrences // PhanPluginEmptyStatementIf : 30+ occurrences // PhanTypeMismatchDimFetch : 30+ occurrences @@ -108,19 +108,13 @@ return [ 'htdocs/compta/bank/various_payment/document.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/various_payment/info.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/compta/bank/various_payment/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchProperty'], - 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPossiblyUndeclaredGlobalVariable'], + 'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'], 'htdocs/compta/cashcontrol/cashcontrol_list.php' => ['PhanTypeMismatchProperty'], - 'htdocs/compta/charges/index.php' => ['PhanTypeMismatchArgumentNullableInternal'], 'htdocs/compta/clients.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/compta/deplacement/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginEmptyStatementIf'], 'htdocs/compta/facture/card.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'], 'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/compta/facture/contact.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/invoicetemplate_list.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/compta/facture/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/prelevement.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], @@ -599,7 +593,7 @@ return [ 'htdocs/societe/consumption.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable'], - 'htdocs/societe/price.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/societe/price.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/website.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/class/actions_stripe.class.php' => ['PhanPluginBothLiteralsBinaryOp', 'PhanPluginSuspiciousParamPosition'], diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 89675f57f08..66dc032dd2a 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -280,6 +280,9 @@ $theoricalnbofinvoiceforterminal = array(); llxHeader('', $langs->trans("CashControl")); +$terminalid = ''; +$terminaltouse = ''; + if ($action == "create" || $action == "start" || $action == 'close') { if ($action == 'close') { $posmodule = $object->posmodule; @@ -305,7 +308,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { } } - if (isset($terminalid) && $terminalid != '') { + if (isset($terminalid) && $terminalid != '' && isset($posmodule)) { // Calculate $initialbalanceforterminal for terminal 0 foreach ($arrayofpaymentmode as $key => $val) { if ($key != 'cash') { diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 9299b55c2cb..76dde4ff08b 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -166,7 +166,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= ")"; } - if (preg_match('/^cs\./', $sortfield) || preg_match('/^c\./', $sortfield) || preg_match('/^pc\./', $sortfield) || preg_match('/^pct\./', $sortfield)) { + if (preg_match('/^(cs?|pct?)\./', (string) $sortfield)) { $sql .= $db->order($sortfield, $sortorder); } //$sql.= $db->plimit($limit+1,$offset); @@ -310,7 +310,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { // so we are compatible when period is not mandatory $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; } - if (preg_match('/^pv\./', $sortfield) || preg_match('/^ptva\./', $sortfield)) { + if (preg_match('/^(pv|ptva)\./', (string) $sortfield)) { $sql .= $db->order($sortfield, $sortorder); } @@ -465,7 +465,7 @@ while ($j < $numlt) { // so we are compatible when period is not mandatory $sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; } - if (preg_match('/^pv/', $sortfield)) { + if (preg_match('/^pv/', (string) $sortfield)) { $sql .= $db->order($sortfield, $sortorder); } diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index d2f0ef05647..79f3f16c9d8 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -176,6 +176,7 @@ if (!$mesg) { $data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear); $filename_avg = ''; +$fileurl_avg = ''; if (!$user->hasRight('societe', 'client', 'voir')) { $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'customer') { diff --git a/htdocs/compta/facture/agenda-rec.php b/htdocs/compta/facture/agenda-rec.php index 5ae579f5a82..6cdbed1196e 100644 --- a/htdocs/compta/facture/agenda-rec.php +++ b/htdocs/compta/facture/agenda-rec.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -227,15 +228,15 @@ if ($object->id > 0) { //$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; //$morehtmlstatus .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); - if (isModEnabled('agenda')) { - /* - if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { - $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); - } else { - $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); - } - */ + //if (isModEnabled('agenda')) { + /* + if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) { + $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); + } else { + $morehtmlstatus .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0); } + */ + //} if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) { diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 65aff00aa88..bd9486e2b97 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -6,6 +6,7 @@ * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2023 Christian Foellmann * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -63,7 +64,7 @@ if ($user->socid) { $object = new Facture($db); // Load object if ($id > 0 || !empty($ref)) { - $ret = $object->fetch($id, $ref, '', '', (getDolGlobalString('INVOICE_USE_SITUATION') ? $conf->global->INVOICE_USE_SITUATION : 0)); + $ret = $object->fetch($id, $ref, '', 0, (getDolGlobalString('INVOICE_USE_SITUATION') ? $conf->global->INVOICE_USE_SITUATION : 0)); } // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('invoicecontactcard', 'globalcard')); @@ -77,7 +78,7 @@ $usercancreate = $user->hasRight("facture", "creer"); * Actions */ -$parameters = array('id'=>$id); +$parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index cf8faf85f15..c3a18a0aa26 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -927,7 +927,7 @@ while ($i < $imaxinloop) { // Payment term if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print '
    '."\n"; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index dfc15d484b0..992fea6556d 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -570,6 +570,8 @@ if ($action == 'makepayment_confirm' && $user->hasRight('facture', 'paiement')) $result_sql = $db->query($rsql); if ($result_sql) { $numprlv = $db->num_rows($result_sql); + } else { + $numprlv = 0; } if ($numprlv > 0) { @@ -633,9 +635,11 @@ if ($socid > 0) { if (empty($search_company)) { $search_company = $soc->name; } +} else { + $soc = null; } -$title = $langs->trans('BillsCustomers').' '.($socid > 0 ? ' - '.$soc->name : ''); +$title = $langs->trans('BillsCustomers').' '.(($socid > 0 && $soc !== null) ? ' - '.$soc->name : ''); $help_url = 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; @@ -1341,7 +1345,7 @@ if (isModEnabled('category') && $user->hasRight("categorie", "lire") && ($user-> include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; $tmptitle = $langs->trans('IncludingProductWithTag'); - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 0, 0, 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
    '; } @@ -1509,7 +1513,7 @@ if (!empty($arrayfields['state.nom']['checked'])) { // Country if (!empty($arrayfields['country.code_iso']['checked'])) { print ''; } // Company type @@ -2051,10 +2055,10 @@ if ($num > 0) { $multicurrency_remaintopay = 0; } if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) { // If credit note closed, we take into account the amount not yet consumed - $remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id); + $remaincreditnote = $discount->getAvailableDiscounts($companystatic, null, 'rc.fk_facture_source='.$facturestatic->id); $remaintopay = -$remaincreditnote; $totalallpayments = price2num($facturestatic->total_ttc - $remaintopay); - $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($companystatic, '', 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1); + $multicurrency_remaincreditnote = $discount->getAvailableDiscounts($companystatic, null, 'rc.fk_facture_source='.$facturestatic->id, 0, 0, 1); $multicurrency_remaintopay = -$multicurrency_remaincreditnote; $multicurrency_totalpay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_remaintopay); } From 3c3a1193a58ab35b47901bd0a306ec738a66d285 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 18:08:53 +0100 Subject: [PATCH 069/139] Fix conf->global --- htdocs/compta/facture/class/facture.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 24b2fac72c6..0b6eacce4f3 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -361,15 +361,15 @@ class Facture extends CommonInvoice 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 210), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 215), 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 225), - 'situation_cycle_ref' => array('type' => 'smallint(6)', 'label' => 'Situation cycle ref', 'enabled' => '$conf->global->INVOICE_USE_SITUATION', 'visible' => -1, 'position' => 230), - 'situation_counter' => array('type' => 'smallint(6)', 'label' => 'Situation counter', 'enabled' => '$conf->global->INVOICE_USE_SITUATION', 'visible' => -1, 'position' => 235), - 'situation_final' => array('type' => 'smallint(6)', 'label' => 'Situation final', 'enabled' => 'empty($conf->global->INVOICE_USE_SITUATION) ? 0 : 1', 'visible' => -1, 'position' => 240), - 'retained_warranty' => array('type' => 'double', 'label' => 'Retained warranty', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 245), - 'retained_warranty_date_limit' => array('type' => 'date', 'label' => 'Retained warranty date limit', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 250), - 'retained_warranty_fk_cond_reglement' => array('type' => 'integer', 'label' => 'Retained warranty fk cond reglement', 'enabled' => '$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible' => -1, 'position' => 255), - 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 260), - 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 265), - 'date_pointoftax' => array('type' => 'date', 'label' => 'DatePointOfTax', 'enabled' => '$conf->global->INVOICE_POINTOFTAX_DATE', 'visible' => -1, 'position' => 270), + 'situation_cycle_ref' => array('type' => 'smallint(6)', 'label' => 'Situation cycle ref', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 230), + 'situation_counter' => array('type' => 'smallint(6)', 'label' => 'Situation counter', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 235), + 'situation_final' => array('type' => 'smallint(6)', 'label' => 'Situation final', 'enabled' => 'getDolGlobalInt("INVOICE_USE_SITUATION")', 'visible' => -1, 'position' => 240), + 'retained_warranty' => array('type' => 'double', 'label' => 'Retained warranty', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 245), + 'retained_warranty_date_limit' => array('type' => 'date', 'label' => 'Retained warranty date limit', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 250), + 'retained_warranty_fk_cond_reglement' => array('type' => 'integer', 'label' => 'Retained warranty fk cond reglement', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 255), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 260), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 265), + 'date_pointoftax' => array('type' => 'date', 'label' => 'DatePointOfTax', 'enabled' => 'isModEnabled("INVOICE_POINTOFTAX_DATE")', 'visible' => -1, 'position' => 270), 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 275), 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Currency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 280), 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'CurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 285, 'isameasure' => 1), From f51935a25895a70652f4bd408ce7a5bfeb17acde Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Sat, 16 Nov 2024 18:10:08 +0100 Subject: [PATCH 070/139] Fix slow user card when many users in same group, disable loading of all other users (#31947) --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 50002e10a25..edb98825159 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1940,7 +1940,7 @@ if ($action == 'create' || $action == 'adduserldap') $exclude = array(); $usergroup = new UserGroup($db); - $groupslist = $usergroup->listGroupsForUser($object->id); + $groupslist = $usergroup->listGroupsForUser($object->id, false); if (!empty($groupslist)) { From a602309e04572e30cb95f9001cd159978c0b69b1 Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Sat, 16 Nov 2024 18:19:59 +0100 Subject: [PATCH 071/139] Fix user::load_previous_next_ref() with MULTICOMPANY_TRANSVERSE_MODE bad sql query (cartesian product replaced by INNER JOIN) (#31946) --- htdocs/core/class/commonobject.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ee4a56eaa9c..0332a29c0ce 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1891,7 +1891,9 @@ abstract class CommonObject $sql = "SELECT MAX(te.".$fieldid.")"; $sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te"; if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; + if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) { + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user=te.rowid"; + } } if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { $tmparray = explode('@', $this->ismultientitymanaged); @@ -1916,7 +1918,6 @@ abstract class CommonObject if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql .= " AND te.entity IS NOT NULL"; // Show all users } else { - $sql .= " AND ug.fk_user = te.rowid"; $sql .= " AND ug.entity IN (".getEntity($this->element).")"; } } else { @@ -1944,7 +1945,9 @@ abstract class CommonObject $sql = "SELECT MIN(te.".$fieldid.")"; $sql .= " FROM ".(empty($nodbprefix) ?MAIN_DB_PREFIX:'').$this->table_element." as te"; if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $sql .= ",".MAIN_DB_PREFIX."usergroup_user as ug"; + if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) { + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user=te.rowid"; + } } if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) { $tmparray = explode('@', $this->ismultientitymanaged); @@ -1969,7 +1972,6 @@ abstract class CommonObject if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) { $sql .= " AND te.entity IS NOT NULL"; // Show all users } else { - $sql .= " AND ug.fk_user = te.rowid"; $sql .= " AND ug.entity IN (".getEntity($this->element).")"; } } else { From 8d580eaa5fdbce468a2dc65f0758a07748f6a417 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 18:39:54 +0100 Subject: [PATCH 072/139] Fix travis --- 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 0b6eacce4f3..d649b49108f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -369,7 +369,7 @@ class Facture extends CommonInvoice 'retained_warranty_fk_cond_reglement' => array('type' => 'integer', 'label' => 'Retained warranty fk cond reglement', 'enabled' => 'getDolGlobalString("INVOICE_USE_RETAINED_WARRANTY")', 'visible' => -1, 'position' => 255), 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 260), 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 265), - 'date_pointoftax' => array('type' => 'date', 'label' => 'DatePointOfTax', 'enabled' => 'isModEnabled("INVOICE_POINTOFTAX_DATE")', 'visible' => -1, 'position' => 270), + 'date_pointoftax' => array('type' => 'date', 'label' => 'DatePointOfTax', 'enabled' => 'getDolGlobalString("INVOICE_POINTOFTAX_DATE")', 'visible' => -1, 'position' => 270), 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 275), 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Currency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 280), 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'CurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 285, 'isameasure' => 1), From 830d0bebeb3298c5d5009768a18d68cf3da641d6 Mon Sep 17 00:00:00 2001 From: evarisk-kilyan Date: Sat, 16 Nov 2024 18:43:21 +0100 Subject: [PATCH 073/139] fix: replace isModEnabled with getDolGlobalString (#31955) Co-authored-by: Laurent Destailleur From 5aab1417144757351e1d424fb0da079dc0cb3c68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 18:48:08 +0100 Subject: [PATCH 074/139] Clean code --- htdocs/core/boxes/box_last_modified_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index f5c5c6b49d3..d10a3db50fd 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -58,7 +58,7 @@ class box_last_modified_ticket extends ModeleBoxes */ public function loadBox($max = 5) { - global $conf, $user, $langs; + global $user, $langs; $this->max = $max; From a811e061ca78ef9e1cac744fcc62eb6d7f4564cf Mon Sep 17 00:00:00 2001 From: evarisk-kilyan Date: Sat, 16 Nov 2024 18:58:24 +0100 Subject: [PATCH 075/139] fix: fatal on install step-5 (#31954) Co-authored-by: Laurent Destailleur --- htdocs/core/modules/DolibarrModules.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 57c2eb780f0..2eaef0842e9 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1606,6 +1606,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // phpcs:enable include_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; include_once DOL_DOCUMENT_ROOT . '/cron/class/cronjob.class.php'; + include_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; global $conf, $user; From 48f0f55b7c8b2bfd1a715793588302139f0b7f00 Mon Sep 17 00:00:00 2001 From: omogenot Date: Sat, 16 Nov 2024 20:13:40 +0100 Subject: [PATCH 076/139] NEW: Allow multiple extrafields deletion (#31956) * Allow multiple extrafields deletion If no element type parameter is given to the delete_label function, all occurences of the same extra field name are deleted at once. This simplifies the de-installation of a module that would have created multiple extra fields accros several element types. * Update extrafields.class.php Remove empty line whitespace --- htdocs/core/class/extrafields.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 65dfd9a94f8..1712b3aca53 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -619,7 +619,9 @@ class ExtraFields $sql = "DELETE FROM ".$this->db->prefix()."extrafields"; $sql .= " WHERE name = '".$this->db->escape($attrname)."'"; $sql .= " AND entity IN (0,".$conf->entity.')'; - $sql .= " AND elementtype = '".$this->db->escape($elementtype)."'"; + if (!empty($elementtype)) { + $sql .= " AND elementtype = '".$this->db->escape($elementtype)."'"; + } dol_syslog(get_class($this)."::delete_label", LOG_DEBUG); $resql = $this->db->query($sql); From 8642e77110023bb00b54a9c1b96aa35d2859aa79 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 16 Nov 2024 20:48:09 +0100 Subject: [PATCH 077/139] Accountancy personalized reports - Prepare menu (#31932) * Accountancy personalized reports - Prepare menu * Indent --- htdocs/core/menus/standard/eldy.lib.php | 37 +++++++++++++++++++++++-- htdocs/langs/en_US/accountancy.lang | 2 ++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index b0c55fd6364..8bfe214c523 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1702,7 +1702,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110); $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120); if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { - $newmenu->add("/accountancy/admin/report_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingReport"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 125); + $newmenu->add("/accountancy/admin/report_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingReport"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_report', 125); } $newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 130); } @@ -1844,7 +1844,40 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report", $langs->trans("MenuReportInOut"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report", $langs->trans("ByPredefinedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); - $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { + global $mysoc; + + // Multi personalized reports + $sql = "SELECT rowid, code, label"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_report"; + $sql .= " WHERE entity = ".((int) $conf->entity); + $sql .= " AND fk_country = ".((int) $mysoc->country_id); + $sql .= " AND active = 1"; + $sql .= " ORDER BY label DESC"; + + $resql = $db->query($sql); + if ($resql) { + $numr = $db->num_rows($resql); + $i = 0; + + if ($numr > 0) { + while ($i < $numr) { + $objp = $db->fetch_object($resql); + $newmenu->add('/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report&id_report='.$objp->rowid, $langs->trans("Personalized") . " - " . $objp->label, 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + $i++; + } + } else { + // Should not happen. Entries are added + $newmenu->add('', $langs->trans("NoReportDefined"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + } + } else { + dol_print_error($db); + } + $db->free($resql); + } else { + $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report", $langs->trans("ByPersonalizedAccountGroups"), 3, $user->hasRight('accounting', 'comptarapport', 'lire')); + } } $modecompta = 'CREANCES-DETTES'; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 8233f08c9dd..c4e8cfb2e9f 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -229,6 +229,8 @@ AccountingAccountGroupsDesc=You can define here some groups of accounting accoun ByAccounts=By accounts ByPredefinedAccountGroups=By predefined groups ByPersonalizedAccountGroups=By personalized groups +Personalized=Personalized +NoReportDefined=No personalized reports defined NotMatch=Not Set DeleteMvt=Delete some lines from accounting DelMonth=Month to delete From 73171867e0e7b55b90b8404b42f7c372539639a1 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 16 Nov 2024 20:58:09 +0100 Subject: [PATCH 078/139] Accountancy personalized reports - Prepare report page (#31935) --- .../class/accountancycategory.class.php | 4 +++- htdocs/compta/resultat/result.php | 14 +++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 0bf41cf2e42..d71dc306478 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -775,10 +775,11 @@ class AccountancyCategory // extends CommonObject * * @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups * @param int $active 1= active, 0=not active + * @param int $id_report id of the report * @return never|array|int Array of groups or -1 if error * @see getCatsCpts(), getCptsCat() */ - public function getCats($categorytype = -1, $active = 1) + public function getCats($categorytype = -1, $active = 1, $id_report = 1) { global $conf, $mysoc; @@ -790,6 +791,7 @@ class AccountancyCategory // extends CommonObject $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens"; $sql .= " FROM ".$this->db->prefix().$this->table_element." as c"; $sql .= " WHERE c.active = " . (int) $active; + $sql .= " AND c.fk_report=".((int) $id_report); $sql .= " AND c.entity = ".$conf->entity; if ($categorytype >= 0) { $sql .= " AND c.category_type = 1"; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 5d20a92b03d..a021c95cfab 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyreport.class.php'; /** * @var Conf $conf @@ -45,6 +46,8 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy')); +$id_report = GETPOSTINT('id_report'); + $error = 0; $mesg = ''; @@ -238,7 +241,12 @@ if ($modecompta == "CREANCES-DETTES") { $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "BOOKKEEPING") { - $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups"); + $accountingreportstatic = new AccountancyReport($db); + $accountingreportstatic->fetch($id_report); + $reportLabel = ''; + $reportLabel = $accountingreportstatic->label; + + $name = $langs->trans("ReportInOut").', '.$langs->trans("ByPersonalizedAccountGroups").' '.$reportLabel; $calcmode = $langs->trans("CalcModeBookkeeping"); //$calcmode.='
    ('.$langs->trans("SeeReportInDueDebtMode",'','').')'; //$calcmode.='
    ('.$langs->trans("SeeReportInInputOutputMode",'','').')'; @@ -292,8 +300,8 @@ if ($modecompta == 'CREANCES-DETTES') { // $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } elseif ($modecompta == "BOOKKEEPING") { // Get array of all report groups that are active - $cats = $AccCat->getCats(); // WARNING: Computed groups must be after group they include - $unactive_cats = $AccCat->getCats(-1, 0); + $cats = $AccCat->getCats(-1, 1, $id_report); // WARNING: Computed groups must be after group they include + $unactive_cats = $AccCat->getCats(-1, 0, $id_report); /* $sql = 'SELECT DISTINCT t.numero_compte as nb FROM '.MAIN_DB_PREFIX.'accounting_bookkeeping as t, '.MAIN_DB_PREFIX.'accounting_account as aa'; From a6266ce664a644e556365b9854ff462ebd437a53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 22:22:49 +0100 Subject: [PATCH 079/139] Try to discard a false positive of phpstan --- phpstan.neon.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 5d7e7bd30f1..ba219466cea 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -51,6 +51,7 @@ parameters: treatPhpDocTypesAsCertain: false ignoreErrors: - '#.*phan-var#' + - '#Right side of && is always true#' internalErrorsCountLimit: 50 cache: # nodesByFileCountMax: 512 From ab9c7f9a31483e169c19d17c75b7f376849ca946 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 22:31:40 +0100 Subject: [PATCH 080/139] Try to exclude phpstan false positive --- phpstan.neon.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ba219466cea..e469fffd923 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -51,6 +51,7 @@ parameters: treatPhpDocTypesAsCertain: false ignoreErrors: - '#.*phan-var#' + - '#is always true#' - '#Right side of && is always true#' internalErrorsCountLimit: 50 cache: From f4899904420d19a21ef4b532692dbd8527effd30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 22:42:21 +0100 Subject: [PATCH 081/139] Try to solve false positive of phpstan --- build/phpstan/phpstan-baseline.neon | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index fcd41ac896b..d6085a40913 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -36294,12 +36294,6 @@ parameters: count: 1 path: ../../htdocs/webhook/target_card.php - - - message: '#^Right side of && is always true\.$#' - identifier: booleanAnd.rightAlwaysTrue - count: 6 - path: ../../htdocs/webhook/target_card.php - - message: '#^Variable \$permissiontoadd in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable From e866f90b122180f6e7b8a22de4bfdac347b733d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 22:51:35 +0100 Subject: [PATCH 082/139] Compatible php 8.3 --- htdocs/install/check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 0ea1ec87528..76cdc282233 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -108,7 +108,7 @@ if (empty($force_install_nophpinfo)) { print "
    \n"; // Check PHP version max -$arrayphpmaxversionwarning = array(8, 2, 0); +$arrayphpmaxversionwarning = array(8, 3, 0); if (versioncompare(versionphparray(), $arrayphpmaxversionwarning) > 0 && versioncompare(versionphparray(), $arrayphpmaxversionwarning) < 3) { // Maximum to use (warning if higher) print 'Error '.$langs->trans("ErrorPHPVersionTooHigh", versiontostring($arrayphpmaxversionwarning)); $checksok = 1; // 0=error, 1=warning From cbdda5d1a8efd4b3bbf7f867b5b070ed028f8074 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Nov 2024 23:23:14 +0100 Subject: [PATCH 083/139] Fix the automatic nb of list --- htdocs/core/class/conf.class.php | 7 +++++-- htdocs/main.inc.php | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index a86f0551bab..02e4d63e5f0 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -951,11 +951,14 @@ class Conf extends stdClass } // conf->liste_limit = constant to limit size of lists + // This value can be overwritten by user choice in main.inc.php $this->liste_limit = getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT', 15); if ((int) $this->liste_limit <= 0) { - // Mode automatic. + // Mode automatic. Similar code than into main.inc.php $this->liste_limit = 15; - if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { + if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 700) { + $this->liste_limit = 8; + } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { $this->liste_limit = 10; } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] > 1130) { $this->liste_limit = 20; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 24cb4211074..53cdffdb145 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1405,9 +1405,11 @@ if (!defined('NOLOGIN')) { $conf->liste_limit = getDolUserInt('MAIN_SIZE_LISTE_LIMIT'); // Can be 0 } if ((int) $conf->liste_limit <= 0) { - // Mode automatic. + // Mode automatic. Similar code than into conf.class.php $conf->liste_limit = 15; - if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { + if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 700) { + $conf->liste_limit = 8; + } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { $conf->liste_limit = 10; } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] > 1130) { $conf->liste_limit = 20; From a960be440bf7d88de3246cb0577f7841d354143d Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Sun, 17 Nov 2024 00:06:33 +0100 Subject: [PATCH 084/139] FIX: All contacts were loaded even if no thirdparty was selected (#31877) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * FIX: All contact were loaded even if no thirdparty selected * Update card.php --------- Co-authored-by: Noé Co-authored-by: Laurent Destailleur --- htdocs/comm/action/card.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 2b004f0ff10..3076f3d4854 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -2067,7 +2067,27 @@ if ($id > 0) { // related contact print '
    '; print ''; From 860e1b779fcfb44728d27a0813fc90d6612b3406 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 17 Nov 2024 01:09:56 +0100 Subject: [PATCH 085/139] Fix vCard output #31958 (#31959) Fix #31958 - avoid messing up ENCODIGN & add CHARSET Workaround by limiting the too generic replacement for social networks. Add CHARSET for proper decoding. --- htdocs/core/class/vcard.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index 9e68c6669c5..d447c0b7010 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -2,6 +2,7 @@ /* Copyright (C) Kai Blankenhorn * Copyright (C) 2005-2017 Laurent Destailleur * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2024 MDW * * 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 @@ -100,7 +101,7 @@ class vCard /** * @var string encoding */ - public $encoding = "ENCODING=QUOTED-PRINTABLE"; + public $encoding = "CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE"; /** @@ -163,7 +164,7 @@ class vCard public function setName($family = "", $first = "", $additional = "", $prefix = "", $suffix = "") { //$this->properties["N;".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix); - $this->properties["N"] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix); + $this->properties["N;".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix); $this->filename = "$first%20$family.vcf"; if (empty($this->properties["FN"])) { $this->setFormattedName(trim("$prefix $first $additional $family $suffix")); @@ -211,7 +212,7 @@ class vCard $this->properties[$key] = encode($postoffice).";".encode($extended).";".encode($street).";".encode($city).";".encode($region).";".encode($zip).";".encode($country); //if ($this->properties["LABEL;".$type.";".$this->encoding] == '') { - //$this->setLabel($postoffice, $extended, $street, $city, $region, $zip, $country, $type); + //$this->setLabel($postoffice, $extended, $street, $city, $region, $zip, $country, $type); //} } @@ -362,7 +363,7 @@ class vCard $text .= "VERSION:4.0\r\n"; // With V4, all encoding are UTF-8 //$text.= "VERSION:2.1\r\n"; foreach ($this->properties as $key => $value) { - $newkey = preg_replace('/-.*$/', '', $key); // remove suffix -twitter, -facebook, ... + $newkey = preg_replace('/(? Date: Sun, 17 Nov 2024 01:16:29 +0100 Subject: [PATCH 086/139] Fix phpstan --- htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index fa4b09bd26f..6ce3e174457 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -1190,7 +1190,7 @@ class MyObject extends CommonObject * Return validation test result for a field. * Need MAIN_ACTIVATE_VALIDATION_RESULT to be called. * - * @param array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> $fields Array of properties of field to show + * @param array|string,position:int,notnull?:int,visible:int<-2,5>|string,noteditable?:int<0,1>,default?:int<0,1>|string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array,comment?:string,validate?:int<0,1>}> $fields Array of properties of field to show * @param string $fieldKey Key of attribute * @param string $fieldValue value of attribute * @return bool Return false if fail, true on success, set $this->error for error message From ceaeabb115307aa1dbc2958a20221bc079b789a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 01:27:33 +0100 Subject: [PATCH 087/139] FIX #22539 #31900 --- htdocs/core/lib/pdf.lib.php | 12 ++++++------ .../modules/commande/doc/pdf_eratosthene.modules.php | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1fdc37aa211..566c3707443 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -2647,10 +2647,9 @@ function pdf_getLinkedObjects(&$object, $outputlangs) */ function pdf_getSizeForImage($realpath) { - global $conf; - $maxwidth = getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH', 20); $maxheight = getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_HEIGHT', 32); + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; $tmp = dol_getImageSize($realpath); $width = 0; @@ -2674,17 +2673,18 @@ function pdf_getSizeForImage($realpath) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int<0,2> $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @return float|string Return total of line excl tax + * @return int|float|string Return total of line excl tax */ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = 0) { - global $conf, $hookmanager; + global $hookmanager; $sign = 1; if (isset($object->type) && $object->type == 2 && getDolGlobalString('INVOICE_POSITIVE_CREDIT_NOTE')) { $sign = -1; } if ($object->lines[$i]->special_code == 3) { + // If option return $outputlangs->transnoentities("Option"); } else { if (is_object($hookmanager)) { @@ -2704,7 +2704,7 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = if ($hookmanager->executeHooks('getlinetotalremise', $parameters, $object, $action) > 0) { // Note that $action and $object may have been modified by some hooks if (isset($hookmanager->resArray['linetotalremise'])) { - return $hookmanager->resArray['linetotalremise']; + return (float) $hookmanager->resArray['linetotalremise']; } else { return (float) $hookmanager->resPrint; // For backward compatibility } @@ -2712,7 +2712,7 @@ function pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails = } if (empty($hidedetails) || $hidedetails > 1) { - return $sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht); + return (float) price2num($sign * (($object->lines[$i]->subprice * (float) $object->lines[$i]->qty) - $object->lines[$i]->total_ht), 'MT', 1); } } return 0; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 4cef49bc129..9a371ccb0a2 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1158,6 +1158,8 @@ class pdf_eratosthene extends ModelePDFCommandes $total_line_remise += -$line->total_ht; } } + $total_line_remise = (float) price2num($total_line_remise, 'MT', 1); + if ($total_line_remise > 0) { $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl); From 6485d02de286d24e5b84dc617e7a805e17e50d8b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 01:40:32 +0100 Subject: [PATCH 088/139] Fix missing migration in v20 --- htdocs/install/mysql/migration/20.0.0-21.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql index 1a052915748..b823e23f6f8 100644 --- a/htdocs/install/mysql/migration/20.0.0-21.0.0.sql +++ b/htdocs/install/mysql/migration/20.0.0-21.0.0.sql @@ -47,6 +47,8 @@ ALTER TABLE llx_c_holiday_types ADD UNIQUE INDEX uk_c_holiday_types (entity, cod ALTER TABLE llx_hrm_evaluation MODIFY COLUMN modelpdf varchar(255) DEFAULT NULL; +-- Add ref_ext to asset_model to use various CommonOjbect methods +ALTER TABLE llx_asset_model ADD COLUMN ref_ext varchar(255) AFTER ref; -- V21 migration From da70b46647671c3ba3f483e089ee5a1cb0507c42 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sun, 17 Nov 2024 01:43:43 +0100 Subject: [PATCH 089/139] FIX: asset: missing ref_ext field used in CommonObject::isExistingObject() (#31870) --- htdocs/asset/class/assetmodel.class.php | 1 + htdocs/install/mysql/migration/19.0.0-20.0.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_asset_model-asset.sql | 1 + 3 files changed, 6 insertions(+) diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 0e457761f9d..208e90efa50 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -94,6 +94,7 @@ class AssetModel extends CommonObject public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'validate' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 25, 'notnull' => 0, 'visible' => 0), 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2', 'validate' => 1,), 'asset_type' => array('type' => 'smallint', 'label' => 'AssetType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array('0' => 'AssetTypeIntangible', '1' => 'AssetTypeTangible', '2' => 'AssetTypeInProgress', '3' => 'AssetTypeFinancial'), 'validate' => 1,), 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 300, 'notnull' => 0, 'visible' => 0, 'validate' => 1,), diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index 65901dcd91e..b2397e2069c 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -420,3 +420,7 @@ UPDATE llx_c_units SET short_label = 'mn' WHERE short_label = 'i' AND code = 'MI ALTER TABLE llx_c_holiday_types DROP INDEX uk_c_holiday_types; ALTER TABLE llx_c_holiday_types ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_c_holiday_types ADD UNIQUE INDEX uk_c_holiday_types (entity, code); + + +-- Add ref_ext to asset_model to use various CommonOjbect methods +ALTER TABLE llx_asset_model ADD COLUMN ref_ext varchar(255) AFTER ref; diff --git a/htdocs/install/mysql/tables/llx_asset_model-asset.sql b/htdocs/install/mysql/tables/llx_asset_model-asset.sql index 8c285515986..9a264204e58 100644 --- a/htdocs/install/mysql/tables/llx_asset_model-asset.sql +++ b/htdocs/install/mysql/tables/llx_asset_model-asset.sql @@ -25,6 +25,7 @@ CREATE TABLE llx_asset_model( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id ref varchar(128) NOT NULL, + ref_ext varchar(255), label varchar(255) NOT NULL, asset_type smallint NOT NULL, fk_pays integer DEFAULT 0, From fc565e6b76b0e497bc311fa207d34fb2f67e73cf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 02:03:13 +0100 Subject: [PATCH 090/139] Look and feel v21 --- htdocs/user/param_ihm.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index abcc5511bdb..df2897a86cf 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -92,6 +92,7 @@ $searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$lan $form = new Form($db); $formadmin = new FormAdmin($db); + /* * Actions */ @@ -379,9 +380,9 @@ if ($action == 'edit') { // Language by default print ''; print ''; print ''; $mainsizelistelimit = getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT'); - print ''; + print ''; print ''; print ''; - // Max size of lists + // Max size of short lists print ''; print ''; print ''; print ''; print ''; print ''; $mainsizelistelimit = getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT'); - print ''; + print ''; print ''; print ''; - // Max size for lists + // Max size for short lists print ''; print ''; print ''; From 63011d3029cc242ef8e43b0658a629a89c7134d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 02:15:53 +0100 Subject: [PATCH 091/139] Debug v21 --- htdocs/hrm/skill_tab.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php index 1c8d60d0d62..c933765fdef 100644 --- a/htdocs/hrm/skill_tab.php +++ b/htdocs/hrm/skill_tab.php @@ -611,15 +611,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $sql .= " WHERE e.rowid = ed.fk_evaluation"; $sql .= " AND s.rowid = ed.fk_skill"; $sql .= " AND e.fk_user = ".((int) $id); - $sql .= " AND e.status > 0"; + $resql = $db->query($sql); $num = $db->num_rows($resql); //num of evaluations for each user - $sqlEval = "SELECT rowid FROM ".MAIN_DB_PREFIX."hrm_evaluation as e"; + $sqlEval = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."hrm_evaluation as e"; $sqlEval .= " WHERE e.fk_user = ".((int) $id); $rslt = $db->query($sqlEval); - $numEval = $db->num_rows($rslt); + $tmpobj = $db->fetch_object($rslt); + $numEval = 0; + if ($tmpobj) { + $numEval = $tmpobj->nb; + } $page = 0; print_barre_liste($langs->trans("Evaluations"), $page, $_SERVER["PHP_SELF"], '', '', '', '', $numEval, $numEval, $evaltmp->picto, 0); @@ -646,6 +650,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $objects[$i] = $obj; $i++; } + //grouped skills by evaluation $resultArray = getGroupedEval($objects); foreach ($resultArray as $object) { @@ -673,12 +678,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $evaltmp->getLibStatut(2); print ''; print ''; From b2bad15a046d13594efd463fcf10fe899e2eb736 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 02:25:37 +0100 Subject: [PATCH 092/139] CSS --- htdocs/contact/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index f6aedacb6bf..e4831263aff 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1600,7 +1600,7 @@ while ($i < $imaxinloop) { // EMail if (!empty($arrayfields['p.email']['checked'])) { - print ''; print ''; print ''; print ''; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 1bf6c6f207f..eb867663795 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -640,10 +640,11 @@ function ajax_event($htmlname, $events) * @param string $mode Add parameter &mode= to the href link (Used for href link) * @param string $morecss More CSS * @param int $userconst 1=OnOff for user constant of user $userconst + * @param string $showwarning String to show a warning when enabled the option * @return string * @see ajax_object_onoff() to update the status of an object */ -function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '', $morecss = 'inline-block', $userconst = 0) +function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '', $morecss = 'inline-block', $userconst = 0, $showwarning = '') { global $conf, $langs, $user; @@ -672,9 +673,13 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof var yesButton = \''.dol_escape_js($langs->transnoentities("Yes")).'\'; var noButton = \''.dol_escape_js($langs->transnoentities("No")).'\'; var token = \''.currentToken().'\'; + var warning = \''.dol_escape_js($showwarning).'\'; // Set constant $("#set_" + code).click(function() { + if (warning) { + alert(warning); + } if (input.alert && input.alert.set) { if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton; if (input.alert.set.noButton) noButton = input.alert.set.noButton; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 238d6185f15..4bbbf0ec069 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2593,4 +2593,5 @@ Decrypt=Decrypt FilesIntegrityDesc=If you want to check the integrity of files instead of database, you can do it by using this tool. AttributeCodeHelp=A code of your choice (without special char and space) to identify the property.
    Note that if an object B is created from an existing object A that has a different type (for example creation of an invoice from an order), the value of the complementary attributes of A are also copied into the complementary attributes of B when the code of the attribute is the same. ThereIsMoreThanXAnswers=There is more than %s answers with your filter. Please add more filters... -PdfAddTermOfSaleHelp=Upload the condition of sales from file input at the bottom of this setup page \ No newline at end of file +PdfAddTermOfSaleHelp=Upload the condition of sales from file input at the bottom of this setup page +WarningOnlineSignature=Please note that this function allows a user (customer, supplier, ...) to insert, online, the image of his signature in the PDF document. As for a handwritten signature, such a signature can be made by anyone and does not have the same legal value as a legal electronic signature system going through a paying trusted third party. If you need this level of security, you can contact an integrator for more information or check for addons on www.dolistore.org. From a746c6aab0525550e9a93903e7c890bd5d9b2631 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 13:20:55 +0100 Subject: [PATCH 099/139] Show a legal warning when enabling online signature --- htdocs/admin/bank.php | 18 ++++++++---------- htdocs/admin/contract.php | 18 +++++++++++------- htdocs/admin/expedition.php | 2 +- htdocs/langs/en_US/admin.lang | 2 +- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 9ce6cbdf83e..b8d13476e4e 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -499,13 +499,13 @@ print load_fiche_titre($langs->trans("Other"), '', ''); print '
    '; print '
    '; - $form->form_conditions_reglement('', $objp->fk_cond_reglement, 'none'); + $form->form_conditions_reglement(0, $objp->fk_cond_reglement, 'none'); print ''; - print $form->select_country($search_country, 'search_country', '', 0, 'minwidth150imp maxwidth150', 'code2', 1, 0, 1, null, 1); + print $form->select_country($search_country, 'search_country', '', 0, 'minwidth150imp maxwidth150', 'code2', 1, 0, 1, array(), 1); print '
    '.$langs->trans("ActionOnContact").''; print '
    '; - print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(!getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, array(), 'multiple', 'contactid'); + + $searchSocid = ($object->socid > 0) ? $object->socid : (getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : -1); + + print img_picto('', 'contact', 'class="paddingrightonly"'); + print $form->selectcontacts( + $searchSocid, + array_keys($object->socpeopleassigned), + 'socpeopleassigned[]', + 1, + '', + '', + 1, + 'minwidth300 widthcentpercentminusx', + false, + 0, + 0, + array(), + 'multiple', + 'contactid' + ); + print '
    '; print '
    '.$langs->trans("Language").''; - $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); + $s = picto_from_langcode(getDolGlobalString('MAIN_LANG_DEFAULT')); print $s ? $s.' ' : ''; - print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_" . getDolGlobalString('MAIN_LANG_DEFAULT'))); + print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $form->textwithpicto($langs->trans("Automatic"), $langs->trans("AutoDetectLang")) : $langs->trans("Language_" . getDolGlobalString('MAIN_LANG_DEFAULT'))); print 'conf->MAIN_LANG_DEFAULT) ? " checked" : ""); print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo @@ -426,13 +427,13 @@ if ($action == 'edit') { // Max size of lists print '
    '.$langs->trans("MaxSizeList").''.($mainsizelistelimit > 0 ? getDolGlobalString('MAIN_SIZE_LISTE_LIMIT') : ''.$langs->trans("Automatic").'').''.($mainsizelistelimit > 0 ? getDolGlobalString('MAIN_SIZE_LISTE_LIMIT') : ''.$langs->trans("Automatic").'').'conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : ""); print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo print '>
    '.$langs->trans("MaxSizeShortList").'' . getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT').'conf->MAIN_SIZE_SHORTLIST_LIMIT) ? " checked" : ""); @@ -501,9 +502,9 @@ if ($action == 'edit') { // Language print '
    '.$langs->trans("Language").''; - $s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); + $s = picto_from_langcode(getDolGlobalString('MAIN_LANG_DEFAULT')); print($s ? $s.' ' : ''); - print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $langs->trans("AutoDetectLang") : $langs->trans("Language_" . getDolGlobalString('MAIN_LANG_DEFAULT'))); + print(getDolGlobalString('MAIN_LANG_DEFAULT') == 'auto' ? $form->textwithpicto($langs->trans("Automatic"), $langs->trans("AutoDetectLang")) : $langs->trans("Language_" . getDolGlobalString('MAIN_LANG_DEFAULT'))); print 'conf->MAIN_LANG_DEFAULT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").''; @@ -568,11 +569,11 @@ if ($action == 'edit') { // Max size for lists print '
    '.$langs->trans("MaxSizeList").''.($mainsizelistelimit > 0 ? getDolGlobalString('MAIN_SIZE_LISTE_LIMIT') : ''.$langs->trans("Automatic").'').''.($mainsizelistelimit > 0 ? getDolGlobalString('MAIN_SIZE_LISTE_LIMIT') : ''.$langs->trans("Automatic").'').'conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").''.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : ' ').'
    '.$langs->trans("MaxSizeShortList").''.getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT', ' ').'conf->MAIN_SIZE_SHORTLIST_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").''; - - if (!is_array($object)) { - print $object->result; - } else { - foreach ($object as $skill) { - print $skill->result; + if ($job->status == $job::STATUS_VALIDATED) { + if (!is_array($object)) { + print $object->result; + } else { + foreach ($object as $skill) { + print $skill->result; + } } } print ''; + print ''; if ($contextpage == 'poslist') { print $obj->email; } else { @@ -1640,7 +1640,7 @@ while ($i < $imaxinloop) { // Company / Third Party if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; if ($obj->socid) { $objsoc = new Societe($db); $objsoc->fetch($obj->socid); From 7ca9f0022aeee2939955f48452ac212f86a903a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 10:31:11 +0100 Subject: [PATCH 093/139] Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 --- htdocs/commande/card.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 7128688a7cc..7002ba580eb 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -871,17 +871,17 @@ if (empty($reshook)) { // Set unit price to use if (!empty($price_ht) || $price_ht === '0') { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); + $pu_ht = (float) price2num($price_ht, 'MU'); + $pu_ttc = (float) price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } elseif (!empty($price_ttc) || $price_ttc === '0') { - $pu_ttc = price2num($price_ttc, 'MU'); - $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); + $pu_ttc = (float) price2num($price_ttc, 'MU'); + $pu_ht = (float) price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } elseif ($tmpvat != $tmpprodvat) { // Is this still used ? if ($price_base_type != 'HT') { - $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); + $pu_ht = (float) price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } else { - $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); + $pu_ttc = (float) price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } From 72fda5eeb38ac11e81b015387e23c3bc40eaf569 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 14:13:51 +0100 Subject: [PATCH 094/139] Debug v21 --- htdocs/core/modules/hrm/mod_evaluation_advanced.php | 4 ++-- htdocs/recruitment/admin/setup.php | 7 +++---- .../recruitment/mod_recruitmentcandidature_advanced.php | 4 ++-- .../recruitment/mod_recruitmentjobposition_advanced.php | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/hrm/mod_evaluation_advanced.php b/htdocs/core/modules/hrm/mod_evaluation_advanced.php index 9482b998962..de221e52fee 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_advanced.php +++ b/htdocs/core/modules/hrm/mod_evaluation_advanced.php @@ -71,7 +71,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation $texte .= ''; $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= '
    '; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Evaluation"), $langs->transnoentities("Evaluation")); $tooltip .= $langs->trans("GenericMaskCodes2"); @@ -84,7 +84,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php index b641c23432d..d2bf9e12306 100644 --- a/htdocs/recruitment/admin/setup.php +++ b/htdocs/recruitment/admin/setup.php @@ -229,7 +229,7 @@ if ($action == 'edit') { } else { if (!empty($arrayofparameters)) { print '
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
    '; - print ''; + print ''; foreach ($arrayofparameters as $key => $val) { $setupnotempty++; @@ -251,9 +251,7 @@ if ($action == 'edit') { foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if ($myTmpObjectArray['includerefgeneration']) { - /* - * Orders Numbering model - */ + // Numbering models $setupnotempty++; print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', ''); @@ -278,6 +276,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { while (($file = readdir($handle)) !== false) { if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') { $file = substr($file, 0, dol_strlen($file) - 4); + print ''."\n"; require_once $dir.'/'.$file.'.php'; $module = new $file($db); diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php index 95503767c91..e5feff9f403 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/recruitment/mod_recruitmentcandidaturen_advanced.php + * \file htdocs/core/modules/recruitment/mod_recruitmentcandidature_advanced.php * \ingroup recruitment * \brief File containing class for advanced numbering model of RecruitmentCandidature */ @@ -84,7 +84,7 @@ class mod_recruitmentcandidature_advanced extends ModeleNumRefRecruitmentCandida $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php index 28b5b161c5b..e7d6b1d918c 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php @@ -84,7 +84,7 @@ class mod_recruitmentjobposition_advanced extends ModeleNumRefRecruitmentJobPosi $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; From 7d5e6e9f729b499e547e9385f179c7367618315e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 15:04:00 +0100 Subject: [PATCH 095/139] FIX PHP 7.0 compatibility --- .../vendor/illuminate/collections/Traits/EnumeratesValues.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Traits/EnumeratesValues.php b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Traits/EnumeratesValues.php index 269d1a66656..7d6d4e70100 100644 --- a/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Traits/EnumeratesValues.php +++ b/htdocs/includes/webklex/php-imap/vendor/illuminate/collections/Traits/EnumeratesValues.php @@ -736,7 +736,7 @@ trait EnumeratesValues function ($carry, $pipe) { return $pipe($carry); }, - $this, + $this ); } From 07bd12717a404e9b0ea12b2caff734a2944d2593 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 12:15:47 +0100 Subject: [PATCH 096/139] Fix look and feel v21 --- htdocs/admin/propal.php | 28 +++------- htdocs/admin/tools/ui/content/tables.php | 70 +++++++++++++++++++----- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 09ddd0877ae..2a0a8cdfcde 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -718,35 +718,21 @@ print '
    '; - -/* - * Directory - */ -print '
    '; -print load_fiche_titre($langs->trans("PathToDocuments"), '', ''); - -print "
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '.$langs->trans("Parameter").'
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
    \n"; -print "\n"; -print " \n"; -print " \n"; -print "\n"; -print "\n \n \n\n"; print "
    ".$langs->trans("Name")."".$langs->trans("Value")."
    ".$langs->trans("PathDirectory")."".$conf->propal->multidir_output[$conf->entity]."
    \n
    "; +print '

    '; + + /* - * Notifications + * Other */ -print load_fiche_titre($langs->trans("Notifications"), '', ''); print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; -print '\n \n \n\n"; + +print '\n"; diff --git a/htdocs/admin/tools/ui/content/tables.php b/htdocs/admin/tools/ui/content/tables.php index a39ac89d44b..00fd9bbf666 100644 --- a/htdocs/admin/tools/ui/content/tables.php +++ b/htdocs/admin/tools/ui/content/tables.php @@ -62,7 +62,7 @@ $documentation->showSidebar(); ?>

    trans('DocTableTitle'); ?>

    -

    trans('DocTableMainDescription'); ?>

    +

    trans('Description'); ?>

    showSummary(); ?> @@ -70,37 +70,37 @@ $documentation->showSidebar(); ?>
    -

    trans('DocTableBasic'); ?>

    +

    Table with a title line

    trans('DocTableBasicDescription'); ?>

    -
    '.$langs->trans("Parameter").' 
    '; +print "
    ".$langs->trans("PathToDocuments")."".$conf->propal->multidir_output[$conf->entity]."
    '; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
    '; print '
    '; print "
    +
    - + - + - + - + @@ -115,15 +115,15 @@ $documentation->showSidebar(); ?> echo $documentation->showCode($lines); ?> - +
    -

    trans('DocTableWithFilters'); ?>

    +

    Table with a filter line and title line

    trans('DocTableWithFiltersDescription'); ?>

    -
    First Name Last Name Age Country
    John Doe 37 U.S.A
    Jack Sparrow 29 Caribbean
    Sacha Ketchum 16 Kanto
    Albert Einstein 72
    +
    @@ -136,25 +136,25 @@ $documentation->showSidebar(); ?> - + - + - + - + @@ -170,6 +170,48 @@ $documentation->showSidebar(); ?> + +
    + +

    Table with no filter, no title line

    + +

    trans('Description'); ?>

    +
    +
    +
    Age Country
    John Doe 37 U.S.A
    Jack Sparrow 29 Caribbean
    Sacha Ketchum 16 Kanto
    Albert Einstein 72
    + + + + + + + + + + + + + + + + + + + + + + + + +
    JohnDoe37U.S.A
    JackSparrow29Caribbean
    SachaKetchum16Kanto
    AlbertEinstein72Germany
    + + + showCode($lines); ?> + + From e06bf7c145db2a02c7ac45946c4dc63089399047 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 12:19:17 +0100 Subject: [PATCH 097/139] Clean code --- htdocs/admin/tools/ui/class/documentation.class.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/admin/tools/ui/class/documentation.class.php b/htdocs/admin/tools/ui/class/documentation.class.php index f7f00b5dc52..584f6c36a7f 100644 --- a/htdocs/admin/tools/ui/class/documentation.class.php +++ b/htdocs/admin/tools/ui/class/documentation.class.php @@ -26,7 +26,6 @@ */ class Documentation { - /** * Views * @@ -206,7 +205,7 @@ class Documentation */ public function docFooter() { - global $conf, $langs; + global $langs; // DIV FOR SCROLL ANIMATION print '
    '; @@ -320,9 +319,6 @@ class Documentation */ public function showSummary($showsubmenu = 1, $showsubmenu_summary = 1) { - - global $langs; - $i = 0; if (!empty($this->view)) : // On se place au bon niveau From d9d97c4eb386cf361b830a1af078b1469f721a75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 12:52:49 +0100 Subject: [PATCH 098/139] Add a lega linformation on online signature --- htdocs/admin/propal.php | 2 +- htdocs/core/lib/ajax.lib.php | 7 ++++++- htdocs/langs/en_US/admin.lang | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 2a0a8cdfcde..5b68c10a838 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -677,7 +677,7 @@ print '
    '.$langs->trans("AllowOnLineSign").''; -print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1); +print ajax_constantonoff('PROPOSAL_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); print '
    '."\n"; print ''."\n"; -print ''; -print ''; -print '\n"; +print ''; +print "\n"; print "\n"; +// Disable direct input print ''; -print ''; +print ''; if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) { print ''; -print ''; // Active @@ -539,10 +538,9 @@ print "\n"; // Allow SEPA Mandate OnLine Sign if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT')) { print ''; - print ''; - print ''; + print ''; print ''; } diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index d850d5f6eb3..f60f8cb8d44 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -540,14 +540,18 @@ print ''; print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index f18c2c4b7bd..45c74c98523 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -487,7 +487,7 @@ print ''; print ''; print ''; print '
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Parameter").'
    '.$langs->trans("BANK_DISABLE_DIRECT_INPUT").''.$langs->trans("BANK_DISABLE_DIRECT_INPUT").''; print img_picto($langs->trans("Activated"), 'switch_on'); @@ -517,9 +517,8 @@ if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) { } print '
    '; -print $langs->trans('AccountStatement'); -print "\n"; +// Autofill bank statement +print '
    '."\n"; print $langs->trans('AutoReportLastAccountStatement'); print '
    '.$langs->trans("AllowOnLineSign").''.$langs->trans("AllowOnLineSignDesc").''.$form->textwithpicto($langs->trans("AllowOnLineSign"), $langs->trans("AllowOnLineSignDesc")).''; - print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1); + print ajax_constantonoff('SOCIETE_RIB_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); print '
    '.$langs->trans("AllowOnlineSign").''; -if (getDolGlobalString('CONTRACT_ALLOW_ONLINESIGN')) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('CONTRACT_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + if (getDolGlobalString('CONTRACT_ALLOW_ONLINESIGN')) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } } print '
    '.$langs->trans("AllowOnLineSign"); print ''; -print ajax_constantonoff('EXPEDITION_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1); +print ajax_constantonoff('EXPEDITION_ALLOW_ONLINESIGN', array(), null, 0, 0, 0, 2, 0, 1, '', '', 'inline-block', 0, $langs->trans("WarningOnlineSignature")); print '
    '; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4bbbf0ec069..9648aa4f2e1 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2594,4 +2594,4 @@ FilesIntegrityDesc=If you want to check the integrity of files instead of databa AttributeCodeHelp=A code of your choice (without special char and space) to identify the property.
    Note that if an object B is created from an existing object A that has a different type (for example creation of an invoice from an order), the value of the complementary attributes of A are also copied into the complementary attributes of B when the code of the attribute is the same. ThereIsMoreThanXAnswers=There is more than %s answers with your filter. Please add more filters... PdfAddTermOfSaleHelp=Upload the condition of sales from file input at the bottom of this setup page -WarningOnlineSignature=Please note that this function allows a user (customer, supplier, ...) to insert, online, the image of his signature in the PDF document. As for a handwritten signature, such a signature can be made by anyone and does not have the same legal value as a legal electronic signature system going through a paying trusted third party. If you need this level of security, you can contact an integrator for more information or check for addons on www.dolistore.org. +WarningOnlineSignature=Please note that this function allows a person (customer, supplier...) to insert, online, the image of his signature in the PDF document. As for a handwritten signature, such a signature can be made by anyone and does not have the same legal value as a legal electronic signature system going through a paying trusted third party. If you need this level of security, you can contact an integrator for more information or check for addons on www.dolistore.org. From 1486dea1c2c6ba1e25d3fd31ae2e0dc6bc5f2d2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 13:35:04 +0100 Subject: [PATCH 100/139] Debug v21 --- htdocs/core/actions_setmoduleoptions.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index fd622c1017f..3d1725e4a46 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -129,13 +129,19 @@ if ($action == 'setModuleOptions' && !empty($user->admin)) { foreach ($_POST as $key => $val) { $reg = array(); if (preg_match('/^param(\d*)$/', $key, $reg)) { // Works for POST['param'], POST['param1'], POST['param2'], ... - $param = GETPOST("param".$reg[1], 'alpha'); + $param = GETPOST("param".$reg[1], 'aZ09'); $value = GETPOST("value".$reg[1], 'alpha'); if ($param) { $res = dolibarr_set_const($db, $param, $value, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } + + // Case we modify the list of directories for ODT templases, we want to be sure directory exists + if (preg_match('/_ADDON_PDF_ODT_PATH$/', $param) && preg_match('/^DOL_DATA_ROOT/', $value)) { + $tmpdir = preg_replace('/^DOL_DATA_ROOT/', DOL_DATA_ROOT, $value); + dol_mkdir($tmpdir, DOL_DATA_ROOT); + } } } } From 2d08d89d55f18ef264e293b7e239896a7a46f914 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 13:58:29 +0100 Subject: [PATCH 101/139] Trans --- htdocs/admin/modules.php | 3 ++- htdocs/admin/user.php | 4 +++- htdocs/core/modules/DolibarrModules.class.php | 6 +++--- htdocs/langs/en_US/admin.lang | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 9e91aac4327..6b6faa7d481 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; require_once DOL_DOCUMENT_ROOT.'/admin/remotestore/class/dolistore.class.php'; ' @@ -745,7 +746,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter = '
    '; $moreforfilter .= '