Bug 25146 - Move reconcile_balances.pl script into maintenance directory
Summary: Move reconcile_balances.pl script into maintenance directory
Status: BLOCKED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: 19.05
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 21915 25148
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-14 18:55 UTC by Kelly McElligott
Modified: 2020-04-14 22:41 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 25146: Move reconcile_balances.pl script into maintenance directory (977 bytes, patch)
2020-04-14 22:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 25146: Move reconcile_balances.pl script into maintenance directory (1.44 KB, patch)
2020-04-14 22:39 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kelly McElligott 2020-04-14 18:55:07 UTC
The reconcile balance cron was introduced to handle the patrons accounting where debits and credits were out of line.  After this cron was introduced, a system preference, AccountAutoReconcile, was created to allow libraries to reconcile patron balances automatically as they happened. I would argue that this cron can be eliminated as the system preference can do the same thing and it gives control to the library through the staff client vs a cron.
Comment 1 Katrin Fischer 2020-04-14 19:21:03 UTC
I am not sure if the cron would still be useful for people updating from earlier versions - allowing a 'clean-up' of data created before the pref was added. 
We could discuss moving it into a different directory then maybe - (maintenance?)
Adding Tomas as the original author and linking to the original bug.
Comment 2 Tomás Cohen Arazi (tcohen) 2020-04-14 19:53:48 UTC
I agree this shouldn't be a cronjob anymore. This should belong to the maintenance scripts collection (even if AutoReconcile is on, there is no other tool that traverses all patrons and calls the reconcile_balance method on their behalf).

For that reason, I would keep it, not as a cronjob, but keep it.
Comment 3 Katrin Fischer 2020-04-14 22:34:30 UTC
I have tried to patch this, but running the script, I get a fatal error:
SQL::Abstract::puke(): [SQL::Abstract::__ANON__] Fatal: SQL::Abstract before v1.75 used to generate incorrect SQL when the -IN operator was given an undef-containing list: !!!AUDIT YOUR CODE AND DATA!!! (the upcoming Data::Query-based version of SQL::Abstract will emit the logically correct SQL instead of raising this exception) at /home/vagrant/kohaclone/Koha/Objects.pm line 210

Tomas, can you help?
Comment 4 Katrin Fischer 2020-04-14 22:36:42 UTC
Created attachment 102954 [details] [review]
Bug 25146: Move reconcile_balances.pl script into maintenance directory

This moves the reconcile_balances.pl script from the cronjobs
to the maintenance directory. It's still useful if you want
to start using AccountAutoReconcile to clean your data up
at the beginning, but is not supposed to run regularly in cron.

To test:
- Verify the file has been moved
- Run the script and verify it still works
Comment 5 Katrin Fischer 2020-04-14 22:39:03 UTC
Created attachment 102955 [details] [review]
Bug 25146: Move reconcile_balances.pl script into maintenance directory

This moves the reconcile_balances.pl script from the cronjobs
to the maintenance directory. It's still useful if you want
to start using AccountAutoReconcile to clean your data up
at the beginning, but is not supposed to run regularly in cron.

To test:
- Verify the file has been moved
- Run the script and verify it still works