Bugzilla – Attachment 167622 Details for
Bug 28575
Add ability to choose if lost fee is refunded based on when lost fee was paid off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28575: Stop lost fine refund if fine is older than syspref value
Bug-28575-Stop-lost-fine-refund-if-fine-is-older-t.patch (text/plain), 2.94 KB, created by
Matt Blenkinsop
on 2024-06-11 10:46:10 UTC
(
hide
)
Description:
Bug 28575: Stop lost fine refund if fine is older than syspref value
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-06-11 10:46:10 UTC
Size:
2.94 KB
patch
obsolete
>From 6e287dbd04b32dc1724d3134a5f8bfdab47c7215 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 7 Jun 2024 10:23:01 +0000 >Subject: [PATCH] Bug 28575: Stop lost fine refund if fine is older than > syspref value > >Test plan: >1) Apply patch and reset_all >2) Checkout an item to a patron >3) Mark that item as lost >4) Add a manual invoice for that item's barcode to the patron's account >5) Pay that fine in the Make a payment tab >6) In system preferences, search for NoRefundOnLostFinesPaidAge >7) Set this to -1. I use this value here to avoid needing to go into the database to change the date of the payment we made in step 5. Any fines older than -1 days (i.e. all fines) will be caught by the syspref which is what we want to test) >8) Check in the item >9) The check in message should display "Any lost item fees for this item will remain on the patron's account." >10) Navigate to the Patron's account and confirm that no credit has been added and that the lost fee has therefore not been refunded >11) Run unit test: prove t/db_dependent/Circulation.t >--- > Koha/Item.pm | 23 +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 91c15b22d5..7d8604e303 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1488,6 +1488,29 @@ sub _set_found_trigger { > # will be credited which settles the debt without > # creating extra credits > >+ if ( $lost_charge->amountoutstanding == 0 ) { >+ my $no_refund_if_lost_fee_paid_age = C4::Context->preference('NoRefundOnLostFinesPaidAge'); >+ if ($no_refund_if_lost_fee_paid_age) { >+ my $lost_fee_payment = $lost_charge->debit_offsets( { type => 'APPLY' } )->last; >+ if ($lost_fee_payment) { >+ my $today = dt_from_string(); >+ my $payment_age_in_days = >+ dt_from_string( $lost_fee_payment->created_on )->delta_days($today) >+ ->in_units('days'); >+ if ( $payment_age_in_days > $no_refund_if_lost_fee_paid_age ) { >+ $self->add_message( >+ { >+ type => 'info', >+ message => 'payment_not_refunded', >+ payload => undef >+ } >+ ); >+ return $self; >+ } >+ } >+ } >+ } >+ > my $credit_offsets = $lost_charge->debit_offsets( > { > 'credit_id' => { '!=' => undef }, >-- >2.39.3 (Apple Git-146)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28575
:
167567
|
167568
|
167569
|
167621
|
167622
|
167623
|
167624
|
167627
|
167635
|
167636
|
167637
|
167638
|
168146
|
172252
|
172253
|
172254
|
172255
|
172256
|
172257
|
172258