Summary: | C4::Overdues::CalcFine should consider default item type replacement cost | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrew> |
Component: | Fines and fees | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | normal | ||
Priority: | P5 - low | CC: | caroline.cyr-la-rose, fridolin.somers, jonathan.druart, martin.renvoize, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 12768 | ||
Bug Blocks: | |||
Attachments: |
Bug 21196: Add tests
Bug 21196: Use replacement cost from the item type if not set at item level Bug 21196: Add tests Bug 21196: Use replacement cost from the item type if not set at item level |
Description
Andrew Fuerste-Henry
2018-08-09 17:43:13 UTC
Created attachment 77758 [details] [review] Bug 21196: Add tests Created attachment 77759 [details] [review] Bug 21196: Use replacement cost from the item type if not set at item level When circ rules are set to cap at item replacement cost, calcfine only checks the price in the item record, not the default replacement cost by item type. Note: We do not take '0' into account, what if you do not want to set a replacement cost for an item? It is how it is done in chargelostitem so keeping the existing behaviour, but that may be considered as a bug (?) Test plan: - Set useDefaultReplacementCost to use - Set a default replacement cost for a given item type - Create an item of that type with a replacementcost=0 - Create a circ rule for that item type that accrues fines but caps at replacement cost - check the item out, forcing a due date in the past - check that item in => Fines should have been generated I can reproduce the original problem. I get fines, but way over the replacement cost, confirming the default item type replacement cost is not taken into account. Once I apply the patch, the fines are capped at the default replacement cost. So it works as intended. Created attachment 79340 [details] [review] Bug 21196: Add tests Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 79341 [details] [review] Bug 21196: Use replacement cost from the item type if not set at item level When circ rules are set to cap at item replacement cost, calcfine only checks the price in the item record, not the default replacement cost by item type. Note: We do not take '0' into account, what if you do not want to set a replacement cost for an item? It is how it is done in chargelostitem so keeping the existing behaviour, but that may be considered as a bug (?) Test plan: - Set useDefaultReplacementCost to use - Set a default replacement cost for a given item type - Create an item of that type with a replacementcost=0 - Create a circ rule for that item type that accrues fines but caps at replacement cost - check the item out, forcing a due date in the past - check that item in => Fines should have been generated Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Awesome work all! Pushed to master for 18.11 Pushed to 18.05.x for 18.05.05 Pushed to 17.11.x for 17.11.11 |