From 5a4fcb471840ae17a0ae69fa52bbff6b27555425 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 29 Nov 2018 19:56:43 +0000 Subject: [PATCH] Bug 21918: Update buttons on fines to match newer buttons This patch makes a number of changes to the "Pay fines" template, the goal of which is to make the interface look better in general. Changes include: - Styling the "Pay" and "Write off" buttons as Bootstrap buttons. - Adding DataTables sorting, searching, and filtering. - Adding a column showing the fine date. - Hide the "Add note" input, add a link to show it. - Add some missing "preventDefault" methods from events. - Add "Writeoff selected" to the buttons which are disabled when there is no checkbox selection. - The tag is now expected by the HTML validator to be after , so this section has been moved to suppress validator errors. To test, apply the patch and locate a patron who has multiple outstanding fines. - Go to Fines -> Pay fines - Confirm that the table of fines is shown as a DataTable, with sorting on columns which have data. - Test columns settings in Administration -> Columns settings. - Confirm that fine dates are shown, and that sorting by this column works correctly. - Click an "Add note" link to show a note input field. Focus should be in the newly-displayed input. - Confirm that notes are still saved correctly when paying or writing off single or multiple fines. - Confirm that when the "add note" input is hidden, its contents are erased. - Uncheck all checkboxes by clicking the "Clear all" link at the top. The "Pay selected" and "Write off selected" buttons should become disabled. - Checking any checkbox should re-enable those buttons. - Test that the relocated "Apply" button (for outstanding credits) still works as expected. Signed-off-by: Jose-Mario Monteiro-Santos Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- admin/columns_settings.yml | 23 ++++ .../prog/css/src/staff-global.scss | 1 + .../prog/en/modules/members/pay.tt | 112 ++++++++++++------ 3 files changed, 100 insertions(+), 36 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 292c72b70d..8176529d76 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -319,6 +319,29 @@ modules: cannot_be_toggled: 1 cannot_be_modified: 1 + pay: + pay-fines-table: + - + columnname: checkbox + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: actions + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: description + - + columnname: date + - + columnname: note + - + columnname: account_type + - + columnname: amount + - + columnname: amountoutstanding + member: memberresultst: - diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index e98bb380ca..4df909dfee 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -859,6 +859,7 @@ tfoot { td { background-color: #F3F3F3; font-weight: bold; + vertical-align: middle; } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index 207db5ac9e..f82fbeaadc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -4,10 +4,13 @@ [% USE AuthorisedValues %] [% USE Branches %] [% USE Price %] +[% USE ColumnsSettings %] +[% USE KohaDates %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Make a payment for [% patron.firstname | html %] [% patron.surname | html %] [% INCLUDE 'doc-head-close.inc' %] +[% Asset.css("css/datatables.css") | $raw %] @@ -40,25 +43,17 @@ - - + + - + + - - - -[% IF outstanding_credits.total_outstanding < 0 %] - -[% ELSE %] - -[% END %] - - + [% FOREACH line IN accounts %] @@ -67,10 +62,12 @@ [% END %] - - + + [% END %] -[% IF outstanding_credits.total_outstanding < 0 %] - - - - -[% END %] -[% IF ( account_grp.total ) %] - - - - - -[% END %] + + + [% IF outstanding_credits.total_outstanding < 0 %] + + + + + [% END %] + [% IF ( account_grp.total ) %] + + + + + [% END %] + + + [% IF outstanding_credits.total_outstanding < 0 %] + + [% ELSE %] + + [% END %] + + +
 Fines & charges Actions DescriptionPayment noteDatePayment note Account type Amount Amount outstanding
Total due:[% total + outstanding_credits.total_outstanding | $Price %][% total | $Price %]
+ [% IF ( line.amountoutstanding > 0 ) %] - - [% IF CAN_user_updatecharges_writeoff %][% END %] + + [% IF CAN_user_updatecharges_writeoff %] + + [% END %] [% END %] @@ -107,26 +104,43 @@ [%- IF line.description %], [% line.description | html %][% END %] [% IF line.title %]([% line.title | html %])[% END %] + [% line.date | $KohaDates %] + + Add note + + [% line.accounttype | html %] [% line.amount | $Price %] [% line.amountoutstanding | $Price %]
Outstanding credits could be applied [% outstanding_credits.total_outstanding | $Price %]
Sub total:[% account_grp.total | $Price %]
Outstanding credits could be applied:
Sub total:[% account_grp.total | $Price %]
Total due:[% total + outstanding_credits.total_outstanding | $Price %][% total | $Price %]
@@ -155,14 +169,16 @@ [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] - [% END %] -- 2.39.5