http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14402
--- Comment #25 from Barton Chittenden <bar...@bywatersolutions.com> --- Created attachment 42817 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42817&action=edit Bug 14402: 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. http://bugs.koha-community.org/show_bug.cgi?id=14402 Signed-off-by: Nancy Keener <nkee...@washoecounty.us> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/