https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44164
Bug ID: 44164
Summary: Marking an item lost dies when its item type cannot be
resolved
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: Fines and fees
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
Target Milestone: ---
Koha::Account->add_lost_replacement_fee reads the default replacement cost of
the item type before it checks useDefaultReplacementCost. Koha::Item->itemtype
returns undef when the item has no item type, or when its code is not in the
itemtypes table (misc/maintenance/search_for_data_inconsistencies.pl reports
such items). The method then dies with: Can't call method "defaultreplacecost"
on an undefined value. It dies even when useDefaultReplacementCost is off and a
replacement price is given.
C4::Circulation::LostItem and Koha::Checkin call it through
C4::Accounts::chargelostitem, so marking such an item as lost fails instead of
charging the replacement price.
Test plan:
1. Set WhenLostChargeReplacementFee to charge, useDefaultReplacementCost to not
use
2. Give an item a replacement price of 25 and make its item type empty:
UPDATE items SET itype=NULL, replacementprice=25 WHERE barcode='...';
UPDATE biblioitems SET itemtype=NULL WHERE biblionumber=...;
3. Check the item out to a patron and mark it lost from the item page or the
patron's checkouts
=> The operation fails with an error
Expected: the patron is charged the replacement price of 25.
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/