Bug 18344 - Overdue fines 'cap at replacement price' and 'cap by amount' should work together
Summary: Overdue fines 'cap at replacement price' and 'cap by amount' should work toge...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords: release-notes-needed
Depends on:
Blocks:
 
Reported: 2017-03-28 11:04 UTC by Kyle M Hall
Modified: 2019-06-19 19:25 UTC (History)
12 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.01


Attachments
Bug 18344 - Allow overdue fines cap at replacement price, and cap by amount to work together (1.97 KB, patch)
2017-03-28 11:08 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18344 - Allow overdue fines cap at replacement price, and cap by amount to work together (2.02 KB, patch)
2017-04-15 19:26 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 18344 - Allow overdue fines cap at replacement price, and cap by amount to work together (2.12 KB, patch)
2017-08-04 07:37 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18344 - Allow overdue fines cap at replacement price, and cap by amount to work together (2.07 KB, patch)
2019-03-25 17:55 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18344 - Unit tests (2.48 KB, patch)
2019-03-25 17:56 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 18344: Allow overdue fines cap at replacement price, and cap by amount to work together (2.11 KB, patch)
2019-05-11 13:43 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18344: Add unit tests (2.53 KB, patch)
2019-05-11 13:43 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2017-03-28 11:04:51 UTC
There is no reason that a library shouldn't be able to use the monetary fines cap and the replacement price cap at the same time. The code is written in such a way that they already work harmoniously. We have librarians who wish to use both so they can set a high cap of $10.00 but also use the replacement price cap so that a $20.00 book would only get a fine of $10.00, but a $5.00 paperback will only get a fine of $5.00
Comment 1 Kyle M Hall 2017-03-28 11:08:41 UTC
Created attachment 61658 [details] [review]
Bug 18344 - Allow overdue fines cap at replacement price, and cap by amount to work together

There is no reason that a library shouldn't be able to use the monetary
fines cap and the replacement price cap at the same time. The code is
written in such a way that they already work harmoniously. We have
librarians who wish to use both so they can set a high cap of $10.00 but
also use the replacement price cap so that a $20.00 book would only get
a fine of $10.00, but a $5.00 paperback will only get a fine of $5.00

Test Plan:
1) Apply this patch
2) Create a rule with a fines cap of $10, *and* a cap at replacement price, and a daily fine of $1
3) Create two items, one with a replacement price of $5 and one with a
   replacement price of $15
4) Check out these items to a patron, backdate the checkouts so they are
   already overdue by a couple months
5) Check the items in ( make sure calc fine at checkin is enabled for
    you )
6) Note the one item has a fine of $5 and the other has a fine of $10!
Comment 2 sandboxes@biblibre.com 2017-04-15 19:26:11 UTC
Patch tested with a sandbox, by David Kuhn <techservspec@gmail.com>
Comment 3 sandboxes@biblibre.com 2017-04-15 19:26:31 UTC
Created attachment 62190 [details] [review]
Bug 18344 - Allow overdue fines cap at replacement price, and cap by amount to work together

There is no reason that a library shouldn't be able to use the monetary
fines cap and the replacement price cap at the same time. The code is
written in such a way that they already work harmoniously. We have
librarians who wish to use both so they can set a high cap of $10.00 but
also use the replacement price cap so that a $20.00 book would only get
a fine of $10.00, but a $5.00 paperback will only get a fine of $5.00

Test Plan:
1) Apply this patch
2) Create a rule with a fines cap of $10, *and* a cap at replacement price, and a daily fine of $1
3) Create two items, one with a replacement price of $5 and one with a
   replacement price of $15
4) Check out these items to a patron, backdate the checkouts so they are
   already overdue by a couple months
5) Check the items in ( make sure calc fine at checkin is enabled for
    you )
6) Note the one item has a fine of $5 and the other has a fine of $10!

Signed-off-by: David Kuhn <techservspec@gmail.com>
Comment 4 Marcel de Rooy 2017-08-04 07:37:43 UTC
Created attachment 65493 [details] [review]
Bug 18344 - Allow overdue fines cap at replacement price, and cap by amount to work together

There is no reason that a library shouldn't be able to use the monetary
fines cap and the replacement price cap at the same time. The code is
written in such a way that they already work harmoniously. We have
librarians who wish to use both so they can set a high cap of $10.00 but
also use the replacement price cap so that a $20.00 book would only get
a fine of $10.00, but a $5.00 paperback will only get a fine of $5.00

Test Plan:
1) Apply this patch
2) Create a rule with a fines cap of $10, *and* a cap at replacement price, and a daily fine of $1
3) Create two items, one with a replacement price of $5 and one with a
   replacement price of $15
4) Check out these items to a patron, backdate the checkouts so they are
   already overdue by a couple months
5) Check the items in ( make sure calc fine at checkin is enabled for
    you )
6) Note the one item has a fine of $5 and the other has a fine of $10!

Signed-off-by: David Kuhn <techservspec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2017-08-04 07:39:11 UTC
Looks good to me.
But I do like to see a test like the one in your test plan added to CalcFine.t too.
Comment 6 Liz Rea 2019-03-25 15:15:05 UTC
*sadface* doesn't apply anymore
Comment 7 Kyle M Hall 2019-03-25 17:55:59 UTC
Created attachment 86988 [details] [review]
Bug 18344 - Allow overdue fines cap at replacement price, and cap by amount to work together

There is no reason that a library shouldn't be able to use the monetary
fines cap and the replacement price cap at the same time. The code is
written in such a way that they already work harmoniously. We have
librarians who wish to use both so they can set a high cap of $10.00 but
also use the replacement price cap so that a $20.00 book would only get
a fine of $10.00, but a $5.00 paperback will only get a fine of $5.00

Test Plan:
1) Apply this patch
2) Create a rule with a fines cap of $10, *and* a cap at replacement price, and a daily fine of $1
3) Create two items, one with a replacement price of $5 and one with a
   replacement price of $15
4) Check out these items to a patron, backdate the checkouts so they are
   already overdue by a couple months
5) Check the items in ( make sure calc fine at checkin is enabled for
    you )
6) Note the one item has a fine of $5 and the other has a fine of $10!

Signed-off-by: David Kuhn <techservspec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Kyle M Hall 2019-03-25 17:56:10 UTC
Created attachment 86989 [details] [review]
Bug 18344 - Unit tests
Comment 9 Katrin Fischer 2019-05-11 13:41:50 UTC
This is actually a much simpler change than I thought when I had started - it just removed a little bit of JavaScript and adds some tests.
Comment 10 Katrin Fischer 2019-05-11 13:43:51 UTC
Created attachment 89607 [details] [review]
Bug 18344: Allow overdue fines cap at replacement price, and cap by amount to work together

There is no reason that a library shouldn't be able to use the monetary
fines cap and the replacement price cap at the same time. The code is
written in such a way that they already work harmoniously. We have
librarians who wish to use both so they can set a high cap of $10.00 but
also use the replacement price cap so that a $20.00 book would only get
a fine of $10.00, but a $5.00 paperback will only get a fine of $5.00

Test Plan:
1) Apply this patch
2) Create a rule with a fines cap of $10, *and* a cap at replacement price, and a daily fine of $1
3) Create two items, one with a replacement price of $5 and one with a
   replacement price of $15
4) Check out these items to a patron, backdate the checkouts so they are
   already overdue by a couple months
5) Check the items in ( make sure calc fine at checkin is enabled for
    you )
6) Note the one item has a fine of $5 and the other has a fine of $10!

Signed-off-by: David Kuhn <techservspec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2019-05-11 13:43:55 UTC
Created attachment 89608 [details] [review]
Bug 18344: Add unit tests

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Martin Renvoize 2019-06-11 09:24:09 UTC
Nice work!

Pushed to master for 19.11.00
Comment 13 Fridolin SOMERS 2019-06-11 15:30:22 UTC
Pushed to 19.05.x for 19.05.01
Comment 14 Lucas Gass 2019-06-19 19:25:38 UTC
backported to 18.11.x for 18.11.07