Bugzilla – Attachment 10951 Details for
Bug 7189
preference to control if returning lost items gives refund
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7189 - preference to control if returning lost items gives refund
Bug-7189---preference-to-control-if-returning-lost.patch (text/plain), 6.74 KB, created by
Kyle M Hall (khall)
on 2012-07-18 13:54:30 UTC
(
hide
)
Description:
Bug 7189 - preference to control if returning lost items gives refund
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-07-18 13:54:30 UTC
Size:
6.74 KB
patch
obsolete
>From a6c5295049d7ba22717ce5d109b5bc09a19876a6 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 24 Apr 2012 09:05:36 -0400 >Subject: [PATCH] Bug 7189 - preference to control if returning lost items gives refund > >Right now when you return an item that was lost the patron's card is >credited with the lost fee, but not all libraries refund lost fees >and sometimes the fee is refunded after the patron has paid for it, >causing all kinds of financial issues. > >Adds the syspref RefundLostItemFeeOnReturn to control whether >returning a lost item refunds the fee charged for losing that >item. Enabled by default to maintain Koha's current functionality. >--- > C4/Circulation.pm | 12 +++++++++--- > circ/returns.pl | 3 +++ > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/circulation.pref | 6 ++++++ > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 5 +++++ > 6 files changed, 31 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9508c78..75462ed 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1069,7 +1069,9 @@ sub AddIssue { > > ## If item was lost, it has now been found, reverse any list item charges if neccessary. > if ( $item->{'itemlost'} ) { >- _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); >+ if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { >+ _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); >+ } > } > > ModItem({ issues => $item->{'issues'}, >@@ -1668,9 +1670,13 @@ sub AddReturn { > } > > # fix up the accounts..... >- if ($item->{'itemlost'}) { >- _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode); # can tolerate undef $borrowernumber >+ if ( $item->{'itemlost'} ) { > $messages->{'WasLost'} = 1; >+ >+ if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { >+ _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode); # can tolerate undef $borrowernumber >+ $messages->{'LostItemFeeRefunded'} = 1; >+ } > } > > # fix up the overdues in accounts... >diff --git a/circ/returns.pl b/circ/returns.pl >index b9127da..e39ea57 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -433,6 +433,9 @@ foreach my $code ( keys %$messages ) { > elsif ( $code eq 'WasLost' ) { > $err{waslost} = 1; > } >+ elsif ( $code eq 'LostItemFeeRefunded' ) { >+ $err{LostItemFeeRefunded} = 1; >+ } > elsif ( $code eq 'ResFound' ) { > ; # FIXME... anything to do here? > } >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 7009155..72eb580 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -375,3 +375,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( > INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lst item is returned.', NULL, 'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index bb96644..01ab437 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5536,6 +5536,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.09.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lst item is returned.', NULL, 'YesNo')"); >+ print "Upgrade to $DBversion done ( Add system preference RefundLostItemFeeOnReturn )\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >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 e07fc0d..b3e9acd 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 >@@ -393,6 +393,12 @@ Circulation: > test: Calculate (but only for mailing to the admin) > production: Calculate and charge > - fines (when <code>misc/cronjobs/fines.pl</code> is being run). >+ - >+ - pref: RefundLostItemFeeOnReturn >+ choices: >+ yes: Refund >+ no: "Don't refund" >+ - lost item fees charged to a borrower when the lost item is returned. > Self Checkout: > - > - pref: ShowPatronImageInWebBasedSelfCheck >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 1ed01f0..15fa45f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -333,6 +333,11 @@ $(document).ready(function () { > [% END %] > [% IF ( errmsgloo.waslost ) %] > <p class="problem">Item was lost, now found.</p> >+ [% IF ( errmsgloo.LostItemFeeRefunded ) %] >+ <p class="problem">A refund has been applied to the borrowing patron's account.</p> >+ [% ELSE %] >+ <p class="problem">Any lost item fees for this item will remain on the patron's account</p> >+ [% END %] > [% END %] > [% IF ( errmsgloo.withdrawn ) %] > <p class="problem">Item is withdrawn.</p> >-- >1.7.2.5
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 7189
:
9283
|
10614
|
10892
|
10951
|
10971
|
10974
|
11005
|
11054