Add a protection so bank receipt is a sortable number

This commit is contained in:
Laurent Destailleur 2023-05-04 19:00:04 +02:00
parent c4dc0b3c35
commit 65b0086cfb
2 changed files with 14 additions and 3 deletions

View File

@ -808,8 +808,18 @@ if ($resql) {
// Form to reconcile
if ($user->rights->banque->consolidate && $action == 'reconcile') {
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
print '<input class="flat" id="num_releve" name="num_releve" type="text" value="'.(GETPOST('num_releve') ?GETPOST('num_releve') : '').'" size="10">'; // 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 '<input class="flat width175" pattern="[0-9]+" title="'.dol_escape_htmltag($texttoshow.($placeholder ? ': '.$placeholder : '')).'" id="num_releve" name="num_releve" placeholder="'.dol_escape_htmltag($placeholder).'" type="text" value="'.(GETPOST('num_releve', 'int') ? GETPOST('num_releve', 'int') : '').'">'; // The only default value is value we just entered
print '</div>';
if (is_array($options) && count($options)) {
print $langs->trans("EventualyAddCategory").': ';

View File

@ -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