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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
593cd04f1e
commit
5776f28efa
|
|
@ -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} );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue