[Koha-bugs] [Bug 14402] Add --fees option to cleanup_database.pl to purge all 0 balance fees and payments older than the given number of days
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Sat Jul 18 22:36:59 CEST 2015
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14402
--- Comment #5 from Barton Chittenden <barton at bywatersolutions.com> ---
Created attachment 41087
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41087&action=edit
Add unit tests for purge_zero_balance_fees()
The function C4::Accounts::purge_zero_balance_fees() should delete rows
in accountlines where amountoutstanding is 0 and accountlines.date is
less than the current date minus '$days', i.e a number of days passed
to the function. Tests were added to prove the following:
* accountlines.amountoutstanding is 0, and date is set to CURRENT_DATE.
The accountlines row should not be deleted. This is merely a sanity check,
because difference between today's date and the fee date cannot be
greater than $days.
* 'Before', 'On' and 'After' tests for accountlines.amountoutstanding = 0
* accountlines.amountoutstanding is 0, and date is set to $days - 1
days ago. The accountlines row should not be deleted.
* accountlines.amountoutstanding is 0, and date is set to $days
days ago. the accountlines row should not be deleted, because
the difference must be *greater* than $days.
* accountlines.amountoutstanding is 0, and date is set to $days + 1
days ago. The accountlines row *will* be deleted in this case.
* 'Before', 'On' and 'After' tests for accountlines.amountoutstanding > 0.
(3 tests). The accountlines row will never be deleted, because
amountoutstanding is not 0.
* 'Before', 'On' and 'After' tests for accountlines.amountoutstanding < 0.
(3 testes) This tests credits. Again, the accountlines row will never
be deleted, because amountoutstanding is not 0.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list