From 4340f85e3c50aadeb62473ff2233842907fcf5e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Nov 2019 01:22:13 +0100 Subject: [PATCH] Add warning --- htdocs/compta/paiement/cheque/card.php | 18 ++++++++++-------- htdocs/langs/en_US/errors.lang | 3 ++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 72de78e5d9f..9388fbcdd1f 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -678,19 +678,12 @@ else print_liste_field_titre("LineRecord", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; - $i = 1; + $i = 1; if ($num > 0) { while ($objp = $db->fetch_object($resql)) { - //$account_id = $objp->bid; FIXME not used - - // FIXME $accounts[$objp->bid] is a label - /*if (! isset($accounts[$objp->bid])) - $accounts[$objp->bid]=0; - $accounts[$objp->bid] += 1;*/ - print ''; print ''.$i.''; print ''.dol_print_date($db->jdate($objp->date), 'day').''; // Date operation @@ -751,6 +744,15 @@ else } print ""; + + // Cheque denormalized data nbcheque is similar to real number of cheque + if ($num > 0 && $i < ($object->nbcheque + 1)) { + // Show warning that some records were removed. + $langs->load("errors"); + print info_admin($langs->trans("WarningSomeBankTransactionByChequeWereRemovedAfter"), 0, 0, 'warning'); + // TODO Fix data ->nbcheque and ->amount + } + print ""; } else diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 2b23fc6d19e..53f9e57fceb 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -247,4 +247,5 @@ WarningYourLoginWasModifiedPleaseLogin=Your login was modified. For security pur WarningAnEntryAlreadyExistForTransKey=An entry already exists for the translation key for this language WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different recipient is limited to %s when using the mass actions on lists WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report -WarningProjectClosed=Project is closed. You must re-open it first. \ No newline at end of file +WarningProjectClosed=Project is closed. You must re-open it first. +WarningSomeBankTransactionByChequeWereRemovedAfter=Some bank transaction were removed after that the receipt including them were generated. So nb of cheques and total of receipt may differ from number and total in list. \ No newline at end of file