From da099c1c0ea58e9442b3d16db6829b4789de9664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:42:45 +0100 Subject: [PATCH 1/7] FIX #27536 --- htdocs/core/class/html.form.class.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9db677432d1..550d4cbc57f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6509,14 +6509,31 @@ class Form } if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; + // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries + // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country + $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) { // We also add the buyer country code if (is_numeric($type)) { if ($type == 1) { // We know product is a service - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; + switch ($selectVatComboMode) { + case '1': + $code_country .= ",'" . $societe_acheteuse->country_code . "'"; + break; + case '2': + $code_country = "'" . $societe_acheteuse->country_code . "'"; + break; + } } } elseif (!$idprod) { // We don't know type of product - $code_country .= ",'" . $societe_acheteuse->country_code . "'"; + switch ($selectVatComboMode) { + case '1': + $code_country .= ",'" . $societe_acheteuse->country_code . "'"; + break; + case '2': + $code_country = "'" . $societe_acheteuse->country_code . "'"; + break; + } } else { $prodstatic = new Product($this->db); $prodstatic->fetch($idprod); From f53aa7c5050c992bdbb870bafb7acc998d315dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:45:38 +0100 Subject: [PATCH 2/7] phpcs correction --- 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 550d4cbc57f..31ef838edad 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6509,7 +6509,7 @@ class Form } if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; - // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries + // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) { From efdaa0c9ec9abc5484784f945edc7e186a7fd8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:49:15 +0100 Subject: [PATCH 3/7] phpcs correction --- 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 31ef838edad..36865cffac6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6510,7 +6510,7 @@ class Form if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) { // If option to have vat for end customer for services is on require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries - // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country + // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) { // We also add the buyer country code From b70faf91328b1e505056ee797580f9e9b2428f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:04:26 +0100 Subject: [PATCH 4/7] oubli correction de la logique pour la TVA Intraco vers un particulier --- 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 36865cffac6..e696aa9dee4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6512,7 +6512,7 @@ class Form // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); - if (!isInEEC($societe_vendeuse) && (!is_object($societe_acheteuse) || (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()))) { + if (isInEEC($societe_vendeuse) && (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()) { // We also add the buyer country code if (is_numeric($type)) { if ($type == 1) { // We know product is a service From ec23bc3c9051332f8bae00f6421e1d6bf9ef9bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20NASSIET?= <109105553+comaiteseb@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:03:14 +0100 Subject: [PATCH 5/7] Syntax error crrected --- 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 e696aa9dee4..f18e3eb85a6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6512,7 +6512,7 @@ class Form // If SERVICE_ARE_ECOMMERCE_200238EC=1 combo list vat rate of purchaser and seller countries // If SERVICE_ARE_ECOMMERCE_200238EC=2 combo list only the vat rate of the purchaser country $selectVatComboMode = getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC'); - if (isInEEC($societe_vendeuse) && (isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()) { + if (isInEEC($societe_vendeuse) && isInEEC($societe_acheteuse) && !$societe_acheteuse->isACompany()) { // We also add the buyer country code if (is_numeric($type)) { if ($type == 1) { // We know product is a service From c1255c7d9529fe296a474ffb77c17b457ba6894c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Chanton?= Date: Thu, 18 Jan 2024 06:59:09 +0100 Subject: [PATCH 6/7] Set variable $projectstatic->usage_bill_tim for field compatibility --- htdocs/projet/tasks/time.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 48e941aae91..aec15463d92 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -173,6 +173,9 @@ if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a ded } $arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1); $arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1); +if (!getDolGlobalInt('PROJECT_HIDE_TASKS') && getDolGlobalInt('PROJECT_BILL_TIME_SPENT') && !$projectstatic->usage_bill_time ) { + $projectstatic->usage_bill_time=1; +} if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { $arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1); } From eadb6625f0a9cdf79027686fd703316d62d21321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Chanton?= Date: Thu, 18 Jan 2024 07:15:41 +0100 Subject: [PATCH 7/7] fiix depreciated --- htdocs/projet/tasks/time.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index aec15463d92..8a4c7f1c976 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -2285,7 +2285,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; $userstatic->photo = $task_time->photo; - $userstatic->statut = $task_time->user_status; + $userstatic->status = $task_time->user_status; print $userstatic->getNomUrl(-1); } print ''; @@ -2567,7 +2567,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; $userstatic->photo = $task_time->photo; - $userstatic->statut = $task_time->user_status; + $userstatic->status = $task_time->user_status; print $userstatic->getNomUrl(-1); } print ''; @@ -2723,7 +2723,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $userstatic->lastname = $task_time->lastname; $userstatic->firstname = $task_time->firstname; $userstatic->photo = $task_time->photo; - $userstatic->statut = $task_time->user_status; + $userstatic->status = $task_time->user_status; print $userstatic->getNomUrl(-1); } print '';