Bugzilla – Attachment 142575 Details for
Bug 23012
Possibility to mark processing fee by default refund when item is found
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23012: get_lostreturn_policy returns a scalar
Bug-23012-getlostreturnpolicy-returns-a-scalar.patch (text/plain), 2.29 KB, created by
Tomás Cohen Arazi
on 2022-10-24 21:43:17 UTC
(
hide
)
Description:
Bug 23012: get_lostreturn_policy returns a scalar
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2022-10-24 21:43:17 UTC
Size:
2.29 KB
patch
obsolete
>From c2fee12cd0f652b16929eb503793e3594e778a23 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 24 Oct 2022 18:36:46 -0300 >Subject: [PATCH] Bug 23012: get_lostreturn_policy returns a scalar > >On commit 4d994773f83468b561896939f16131d0332d9cfc >Koha::Item->_set_found_trigger gets the call to get_lostreturn_policy() >changed so it expects a hashref instead of the scalar it returns. This >patch adjusts it back. > >To test: >1. Run: > $ kshell > k$ prove t/db_dependent/Koha/Item.t >=> FAIL: Tests fail! >2. Apply this patch >3. Repeat 1 >=> SUCCESS: Tests pass! > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Item.pm | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 25b4e54dc39..aa621396e0c 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1159,15 +1159,13 @@ sub _set_found_trigger { > return $self unless $lost_age_in_days < $no_refund_after_days; > } > >- my $lost_proc_return_policy = Koha::CirculationRules->get_lostreturn_policy( >- { >- item => $self, >+ my $lostreturn_policy = Koha::CirculationRules->get_lostreturn_policy( >+ { item => $self, > return_branch => C4::Context->userenv > ? C4::Context->userenv->{'branch'} > : undef, > } >- ); >- my $lostreturn_policy = $lost_proc_return_policy->{lostreturn}; >+ ); > > if ( $lostreturn_policy ) { > >@@ -1325,9 +1323,7 @@ sub _set_found_trigger { > } > } > >- my $processingreturn_policy = $lost_proc_return_policy->{lostreturn}; >- >- if ( $processingreturn_policy ) { >+ if ( $lostreturn_policy ) { > > # refund processing charge made for lost book > my $processing_charge = Koha::Account::Lines->search( >@@ -1355,7 +1351,7 @@ sub _set_found_trigger { > # Use cases > if ( > $processing_charge->amount > $processing_charge->amountoutstanding && >- $processingreturn_policy ne "refund_unpaid" >+ $lostreturn_policy ne "refund_unpaid" > ) { > # some amount has been cancelled. collect the offsets that are not writeoffs > # this works because the only way to subtract from this kind of a debt is >-- >2.34.1
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 23012
:
141627
|
141628
|
141629
|
141630
|
142046
|
142047
|
142048
|
142049
|
142113
|
142123
|
142124
|
142125
|
142126
|
142481
|
142482
|
142483
|
142484
|
142485
|
142486
|
142487
|
142575
|
142652
|
142693
|
142736
|
142737