Bugzilla – Attachment 40064 Details for
Bug 14373
Disallow payment of accruing fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14373 - Disallow payment of accruing fines
0001-Bug-14373-Disallow-payment-of-accruing-fines.patch (text/plain), 4.70 KB, created by
Kyle M Hall (khall)
on 2015-06-10 13:12:49 UTC
(
hide
)
Description:
Bug 14373 - Disallow payment of accruing fines
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-06-10 13:12:49 UTC
Size:
4.70 KB
patch
obsolete
>From 7e968e3ade7381169073c11b6960fe0256a5f490 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 10 Jun 2015 05:58:46 -0700 >Subject: [PATCH] Bug 14373 - Disallow payment of accruing fines > >Some libraries wish to prevent payment of accruing fines so that when backdating returns it will not create a negative balance for patrons that paid those fines in advance. > >Test Plan: >1) Apply this patch >2) Note accruing fines don't show up in the pay fines table >3) Note that paying by amount does not pay on accruing fines >--- > 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 > >diff --git a/Koha/Accounts.pm b/Koha/Accounts.pm >index 02165aa..22193a4 100644 >--- a/Koha/Accounts.pm >+++ b/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() >diff --git a/installer/data/mysql/atomicupdate/bug_14373.sql b/installer/data/mysql/atomicupdate/bug_14373.sql >new file mode 100644 >index 0000000..57dbc25 >--- /dev/null >+++ b/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'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index f371193..4c348c9 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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'), >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 a16f231..8d1ed15 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 >@@ -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:" >diff --git a/members/account_payment.pl b/members/account_payment.pl >index 54b20e1..0904335 100755 >--- a/members/account_payment.pl >+++ b/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, >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14373
: 40064