Bugzilla – Attachment 10662 Details for
Bug 7639
system preference to forgive fines on lost items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Sending Improved Patch.
0001-Bug-7639-system-preference-to-forgive-fines-on-lost-.patch (text/plain), 8.29 KB, created by
Meenakshi
on 2012-07-06 05:52:58 UTC
(
hide
)
Description:
Sending Improved Patch.
Filename:
MIME Type:
Creator:
Meenakshi
Created:
2012-07-06 05:52:58 UTC
Size:
8.29 KB
patch
obsolete
>From eca0093bf7037f29d4ade9fb80a33436fa301472 Mon Sep 17 00:00:00 2001 >From: shinoy <shinoy.m@osslabs.biz> >Date: Fri, 20 Apr 2012 17:06:44 +0530 >Subject: [PATCH] Bug 7639 - system preference to forgive fines on lost items > >Added Sys prefs ForgiveFineWhenLost and ChargeReplFeeWhenLost >--- > C4/Circulation.pm | 22 ++++++++++++------- > catalogue/updateitem.pl | 2 +- > cataloguing/additem.pl | 7 ++++++ > installer/data/mysql/sysprefs.sql | 2 + > installer/data/mysql/updatedatabase.pl | 8 +++++++ > .../en/modules/admin/preferences/circulation.pref | 12 ++++++++++ > tools/batchMod.pl | 2 +- > 7 files changed, 45 insertions(+), 10 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 6ca860d..851b539 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3062,7 +3062,7 @@ sub ReturnLostItem{ > > > sub LostItem{ >- my ($itemnumber, $mark_returned, $charge_fee) = @_; >+ my ($itemnumber, $mark_returned ) = @_; > > my $dbh = C4::Context->dbh(); > my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title >@@ -3076,13 +3076,19 @@ sub LostItem{ > > # if a borrower lost the item, add a replacement cost to the their record > if ( my $borrowernumber = $issues->{borrowernumber} ){ >- >- C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}") >- if $charge_fee; >- #FIXME : Should probably have a way to distinguish this from an item that really was returned. >- #warn " $issues->{'borrowernumber'} / $itemnumber "; >- MarkIssueReturned($borrowernumber,$itemnumber) if $mark_returned; >- } >+ if (C4::Context->preference('ForgiveFineWhenLost')){ >+ my $exemptfine=1; >+ my $dropbox=0; >+ my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine, $dropbox); >+ defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!"; # zero is OK, check defined >+ } >+ if (C4::Context->preference('ChargeReplFeeWhenLost')){ >+ C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}"); >+ #FIXME : Should probably have a way to distinguish this from an item that really was returned. >+ #warn " $issues->{'borrowernumber'} / $itemnumber "; >+ } >+ MarkIssueReturned($borrowernumber,$itemnumber) if $mark_returned; >+ } > } > > sub GetOfflineOperations { >diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl >index abc809d..21e3c01 100755 >--- a/catalogue/updateitem.pl >+++ b/catalogue/updateitem.pl >@@ -74,6 +74,6 @@ if (defined $itemnotes) { # i.e., itemnotes parameter passed from form > > ModItem($item_changes, $biblionumber, $itemnumber); > >-LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $itemlost; >+LostItem($itemnumber, 'MARK RETURNED') if $itemlost; > > print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber"); >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 9c8120e..5f83af3 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -27,6 +27,7 @@ use C4::Output; > use C4::Biblio; > use C4::Items; > use C4::Context; >+use C4::Circulation; > use C4::Koha; # XXX subfield_is_koha_internal_p > use C4::Branch; # XXX subfield_is_koha_internal_p > use C4::ClassSource; >@@ -519,6 +520,12 @@ if ($op eq "additem") { > ModItemFromMarc($itemtosave,$biblionumber,$itemnumber); > $itemnumber=""; > } >+ my $item = GetItem( $itemnumber ); >+ my $olditemlost = $item->{'itemlost'}; >+ my $newitemlost = $itemtosave->subfield('952','1'); >+ if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){ >+ LostItem($itemnumber,'MARK RETURNED'); >+ } > $nextop="additem"; > } elsif ($op eq "delinkitem"){ > my $analyticfield = '773'; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 49debd2..52935ea 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -34,6 +34,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('expandedSearchOption',0,'If ON, set advanced search to be expanded by default',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FineNotifyAtCheckin',0,'If ON notify librarians of overdue fines on the items they are checking in.',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo'); >+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('ForgiveFineWhenLost','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo'); >+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('ChargeReplFeeWhenLost','0',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WaitingNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index e140ff3..c2f1d1e 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5198,6 +5198,14 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.07.00.50"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('ForgiveFineWhenLost','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo')"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('ChargeReplFeeWhenLost','0',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo')"); >+ print "Upgrade to $DBversion done (Added sysprefs ForgiveFineWhenLost and ChargeReplFeeWhenLost)\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 471aa0e..cf96088 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 >@@ -367,6 +367,18 @@ 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: ForgiveFineWhenLost >+ choices: >+ yes: Forgive >+ no: "Don't Forgive" >+ - the fines on an item when it is lost. >+ - >+ - pref: ChargeReplFeeWhenLost >+ choices: >+ yes: Charge >+ no: "Don't Charge" >+ - the replacement price when a patron loses an item. > Self Checkout: > - > - pref: ShowPatronImageInWebBasedSelfCheck >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 9d59e3a..10388af 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -188,7 +188,7 @@ if ($op eq "action") { > UpdateMarcWith( $marcitem, $localmarcitem ); > eval{ > if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) { >- LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $item->{itemlost}; >+ LostItem($itemnumber, 'MARK RETURNED') if $item->{itemlost}; > } > }; > } >-- >1.7.1 >
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 7639
:
9281
|
9282
|
9436
|
10662
|
10663
|
13006
|
13007
|
14961
|
14962
|
15088
|
15089
|
16593
|
16607
|
16608
|
16609
|
16729
|
16730
|
16731
|
18929
|
18930
|
18932
|
18964
|
18965
|
18966
|
19654
|
19655
|
19656
|
19657
|
20436
|
20437
|
20438
|
20439
|
20456
|
20487