From c4e4c834d1ed3955d7a34a4505d2a9af10726dda 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' Signed-off-by: Andrew Fuerste Henry --- .../bug_28575-no-refund-lost-age.pl | 20 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 5 +++++ 3 files changed, 26 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..fc172a0bd7 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28575-no-refund-lost-age.pl @@ -0,0 +1,20 @@ +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 d6a450e514..3a92e917cc 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.2