From ba6d75b0bc8a63ba527c0ebb7e2df834b0c0f641 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 4 Mar 2025 13:44:53 +0000 Subject: [PATCH] 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 --- Koha/Patron/Debarments.pm | 1 + misc/cronjobs/writeoff_debts.pl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Patron/Debarments.pm b/Koha/Patron/Debarments.pm index 27ac527f284..b46cc968443 100644 --- a/Koha/Patron/Debarments.pm +++ b/Koha/Patron/Debarments.pm @@ -23,6 +23,7 @@ use C4::Context; use C4::Log qw( logaction ); use Koha::Database; +use Koha::Patrons; use Koha::Patron::Restriction::Types; use Koha::Patron::Restrictions; diff --git a/misc/cronjobs/writeoff_debts.pl b/misc/cronjobs/writeoff_debts.pl index 4c9dea6fc39..6ac740b765a 100755 --- a/misc/cronjobs/writeoff_debts.pl +++ b/misc/cronjobs/writeoff_debts.pl @@ -113,7 +113,7 @@ while ( my $line = $lines->next ) { my $writeoff_offset = Koha::Account::Offset->new( { credit_id => $writeoff->accountlines_id, - type => 'WRITEOFF', + type => 'CREATE', amount => $line->amountoutstanding } )->store(); -- 2.39.5