From 139a1ba70d2d2b911ac50e8b30474921bd4fa547 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 29 Mar 2021 17:22:19 +0200 Subject: [PATCH 1/4] FIX : if $conf->banque->enabled --- htdocs/compta/sociales/list.php | 4 +++- htdocs/compta/sociales/payments.php | 2 +- htdocs/compta/tva/list.php | 4 +++- htdocs/compta/tva/payments.php | 37 +++++++++++++++++------------ htdocs/salaries/payments.php | 20 ++++++++++------ 5 files changed, 42 insertions(+), 25 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index b83df0b90b6..d65df40f48d 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -111,10 +111,12 @@ $arrayfields = array( 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->projet->enabled))), 'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70), 'cs.fk_mode_reglement' =>array('checked'=>1, 'position'=>80, 'label'=>"DefaultPaymentMode"), - 'cs.fk_account' =>array('checked'=>1, 'position'=>90, 'label'=>"DefaultBankAccount"), 'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100), 'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110), ); + +if(!empty($conf->banque->enabled)) $arrayfields['cs.fk_account'] = array('checked'=>1, 'position'=>90, 'label'=>"DefaultBankAccount"); + $arrayfields = dol_sort_array($arrayfields, 'position'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index d5079ed3c06..c11f13c14fa 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -239,8 +239,8 @@ print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $pa print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "pc.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); -print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "pc.fk_bank", "", $param, '', $sortfield, $sortorder); if (!empty($conf->banque->enabled)) { + print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "pc.fk_bank", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index b509570fa41..51960a3fb41 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -86,10 +86,12 @@ $arrayfields = array( 't.label' =>array('checked'=>1, 'position'=>20, 'label'=>"Label"), 't.datev' =>array('checked'=>1, 'position'=>30, 'label'=>"PeriodEndDate"), 't.fk_typepayment' =>array('checked'=>1, 'position'=>50, 'label'=>"DefaultPaymentMode"), - 't.fk_account' =>array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"), 't.amount' =>array('checked'=>1, 'position'=>90, 'label'=>"Amount"), 't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"), ); + +if(!empty($conf->banque->enabled)) $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); + $arrayfields = dol_sort_array($arrayfields, 'position'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 73f34a476e6..83399d5a5c8 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -125,8 +125,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "pc.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); - print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "ptva.fk_bank", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "bank.ref", "", $param, '', $sortfield, $sortorder); + if (!empty($conf->banque->enabled)) { + print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "ptva.fk_bank", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "bank.ref", "", $param, '', $sortfield, $sortorder); + } //print_liste_field_titre("TypeContrib", $_SERVER["PHP_SELF"], "tva.fk_type", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ExpectedToPay", $_SERVER["PHP_SELF"], "tva.amount", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder); @@ -207,18 +209,21 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { // Chq number print ''.$obj->num_payment.''; - // Bank transaction - print ''; - $accountlinestatic->id = $obj->fk_bank; - print $accountlinestatic->getNomUrl(1); - print ''; + if (!empty($conf->banque->enabled)) { + // Bank transaction + print ''; + $accountlinestatic->id = $obj->fk_bank; + print $accountlinestatic->getNomUrl(1); + print ''; + + // Account + print ''; + $account = new Account($db); + $account->fetch($obj->fk_account); + print $account->getNomUrl(1); + print ''; + } - // Account - print ''; - $account = new Account($db); - $account->fetch($obj->fk_account); - print $account->getNomUrl(1); - print ''; // Type //print ''.$obj->type_label.''; // Expected to pay @@ -240,8 +245,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { print ''; // A total here has no sense //print ' '; print ' '; - print ' '; - print ' '; + if (!empty($conf->banque->enabled)) { + print ' '; + print ' '; + } print ' '; print ' '; print ''.price($totalpaye).""; diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 7819cdad0e8..7cf48c77fa5 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -330,12 +330,15 @@ $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16 print ''; // Chq number print ''; -// Bank transaction -print ''; -print ''; -print ''; -// Account + if (!empty($conf->banque->enabled)) { + + // Bank transaction + print ''; + print ''; + print ''; + + // Account print ''; $form->select_comptes($search_account, 'search_account', 0, '', 1); print ''; @@ -369,8 +372,10 @@ print_liste_field_titre("DateValue", $_SERVER["PHP_SELF"], "b.datev,s.rowid", "" print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pst.code", "", $param, 'class="left"', $sortfield, $sortorder); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "s.num_payment", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); -print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "s.fk_bank", "", $param, '', $sortfield, $sortorder); -if (!empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); +if (!empty($conf->banque->enabled)) { + print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "s.fk_bank", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); +} print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -459,6 +464,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $accountlinestatic->id = $obj->fk_bank; print $accountlinestatic->getNomUrl(1); print ''; + if (!$i) $totalarray['nbfield']++; print ''; if ($obj->fk_bank > 0) { From e1e3bcbf28cea0fba05174e5ac8fa07882aa5eef Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 29 Mar 2021 15:26:24 +0000 Subject: [PATCH 2/4] Fixing style errors. --- htdocs/compta/sociales/list.php | 2 +- htdocs/compta/tva/list.php | 2 +- htdocs/salaries/payments.php | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index d65df40f48d..38e0161e1a2 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -115,7 +115,7 @@ $arrayfields = array( 'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110), ); -if(!empty($conf->banque->enabled)) $arrayfields['cs.fk_account'] = array('checked'=>1, 'position'=>90, 'label'=>"DefaultBankAccount"); +if (!empty($conf->banque->enabled)) $arrayfields['cs.fk_account'] = array('checked'=>1, 'position'=>90, 'label'=>"DefaultBankAccount"); $arrayfields = dol_sort_array($arrayfields, 'position'); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 51960a3fb41..3079d163e36 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -90,7 +90,7 @@ $arrayfields = array( 't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"), ); -if(!empty($conf->banque->enabled)) $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); +if (!empty($conf->banque->enabled)) $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); $arrayfields = dol_sort_array($arrayfields, 'position'); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index 7cf48c77fa5..c91613f2327 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -332,7 +332,6 @@ print ''; print ''; if (!empty($conf->banque->enabled)) { - // Bank transaction print ''; print ''; From b732a82c3d7a59966a802a5ce3df5df59ce42115 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Mar 2021 17:40:36 +0200 Subject: [PATCH 3/4] Update list.php --- htdocs/compta/sociales/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 38e0161e1a2..0614532605f 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -115,7 +115,9 @@ $arrayfields = array( 'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110), ); -if (!empty($conf->banque->enabled)) $arrayfields['cs.fk_account'] = array('checked'=>1, 'position'=>90, 'label'=>"DefaultBankAccount"); +if (!empty($conf->banque->enabled)) { + $arrayfields['cs.fk_account'] = array('checked'=>1, 'position'=>90, 'label'=>"DefaultBankAccount"); +} $arrayfields = dol_sort_array($arrayfields, 'position'); From f4b0723f30574892d4ca9f90bcccfbb3ddf727c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Mar 2021 17:41:19 +0200 Subject: [PATCH 4/4] Update list.php --- htdocs/compta/tva/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 3079d163e36..16e780e4b0d 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -90,7 +90,9 @@ $arrayfields = array( 't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"), ); -if (!empty($conf->banque->enabled)) $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); +if (!empty($conf->banque->enabled)) { + $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); +} $arrayfields = dol_sort_array($arrayfields, 'position');