Bug 14702: Refactor GetReserveFee
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 21 Aug 2015 09:44:55 +0000 (11:44 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 7 Sep 2015 15:04:48 +0000 (12:04 -0300)
commit44a4e043a5b9332595a58e4f9d9eb8f4eb8353c0
tree3261d9bf448c20accab22409fa7b6bb07e9bf88d
parent7f65aaac748833b57f9f1c8ae754d66c7e144d81
Bug 14702: Refactor GetReserveFee

The code of GetReserveFee was not very clear.
What it did was: check if there are some items not issued. If so and there
are no holds, calculate no fee.

While doing so, I moved the code to charge the fee (in AddReserve) to a small
new sub ChargeReserveFee.

There is no change in behavior.
The follow-up patch adds unit tests.

Test plan:
[1] Make sure that a patron category (X) includes a hold fee.
[2] Select a biblio with 2 items.
[3] Issue one item to another patron.
[4] Place a hold on this biblio by patron with category X. No charge?
[5] Cancel the hold from the previous step.
[6] Use another patron to place another hold on this biblio.
[7] Place hold again by patron with category X. Is it charged?
[8] Cancel that hold again. Issue the second item to another patron.
[9] Place hold again by patron with category X. Is it charged again?

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Reserves.pm