Bugzilla – Attachment 91330 Details for
Bug 23018
Refunding a lost item fee may trigger error if any fee has been written off related to that item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23018: Refunding a lost item fee may trigger error if any fee has been written off related to that item
Bug-23018-Refunding-a-lost-item-fee-may-trigger-er.patch (text/plain), 2.04 KB, created by
Marcel de Rooy
on 2019-07-05 09:29:44 UTC
(
hide
)
Description:
Bug 23018: Refunding a lost item fee may trigger error if any fee has been written off related to that item
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2019-07-05 09:29:44 UTC
Size:
2.04 KB
patch
obsolete
>From a10663117688136b234438f792af0d19e2d7a71c Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 30 May 2019 14:15:52 -0400 >Subject: [PATCH] Bug 23018: Refunding a lost item fee may trigger error if any > fee has been written off related to that item >Content-Type: text/plain; charset=utf-8 > >If a lost item fee is written off, it creates a writeoff with the same itemnumber but the amount column is a negative number. > >Now, when the lost item is returned, it calls _FixAccountForLostAndReturned which searchs for all accountlines with an account type of 'L' or 'W'. > >Then, if the *first* of those lines has an outstanding balance, a credit is created and *all* the lines found are passed to $credit->apply. The apply method then calls is_debit on each line and when it hits the writeoff, it throws an exception ( Koha::Exceptions::Account::IsNotDebit ). > >When this happens, the credit is creating but not applied the the outstanding lost item fee, and the librarian is presented with an error page. > >It seems like the solution is to only fetch the first result since it seems like that is the only one we should be operating on. > >Test Plan: >1) Create a lost item with a fee >2) Create a manual debit using the barcode of the item >3) Write off that manual debit >4) Check in the item, note the error >5) Apply this patch >6) Repeat steps 1-3 >7) Check in the item, no error! > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Circulation.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 560abc1430..59626b441b 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2408,7 +2408,7 @@ sub _FixAccountForLostAndReturned { > my $accountlines = Koha::Account::Lines->search( > { > itemnumber => $itemnumber, >- accounttype => { -in => [ 'L', 'W' ] }, >+ accounttype => 'L', > }, > { > order_by => { -desc => [ 'date', 'accountlines_id' ] } >-- >2.11.0
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 23018
:
90205
|
90206
|
90640
| 91330