From 0a2481c702a8c69f8410d51212ac62112f4a8838 Mon Sep 17 00:00:00 2001 From: Yamil Esteban Garcia <120027058+developmentOYR@users.noreply.github.com> Date: Tue, 26 Mar 2024 22:14:19 +0100 Subject: [PATCH 01/12] Update fournisseur.facture.class.php IRPF reset when editing the label of a supplier invoice #29049 --- htdocs/fourn/class/fournisseur.facture.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8284c0cedf2..c300190799c 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1168,8 +1168,8 @@ class FactureFournisseur extends CommonInvoice if (isset($this->localtax1)) { $this->localtax1 = trim($this->localtax1); } - if (isset($this->localtax2)) { - $this->localtax2 = trim($this->localtax2); + if (isset($this->total_localtax2)) { + $this->total_localtax2 = trim($this->total_localtax2); } if (empty($this->total_ht)) { $this->total_ht = 0; @@ -1243,7 +1243,7 @@ class FactureFournisseur extends CommonInvoice $sql .= " close_code=".(isset($this->close_code) ? "'".$this->db->escape($this->close_code)."'" : "null").","; $sql .= " close_note=".(isset($this->close_note) ? "'".$this->db->escape($this->close_note)."'" : "null").","; $sql .= " localtax1=".(isset($this->localtax1) ? ((float) $this->localtax1) : "null").","; - $sql .= " localtax2=".(isset($this->localtax2) ? ((float) $this->localtax2) : "null").","; + $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_tva=".(isset($this->total_tva) ? ((float) $this->total_tva) : "null").","; $sql .= " total_ttc=".(isset($this->total_ttc) ? ((float) $this->total_ttc) : "null").","; From d1cb440916068102d65a9ab71c8659f54a68a55b Mon Sep 17 00:00:00 2001 From: Jonathan lescaut Date: Thu, 28 Mar 2024 17:56:39 +0100 Subject: [PATCH 02/12] massAction unlocate commercial --- htdocs/core/actions_massactions.inc.php | 42 +++++++++++++++++++++++++ htdocs/core/tpl/massactions_pre.tpl.php | 10 ++++++ htdocs/langs/en_US/companies.lang | 1 + htdocs/societe/list.php | 3 +- 4 files changed, 55 insertions(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 2fca6e22a33..410cdf5aa21 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1544,6 +1544,48 @@ if (!$error && ($massaction == 'affectcommercial' || ($action == 'affectcommerci } } +if (!$error && ($massaction == 'Unassigncommercial' || ($action == 'Unassigncommercial' && $confirm == 'yes')) && $permissiontoadd) { + $db->begin(); + + $objecttmp = new $objectclass($db); + $nbok = 0; + + foreach ($toselect as $toselectid) { + $result = $objecttmp->fetch($toselectid); + if ($result > 0) { + if (in_array($objecttmp->element, array('societe'))) { + $TCommercial = GETPOST("commercial", "alpha"); + if (is_array($TCommercial)){ + foreach ($TCommercial as $commercial){ + $result = $objecttmp->del_commercial($user, $commercial); + } + } + } + if ($result <= 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } else { + $nbok++; + } + } else { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (!$error) { + if ($nbok > 1) { + setEventMessages($langs->trans("CommercialsAffected", $nbok), null, 'mesgs'); + } else { + setEventMessages($langs->trans("CommercialAffected"), null, 'mesgs'); + } + $db->commit(); + } else { + $db->rollback(); + } +} // Approve for leave only if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $confirm == 'yes')) && $permissiontoapprove) { $db->begin(); diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index cf57e63b9c5..d27b1f9c0f5 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -394,6 +394,16 @@ if ($massaction == 'presetcommercial') { 'value' => $form->multiselectarray('commercial', $userlist, null, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0, '', '', '', 1)); print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmAllocateCommercial"), $langs->trans("ConfirmAllocateCommercialQuestion", count($toselect)), "affectcommercial", $formquestion, 1, 0, 200, 500, 1); } +if ($massaction == 'unsetcommercial') { + $formquestion = array(); + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1); + $formquestion[] = array('type' => 'other', + 'name' => 'Unassigncommercial', + 'label' => $form->editfieldkey('UnallocateCommercial', 'commercial_id', '', $object, 0), + 'value' => $form->multiselectarray('commercial', $userlist, null, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0, '', '', '', 1)); + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUnallocateCommercial"), $langs->trans("ConfirmUnallocateCommercialQuestion", count($toselect)), "Unassigncommercial", $formquestion, 1, 0, 200, 500, 1); +} + if ($massaction == 'preapproveleave') { print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, 'yes', 0, 200, 500, 1); } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index d1ca72b826a..81febdac01c 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -384,6 +384,7 @@ JuridicalStatus200=Independent DeleteFile=Delete file ConfirmDeleteFile=Are you sure you want to delete this file %s? AllocateCommercial=Assigned to sales representative +UnallocateCommercial = De-assigning a sales representative Organization=Organization FiscalYearInformation=Fiscal Year FiscalMonthStart=Starting month of the fiscal year diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 73fdb35e5af..fbdc79e3244 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -203,7 +203,6 @@ if ($type == 'f') { $search_type = '4'; } } - // Initialize technical objects to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Societe($db); $extrafields = new ExtraFields($db); @@ -1106,7 +1105,9 @@ if ($user->hasRight("societe", "creer")) { } if ($user->hasRight("societe", "creer")) { $arrayofmassactions['presetcommercial'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("AllocateCommercial"); + $arrayofmassactions['unsetcommercial'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("UnallocateCommercial"); } + if ($user->hasRight('societe', 'supprimer')) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } From 101f16f7b363fc08708054f9c215cbba14297e19 Mon Sep 17 00:00:00 2001 From: Jonathan lescaut Date: Fri, 29 Mar 2024 09:52:07 +0100 Subject: [PATCH 03/12] retour wysy --- htdocs/core/actions_massactions.inc.php | 4 ++-- htdocs/langs/en_US/main.lang | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 410cdf5aa21..b485f7d8b0f 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1577,9 +1577,9 @@ if (!$error && ($massaction == 'Unassigncommercial' || ($action == 'Unassigncomm if (!$error) { if ($nbok > 1) { - setEventMessages($langs->trans("CommercialsAffected", $nbok), null, 'mesgs'); + setEventMessages($langs->trans("CommercialsDisaffected", $nbok), null, 'mesgs'); } else { - setEventMessages($langs->trans("CommercialAffected"), null, 'mesgs'); + setEventMessages($langs->trans("CommercialDisaffected"), null, 'mesgs'); } $db->commit(); } else { diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d6dfb8bc74b..cbdde72e3df 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1221,9 +1221,13 @@ Terminated=Terminated Position=Position AddLineOnPosition=Add line on position (at the end if empty) ConfirmAllocateCommercial=Assign sales representative confirmation +ConfirmUnallocateCommercial= Confirmation of the de-assignment of a sales representative ConfirmAllocateCommercialQuestion=Are you sure you want to assign the %s selected record(s)? +ConfirmUnallocateCommercialQuestion=Are you sure you want to unassign the selected %s record(s)? CommercialsAffected=Sales representatives assigned CommercialAffected=Sales representative assigned +CommercialsDisaffected=Sales representatives disassigned +CommercialDisaffected=Sales representative disassigned YourMessage=Your message YourMessageHasBeenReceived=Your message has been received. We will answer or contact you as soon as possible. UrlToCheck=Url to check From 930ff0d905edcd183d4f0234d2bf69f47213128d Mon Sep 17 00:00:00 2001 From: Jonathan lescaut Date: Fri, 29 Mar 2024 11:06:42 +0100 Subject: [PATCH 04/12] retour PR --- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/tpl/massactions_pre.tpl.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b485f7d8b0f..d245ca62708 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1544,7 +1544,7 @@ if (!$error && ($massaction == 'affectcommercial' || ($action == 'affectcommerci } } -if (!$error && ($massaction == 'Unassigncommercial' || ($action == 'Unassigncommercial' && $confirm == 'yes')) && $permissiontoadd) { +if (!$error && ($massaction == 'unassigncommercial' || ($action == 'unassigncommercial' && $confirm == 'yes')) && $permissiontoadd) { $db->begin(); $objecttmp = new $objectclass($db); diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index d27b1f9c0f5..d479a223a12 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -398,10 +398,10 @@ if ($massaction == 'unsetcommercial') { $formquestion = array(); $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, 'AND u.statut = 1', 0, '', '', 0, 1); $formquestion[] = array('type' => 'other', - 'name' => 'Unassigncommercial', + 'name' => 'unassigncommercial', 'label' => $form->editfieldkey('UnallocateCommercial', 'commercial_id', '', $object, 0), 'value' => $form->multiselectarray('commercial', $userlist, null, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0, '', '', '', 1)); - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUnallocateCommercial"), $langs->trans("ConfirmUnallocateCommercialQuestion", count($toselect)), "Unassigncommercial", $formquestion, 1, 0, 200, 500, 1); + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUnallocateCommercial"), $langs->trans("ConfirmUnallocateCommercialQuestion", count($toselect)), "unassigncommercial", $formquestion, 1, 0, 200, 500, 1); } if ($massaction == 'preapproveleave') { From 3130ede583708472e7aaeb247668959f0c7220ba Mon Sep 17 00:00:00 2001 From: Jonathan lescaut Date: Fri, 29 Mar 2024 12:17:47 +0100 Subject: [PATCH 05/12] retour PR --- htdocs/core/actions_massactions.inc.php | 4 ++-- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index d245ca62708..b42f6fb0860 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1555,8 +1555,8 @@ if (!$error && ($massaction == 'unassigncommercial' || ($action == 'unassigncomm if ($result > 0) { if (in_array($objecttmp->element, array('societe'))) { $TCommercial = GETPOST("commercial", "alpha"); - if (is_array($TCommercial)){ - foreach ($TCommercial as $commercial){ + if (is_array($TCommercial)) { + foreach ($TCommercial as $commercial) { $result = $objecttmp->del_commercial($user, $commercial); } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 97082b64db2..3fd6738addf 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8436,7 +8436,7 @@ class Form if ($value_as_key) { $array = array_combine($array, $array); } - +q $out = ''; if ($addjscombo < 0) { From 68f4752ae8b86cee335fdae4b0b061989f97b8c8 Mon Sep 17 00:00:00 2001 From: Vaadasch Date: Mon, 1 Apr 2024 02:10:54 +0200 Subject: [PATCH 06/12] FIX & ADD llx_accounting_account_fr : correction coquilles et ajout de l'impot sur le revenu --- .../install/mysql/data/llx_accounting_account_fr.sql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index 7b9f90d99c9..a4b2a6e5386 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -517,6 +517,8 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5971,'PCG14-DEV','FINAN', '5', 0, 'Comptes financiers','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5972,'PCG14-DEV','EXPENSE', '6', 0, 'Comptes de charges','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5973,'PCG14-DEV','INCOME', '7', 0, 'Comptes de produits','1'); +-- Rowid 5974 ajouté en erratum, ajout de "697 - Imposition forfaitaire annuelle des sociétés" (absent de la liste dans PCG officiel, mais présent dans articles +-- Rowid 5975 à 5977, ajouts pour les codes 4421 (pour le prélèvement à la source de l'impot sur le revenu), 4422 et 4423 INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5000,'PCG14-DEV','CAPIT', '10',5967,'Capital et réserves','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5001,'PCG14-DEV','CAPIT', '101',5000,'Capital','1'); @@ -635,7 +637,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5114,'PCG14-DEV','CAPIT', '1688',5110,'Intérêts courus','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5115,'PCG14-DEV','CAPIT','16881',5114,'sur emprunts obligataires convertibles','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5116,'PCG14-DEV','CAPIT','16883',5114,'sur autres emprunts obligataires','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5117,'PCG14-DEV','CAPIT','16684',5114,'sur emprunts auprès des établissements de crédit','1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5117,'PCG14-DEV','CAPIT','16884',5114,'sur emprunts auprès des établissements de crédit','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5118,'PCG14-DEV','CAPIT','16885',5114,'sur dépôts et cautionnements reçus','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5119,'PCG14-DEV','CAPIT','16886',5114,'sur participation des salariés aux résultats','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5120,'PCG14-DEV','CAPIT','16887',5114,'sur emprunts et dettes assortis de conditions particulières','1'); @@ -947,6 +949,9 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5426,'PCG14-DEV','THIRDPARTY','4418',5423,'Subventions d''équilibre','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5427,'PCG14-DEV','THIRDPARTY','4419',5423,'Avances sur subventions','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5428,'PCG14-DEV','THIRDPARTY','442',5422,'Etat - Impôts et taxes recouvrables sur des tiers','1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5975,'PCG14-DEV','THIRDPARTY','4421',5428,'Prélèvements à la source (Impôt sur le revenu)','1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5976,'PCG14-DEV','THIRDPARTY','4422',5428,'Prélèvements forfaitaires non libératoires','1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5977,'PCG14-DEV','THIRDPARTY','4423',5428,'Retenues et prélèvements sur les distributions','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5429,'PCG14-DEV','THIRDPARTY','4424',5428,'Obligataires','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5430,'PCG14-DEV','THIRDPARTY','4425',5428,'Associés','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5431,'PCG14-DEV','THIRDPARTY','443',5422,'Opérations particulières avec l''Etat les collectivités publiques, les organismes internationaux','1'); @@ -1042,7 +1047,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5521,'PCG14-DEV','THIRDPARTY','4962',5520,'Créances sur cessions d''immobilisations','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5522,'PCG14-DEV','THIRDPARTY','4965',5520,'Créances sur cessions de valeurs mobilières de placement','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5523,'PCG14-DEV','THIRDPARTY','4967',5520,'Autres comptes débiteurs','1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5524,'PCG14-DEV','FINAN','50',5971,'Parts dans des entreprises liées','1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5524,'PCG14-DEV','FINAN','501',5971,'Parts dans des entreprises liées','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5526,'PCG14-DEV','FINAN','502',5524,'Actions propres','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5527,'PCG14-DEV','FINAN','5021',5526,'Actons destinées à être attribuées aux employés et affectées à des plans déterminés','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5528,'PCG14-DEV','FINAN','5022',5526,'Actons disponibles pour être attribuées aux employés ou pour la régularisation des cours de bourse','1'); @@ -1350,6 +1355,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5830,'PCG14-DEV','EXPENSE','6952',5828,'Contribution additionnelle à l''impôt sur les bénéfices','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5831,'PCG14-DEV','EXPENSE','6954',5828,'Impôts dus à l''étranger','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5832,'PCG14-DEV','EXPENSE','696',5826,'Suppléments d''impôt sur les sociétés liés aux distributions','1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5974,'PCG14-DEV','EXPENSE','697',5826,'Imposition forfaitaire annuelle des sociétés','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5833,'PCG14-DEV','EXPENSE','698',5826,'Intégration fiscale','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5834,'PCG14-DEV','EXPENSE','6981',5833,'Intégration fiscale - Charges','1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 5835,'PCG14-DEV','EXPENSE','6989',5833,'Intégration fiscale - Produits','1'); From a9821e2bf1adec65086d8a8bc2bca74a2e0ed4ce Mon Sep 17 00:00:00 2001 From: Yamil Esteban Garcia <120027058+developmentOYR@users.noreply.github.com> Date: Mon, 1 Apr 2024 09:47:42 +0200 Subject: [PATCH 07/12] Update fournisseur.facture.class.php Hello Eldy, I just made the changes you asked me for. I have carried out the appropriate checks to verify that everything is working correctly. All the best --- htdocs/fourn/class/fournisseur.facture.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c300190799c..7bc0cd83c25 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1165,8 +1165,8 @@ class FactureFournisseur extends CommonInvoice if (isset($this->close_note)) { $this->close_note = trim($this->close_note); } - if (isset($this->localtax1)) { - $this->localtax1 = trim($this->localtax1); + if (isset($this->total_localtax1)) { + $this->total_localtax1 = trim($this->total_localtax1); } if (isset($this->total_localtax2)) { $this->total_localtax2 = trim($this->total_localtax2); @@ -1242,7 +1242,7 @@ class FactureFournisseur extends CommonInvoice $sql .= " paye=".(isset($this->paye) ? ((int) $this->paye) : "0").","; $sql .= " close_code=".(isset($this->close_code) ? "'".$this->db->escape($this->close_code)."'" : "null").","; $sql .= " close_note=".(isset($this->close_note) ? "'".$this->db->escape($this->close_note)."'" : "null").","; - $sql .= " localtax1=".(isset($this->localtax1) ? ((float) $this->localtax1) : "null").","; + $sql .= " localtax1=".(isset($this->total_localtax1) ? ((float) $this->total_localtax1) : "null").","; $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_tva=".(isset($this->total_tva) ? ((float) $this->total_tva) : "null").","; From c7560a7c897caa951f6153bce333916600f84340 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 2 Apr 2024 11:57:57 +0200 Subject: [PATCH 08/12] Qual: improve typing for jdate # Qual: improve typing for jdate Limit jdate return type to int|'' . Tested with phan and phpstan. This will allow setting the same type on the date fields and allow detecting the assignment of non empty strings. int|''|'specific value' also works, so could be used on other fields. --- htdocs/core/db/Database.interface.php | 2 +- htdocs/core/db/DoliDB.class.php | 2 +- htdocs/debugbar/class/TraceableDB.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 9a796160292..216865b39a3 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -467,7 +467,7 @@ interface Database * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param bool $gm 1=Input information are GMT values, otherwise local to server TZ - * @return int|string Date TMS or '' + * @return int|'' Date TMS or '' */ public function jdate($string, $gm = false); diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 01237c5c676..3265485cc4d 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -356,7 +356,7 @@ abstract class DoliDB implements Database * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param mixed $gm 'gmt'=Input information are GMT values, 'tzserver'=Local to server TZ - * @return int|string Date TMS or '' + * @return int|'' Date TMS or '' */ public function jdate($string, $gm = 'tzserver') { diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php index 4ddcf1eb22e..6e3312e547b 100644 --- a/htdocs/debugbar/class/TraceableDB.php +++ b/htdocs/debugbar/class/TraceableDB.php @@ -632,7 +632,7 @@ class TraceableDB extends DoliDB * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param bool $gm 1=Input information are GMT values, otherwise local to server TZ - * @return int|string Date TMS or '' + * @return int|'' Date TMS or '' */ public function jdate($string, $gm = false) { From e94bb650d3df5181ebdea17a098985ec4ee4e793 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 2 Apr 2024 13:52:51 +0200 Subject: [PATCH 09/12] Qual: Fix typings in actioncomm # Qual: Fix typings in actioncomm Allow -1 for percentage. $icalcolor as string. Extend range of return types for update() and delete() --- htdocs/comm/action/class/actioncomm.class.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 13066e7d6cf..7f8afbecf48 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -132,17 +132,17 @@ class ActionComm extends CommonObject private $libelle; /** - * @var integer Date creation record (datec) + * @var int Date creation record (datec) */ public $datec; /** - * @var integer Duration (duree) + * @var int Duration (duree) */ public $duree; /** - * @var integer Date modification record (tms) + * @var int Date modification record (tms) */ public $datem; @@ -171,27 +171,27 @@ class ActionComm extends CommonObject public $usermodid; /** - * @var integer Date action start (datep) + * @var int Date action start (datep) */ public $datep; /** - * @var integer Date action end (datef) + * @var int Date action end (datef) */ public $datef; /** - * @var integer This is date start action (datep) but modified to not be outside calendar view. + * @var int This is date start action (datep) but modified to not be outside calendar view. */ public $date_start_in_calendar; /** - * @var integer This is date end action (datef) but modified to not be outside calendar view. + * @var int This is date end action (datef) but modified to not be outside calendar view. */ public $date_end_in_calendar; /** - * @var integer Date action end (datep2) + * @var int Date action end (datep2) */ public $datep2; @@ -212,7 +212,7 @@ class ActionComm extends CommonObject public $ponctuel; /** - * @var int<0,100> Percentage + * @var int<-1,100> Percentage */ public $percentage; @@ -308,7 +308,7 @@ class ActionComm extends CommonObject public $icalname; /** - * @var int<0,3> Ical color + * @var string Ical color (Hex value for color on 6 nibles) */ public $icalcolor; @@ -1041,7 +1041,7 @@ class ActionComm extends CommonObject * * @param User $user User making the delete * @param int<0,1> $notrigger 1 = disable triggers, 0 = enable triggers - * @return int<-1,1> Return integer <0 if KO, >0 if OK + * @return int<-2,1> Return integer <0 if KO, >0 if OK */ public function delete($user, $notrigger = 0) { @@ -1137,7 +1137,7 @@ class ActionComm extends CommonObject * * @param User $user Object user making change * @param int<0,1> $notrigger 1 = disable triggers, 0 = enable triggers - * @return int<-1,1> Return integer <0 if KO, >0 if OK + * @return int<-2,1> Return integer <0 if KO, >0 if OK */ public function update(User $user, $notrigger = 0) { From 92797333e63f4ead685b301a3925afe19f4d456b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Apr 2024 15:01:44 +0200 Subject: [PATCH 10/12] Update companies.lang --- htdocs/langs/en_US/companies.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 74c2c99e055..3d641dfb8fa 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -388,8 +388,8 @@ SupplierCategory=Vendor category JuridicalStatus200=Independent DeleteFile=Delete file ConfirmDeleteFile=Are you sure you want to delete this file %s? -AllocateCommercial=Assigned to sales representative -UnallocateCommercial = De-assigning a sales representative +AllocateCommercial=Assign to sales representatives +UnallocateCommercial=Unassigned sales representatives Organization=Organization FiscalYearInformation=Fiscal Year FiscalMonthStart=Starting month of the fiscal year From acb80c551f1275ce44627b2577f092110480d633 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Apr 2024 15:03:59 +0200 Subject: [PATCH 11/12] Update main.lang --- htdocs/langs/en_US/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index cbdde72e3df..24e96d2a6a1 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1221,7 +1221,7 @@ Terminated=Terminated Position=Position AddLineOnPosition=Add line on position (at the end if empty) ConfirmAllocateCommercial=Assign sales representative confirmation -ConfirmUnallocateCommercial= Confirmation of the de-assignment of a sales representative +ConfirmUnallocateCommercial=Are you sure you want to unassign the sales representative(s) from all selected thirdparties? ConfirmAllocateCommercialQuestion=Are you sure you want to assign the %s selected record(s)? ConfirmUnallocateCommercialQuestion=Are you sure you want to unassign the selected %s record(s)? CommercialsAffected=Sales representatives assigned From 9f993fb8e65220cf2e17940f047a3afd493ddc2d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Apr 2024 15:10:36 +0200 Subject: [PATCH 12/12] Update fournisseur.facture.class.php --- htdocs/fourn/class/fournisseur.facture.class.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f2bd6330897..2f8dd59bdfd 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1184,20 +1184,12 @@ class FactureFournisseur extends CommonInvoice if (isset($this->close_note)) { $this->close_note = trim($this->close_note); } - if (isset($this->total_localtax1)) { - $this->total_localtax1 = trim($this->total_localtax1); - } - if (isset($this->total_localtax2)) { - $this->total_localtax2 = trim($this->total_localtax2); - } if (empty($this->total_ht)) { $this->total_ht = 0; } if (empty($this->total_tva)) { $this->total_tva = 0; } - // if (isset($this->total_localtax1)) $this->total_localtax1=trim($this->total_localtax1); - // if (isset($this->total_localtax2)) $this->total_localtax2=trim($this->total_localtax2); if (isset($this->total_ttc)) { $this->total_ttc = (float) $this->total_ttc; }