Description
Kyle M Hall (khall)
2017-03-28 11:04:51 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! Patch tested with a sandbox, by David Kuhn <techservspec@gmail.com> 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> 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> Looks good to me. But I do like to see a test like the one in your test plan added to CalcFine.t too. *sadface* doesn't apply anymore 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> Created attachment 86989 [details] [review] Bug 18344 - Unit tests 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. 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> Created attachment 89608 [details] [review] Bug 18344: Add unit tests Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Nice work! Pushed to master for 19.11.00 Pushed to 19.05.x for 19.05.01 backported to 18.11.x for 18.11.07 |