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.
Signed-off-by: Nancy Keener <nkeener@washoecounty.us> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>