This patch just check the syspref and use it as base date of renew.
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
$item->{homebranch} # item's homebranch determines loanlength OR do we want the branch specified by the AddRenewal argument?
);
+ $datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ?
+ C4::Dates->new($issuedata->{date_due}, 'iso') :
+ C4::Dates->new();
#FIXME -- use circControl?
- $datedue = CalcDateDue(C4::Dates->new($issuedata->{date_due}, 'iso'),$loanlength,$branch); # this branch is the transactional branch.
+ $datedue = CalcDateDue($datedue,$loanlength,$branch); # this branch is the transactional branch.
# The question of whether to use item's homebranch calendar is open.
}
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'if ON, enables the librarian to choose when they want to check out a notForLoan regular item',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','date_due|now','Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '1', 'Si Activé, permet que les périodes de renouvellement puisse être positionnée manuellement durant la circulation',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '0', 'Si Activé, met à jour toutes les notices bibliographiques afférentes dès la modification d''une autorité',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'Si activé, permet au bibliothécaire de choisir de prêter tout de même un exemplaire normalement exclu du prêt',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Permet de déterminer si la période de renouvellement doit être calculée sur la date de retour ou sur le jour du renouvellement','date_due|now','Choice');
SetVersion ($DBversion);
}
+$DBversion = "3.00.01.007";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do(<<ENDOFRENEWAL);
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','date_due|now','Choice');
+ENDOFRENEWAL
+ print "Upgrade to $DBversion done (Change the field)\n";
+ SetVersion ($DBversion);
+}
+
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
use strict;
sub kohaversion {
- our $VERSION = '3.00.01.006';
+ our $VERSION = '3.00.01.007';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install