if ( $borrower->{'branchcode'} ne $userenv->{branch} );
}
}
+ #
+ # CHECK IF THERE IS RENTAL CHARGES. RENTAL MUST BE CONFIRMED BY THE BORROWER
+ #
+ my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation");
+
+ if ( $rentalConfirmation ){
+ my ($rentalCharge) = GetIssuingCharges( $item->{'itemnumber'}, $borrower->{'borrowernumber'} );
+ if ( $rentalCharge ){
+ $rentalCharge = sprintf("%.02f", $rentalCharge);
+ $needsconfirmation{RENTALCHARGE} = $rentalCharge;
+ }
+ }
#
# CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER
#
- if ( $issue->{borrowernumber} && $issue->{borrowernumber} eq $borrower->{'borrowernumber'} )
- {
+ if ( $issue->{borrowernumber} && $issue->{borrowernumber} eq $borrower->{'borrowernumber'} ){
# Already issued to current borrower. Ask whether the loan should
# be renewed.
('RenewalPeriodBase','date_due','date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','Choice'),
('RenewalSendNotice','0','',NULL,'YesNo'),
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
+('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'),
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
SetVersion($DBversion);
}
+
+
+$DBversion = "XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q|
+ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo')
+ |);
+ print "Upgrade to $DBversion done (Bug 11169 - Add RentalFeesCheckoutConfirmation syspref)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
block: Block
noblock: "Don't block"
confirmation: Ask for confirmation
- - when checking out to a borrower that has overdues outstanding
+ - when checking out to a borrower that has overdues outstanding
+ -
+ - "When checking out an item with rental fees, "
+ - pref: RentalFeesCheckoutConfirmation
+ choices:
+ yes: ask
+ no: "do not ask"
+ - "for confirmation."
-
- On checkin route the returned item to
- pref: HomeOrHoldingBranchReturn
[% END %]
[% IF ( DEBT ) %]
- <li>The patron has a debt of [% DEBT %]</li>
+ <li>The patron has a debt of [% DEBT %].</li>
+[% END %]
+
+[% IF ( RENTALCHARGE ) %]
+ <li>Rental charge for this item: [% RENTALCHARGE %]</li>
[% END %]
[% IF ( RENEW_ISSUE ) %]