my $dbh = C4::Context->dbh;
my $borrower = GetMember('borrowernumber'=>$borrowerid);
unless ($date){
- $date=POSIX::strftime("%Y-%m-%d",localtime());
+ $date = (C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry') ?
+ C4::Dates->new($borrower->{'dateexpiry'}, 'iso')->output("iso") :
+ C4::Dates->new()->output("iso");
$date = GetExpiryDate( $borrower->{'categorycode'}, $date );
}
my $sth = $dbh->do(<<EOF);
--- /dev/null
+#! /usr/bin/perl
+use strict;
+use warnings;
+use C4::Context;
+my $dbh=C4::Context->dbh;
+$dbh->do(<<ENDOFRENEWAL);
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice');
+ENDOFRENEWAL
+print "Upgrade done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n";
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACLocalCoverImages','0','Display local cover images on OPAC search and details pages.','1','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('LocalCoverImages','0','Display local cover images on intranet details pages.','1','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowMultipleCovers','0','Allow multiple cover images to be attached to each bibliographic record.','1','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice');
yes: Do
no: "Don't"
- store and display surnames in upper case.
+ -
+ - When renewing borrowers, base the new expiry date on
+ - pref: BorrowerRenewalPeriodBase
+ choices:
+ now: current date.
+ dateexpiry: current membership expiry date.