Bug ID: 20325
Summary: C4::Accounts::purge_zero_balance_fees does not check
Change sponsored?: ---
Priority: P5 - low
Component: Architecture, internals, and plumbing
QA Contact: testo...@bugs.koha-community.org
purge_zero_balance_fees is used in cleanup_database.pl to determine which fees
can be cleaned up.
It uses a simple SQL query to determine which rows in accountlines need to be
463 my $sth = $dbh->prepare(
465 DELETE FROM accountlines
466 WHERE date < date_sub(curdate(), INTERVAL ? DAY)
467 AND ( amountoutstanding = 0 or amountoutstanding IS NULL );
The function comes with the following warning:
451 B<Warning:> Because fines and payments are not linked in accountlines, it
452 possible for a fine to be deleted without the accompanying payment,
453 or vise versa. This won't affect the account balance, but might be
454 confusing to staff.
This was a reasonable solution prior to the addition of account_offsets in
17.11. The problem now is that rows in accountlines which are linked as credits
in accountlines will *always* have amountoutstanding marked as 0. These are
linked to debits via account_offsets. purge_zero_balance_fees will delete
credits and leave rows in account_offsets which link to deleted credits.
Sites using the --fees option cleanup_database.pl which upgrade to 17.11 may
have all of their credits removed without warning.
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
Koha-bugs mailing list
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/