From 330e9cf50725c37176c45df32b920a6a363de6f9 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 1 Feb 2018 09:50:06 -0500 Subject: [PATCH] Bug 20120 - Writeoffs for individual fees allows an amount to be written off more than the amount of the fee In short, it is possible to 'over-writeoff' a fee such that the value of the fee is now a credit. Test Plan: 1) Attempt to writeoff a single fee, set the amount input to more than the amount of the fee. 2) Note the writeoff makes the fee go negative 3) Apply this patch 4) Attempt to repeat step 1, you should not be able to over-writeoff the fee --- .../intranet-tmpl/prog/en/modules/members/pay.tt | 6 ++++++ .../prog/en/modules/members/paycollect.tt | 24 ++++++++++++++++++++-- members/pay.pl | 10 +++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) 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 c9a5a30..304a95d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -66,6 +66,12 @@ function enableCheckboxActions(){
  • Create manual credit
  • + [% IF ( error_over ) %] +
    + The writeoff submitted was more than the value of the fee being written off. + The amount of the writeoff has been reduced from [% error_amount | format('%.2f') %] to [% error_amount_outstanding | format('%.2f') %]. +
    + [% END %] [% IF ( accounts ) %]
    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 7629874..c56111f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt @@ -6,10 +6,28 @@