From 0d693140a2359991d799c8b80c47e63243f96225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick?= Date: Tue, 10 Dec 2013 16:51:39 -0500 Subject: [PATCH] Bug 11373: Show the difference between the amount collected and the amount paid of a fine payment. This patch adds a feature in the fine payment section. It allows to see the change due to patrons when the amount collected is higher than the amount paid. This includes also a new system preference called FineChange which enables or disables the feature. Test plan : - Apply patch. - Make sure FineChange is at ENABLE in System preferences > Patrons. - Select a patron with a fine. - Go to Fines > Pay fines. - Click the button pay. - Choose the amount paid equal to the outstanding amount (exemple : 3$). - Choose the amount collected to be more than the outstanding amount (exemple : 5$). - Confirm that the change is correct (example : 5$ - 3$ = 2$). - Click the button confirm. - Click on Yes in the dialog box. - Confirm that the payment has been made (example : last amount = 3$). - Make sure FineChange is at DISABLE in System preferences > Patrons. - Select a patron with a fine and go to Fines > Pay fines. - Confirm that the inputs paid and change are gone. - Choose an amount collected (exemple : 3$). - Click the button confirm. - Confirm that the payment has been made. --- .../prog/en/modules/admin/preferences/patrons.pref | 6 ++ .../prog/en/modules/members/paycollect.tt | 89 +++++++++++++++++++++- members/paycollect.pl | 1 + 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 8c8227d4..2a6dbaf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -213,6 +213,12 @@ Patrons: yes: Allow only superlibrarians no: Allow all permitted users - "to access/change superlibrarian privileges. Note: A permitted user needs to have the 'permissions' flag (if no superlibrarian)." + - + - pref: FineChange + choices: + yes: Enable + no: Disable + - fine change display when a user pays a fine. Privacy: - - Use the following URL diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt index 14384b3..f5ff194 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -98,11 +98,26 @@
    + [% IF FineChange %] +
  1. + + +
  2. +
  3. + + +
  4. +
  5. + + +
  6. + [% ELSE %]
  7. + [% END %] [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] [% IF payment_types %]
  8. @@ -191,6 +206,24 @@ Total amount outstanding: [% total | format('%.2f') %]
  9. + [% IF FineChange %] +
  10. + + +
  11. +
  12. + [% IF type == 'writeoff' %] + + [% ELSE %] + + [% END %] + +
  13. +
  14. + + +
  15. + [% ELSE %]
  16. [% IF type == 'writeoff' %] @@ -200,6 +233,7 @@
  17. + [% END %] [% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] [% IF payment_types %]
  18. @@ -233,14 +267,54 @@ + + + + [% MACRO jsinclude BLOCK %] [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %] [% END %] diff --git a/members/paycollect.pl b/members/paycollect.pl index a15267f..4f6584f 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -194,6 +194,7 @@ $template->param( patron => $patron, total => $total_due, ExtendedPatronAttributes => C4::Context->preference('ExtendedPatronAttributes'), + FineChange => C4::Context->preference('FineChange'), csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), ); -- 2.7.4