Bugzilla – Attachment 173722 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.62 KB, created by
Jonathan Druart
on 2024-10-30 15:39:00 UTC
(
hide
)
Description:
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-10-30 15:39:00 UTC
Size:
1.62 KB
patch
obsolete
>From 3127d72c669e2fd26f86a4b816feadd0ee50b524 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. >--- > 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.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 38303
:
173722
|
173730
|
173746