Bugzilla – Attachment 15970 Details for
Bug 4906
Allow fine calculation to exclude grace period
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 4906: Allow fine calculation to exclude grace period
Bug-4906-Allow-fine-calculation-to-exclude-grace-p.patch (text/plain), 4.49 KB, created by
Marcel de Rooy
on 2013-03-08 10:57:54 UTC
(
hide
)
Description:
Bug 4906: Allow fine calculation to exclude grace period
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-03-08 10:57:54 UTC
Size:
4.49 KB
patch
obsolete
>From 1bf451451fbee3ba4cefa3f279a1b75ee211045a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 9 Aug 2012 10:53:46 -0400 >Subject: [PATCH] Bug 4906: Allow fine calculation to exclude grace period >Content-Type: text/plain; charset="utf-8" > >This patch adds the system preference FinesIncludeGracePeriod which >allows the library the choice to include the grace period when calculating >a fine ( Koha's current behavior ) or to ignore the grace period for >the purposes of fines calculation. It is set by default to preserve the >current behavior. > >Signed-off-by: Srikanth Dhondi <srikanth@catalyst.net.nz> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Rebased March 8, 2013. Included renaming pref. >Works as advertised. Renamed the bug title and opened a new report for the >original bug. >--- > C4/Overdues.pm | 6 +++++- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/circulation.pref | 6 ++++++ > 4 files changed, 19 insertions(+), 1 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index ac66c36..80771ae 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -264,7 +264,11 @@ sub CalcFine { > my $units_minus_grace = $chargeable_units - $data->{firstremind}; > my $amount = 0; > if ($data->{'chargeperiod'} && ($units_minus_grace > 0) ) { >- $amount = int($chargeable_units / $data->{'chargeperiod'}) * $data->{'fine'};# TODO fine calc should be in cents >+ if ( C4::Context->preference('FinesIncludeGracePeriod') ) { >+ $amount = int($chargeable_units / $data->{'chargeperiod'}) * $data->{'fine'};# TODO fine calc should be in cents >+ } else { >+ $amount = int($units_minus_grace / $data->{'chargeperiod'}) * $data->{'fine'}; >+ } > } else { > # a zero (or null) chargeperiod or negative units_minus_grace value means no charge. > } >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index cad409c..e8d2e13 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -418,3 +418,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('Persona',0,'Use Mozilla Persona for login','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacItemLocation','callnum','Show the shelving location of items in the opac','callnum|ccode|location','Choice'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('TrackClicks','0','Track links clicked',NULL,'Integer'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 041040a..61b4a81 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6476,6 +6476,13 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.11.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('FinesIncludeGracePeriod','1','If enabled, fines calculations will include the grace period.',NULL,'YesNo');"); >+ print "Upgrade to $DBversion done (Add system preference FinesIncludeGracePeriod)\n"; >+ SetVersion($DBversion); >+} >+ > > =head1 FUNCTIONS > >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 82c1c02..f88d964 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 >@@ -482,6 +482,12 @@ Circulation: > yes: Refund > no: "Don't refund" > - lost item fees charged to a borrower when the lost item is returned. >+ - >+ - pref: FinesIncludeGracePeriod >+ choices: >+ yes: Include >+ no: "Don't include" >+ - the grace period when calculating the fine for an overdue item. > Self Checkout: > - > - "Include the following JavaScript on all pages in the web-based self checkout:" >-- >1.7.7.6
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 4906
:
11507
|
11508
|
13515
|
13570
|
13574
|
15969
| 15970