Bug 14801

Summary: Fix Reserves.t
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Hold requestsAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: gmcharlt, gwilliams, tomascohen, veron
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14464
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 14801: Fix Reserves.t
[Signed-off] Bug 14801: Fix Reserves.t
[PASSED QA] Bug 14801: Fix Reserves.t
Bug 14801: Fix Reserves.t -- Follow-up for ChargeReserveFee
Bug 14801: Fix Reserves.t
Bug 14801: Fix Reserves.t -- Follow-up for ChargeReserveFee

Description Marcel de Rooy 2015-09-10 14:39:38 UTC
Fix this:

ok 58 - OnShelfHoldsAllowed() disallowed
not ok 59 - Bug 14464 - No fines at beginning
ok 60 - Bug 14464 - 1st reserve correctly created
not ok 61 - Bug 14464 - No fines after cancelling reserve with no charge configured
ok 62 - Bug 14464 - 2nd reserve correctly created
not ok 63 - Bug 14464 - No fines after cancelling reserve with no charge desired
Comment 1 Marcel de Rooy 2015-09-10 14:41:16 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-09-10 15:53:44 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2015-09-13 16:30:31 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2015-09-14 08:49:58 UTC
Still looking a little bit at this one.
Will probably add a tiny follow-up.
Comment 5 Marcel de Rooy 2015-09-14 09:22:21 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2015-09-14 09:25:07 UTC
Tomas:
I added a followup that resolves the deeper cause of the failing test.
It is fairly trivial :)
But if you want another signoff or so, please change the status accordingly.
Comment 7 Marcel de Rooy 2015-09-14 09:34:32 UTC
Created attachment 42507 [details] [review]
Bug 14801: Fix Reserves.t

Fix the following errors:
not ok 59 - Bug 14464 - No fines at beginning
ok 60 - Bug 14464 - 1st reserve correctly created
not ok 61 - Bug 14464 - No fines after cancelling reserve with no charge configured
ok 62 - Bug 14464 - 2nd reserve correctly created
not ok 63 - Bug 14464 - No fines after cancelling reserve with no charge desired

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended the x==0 test with !x || x==0 to include 0.00 and prevent warn.
Comment 8 Marcel de Rooy 2015-09-14 09:34:36 UTC
Created attachment 42508 [details] [review]
Bug 14801: Fix Reserves.t -- Follow-up for ChargeReserveFee

The problem making some tests fail, actually was the unneeded addition
of zero accountline records by ChargeReserveFee, called by AddReserve.
The balance is still zero, but a test like !$var responds differently
when var is 0.00 instead of 0 or undef.

This patch adjusts the test in ChargeReserveFee in order to prevent
adding these records with 0.00.
The first patch that adjusts the tests in Reserves.t is not strictly
needed anymore, but can stay.

Test plan:
[1] Run t/db_dependent/Reserves.t
[2] Run t/db_dependent/Reserves/GetReserveFee.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Tomás Cohen Arazi (tcohen) 2015-09-16 13:52:55 UTC
Patches pushed to master.

Thanks Marcel!