## 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'},
}
# 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...
elsif ( $code eq 'WasLost' ) {
$err{waslost} = 1;
}
+ elsif ( $code eq 'LostItemFeeRefunded' ) {
+ $template->param( LostItemFeeRefunded => 1 );
+ }
elsif ( $code eq 'ResFound' ) {
; # FIXME... anything to do here?
}
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'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 lost item is returned.', NULL, 'YesNo');
SetVersion ($DBversion);
}
+$DBversion = "3.11.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 lost item is returned.', NULL, 'YesNo')");
+ print "Upgrade to $DBversion done (Bug 7189: Add system preference RefundLostItemFeeOnReturn)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
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
[% END %]
[% IF ( errmsgloo.waslost ) %]
<p class="problem">Item was lost, now found.</p>
+ [% IF ( 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 ) %]
[% IF BlockReturnOfWithdrawnItems %]