Lines 69-83
FIXME : if no replacement price, borrower just doesn't get charged?
Link Here
|
69 |
|
69 |
|
70 |
sub chargelostitem { |
70 |
sub chargelostitem { |
71 |
my $dbh = C4::Context->dbh(); |
71 |
my $dbh = C4::Context->dbh(); |
72 |
my ($borrowernumber, $itemnumber, $amount, $description) = @_; |
72 |
my ($borrowernumber, $itemnumber, $replacementprice, $description) = @_; |
73 |
my $item = Koha::Items->find($itemnumber); |
73 |
my $item = Koha::Items->find($itemnumber); |
74 |
my $itype = $item->itemtype; |
74 |
my $itype = $item->itemtype; |
75 |
my $replacementprice = $amount; |
75 |
$replacementprice //= 0; |
76 |
my $defaultreplacecost = $itype->defaultreplacecost; |
76 |
my $defaultreplacecost = $itype->defaultreplacecost; |
77 |
my $processfee = $itype->processfee; |
77 |
my $processfee = $itype->processfee; |
78 |
my $usedefaultreplacementcost = C4::Context->preference("useDefaultReplacementCost"); |
78 |
my $usedefaultreplacementcost = C4::Context->preference("useDefaultReplacementCost"); |
79 |
my $processingfeenote = C4::Context->preference("ProcessingFeeNote"); |
79 |
my $processingfeenote = C4::Context->preference("ProcessingFeeNote"); |
80 |
if ($usedefaultreplacementcost && $amount == 0 && $defaultreplacecost){ |
80 |
if ($usedefaultreplacementcost && $replacementprice == 0 && $defaultreplacecost){ |
81 |
$replacementprice = $defaultreplacecost; |
81 |
$replacementprice = $defaultreplacecost; |
82 |
} |
82 |
} |
83 |
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber }); |
83 |
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber }); |
84 |
- |
|
|