[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
Thu Oct 1 11:25:03 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14402

--- Comment #31 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 42994
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=42994&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 <nkeener at washoecounty.us>

Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list