|
Lines 69-82
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 $itype = Koha::ItemTypes->find({ itemtype => Koha::Items->find($itemnumber)->effective_itemtype() }); |
73 |
my $itype = Koha::ItemTypes->find({ itemtype => Koha::Items->find($itemnumber)->effective_itemtype() }); |
| 74 |
my $replacementprice = $amount; |
74 |
my $replacementprice //= 0; |
| 75 |
my $defaultreplacecost = $itype->defaultreplacecost; |
75 |
my $defaultreplacecost = $itype->defaultreplacecost; |
| 76 |
my $processfee = $itype->processfee; |
76 |
my $processfee = $itype->processfee; |
| 77 |
my $usedefaultreplacementcost = C4::Context->preference("useDefaultReplacementCost"); |
77 |
my $usedefaultreplacementcost = C4::Context->preference("useDefaultReplacementCost"); |
| 78 |
my $processingfeenote = C4::Context->preference("ProcessingFeeNote"); |
78 |
my $processingfeenote = C4::Context->preference("ProcessingFeeNote"); |
| 79 |
if ($usedefaultreplacementcost && $amount == 0 && $defaultreplacecost){ |
79 |
if ($usedefaultreplacementcost && $replacementprice == 0 && $defaultreplacecost){ |
| 80 |
$replacementprice = $defaultreplacecost; |
80 |
$replacementprice = $defaultreplacecost; |
| 81 |
} |
81 |
} |
| 82 |
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber }); |
82 |
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber }); |
| 83 |
- |
|
|