Fixes error with generate_fines for overdues returned after closed date user/ldw/lp1193204
authorLiam Whalen <whalen.ld@gmail.com>
Mon, 15 Jul 2013 04:00:14 +0000 (21:00 -0700)
committerLiam Whalen <whalen.ld@gmail.com>
Mon, 15 Jul 2013 04:00:14 +0000 (21:00 -0700)
commitc8776db5fdba74f134f9f43c8253b6cf1a2950f2
treed93a8a03d76f4c53f3fef437a659a7f1856f6659
parent335f8899ef9bd807823796d977f31bd3cc8b6ba6
Fixes error with generate_fines for overdues returned after closed date

If an overdue is returned after a closed date, the generate_fines code
will not generate fines for those items because the section of code that
checks for closed dates returns from the function if a closed date is
encountered.

For example, if an item is due on June 29th, but is not returned until
after July 1st (Canada Day), then when fines are generated for the item,
generate fines creates a fine for the 30th of June, but when it
gets to the 1st of July it encouters a closed date and executes a
'return' statement which exits the generate_fines code causing the
fine from June 30th to be rolled back as well as preventing
further fines from being generated.

This fix replaces the 'return' statements insisde the 'for' loop that is
nested within the eval with 'next' statements.  The next statements  were
changed into returns to prevent excessive warning messages.  However,
after testing locally, next statements within a for loop nested within an
eval do not generate warnings.  If my tests are incorrect,
"no warnings 'exiting';" at the start of the eval should also address
this problem while maintaining the necessary next statements within the
internal for loop.
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm