Bugzilla – Attachment 140352 Details for
Bug 29184
Warn from chargelostitem when no replacement cost set for item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29184: Fix warn about undefined replacecost
Bug-29184-Fix-warn-about-undefined-replacecost.patch (text/plain), 1.97 KB, created by
Joonas Kylmälä
on 2022-09-08 16:20:02 UTC
(
hide
)
Description:
Bug 29184: Fix warn about undefined replacecost
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2022-09-08 16:20:02 UTC
Size:
1.97 KB
patch
obsolete
>From 2a33d73aedabc08c4970f1e10629af1eb0baf6e7 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 6 Oct 2021 12:48:23 +0000 >Subject: [PATCH] Bug 29184: Fix warn about undefined replacecost >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch simply sets the cost to 0 if undefined > >To test: >1 - Create a new item with no replacement cost set >2 - Check the item out to a patron >3 - Mark the item lost >4 - Note in plack-intranet-error.log: > [2021/10/06 12:43:26] [WARN] Use of uninitialized value $replacementprice in numeric gt (>) at /kohadevbox/koha/C4/Accounts.pm line 114. >5 - Apply patch >6 - Repeat >7 - No warn > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> >--- > C4/Accounts.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Accounts.pm b/C4/Accounts.pm >index e5b7c441d8..ad4bd86d76 100644 >--- a/C4/Accounts.pm >+++ b/C4/Accounts.pm >@@ -69,15 +69,15 @@ FIXME : if no replacement price, borrower just doesn't get charged? > > sub chargelostitem { > my $dbh = C4::Context->dbh(); >- my ($borrowernumber, $itemnumber, $amount, $description) = @_; >+ my ($borrowernumber, $itemnumber, $replacementprice, $description) = @_; > my $item = Koha::Items->find($itemnumber); > my $itype = $item->itemtype; >- my $replacementprice = $amount; >+ $replacementprice //= 0; > my $defaultreplacecost = $itype->defaultreplacecost; > my $processfee = $itype->processfee; > my $usedefaultreplacementcost = C4::Context->preference("useDefaultReplacementCost"); > my $processingfeenote = C4::Context->preference("ProcessingFeeNote"); >- if ($usedefaultreplacementcost && $amount == 0 && $defaultreplacecost){ >+ if ($usedefaultreplacementcost && $replacementprice == 0 && $defaultreplacecost){ > $replacementprice = $defaultreplacecost; > } > my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber }); >-- >2.30.2
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 29184
:
125798
|
135076
|
140325
|
140335
| 140352