Bug 21196: Use replacement cost from the item type if not set at item level
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 13 Aug 2018 15:40:22 +0000 (12:40 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 3 Oct 2018 13:10:34 +0000 (15:10 +0200)
commit6f3ecfc10bea5597f9114a0bd98a71bd2ca91308
treeaaff1968b0450ac53027d1accd2b86bfc0aed5a0
parent7db5f67f66c41377eda247ddd715b588043b46ef
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: Caroline Cyr La rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit a62742f4260425af8e69a88822b7affc9cc93c68)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 43b671ac858e9ae63b3ce8e74e555a41600bc383)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Overdues.pm