Bugzilla – Attachment 173746 Details for
Bug 38303
Item's replacement price not set to defaultreplacecost if 0.00
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00
Bug-38303-Set-items-replacement-price-to-defaultre.patch (text/plain), 1.73 KB, created by
Aleisha Amohia
on 2024-10-31 04:57:42 UTC
(
hide
)
Description:
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-10-31 04:57:42 UTC
Size:
1.73 KB
patch
obsolete
>From 385434a11b70246e8cfb013a38d4b36339f8aa4f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 30 Oct 2024 16:37:36 +0100 >Subject: [PATCH] Bug 38303: Set item's replacement price to defaultreplacecost > if 0.00 > >No idea if this is a real bug. This code is fixing the following test >failure: >t/db_dependent/Circulation/CalcFine.t .. 1/7 > # Failed test 'Amount is calculated correctly' > # at t/db_dependent/Circulation/CalcFine.t line 271. > # got: '0' > # expected: '6' > # Looks like you failed 1 test of 2. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> >--- > C4/Overdues.pm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index a2494f7f1e9..7faa2e9f215 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -288,10 +288,12 @@ sub CalcFine { > && $amount > $issuing_rule->{overduefinescap}; > > # This must be moved to Koha::Item (see also similar code in C4::Accounts::chargelostitem >- $item->{replacementprice} ||= $itemtype->defaultreplacecost >- if $itemtype >- && ( ! defined $item->{replacementprice} || $item->{replacementprice} == 0 ) >- && C4::Context->preference("useDefaultReplacementCost"); >+ if ( $itemtype >+ && ( !defined $item->{replacementprice} || $item->{replacementprice} + .0 == 0 ) >+ && C4::Context->preference("useDefaultReplacementCost") ) >+ { >+ $item->{replacementprice} = $itemtype->defaultreplacecost; >+ } > > $amount = $item->{replacementprice} if ( $issuing_rule->{cap_fine_to_replacement_price} && $item->{replacementprice} && $amount > $item->{replacementprice} ); > >-- >2.39.5
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 38303
:
173722
|
173730
| 173746