From 65b0086cfb7b5cd666a1f523397f89bd9aac27ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 May 2023 19:00:04 +0200 Subject: [PATCH] Add a protection so bank receipt is a sortable number --- htdocs/compta/bank/bankentries_list.php | 14 ++++++++++++-- htdocs/langs/en_US/banks.lang | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 96dd247d24b..ac429de383f 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -808,8 +808,18 @@ if ($resql) { // Form to reconcile if ($user->rights->banque->consolidate && $action == 'reconcile') { print '
'; - print ''.$langs->trans("InputReceiptNumber").': '; - print ''; // The only default value is value we just entered + $texttoshow = $langs->trans("InputReceiptNumber").': '; + $yyyy = dol_substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1).substr($langs->transnoentitiesnoconv("Year"), 0, 1); + $mm = dol_substr($langs->transnoentitiesnoconv("Month"), 0, 1).substr($langs->transnoentitiesnoconv("Month"), 0, 1); + $dd = dol_substr($langs->transnoentitiesnoconv("Day"), 0, 1).substr($langs->transnoentitiesnoconv("Day"), 0, 1); + $placeholder = $yyyy.$mm; + $placeholder .= ' '.$langs->trans("or").' '; + $placeholder .= $yyyy.$mm.$dd; + if (!$placeholder) { + $texttoshow .= $langs->trans("InputReceiptNumberBis"); + } + print $texttoshow; + print ''; // The only default value is value we just entered print '
'; if (is_array($options) && count($options)) { print $langs->trans("EventualyAddCategory").': '; diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index 2c895b48034..a5b3f64efea 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -147,7 +147,8 @@ ShowAllAccounts=Show for all accounts FutureTransaction=Future transaction. Unable to reconcile. SelectChequeTransactionAndGenerate=Select/filter the checks which are to be included in the check deposit receipt. Then, click on "Create". SelectPaymentTransactionAndGenerate=Select/filter the documents which are to be included in the %s deposit receipt. Then, click on "Create". -InputReceiptNumber=Choose the bank statement related with the conciliation. Use a sortable numeric value: YYYYMM or YYYYMMDD +InputReceiptNumber=Choose the bank statement related with the conciliation. Use a sortable numeric value +InputReceiptNumberBis=YYYYMM or YYYYMMDD EventualyAddCategory=Eventually, specify a category in which to classify the records ToConciliate=To reconcile? ThenCheckLinesAndConciliate=Then, check the lines present in the bank statement and click