Bugzilla – Attachment 92276 Details for
Bug 23382
Issuing rules failing after bug 20912
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23382: Fix logic in C4::Circulation::CanBookBeIssued
Bug-23382-Fix-logic-in-C4CirculationCanBookBeIssue.patch (text/plain), 2.99 KB, created by
Martin Renvoize (ashimema)
on 2019-08-16 15:45:59 UTC
(
hide
)
Description:
Bug 23382: Fix logic in C4::Circulation::CanBookBeIssued
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-08-16 15:45:59 UTC
Size:
2.99 KB
patch
obsolete
>From 922c532ab3e873f9fc970b19c55813c8668cab99 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 16 Aug 2019 08:32:55 +0100 >Subject: [PATCH] Bug 23382: Fix logic in C4::Circulation::CanBookBeIssued > >It looks like over progressive rebases of bug 20912 a clause was lost >within CanBookBeIssued such that a fatal error may be triggered if an >item with no corresponding itemtype was passed into the routine. > >Additionally the we were passing a Koha::Library object to CalcDateDue >rather than a branchcode which resulted in a different duedate being >used in 'CanBookBeIssued' when compared to 'AddIssue'. >--- > C4/Circulation.pm | 22 ++++++++++++++-------- > 1 file changed, 14 insertions(+), 8 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9961d38077..ef0a880cdf 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -709,8 +709,7 @@ sub CanBookBeIssued { > unless ( $duedate ) { > my $issuedate = $now->clone(); > >- my $branch = $circ_library; >- $duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $patron_unblessed ); >+ $duedate = CalcDateDue( $issuedate, $effective_itemtype, $circ_library->branchcode, $patron_unblessed ); > > # Offline circ calls AddIssue directly, doesn't run through here > # So issuingimpossible should be ok. >@@ -1000,16 +999,23 @@ sub CanBookBeIssued { > if ( $patron->branchcode ne $userenv->{branch} ); > } > } >+ > # > # CHECK IF THERE IS RENTAL CHARGES. RENTAL MUST BE CONFIRMED BY THE BORROWER > # > my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation"); >- >- if ( $rentalConfirmation ){ >+ if ($rentalConfirmation) { > my ($rentalCharge) = GetIssuingCharges( $item_object->itemnumber, $patron->borrowernumber ); >- my $itemtype = Koha::ItemTypes->find( $item_object->itype ); # GetItem sets effective itemtype >- $rentalCharge += $fees->accumulate_rentalcharge({ from => dt_from_string(), to => $duedate }); >- if ( $rentalCharge > 0 ){ >+ >+ my $itemtype_object = Koha::ItemTypes->find( $item_object->effective_itemtype ); >+ if ($itemtype_object) { >+ my $accumulate_charge = $fees->accumulate_rentalcharge(); >+ if ( $accumulate_charge > 0 ) { >+ $rentalCharge += $accumulate_charge; >+ } >+ } >+ >+ if ( $rentalCharge > 0 ) { > $needsconfirmation{RENTALCHARGE} = $rentalCharge; > } > } >@@ -1477,7 +1483,7 @@ sub AddIssue { > if ( $itemtype_object ) { > my $accumulate_charge = $fees->accumulate_rentalcharge(); > if ( $accumulate_charge > 0 ) { >- AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' ) if $accumulate_charge > 0; >+ AddIssuingCharge( $issue, $accumulate_charge, 'rent_daily' ); > $charge += $accumulate_charge; > $item_unblessed->{charge} = $charge; > } >-- >2.20.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 23382
:
92221
|
92222
|
92236
|
92237
|
92238
|
92273
|
92274
|
92275
|
92276
|
93407
|
93408
|
93409
|
93410
|
93411
|
93412
|
94281
|
94282
|
94283
|
94284
|
94285
|
94286
|
94287
|
94288
|
94289
|
94723
|
94724
|
94725
|
94726
|
94727
|
94728
|
94729
|
94730
|
94731
|
94743
|
94755
|
94756
|
94757
|
94758
|
94759
|
94760
|
94761
|
94762
|
94763
|
94764
|
94765
|
94766
|
94774
|
94775
|
94776
|
94777
|
94778
|
94779
|
94780
|
94781
|
94782
|
94783
|
94784
|
107456
|
107457