From 65ecd2f3eff5ac37d5211842639646c64c9442f8 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 22 Feb 2022 17:06:10 +0100 Subject: [PATCH 1/7] Fix : fix error of permission in holiday --- htdocs/holiday/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 70d9c8da54d..cbee61c6962 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -113,7 +113,7 @@ if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write && if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'holiday', $object->id, 'holiday'); +$result = restrictedArea($user, 'holiday', $object->id, 'holiday','','','rowid',$object->statut); /* @@ -1400,7 +1400,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { // Confirmation messages if ($action == 'delete') { - if ($user->rights->holiday->delete) { + if ($candelete) { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("TitleDeleteCP"), $langs->trans("ConfirmDeleteCP"), "confirm_delete", '', 0, 1); } } From 19dbed1804c0a74195a785f81381a765e0ac3fa4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 22 Feb 2022 16:10:56 +0000 Subject: [PATCH 2/7] Fixing style errors. --- htdocs/holiday/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index cbee61c6962..bbabc5327d8 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -113,7 +113,7 @@ if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write && if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'holiday', $object->id, 'holiday','','','rowid',$object->statut); +$result = restrictedArea($user, 'holiday', $object->id, 'holiday', '', '', 'rowid', $object->statut); /* From ed6f4b4ee1a0cf96ec64427623c41ff0055fd2b4 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 23 Feb 2022 15:33:51 +0100 Subject: [PATCH 3/7] Display Salary Paiement on compta report --- htdocs/compta/resultat/clientfourn.php | 4 +++- htdocs/compta/resultat/index.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index b5aca49aaae..f650244d677 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -857,7 +857,7 @@ if ($modecompta == 'BOOKKEEPING') { if ($modecompta == 'CREANCES-DETTES' || $modecompta == 'RECETTES-DEPENSES') { if ($modecompta == 'CREANCES-DETTES') { - $column = 'p.datev'; + $column = 'b.datev'; } else { $column = 'p.datep'; } @@ -865,6 +865,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank=b.rowid"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user"; $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")"; if (!empty($date_start) && !empty($date_end)) { @@ -876,6 +877,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql .= " UNION "; $sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank=b.rowid"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user"; $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")"; if (!empty($date_start) && !empty($date_end)) { diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 2d4ea6fc9e0..5f10013f294 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -611,7 +611,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { - $column = 'p.datev'; + $column = 'b.datev'; } if ($modecompta == "RECETTES-DEPENSES") { $column = 'p.datep'; @@ -621,6 +621,7 @@ if (!empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo $subtotal_ttc = 0; $sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank=b.rowid"; $sql .= " WHERE p.entity IN (".getEntity('payment_salary').")"; if (!empty($date_start) && !empty($date_end)) { $sql .= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'"; From 4d2dde0fe48d335a434a0e88a5101d878d1c7b7e Mon Sep 17 00:00:00 2001 From: Thomas Negre Date: Thu, 24 Feb 2022 14:34:06 +0100 Subject: [PATCH 4/7] fix bookmarks info bubble --- htdocs/bookmarks/bookmarks.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index d24ba63ef55..f8daff1cd14 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -66,7 +66,7 @@ function printDropdownBookmarksList() // Url to list bookmark - $listbtn = ''; + $listbtn = ''; $listbtn .= img_picto('', 'bookmark', 'class="paddingright"').$langs->trans('Bookmarks').''; // Url to go on create new bookmark page From 1040555baf505faa00f4676f80e2a2558a55fc91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9=20GDSOFT?= Date: Fri, 25 Feb 2022 11:26:56 +0100 Subject: [PATCH 5/7] accoutancy : subleger label input automatic filling when selecting subleger account in select2 list --- htdocs/accountancy/bookkeeping/card.php | 5 +++-- htdocs/core/class/html.formaccounting.class.php | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index c156a388735..df43f28bd1f 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -659,7 +659,7 @@ if ($action == 'create') { // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1); + print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1,'maxwidth250','','subledger_label'); } else { print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; } @@ -728,7 +728,7 @@ if ($action == 'create') { // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount('', 'subledger_account', 1); + print $formaccounting->select_auxaccount('', 'subledger_account', 1,'maxwidth250','','subledger_label'); } else { print ''; } @@ -758,6 +758,7 @@ if ($action == 'create') { print ""; } print ''; + } } } else { diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index dc6e6d8c6cd..638d3a4bdfd 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -441,7 +441,7 @@ class FormAccounting extends Form * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. * @return string String with HTML select */ - public function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth250', $usecache = '') + public function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth250', $usecache = '', $labelhtmlname = '') { // phpcs:enable @@ -505,7 +505,20 @@ class FormAccounting extends Form // Build select $out .= Form::selectarray($htmlname, $aux_account, $selectid, ($showempty ? (is_numeric($showempty) ? 1 : $showempty): 0), 0, 0, '', 0, 0, 0, '', $morecss, 1); + //automatic filling if we give the name of the subledger_label input + if (!empty($labelhtmlname)) { + $out .= ''; + } + return $out; } From c0dd96a45654aa8f85f5fcc7278bfcc510cf97bb Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 25 Feb 2022 10:36:02 +0000 Subject: [PATCH 6/7] Fixing style errors. --- htdocs/accountancy/bookkeeping/card.php | 5 ++--- htdocs/core/class/html.formaccounting.class.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index df43f28bd1f..01e78cf4d27 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -659,7 +659,7 @@ if ($action == 'create') { // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1,'maxwidth250','','subledger_label'); + print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); } else { print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; } @@ -728,7 +728,7 @@ if ($action == 'create') { // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount('', 'subledger_account', 1,'maxwidth250','','subledger_label'); + print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); } else { print ''; } @@ -758,7 +758,6 @@ if ($action == 'create') { print ""; } print ''; - } } } else { diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 638d3a4bdfd..645e045a903 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -518,7 +518,7 @@ class FormAccounting extends Form '; } - + return $out; } From be95662ece21162f475fb42876cff87e2843cf06 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Feb 2022 13:19:01 +0100 Subject: [PATCH 7/7] Revert "NEW : accoutancy : subleger label input automatic filling when selecting subleger account in select2 list" --- htdocs/accountancy/bookkeeping/card.php | 4 ++-- htdocs/core/class/html.formaccounting.class.php | 15 +-------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 01e78cf4d27..c156a388735 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -659,7 +659,7 @@ if ($action == 'create') { // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); + print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1); } else { print 'subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">'; } @@ -728,7 +728,7 @@ if ($action == 'create') { // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label'); + print $formaccounting->select_auxaccount('', 'subledger_account', 1); } else { print ''; } diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 645e045a903..dc6e6d8c6cd 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -441,7 +441,7 @@ class FormAccounting extends Form * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. * @return string String with HTML select */ - public function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth250', $usecache = '', $labelhtmlname = '') + public function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth250', $usecache = '') { // phpcs:enable @@ -505,19 +505,6 @@ class FormAccounting extends Form // Build select $out .= Form::selectarray($htmlname, $aux_account, $selectid, ($showempty ? (is_numeric($showempty) ? 1 : $showempty): 0), 0, 0, '', 0, 0, 0, '', $morecss, 1); - //automatic filling if we give the name of the subledger_label input - if (!empty($labelhtmlname)) { - $out .= ''; - } return $out; }