feat: Filter-Persistierung und Standard-Statusfilter
- Filter bleiben beim Navigieren (card.php → list.php) erhalten (Session) - Neuer Admin-Setting: Standard-Statusfilter für die Buchungsliste - Empfehlung: "Neu" als Standard, damit zugeordnete Buchungen ausgeblendet werden Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
201290e6ad
commit
33ecb49fc4
4 changed files with 105 additions and 11 deletions
|
|
@ -205,6 +205,12 @@ if ($action == 'update') {
|
|||
$error++;
|
||||
}
|
||||
|
||||
// Default list status filter
|
||||
$res = dolibarr_set_const($db, "BANKIMPORT_LIST_DEFAULT_STATUS", GETPOST('BANKIMPORT_LIST_DEFAULT_STATUS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Reminder setting
|
||||
$res = dolibarr_set_const($db, "BANKIMPORT_REMINDER_ENABLED", GETPOSTINT('BANKIMPORT_REMINDER_ENABLED'), 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
|
|
@ -394,6 +400,33 @@ print '</tr>';
|
|||
|
||||
print '</table>';
|
||||
|
||||
// List Settings Section
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("ListSettings").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Default status filter
|
||||
$defaultListStatus = getDolGlobalString('BANKIMPORT_LIST_DEFAULT_STATUS');
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="titlefield">'.$langs->trans("DefaultStatusFilter").'</td>';
|
||||
print '<td>';
|
||||
$statusOptions = array(
|
||||
'' => $langs->trans("AllStatuses"),
|
||||
'0' => $langs->trans("StatusNew"),
|
||||
'1' => $langs->trans("StatusMatched"),
|
||||
'2' => $langs->trans("StatusReconciled"),
|
||||
'9' => $langs->trans("StatusIgnored"),
|
||||
);
|
||||
print $form->selectarray('BANKIMPORT_LIST_DEFAULT_STATUS', $statusOptions, $defaultListStatus, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200');
|
||||
print ' <span class="opacitymedium small">'.$langs->trans("DefaultStatusFilterHelp").'</span>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
// PDF Upload Section
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
|
|
|||
|
|
@ -223,6 +223,13 @@ TransactionsLinked = %s Buchungen dem Kontoauszug zugeordnet
|
|||
StatementsUploaded = %s Kontoauszüge erfolgreich hochgeladen
|
||||
MultipleFilesHint = Sie können mehrere PDF-Dateien gleichzeitig auswählen (Strg+Klick oder Shift+Klick)
|
||||
|
||||
#
|
||||
# Admin - Listen-Einstellungen
|
||||
#
|
||||
ListSettings = Listen-Einstellungen
|
||||
DefaultStatusFilter = Standard-Statusfilter
|
||||
DefaultStatusFilterHelp = Welcher Status wird standardmäßig in der Buchungsliste gefiltert. Empfehlung: "Neu" zeigt nur unbearbeitete Buchungen.
|
||||
|
||||
#
|
||||
# Admin - PDF Upload
|
||||
#
|
||||
|
|
|
|||
|
|
@ -267,6 +267,13 @@ Repair = Repair
|
|||
AdminTools = Admin Tools
|
||||
Open = Open
|
||||
|
||||
#
|
||||
# Admin - List Settings
|
||||
#
|
||||
ListSettings = List Settings
|
||||
DefaultStatusFilter = Default Status Filter
|
||||
DefaultStatusFilterHelp = Which status is filtered by default in the transaction list. Recommendation: "New" shows only unprocessed transactions.
|
||||
|
||||
#
|
||||
# Cash Discount / Skonto
|
||||
#
|
||||
|
|
|
|||
69
list.php
69
list.php
|
|
@ -67,18 +67,51 @@ if (!$user->hasRight('bankimport', 'read')) {
|
|||
accessforbidden();
|
||||
}
|
||||
|
||||
// Search parameters
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_iban = GETPOST('search_iban', 'alpha');
|
||||
$search_name = GETPOST('search_name', 'alpha');
|
||||
$search_description = GETPOST('search_description', 'alpha');
|
||||
$search_amount_min = GETPOST('search_amount_min', 'alpha');
|
||||
$search_amount_max = GETPOST('search_amount_max', 'alpha');
|
||||
$search_status = GETPOST('search_status', 'intcomma');
|
||||
// Search parameters - restore from session if no explicit filter provided
|
||||
$sessionKey = 'bankimport_list_filters';
|
||||
$hasSearchParams = GETPOSTISSET('search_ref') || GETPOSTISSET('search_status') || GETPOSTISSET('button_search')
|
||||
|| GETPOSTISSET('button_removefilter') || GETPOSTISSET('button_removefilter_x') || GETPOSTISSET('button_removefilter.x')
|
||||
|| GETPOSTISSET('search_iban') || GETPOSTISSET('search_name') || GETPOSTISSET('search_description')
|
||||
|| GETPOSTISSET('search_amount_min') || GETPOSTISSET('search_amount_max')
|
||||
|| GETPOSTISSET('search_date_fromday') || GETPOSTISSET('search_date_today')
|
||||
|| GETPOSTISSET('sortfield') || GETPOSTISSET('page');
|
||||
|
||||
// Date filter
|
||||
$search_date_from = dol_mktime(0, 0, 0, GETPOSTINT('search_date_frommonth'), GETPOSTINT('search_date_fromday'), GETPOSTINT('search_date_fromyear'));
|
||||
$search_date_to = dol_mktime(23, 59, 59, GETPOSTINT('search_date_tomonth'), GETPOSTINT('search_date_today'), GETPOSTINT('search_date_toyear'));
|
||||
if ($hasSearchParams) {
|
||||
// User is actively filtering - read from GET/POST
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_iban = GETPOST('search_iban', 'alpha');
|
||||
$search_name = GETPOST('search_name', 'alpha');
|
||||
$search_description = GETPOST('search_description', 'alpha');
|
||||
$search_amount_min = GETPOST('search_amount_min', 'alpha');
|
||||
$search_amount_max = GETPOST('search_amount_max', 'alpha');
|
||||
$search_status = GETPOST('search_status', 'intcomma');
|
||||
$search_date_from = dol_mktime(0, 0, 0, GETPOSTINT('search_date_frommonth'), GETPOSTINT('search_date_fromday'), GETPOSTINT('search_date_fromyear'));
|
||||
$search_date_to = dol_mktime(23, 59, 59, GETPOSTINT('search_date_tomonth'), GETPOSTINT('search_date_today'), GETPOSTINT('search_date_toyear'));
|
||||
} elseif (!empty($_SESSION[$sessionKey])) {
|
||||
// Restore from session (coming back from card.php/confirm.php)
|
||||
$filters = $_SESSION[$sessionKey];
|
||||
$search_ref = $filters['search_ref'] ?? '';
|
||||
$search_iban = $filters['search_iban'] ?? '';
|
||||
$search_name = $filters['search_name'] ?? '';
|
||||
$search_description = $filters['search_description'] ?? '';
|
||||
$search_amount_min = $filters['search_amount_min'] ?? '';
|
||||
$search_amount_max = $filters['search_amount_max'] ?? '';
|
||||
$search_status = $filters['search_status'] ?? '';
|
||||
$search_date_from = $filters['search_date_from'] ?? '';
|
||||
$search_date_to = $filters['search_date_to'] ?? '';
|
||||
} else {
|
||||
// First visit - apply default status filter from admin settings
|
||||
$search_ref = '';
|
||||
$search_iban = '';
|
||||
$search_name = '';
|
||||
$search_description = '';
|
||||
$search_amount_min = '';
|
||||
$search_amount_max = '';
|
||||
$defaultStatus = getDolGlobalString('BANKIMPORT_LIST_DEFAULT_STATUS');
|
||||
$search_status = ($defaultStatus !== '') ? $defaultStatus : '';
|
||||
$search_date_from = '';
|
||||
$search_date_to = '';
|
||||
}
|
||||
|
||||
// Sorting
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
|
|
@ -108,8 +141,22 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||
$search_date_from = '';
|
||||
$search_date_to = '';
|
||||
$toselect = array();
|
||||
unset($_SESSION[$sessionKey]);
|
||||
}
|
||||
|
||||
// Save current filters to session for persistence across page navigation
|
||||
$_SESSION[$sessionKey] = array(
|
||||
'search_ref' => $search_ref,
|
||||
'search_iban' => $search_iban,
|
||||
'search_name' => $search_name,
|
||||
'search_description' => $search_description,
|
||||
'search_amount_min' => $search_amount_min,
|
||||
'search_amount_max' => $search_amount_max,
|
||||
'search_status' => $search_status,
|
||||
'search_date_from' => $search_date_from,
|
||||
'search_date_to' => $search_date_to,
|
||||
);
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue