From e904abf6b9ab5f82c5b7ababa1c3c1ec86de5df3 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Fri, 7 Jun 2024 10:22:23 +0000 Subject: [PATCH] Bug 28575: Add new syspref 'NoRefundOnLostFinesPaidAge' --- .../bug_28575-no-refund-lost-age.pl | 21 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 5 +++++ 3 files changed, 27 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_28575-no-refund-lost-age.pl diff --git a/installer/data/mysql/atomicupdate/bug_28575-no-refund-lost-age.pl b/installer/data/mysql/atomicupdate/bug_28575-no-refund-lost-age.pl new file mode 100755 index 0000000000..ce48af1f64 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28575-no-refund-lost-age.pl @@ -0,0 +1,21 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "28575", + description => + "Add a syspref to prevent refunds on lost items if the fee was paid more than a set number of days ago", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('NoRefundOnLostFinesPaidAge','','','Do not refund lost item fees if the fee was paid off more than this number of days ago','Integer') + } + ); + say_success( $out, "Successfully added new system preference: NoRefundOnLostFinesPaidAge" ); + }, +}; + diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index dffaaadd49..fe35d0b683 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -418,6 +418,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before checkouts are blocked','Integer'), ('NoIssuesChargeGuarantorsWithGuarantees','','','Define maximum amount withstanding before checkouts are blocked including guarantors and their other guarantees','Integer'), ('noItemTypeImages','0',NULL,'If ON, disables itemtype images in the staff interface','YesNo'), +('NoRefundOnLostFinesPaidAge','','','Do not refund lost item fees if the fee was paid off more than this number of days ago','Integer'), ('NoRefundOnLostReturnedItemsAge','','','Do not refund lost item fees if item is lost for more than this number of days','Integer'), ('NoRenewalBeforePrecision','exact_time','date|exact_time','Calculate "No renewal before" based on date only or exact time of due date','Choice'), ('NotesToHide','',NULL,'List of notes fields that should not appear in the title notes/description separator of details','free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index e0e0ead489..4f45a608f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -1151,6 +1151,11 @@ Circulation: - pref: NoRefundOnLostReturnedItemsAge class: integer - days after it was marked lost. + - + - "Don't refund lost fees if the fee was paid in full or if the balance of the fee was paid more than" + - pref: NoRefundOnLostFinesPaidAge + class: integer + - days ago. - - pref: WhenLostChargeReplacementFee choices: -- 2.39.3 (Apple Git-146)