@@ -, +, @@ --- Koha/Accounts.pm | 2 ++ installer/data/mysql/atomicupdate/bug_14373.sql | 2 ++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/circulation.pref | 6 ++++++ members/account_payment.pl | 12 ++++++------ 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_14373.sql --- a/Koha/Accounts.pm +++ a/Koha/Accounts.pm @@ -380,6 +380,8 @@ sub CreditDebit { croak("Required parameter 'debit' not passed in!") unless $debit; + return if $debit->accruing() && C4::Context->preference('DisallowPaymentsOnAccruingFines'); + my $amount_to_pay = ( $debit->amount_outstanding() > $credit->amount_remaining() ) ? $credit->amount_remaining() --- a/installer/data/mysql/atomicupdate/bug_14373.sql +++ a/installer/data/mysql/atomicupdate/bug_14373.sql @@ -0,0 +1,2 @@ +INSERT IGNORE INTO systempreferences(variable,value,options,explanation,type) VALUES +('DisallowPaymentsOnAccruingFines', '1', '', 'If enabled, accruing fines will be unpayable until they are no longer accruing', 'YesNo'); --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -107,6 +107,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('defaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), ('defaultSortOrder','dsc','asc|dsc|az|za','Specify the default sort order','Choice'), ('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'), +('DisallowPaymentsOnAccruingFines', '1', '', 'If enabled, accruing fines will be unpayable until they are no longer accruing', 'YesNo'), ('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding Staff Client XSLT option must be on','Choice'), ('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'), ('displayFacetCount','0',NULL,NULL,'YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -626,6 +626,12 @@ Circulation: yes: Charge no: "Don't Charge" - the replacement price when a patron loses an item. + - + - pref: DisallowPaymentsOnAccruingFines + choices: + yes: "Don't" + no: "Do" + - allow payments to be made for accruing fines. Self Checkout: - - "Include the following JavaScript on all pages in the web-based self checkout:" --- a/members/account_payment.pl +++ a/members/account_payment.pl @@ -61,12 +61,12 @@ my $borrowernumber = $cgi->param('borrowernumber'); my $borrower = GetMember( borrowernumber => $borrowernumber ); -my @debits = Koha::Database->new()->schema->resultset('AccountDebit')->search( - { - 'me.borrowernumber' => $borrowernumber, - amount_outstanding => { '>' => 0 } - } -); +my $params; +$params->{'me.borrowernumber'} = $borrowernumber; +$params->{amount_outstanding} = { '>' => 0 }; +$params->{accruing} = 0 if C4::Context->preference('DisallowPaymentsOnAccruingFines'); + +my @debits = Koha::Database->new()->schema->resultset('AccountDebit')->search($params); $template->param( debits => \@debits, --