';
}
}
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index d5d2488c092..c2ccf442c28 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -8,8 +8,8 @@
* Copyright (C) 2016 Juanjo Menent
* Copyright (C) 2017-2019 Alexandre Spangaro
* Copyright (C) 2018 Ferran Marcet
- * Copyright (C) 2018-2024 Frédéric France
- * Copyright (C) 2021 Gauthier VERDOL
+ * Copyright (C) 2018-2024 Frédéric France
+ * Copyright (C) 2021 Gauthier VERDOL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -819,84 +819,6 @@ if ($resql) {
print '';
}
- // Form to reconcile
- if ($user->hasRight('banque', 'consolidate') && $action == 'reconcile') {
- print '
';
+
+ // Show last bank statements
+ $nbmax = 12; // We show last 12 receipts (so we can have more than one year)
+ $liste = "";
+ $sql = "SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX."bank";
+ $sql .= " WHERE fk_account = ".((int) $object->id)." AND num_releve IS NOT NULL";
+ $sql .= $db->order("num_releve", "DESC");
+ $sql .= $db->plimit($nbmax + 1);
+ print ' ';
+ print $langs->trans("LastAccountStatements").' : ';
+ $resqlr = $db->query($sql);
+ if ($resqlr) {
+ $numr = $db->num_rows($resqlr);
+ $i = 0;
+ $last_ok = 0;
+ while (($i < $numr) && ($i < $nbmax)) {
+ $objr = $db->fetch_object($resqlr);
+ if (!$last_ok) {
+ $last_releve = $objr->num_releve;
+ $last_ok = 1;
+ }
+ $i++;
+ $liste = ''.dol_escape_htmltag($objr->num_releve).' '.$liste;
+ }
+ if ($numr >= $nbmax) {
+ $liste = "... ".$liste;
+ }
+ print $liste;
+ if ($numr <= 0) {
+ print ''.$langs->trans("None").'';
+ }
+ } else {
+ dol_print_error($db);
+ }
+
+ // Using BANK_REPORT_LAST_NUM_RELEVE to automatically report last num (or not)
+ if (getDolGlobalString('BANK_REPORT_LAST_NUM_RELEVE')) {
+ print '
+
+ ';
+ }
+ print '
';
+ }
// We can add page now to param
if ($page != '') {
@@ -1031,7 +1032,6 @@ if ($resql) {
}
$moreforfilter = '';
-
$moreforfilter .= '
';
$moreforfilter .= $langs->trans('DateOperationShort');
$moreforfilter .= ($conf->browser->layout == 'phone' ? ' ' : ' ');
@@ -1086,6 +1086,8 @@ if ($resql) {
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
+ $selectedfields .= ($action == 'reconcile' ? $form->showCheckAddButtons('checkforselect', 1) : '');
+
// When action is 'reconcile', we force to have the column num_releve always enabled (otherwise we can't make reconciliation).
if ($action == 'reconcile') {
$arrayfields['b.num_releve']['checked'] = 1;
@@ -1401,14 +1403,7 @@ if ($resql) {
print '';
}
if (!empty($arrayfields['b.num_releve']['checked'])) {
- print '
';
- print '';
- print ' ';
- print '
';
+ print '
';
}
// conciliate
@@ -1461,13 +1456,9 @@ if ($resql) {
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '
';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($obj->rowid, $arrayofselected)) {
- $selected = 1;
- }
- print '';
+ print '
';
if (!$i) {
@@ -1799,13 +1790,6 @@ if ($resql) {
if ($objp->num_releve) {
print ''.dol_escape_htmltag($objp->num_releve).'';
}
- if (!$objp->conciliated && $action == 'reconcile') {
- if ($objp->num_releve) {
- print ' ';
- }
- $tmparray = GETPOST('rowid', 'array:int');
- print 'rowid]) ? ' checked' : '').'>';
- }
}
print '';
if (!$i) {
@@ -1873,13 +1857,9 @@ if ($resql) {
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
- print '
';
- if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
- $selected = 0;
- if (in_array($objp->rowid, $arrayofselected)) {
- $selected = 1;
- }
- print '';
+ print '