| Summary: | writeoff_debts.pl does not run | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
| Component: | Command-line Utilities | Assignee: | Nick Clemens (kidclamp) <nick> |
| Status: | Pushed to stable --- | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | martin.renvoize, paul.derscheid, robin |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | Small patch | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: |
25.05.00,24.11.03
|
Circulation function: | |
| Bug Depends on: | 22435, 31095 | ||
| Bug Blocks: | 37920 | ||
| Attachments: |
Bug 39236: writeoff_debts.pl needs adjustments
Bug 39236: writeoff_debts.pl needs adjustments Bug 39236: writeoff_debts.pl needs adjustments |
||
Created attachment 178916 [details] [review] Bug 39236: writeoff_debts.pl needs adjustments From bug 22435 - we need to use 'CREATE' as the account_offset type From bug 31095 - we need to 'use Koha::Patrons;' To test: 1 - Add a fine to a patron account 2 - perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01 3 - Cronjob dies 4 - Apply patch 5 - Rerun 6 - Job succeeds! 7 - Confirm patron's fine is written off 8 - Sign off Created attachment 179142 [details] [review] Bug 39236: writeoff_debts.pl needs adjustments From bug 22435 - we need to use 'CREATE' as the account_offset type From bug 31095 - we need to 'use Koha::Patrons;' To test: 1 - Add a fine to a patron account 2 - perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01 3 - Cronjob dies 4 - Apply patch 5 - Rerun 6 - Job succeeds! 7 - Confirm patron's fine is written off 8 - Sign off Signed-off-by: Magnus Enger <magnus@libriotech.no> Created attachment 179155 [details] [review] Bug 39236: writeoff_debts.pl needs adjustments From bug 22435 - we need to use 'CREATE' as the account_offset type From bug 31095 - we need to 'use Koha::Patrons;' To test: 1 - Add a fine to a patron account 2 - perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01 3 - Cronjob dies 4 - Apply patch 5 - Rerun 6 - Job succeeds! 7 - Confirm patron's fine is written off 8 - Sign off Signed-off-by: Magnus Enger <magnus@libriotech.no> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> I'm confused by how this has been broken for years.. we've been using it in production for a long time and not notices.. maybe strict mode makes the difference Either way, this is a sensible change and causes no regressions. Passing QA Pushed for 25.05! Well done everyone, thank you! Nice work everyone! Pushed to 24.11.x for 24.11.03 |
To recreate: Add a fine to a patron account Run the cronjob: perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01 Attempting to write off 1 debts DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'type' at row 1 at /kohadevbox/koha/Koha/Object.pm line 174 Invalid value passed, type=WRITEOFF vim misc/cronjobs/writeoff_debts.pl Edit the cronjob and change the 'WRITEOFF' in the account offset to 'CREATE' perl misc/cronjobs/writeoff_debts.pl -v -c --added-after 2025-01-01 Attempting to write off 1 debts {UNKNOWN}: Can't locate object method "find" via package "Koha::Patrons" (perhaps you forgot to load "Koha::Patrons"?) at /kohadevbox/koha/Koha/Patron/Debarments.pm line 316. at misc/cronjobs/writeoff_debts.pl line 128