[Koha-bugs] [Bug 27080] Add --statute-barred-fees option to cleanup_database.pl to purge all fees where the item has been returned and the fee is older than the given number of days.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Dec 11 08:15:59 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27080

--- Comment #20 from Timothy Alexis Vass <timothy_alexis.vass at ub.lu.se> ---
(In reply to Joonas Kylmälä from comment #19)
> Hi,
> 
> - can you explain why only RETURNED fees? It would probably good to have
> this explanation in the help documentation too. Some other fees that might
> need to be removed also could be RENEWED and LOST? Please see
> installer/data/mysql/mandatory/account_debit_types.sql, although it doesn't
> contain every type of fee Koha generates currently.

Statute-barred is a legal term. It is proper to say:
"The fees have become statute-barred."
According to Swedish statutes "perussäännöt", fees for library material are
forbidden to claim after 3 years if the material has been returned.
They are thus "statute-barred" as in "blocked by the fundamental rules of law".

In the other situations "Renewed" and "Lost", it is different. Then the debt
has been handed over to "Kronofogdemyndigheten", which is the Swedish
Enforcement Agency.

All 60+ Swedish libraries using Koha are required by Swedish law to remove
statute-barred fees.
Very likely, something similar will be required in some of the other 1000+ (?)
libraries using Koha around our planet. 

> - Depending on your answer to the above question, would it make sense to
> make the name of this option something more generic, like --unpaid-fees?

The only thing that makes sense is to call it --statute-barred-fees because
that is exactly what it is. They are not --unpaid-fees, they are not
--expired-fees, they are not --old-fees, they are fees that have been barred
according to ruling statutes.

> - The commit title is still too long, see comment #4.

Thank you.

> - The code is now not in a function, i.e. cannot be tested. Would something
> like Koha::Account::Lines::statute_barred (depending on the scope of this
> function maybe a different name) sound good to you? Then you can call
> ->delete or ->count on those and the code will look super cool in the
> script, wouldn't it? :)

Easy to maintain, simple code is preferred.
I would suggest removing all this insane complexity and do database maintenance
in the database, such as:
CREATE EVENT cleanup_statute_barred_fees ON SCHEDULE EVERY 1 DAY
DO
DELETE FROM accountlines
WHERE date < date_sub(curdate(), INTERVAL 1095 DAY)
AND status = 'RETURNED'
AND amountoutstanding > 0

Quite seriously, if you want to make it redundnantly complex because you find
that interesting, you are free to make it happen.
If your purpose here on the planet is to make yourself busy in other's efforts
and to waste time, I advice you to take some time to think about how you can be
a beneficial force for our commonwealth and coexistence here on Earth.

> - The whitespace changes would still be nice to have, just in a separate
> patch. Tip: add it as last in the series so any rebase conflicts will be
> easier to resolve when you only need to redo the whitespace patch and not
> also the feature patch.

I can add them as another patch.

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


More information about the Koha-bugs mailing list