Bug 20703

Summary: Add ability to void any credit
Product: Koha Reporter: Kyle M Hall <kyle>
Component: Fines and feesAssignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: enhancement    
Priority: P5 - low CC: cslone, martin.renvoize, nick, sally.healey, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 20703: Add ability to void any credit
Bug 20703: Add ability to void any credit
Bug 20703: Add ability to void any credit
Bug 20703: Add confirmation modal when making a credit void
Bug 20703: Add confirmation modal when making a credit void

Description Kyle M Hall 2018-05-03 13:15:22 UTC
At this time, only payments may be voided. There is no reason to have this limitation. There are situations where a librarian may need to void an accidental writeoff, or perhaps void an automatic credit that was created by Koha. For illustration, this is directly from a partner library:

"For example a lost book refund becomes a credit on account.  Presently the credit may be applied to a fine for a different item charged to patron. We perform a write off to clear the remaining credit, then add the fine back to the account and give the patron a refund for the lost/refunded amount. Our accounting system ask that we keep the Lost funds/refunds separate from all fines."
Comment 1 Kyle M Hall 2018-05-03 13:15:47 UTC
*** Bug 19449 has been marked as a duplicate of this bug. ***
Comment 2 Kyle M Hall 2018-05-03 13:59:27 UTC
Created attachment 75013 [details] [review]
Bug 20703: Add ability to void any credit

At this time, only payments may be voided. There is no reason to have this limitation. There are situations where a librarian may need to void an accidental writeoff, or perhaps void an automatic credit that was created by Koha. For illustration, this is directly from a partner library:

"For example a lost book refund becomes a credit on account.  Presently the credit may be applied to a fine for a different item charged to patron. We perform a write off to clear the remaining credit, then add the fine back to the account and give the patron a refund for the lost/refunded amount. Our accounting system ask that we keep the Lost funds/refunds separate from all fines."

Test Plan:
1) Create a fine and write it off
2) Note there is no 'void' button for the writeoff
3) Apply this patch
4) Note the buttons now show
5) Test each button on a writeoff
Comment 3 Mark Tompsett 2018-05-08 13:46:33 UTC
Comment on attachment 75013 [details] [review]
Bug 20703: Add ability to void any credit

Review of attachment 75013 [details] [review]:
-----------------------------------------------------------------

::: Koha/Account/Line.pm
@@ +60,4 @@
>      my ($self) = @_;
>  
>      # Make sure it is a payment we are voiding
> +    return unless $self->amount < 0;

Much nicer to not be dependent on a particular text.

::: koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt
@@ +77,5 @@
> +                [% END %]
> +                [% IF account.amount < 0 %]
> +                    <a href="boraccount.pl?action=void&amp;accountlines_id=[% account.accountlines_id %]&amp;borrowernumber=[% account.borrowernumber %]" class="btn btn-default btn-xs"><i class="fa fa-ban"></i> Void</a>
> +                [% END %]
> +          [% ELSE %]

Nice catch on the footerjs already at the top of the file.
Comment 4 Mark Tompsett 2018-05-08 13:47:47 UTC
Created attachment 75154 [details] [review]
Bug 20703: Add ability to void any credit

At this time, only payments may be voided. There is no reason to have this limitation. There are situations where a librarian may need to void an accidental writeoff, or perhaps void an automatic credit that was created by Koha. For illustration, this is directly from a partner library:

"For example a lost book refund becomes a credit on account.  Presently the credit may be applied to a fine for a different item charged to patron. We perform a write off to clear the remaining credit, then add the fine back to the account and give the patron a refund for the lost/refunded amount. Our accounting system ask that we keep the Lost funds/refunds separate from all fines."

Test Plan:
1) Create a fine and write it off
2) Note there is no 'void' button for the writeoff
3) Apply this patch
4) Note the buttons now show
5) Test each button on a writeoff

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 5 Tomás Cohen Arazi 2018-05-22 14:04:17 UTC
Kyle, the functionality is ok. Would you agree there could be a confirmation modal as we have in other places?
Comment 6 Tomás Cohen Arazi 2018-05-22 14:05:44 UTC
Created attachment 75468 [details] [review]
Bug 20703: Add ability to void any credit

At this time, only payments may be voided. There is no reason to have this limitation. There are situations where a librarian may need to void an accidental writeoff, or perhaps void an automatic credit that was created by Koha. For illustration, this is directly from a partner library:

"For example a lost book refund becomes a credit on account.  Presently the credit may be applied to a fine for a different item charged to patron. We perform a write off to clear the remaining credit, then add the fine back to the account and give the patron a refund for the lost/refunded amount. Our accounting system ask that we keep the Lost funds/refunds separate from all fines."

Test Plan:
1) Create a fine and write it off
2) Note there is no 'void' button for the writeoff
3) Apply this patch
4) Note the buttons now show
5) Test each button on a writeoff

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Kyle M Hall 2018-05-22 14:06:51 UTC
(In reply to Tomás Cohen Arazi from comment #5)
> Kyle, the functionality is ok. Would you agree there could be a confirmation
> modal as we have in other places?

A confirmation modal would be a nice enhancement! Are you able to add that?
Comment 8 Tomás Cohen Arazi 2018-05-22 14:48:19 UTC
Created attachment 75471 [details] [review]
Bug 20703: Add confirmation modal when making a credit void

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Kyle M Hall 2018-05-22 14:50:26 UTC
Created attachment 75472 [details] [review]
Bug 20703: Add confirmation modal when making a credit void

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Nick Clemens 2018-07-06 14:42:42 UTC
Awesome work all!

Pushed to master for 18.11
Comment 11 Martin Renvoize 2018-07-10 06:54:26 UTC
Enhancement, not backporting to 18.05.x series.