@@ -, +, @@ out an item with rental fees --- C4/Circulation.pm | 13 +++++++++++++ installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 9 +++++++++ .../prog/en/modules/admin/preferences/circulation.pref | 9 ++++++++- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++++ 5 files changed, 35 insertions(+), 1 deletion(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -907,6 +907,19 @@ sub CanBookBeIssued { } } + # CHECK IF THERE IS RENTAL CHARGES. RENTAL MUST BE CONFIRMED BY THE BORROWER + my $sth = $dbh->prepare("SELECT rentalcharge FROM itemtypes WHERE itemtype = ?"); + $sth->execute( $item->{'itemtype'} ); + my $rentalCharge = $sth->fetchrow(); + my $rentalConfirmation = C4::Context->preference("RentalFeesCheckoutConfirmation"); + + if ( $rentalCharge && $rentalConfirmation ) + { + $rentalCharge = sprintf("%.02f \$", $rentalCharge); + $rentalCharge =~ s/\./,/; + $needsconfirmation{RENTALCHARGE} = $rentalCharge; + } + # # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER # --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -332,6 +332,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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', '1', NULL , 'Allow user to confirme 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'), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -8560,6 +8560,15 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q| + INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('RentalFeesCheckoutConfirmation', '1', NULL , 'Allow user to confirme 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) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -327,7 +327,14 @@ Circulation: 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" + - a confirmation to check-out. - - On checkin route the returned item to - pref: HomeOrHoldingBranchReturn --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -206,6 +206,10 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
  • The patron has a debt of [% DEBT %]
  • [% END %] +[% IF ( RENTALCHARGE ) %] +
  • Rental charge for this item : [% RENTALCHARGE %]
  • +[% END %] + [% IF ( RENEW_ISSUE ) %]
  • Item [% getTitleMessageIteminfo %] ([% getBarcodeMessageIteminfo %]) is currently checked out to this patron. Renew?
  • [% END %] --