From 8c1af0fdb8c9216ff2dbb873830dc500a801d815 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 24 Jun 2020 12:24:47 +0200 Subject: [PATCH 01/24] fix enbtoty on supplier order --- 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 538af54fe23..4b42665199f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -273,7 +273,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - $sql.= " WHERE c.entity = ".$conf->entity; + $sql.= " WHERE c.entity IN (".getEntity('order_invoice').")"; if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'"; else $sql.= " AND c.rowid=".$id; From 77868ad2a366b2d46cb01ab372e89ac02df788d1 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 24 Jun 2020 12:42:41 +0200 Subject: [PATCH 02/24] fix entity on supplier order --- htdocs/fourn/class/fournisseur.commande.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2ad30a60b80..cc394804823 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -273,7 +273,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON c.fk_mode_reglement = p.id"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_input_method as cm ON cm.rowid = c.fk_input_method"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; - $sql.= " WHERE c.entity IN (".getEntity('order_invoice').")"; + $sql.= " WHERE c.entity IN (".getEntity('supplier_order').")"; if ($ref) $sql.= " AND c.ref='".$this->db->escape($ref)."'"; else $sql.= " AND c.rowid=".$id; @@ -528,6 +528,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND fk_statut = ".self::STATUS_DRAFT; + $sql.= " AND entity IN (".getEntity('supplier_order').")"; $resql=$this->db->query($sql); if (! $resql) @@ -844,6 +845,7 @@ class CommandeFournisseur extends CommonOrder $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur SET billed = 1'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; + $sql .= " AND entity IN (".getEntity('supplier_order').")"; if ($this->db->query($sql)) { if (! $error) From dfb7c3e194092f493d0b47d9debad29ffbfa5549 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jun 2020 21:14:49 +0200 Subject: [PATCH 03/24] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index cc394804823..dd8cb1fe722 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -528,7 +528,6 @@ class CommandeFournisseur extends CommonOrder $sql.= " fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; $sql.= " AND fk_statut = ".self::STATUS_DRAFT; - $sql.= " AND entity IN (".getEntity('supplier_order').")"; $resql=$this->db->query($sql); if (! $resql) From 960512acd9176be205b18dd0cbda9bd92f4caf5c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jun 2020 21:21:35 +0200 Subject: [PATCH 04/24] Update fournisseur.commande.class.php Action with filter on rowid does not need to have test on entity --- 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 dd8cb1fe722..ef8d4b4d93f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -844,7 +844,7 @@ class CommandeFournisseur extends CommonOrder $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur SET billed = 1'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; - $sql .= " AND entity IN (".getEntity('supplier_order').")"; + if ($this->db->query($sql)) { if (! $error) From 335a767f22a6d07cf97753baa3c85cb0bbf21259 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sat, 4 Jul 2020 16:37:11 +0200 Subject: [PATCH 05/24] remove warning when date end contract line empty --- htdocs/core/boxes/box_services_contracts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 9d96d11f64d..32edd21b98d 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -142,8 +142,8 @@ class box_services_contracts extends ModeleBoxes $thirdpartytmp->code_compta = $objp->code_compta; $thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur; - $dateline = $this->db->jdate($objp->date_line); - if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); + $dateline =$this->db->jdate($objp->date_line); + if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && !empty($dateline) && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); // Multilangs if (!empty($conf->global->MAIN_MULTILANGS) && $objp->product_id > 0) // if option multilang is on From 03ae31ecedb8db7fe40f318a8c810ce5fc63ea89 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Sat, 4 Jul 2020 16:37:50 +0200 Subject: [PATCH 06/24] remove warning when date end contract line empty --- htdocs/core/boxes/box_services_contracts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 32edd21b98d..7d6d2b0ee10 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -142,7 +142,7 @@ class box_services_contracts extends ModeleBoxes $thirdpartytmp->code_compta = $objp->code_compta; $thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur; - $dateline =$this->db->jdate($objp->date_line); + $dateline = $this->db->jdate($objp->date_line); if ($contractstatic->statut == Contrat::STATUS_VALIDATED && $objp->statut == ContratLigne::STATUS_OPEN && !empty($dateline) && ($dateline + $conf->contrat->services->expires->warning_delay) < $now) $late = img_warning($langs->trans("Late")); // Multilangs From 9cd8c3738ff299624c91dab708dc23029d8aeea4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jul 2020 23:18:19 +0200 Subject: [PATCH 07/24] Fix trans --- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 71be89f30f5..8a13cf0f814 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1349,7 +1349,7 @@ class FactureRec extends CommonInvoice $result = ''; - $label = ''.$langs->trans("ShowInvoice").''; + $label = ''.$langs->trans("RepeatableInvoice").''; if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; } From b33e6390995583b4f04a046c8f806ebf779be0be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Jul 2020 23:21:59 +0200 Subject: [PATCH 08/24] Prepare 12.0.1 --- ChangeLog | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index 19c77c702fd..88b73db8bee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,41 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 12.0.1 compared to 12.0.0 ***** +FIX: $_POST must be GETPOST +FIX: 10.0 - fatal with postgreSQL +FIX: #14109 +FIX: #14112 +FIX: #14142 +FIX: all extrafields cleared after update of one of them +FIX: Avoid warning when creating a module with already existing files +FIX: change selected fields on company card +FIX: Correct ModuleBuilder left menu +FIX: create a deposit with amount using comma didn't work +FIX: CSS +FIX: Entry from stripe intent were reported into SEPA payments +FIX: Filter on status, closing opening status +FIX: html lost on html extrafield +FIX: Label of popup on thirdparty +FIX: missing possibility to change entity when propal cloning +FIX: missing setup of extrafields for MO +FIX: Missing the tooltip when creating bank account +FIX: Missing token +FIX: non numeric value on comm/card.php +FIX: SQL Problem in customer invoice list +FIX: SQL Problem in social contribution list +FIX: SQL Problem in supplier invoice list +FIX: SQL syntax error when editing extrafields +FIX: Sql type +FIX: takepos 12 hook +FIX: Update form erased extrafields that were hidden +FIX: Update of extrafields date +FIX: Update of extrafiels on draft object +FIX: upload documents into manual ECM was reported a permission error +FIX: Use of office365 TLS with SMTPs method. +FIX: wrong origin +FIX: Permission error during import + ***** ChangeLog for 12.0.0 compared to 11.0.0 ***** For users: From b76828df9fb4674cf0d954e9f78a34d264dd8b21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 09:39:26 +0200 Subject: [PATCH 09/24] Fix use of newtoken() --- htdocs/projet/element.php | 4 ++-- htdocs/public/payment/newpayment.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index c6932e34f45..bafa9a0f30e 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -592,7 +592,7 @@ if (!$showdatefilter) { print '
'; print '
'; - print ''; + print ''; print ''; print ''; print ''; @@ -894,7 +894,7 @@ foreach ($listofreferent as $key => $value) // Define form with the combo list of elements to link $addform .= '
'; $addform .= ''; - $addform .= ''; + $addform .= ''; $addform .= ''; $addform .= ''; $addform .= ''; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index ea7fd71c9e6..bcee660a17d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2275,7 +2275,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment var hiddenInput2 = document.createElement('input'); hiddenInput2.setAttribute('type', 'hidden'); hiddenInput2.setAttribute('name', 'token'); - hiddenInput2.setAttribute('value', ''); + hiddenInput2.setAttribute('value', ''); form.appendChild(hiddenInput2); // Submit the form @@ -2299,7 +2299,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment var hiddenInput2 = document.createElement('input'); hiddenInput2.setAttribute('type', 'hidden'); hiddenInput2.setAttribute('name', 'token'); - hiddenInput2.setAttribute('value', ''); + hiddenInput2.setAttribute('value', ''); form.appendChild(hiddenInput2); // Submit the form From 466b7e84efbee9cebed5445e9aa58699bbde2a75 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 6 Jul 2020 09:58:44 +0200 Subject: [PATCH 10/24] FIX : soc filter doesn't work on task list --- htdocs/projet/tasks/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index b97710ba7b6..36c06cd97f2 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -58,6 +58,7 @@ $search_task_label=GETPOST('search_task_label'); $search_task_description=GETPOST('search_task_description'); $search_project_user=GETPOST('search_project_user'); $search_task_user=GETPOST('search_task_user'); +$search_societe=GETPOST('search_societe'); $mine = $_REQUEST['mode']=='mine' ? 1 : 0; if ($mine) { $search_task_user = $user->id; $mine = 0; } From 056aa81ed392fca2ee75c5605e3e75370ba47cc7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 10:59:23 +0200 Subject: [PATCH 11/24] Fix responsive --- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/element.php | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index e61c86d2999..a068fe247fe 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -178,6 +178,7 @@ TypeContact_project_task_internal_TASKCONTRIBUTOR=Contributor TypeContact_project_task_external_TASKCONTRIBUTOR=Contributor SelectElement=Select element AddElement=Link to element +LinkToElementShort=Link to # Documents models DocumentModelBeluga=Project document template for linked objects overview DocumentModelBaleine=Project document template for tasks diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index bafa9a0f30e..5f400dfe7b7 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -884,7 +884,7 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, $exclude_select_element)) { - $selectList = $formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300', -2, !empty($project_field) ? $project_field : 'fk_projet'); + $selectList = $formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300 minwidth75imp', -2, !empty($project_field) ? $project_field : 'fk_projet'); if ($selectList < 0) { setEventMessages($formproject->error, $formproject->errors, 'errors'); @@ -899,9 +899,9 @@ foreach ($listofreferent as $key => $value) $addform .= ''; $addform .= ''; $addform .= ''; - $addform .= '
'; + $addform .= '
'.$langs->trans("SelectElement").'
'; $addform .= ''; - $addform .= ''; + $addform .= ''; $addform .= '
'.$langs->trans("SelectElement").''.$selectList.'
'; $addform .= '
'; $addform .= '
'; @@ -910,9 +910,9 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform .= '
'; - if ($testnew) $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; + if ($testnew) $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; + $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; } $addform .= '
'; } @@ -920,6 +920,7 @@ foreach ($listofreferent as $key => $value) print load_fiche_titre($langs->trans($title), $addform, ''); print "\n".''."\n"; + print '
'; print ''; print ''; @@ -1038,7 +1039,7 @@ foreach ($listofreferent as $key => $value) print "\n"; // Ref - print '
'; + print ''; if ($tablename == 'expensereport_det') { print $expensereport->getNomUrl(1); @@ -1375,6 +1376,7 @@ foreach ($listofreferent as $key => $value) } } print "
"; + print '
'; print "
\n"; } } From 053a1a2230c2e90b01b58dd673fafe1a4839f865 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 11:22:30 +0200 Subject: [PATCH 12/24] Fix duplicate code --- htdocs/compta/resultat/index.php | 67 +------------------------------- 1 file changed, 2 insertions(+), 65 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 887412bc6a4..8c223e3615a 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -499,7 +499,7 @@ elseif ($modecompta=="BOOKKEEPING") } /* - * Charges sociales non deductibles + * Social contributions */ $subtotal_ht = 0; @@ -524,7 +524,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; $sql.= " WHERE p.fk_charge = cs.rowid"; $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; } @@ -560,68 +559,6 @@ elseif ($modecompta=="BOOKKEEPING") } -/* - * Charges sociales deductibles - */ - -$subtotal_ht = 0; -$subtotal_ttc = 0; -if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) -{ - if ($modecompta == 'CREANCES-DETTES') - { - $sql = "SELECT c.libelle as nom, date_format(cs.date_ech,'%Y-%m') as dm, sum(cs.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; - } - elseif ($modecompta=="RECETTES-DEPENSES") - { - $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; - $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p"; - $sql.= " WHERE p.fk_charge = cs.rowid"; - $sql.= " AND cs.fk_type = c.id"; - $sql.= " AND c.deductible = 1"; - if (! empty($date_start) && ! empty($date_end)) - $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; - } - - $sql.= " AND cs.entity = ".$conf->entity; - $sql.= " GROUP BY c.libelle, dm"; - - dol_syslog("get social contributions paid deductible=1", LOG_DEBUG); - $result=$db->query($sql); - if ($result) { - $num = $db->num_rows($result); - $i = 0; - if ($num) { - while ($i < $num) { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } - } else { - dol_print_error($db); - } -} -elseif ($modecompta=="BOOKKEEPING") -{ - // Nothing from this table -} - - /* * Salaries */ @@ -734,7 +671,7 @@ elseif ($modecompta == 'BOOKKEEPING') { /* - * Donation get dunning paiement + * Donation get dunning payments */ if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta=="RECETTES-DEPENSES")) From 2629a98851bc0405e74de669fba17bc38effcb87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 11:31:05 +0200 Subject: [PATCH 13/24] Fix regression --- htdocs/compta/resultat/index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 8c223e3615a..48ededa29bc 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -512,7 +512,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " WHERE cs.fk_type = c.id"; - $sql.= " AND c.deductible = 0"; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } @@ -531,7 +530,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco $sql.= " AND cs.entity = ".$conf->entity; $sql.= " GROUP BY c.libelle, dm"; - dol_syslog("get social contributions deductible=0 ", LOG_DEBUG); + dol_syslog("get social contributions", LOG_DEBUG); $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); From 9b1163cfb87c688cd75f4c6af3aecd9c590ddc03 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 11:52:28 +0200 Subject: [PATCH 14/24] Fix menu organisation. --- htdocs/compta/bank/various_payment/list.php | 2 +- htdocs/compta/charges/index.php | 2 ++ htdocs/core/menus/init_menu_auguria.sql | 29 ++++++++++++--------- htdocs/core/menus/standard/eldy.lib.php | 20 +++++++------- htdocs/langs/en_US/main.lang | 1 + 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 5f68440809c..4e836f10af0 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -180,7 +180,7 @@ if ($result) print ''; print ''; - print_barre_liste($langs->trans("VariousPayments"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($langs->trans("MenuVariousPayment"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); print '
'; print ''."\n"; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index c64797b801c..1f69a6aa1c8 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -465,6 +465,7 @@ while ($j < $numlt) // Payment Salary +/* if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) { if (!$mode || $mode != 'sconly') @@ -575,6 +576,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) } } } +*/ print ''; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index ede2a9f94d3..03f8951b0f8 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -222,27 +222,32 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2002__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/list.php?mainmenu=billing&leftmenu=donations', 'List', 1, 'donations', '$user->rights->don->lire', '', 2, 1, __ENTITY__); -- insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->don->enabled && $leftmenu=="donations"', __HANDLER__, 'left', 2003__+MAX_llx_menu__, 'billing', '', 2000__+MAX_llx_menu__, '/don/stats/index.php?mainmenu=billing&leftmenu=donations', 'Statistics', 1, 'donations', '$user->rights->don->lire', '', 2, 2, __ENTITY__); -- Special expenses -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&leftmenu=tax', 'MenuSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 2200__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Salaries', 1, 'salaries', '$user->rights->salaries->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/card.php?mainmenu=billing&leftmenu=tax_salary&action=create', 'NewPayment', 2, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Payments', 2, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/stats/index.php?mainmenu=billing&leftmenu=tax_salary', 'Statistics', 2, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 2200__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&leftmenu=tax_loan', 'Loans', 1, 'loan', '$user->rights->loan->read', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&leftmenu=tax_loan&action=create', 'NewLoan', 2, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); ---insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&leftmenu=tax_loan', 'Payments', 2, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?mainmenu=billing&leftmenu=tax_loan', 'Calculator', 2, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled || $conf->salaries->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'left', 2200__+MAX_llx_menu__, 'billing', 'tax', 6__+MAX_llx_menu__, '/compta/charges/index.php?mainmenu=billing&leftmenu=tax', 'MenuTaxesAndSpecialExpenses', 0, 'compta', '(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) || (! empty($conf->loan->enabled) && $user->rights->loan->read) || (! empty($conf->banque->enabled) && $user->rights->banque->lire)', '', 0, 6, __ENTITY__); +-- Social contributions insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled', __HANDLER__, 'left', 2250__+MAX_llx_menu__, 'billing', 'tax_social', 2200__+MAX_llx_menu__, '/compta/sociales/list.php?mainmenu=billing&leftmenu=tax_social', 'SocialContributions', 1, '', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2251__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/card.php?mainmenu=billing&leftmenu=tax_social&action=create', 'MenuNewSocialContribution', 2, '', '$user->rights->tax->charges->creer', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && $leftmenu=="tax_social"', __HANDLER__, 'left', 2252__+MAX_llx_menu__, 'billing', '', 2250__+MAX_llx_menu__, '/compta/sociales/payments.php?mainmenu=billing&leftmenu=tax_social&mode=sconly', 'Payments', 2, '', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); +-- VAT insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)', __HANDLER__, 'left', 2300__+MAX_llx_menu__, 'billing', 'tax_vat', 2200__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'VAT', 1, 'companies', '$user->rights->tax->charges->lire', '', 0, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2301__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/card.php?mainmenu=billing&leftmenu=tax_vat&action=create', 'New', 2, 'companies', '$user->rights->tax->charges->creer', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/list.php?mainmenu=billing&leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/index.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByMonth', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2305__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?mainmenu=billing&leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 2200__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 1, 'banks', '$user->rights->banque->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 2, 'various_payment', '$user->rights->banque->modifier', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 2, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); +-- Salary +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled', __HANDLER__, 'left', 2210__+MAX_llx_menu__, 'billing', 'tax_sal', 6__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Salaries', 0, 'salaries', '$user->rights->salaries->read', '', 0, 10, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2211__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/card.php?mainmenu=billing&leftmenu=tax_salary&action=create', 'NewPayment', 1, 'companies', '$user->rights->salaries->write', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2212__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/list.php?mainmenu=billing&leftmenu=tax_salary', 'Payments', 1, 'companies', '$user->rights->salaries->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->salaries->enabled && $leftmenu=="tax_salary"', __HANDLER__, 'left', 2213__+MAX_llx_menu__, 'billing', '', 2210__+MAX_llx_menu__, '/salaries/stats/index.php?mainmenu=billing&leftmenu=tax_salary', 'Statistics', 1, 'companies', '$user->rights->salaries->read', '', 0, 4, __ENTITY__); +-- Loan +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled', __HANDLER__, 'left', 2220__+MAX_llx_menu__, 'billing', 'tax_loan', 6__+MAX_llx_menu__, '/loan/list.php?mainmenu=billing&leftmenu=tax_loan', 'Loans', 0, 'loan', '$user->rights->loan->read', '', 0, 20, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2221__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/card.php?mainmenu=billing&leftmenu=tax_loan&action=create', 'NewLoan', 1, 'loan', '$user->rights->loan->write', '', 0, 2, __ENTITY__); +--insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan"', __HANDLER__, 'left', 2222__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/payment/list.php?mainmenu=billing&leftmenu=tax_loan', 'Payments', 1, 'companies', '$user->rights->loan->read', '', 0, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->loan->enabled && $leftmenu=="tax_loan" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)', __HANDLER__, 'left', 2223__+MAX_llx_menu__, 'billing', '', 2220__+MAX_llx_menu__, '/loan/calc.php?mainmenu=billing&leftmenu=tax_loan', 'Calculator', 1, 'companies', '$user->rights->loan->calc', '', 0, 4, __ENTITY__); +-- Various payments +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 6__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'MenuVariousPayment', 0, 'banks', '$user->rights->banque->lire', '', 0, 30, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/card.php?mainmenu=billing&leftmenu=tax_various&action=create', 'New', 1, 'various_payment', '$user->rights->banque->modifier', '', 0, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/compta/bank/various_payment/list.php?mainmenu=billing&leftmenu=tax_various', 'List', 1, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__); -- Accounting (Double entries) insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'accountancy', 9__+MAX_llx_menu__, '/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', 0, 'main', '! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire', '', 0, 7, __ENTITY__); -- Setup diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 0bfa4cfd2db..99c9a1002a5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1096,7 +1096,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM global $mysoc; $permtoshowmenu = ((!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) || (!empty($conf->loan->enabled) && $user->rights->loan->read) || (!empty($conf->banque->enabled) && $user->rights->banque->lire)); - $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); + $newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=billing", $langs->trans("MenuTaxesAndSpecialExpenses"), 0, $permtoshowmenu, '', $mainmenu, 'tax'); // Social contributions if (!empty($conf->tax->enabled)) @@ -1151,11 +1151,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->salaries->enabled)) { $langs->load("salaries"); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 1, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary&mainmenu=billing", $langs->trans("Salaries"), 0, $user->rights->salaries->read, '', $mainmenu, 'tax_salary'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_salary/i', $leftmenu)) { - $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 2, $user->rights->salaries->write); - $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 2, $user->rights->salaries->read); - $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 2, $user->rights->salaries->read); + $newmenu->add("/salaries/card.php?leftmenu=tax_salary&action=create", $langs->trans("NewPayment"), 1, $user->rights->salaries->write); + $newmenu->add("/salaries/list.php?leftmenu=tax_salary", $langs->trans("Payments"), 1, $user->rights->salaries->read); + $newmenu->add("/salaries/stats/index.php?leftmenu=tax_salary", $langs->trans("Statistics"), 1, $user->rights->salaries->read); } } @@ -1163,9 +1163,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->loan->enabled)) { $langs->load("loan"); - $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 1, $user->rights->loan->read, '', $mainmenu, 'tax_loan'); + $newmenu->add("/loan/list.php?leftmenu=tax_loan&mainmenu=billing", $langs->trans("Loans"), 0, $user->rights->loan->read, '', $mainmenu, 'tax_loan'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_loan/i', $leftmenu)) { - $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 2, $user->rights->loan->write); + $newmenu->add("/loan/card.php?leftmenu=tax_loan&action=create", $langs->trans("NewLoan"), 1, $user->rights->loan->write); //$newmenu->add("/loan/payment/list.php?leftmenu=tax_loan",$langs->trans("Payments"),2,$user->rights->loan->read); } } @@ -1174,10 +1174,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { $langs->load("banks"); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 1, $user->rights->banque->lire, '', $mainmenu, 'tax_various'); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->rights->banque->lire, '', $mainmenu, 'tax_various'); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { - $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 2, $user->rights->banque->modifier); - $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 2, $user->rights->banque->lire); + $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create", $langs->trans("New"), 1, $user->rights->banque->modifier); + $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various", $langs->trans("List"), 1, $user->rights->banque->lire); } } } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index dd250316bc7..ab9ead7e991 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -701,6 +701,7 @@ MenuECM=Documents MenuAWStats=AWStats MenuMembers=Members MenuAgendaGoogle=Google agenda +MenuTaxesAndSpecialExpenses=Taxes | Special expenses ThisLimitIsDefinedInSetup=Dolibarr limit (Menu home-setup-security): %s Kb, PHP limit: %s Kb NoFileFound=No documents saved in this directory CurrentUserLanguage=Current language From 7d7ef1e72afef36113bbd6eb5bf553c8c72f8da2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jul 2020 15:34:26 +0200 Subject: [PATCH 15/24] FIX option PRODUIT_CUSTOMER_PRICES_BY_QTY Fix setup of product --- htdocs/core/lib/ajax.lib.php | 14 ++++++++-- htdocs/core/tpl/objectline_create.tpl.php | 16 ++++++++--- htdocs/product/admin/product.php | 9 ++++-- htdocs/product/price.php | 34 +++++++++++++++-------- 4 files changed, 53 insertions(+), 20 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 1d3e80b90be..fc481e70957 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -61,7 +61,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen $script .= '