Bug 20703 - Add ability to void any credit
Summary: Add ability to void any credit
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
: 19449 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-05-03 13:15 UTC by Kyle M Hall
Modified: 2018-07-10 06:54 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20703: Add ability to void any credit (6.01 KB, patch)
2018-05-03 13:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20703: Add ability to void any credit (6.02 KB, patch)
2018-05-08 13:47 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 20703: Add ability to void any credit (6.07 KB, patch)
2018-05-22 14:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 20703: Add confirmation modal when making a credit void (2.00 KB, patch)
2018-05-22 14:48 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 20703: Add confirmation modal when making a credit void (2.07 KB, patch)
2018-05-22 14:50 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 M. 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 M. 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.