#
my ($current_loan_count, $max_loans_allowed) = TooMany( $borrower, $item->{biblionumber}, $item );
# if TooMany max_loans_allowed returns 0 the user doesn't have permission to check out this book
- if ($max_loans_allowed eq 0) {
+ if (defined $max_loans_allowed && $max_loans_allowed == 0) {
$needsconfirmation{PATRON_CANT} = 1;
} else {
if($max_loans_allowed){
my $query = 'UPDATE issues SET returndate=';
my @bind;
if ($dropbox_branch) {
- my $calendar = Koha->new( branchcode => $dropbox_branch );
+ my $calendar = Koha::Calendar->new( branchcode => $dropbox_branch );
my $dropboxdate = $calendar->addDate( DateTime->now( time_zone => C4::Context->tz), -1 );
$query .= ' ? ';
- push @bind, $dropboxdate->strftimei('%Y-%m-%d %H:%M');
+ push @bind, $dropboxdate->strftime('%Y-%m-%d %H:%M');
} elsif ($returndate) {
$query .= ' ? ';
push @bind, $returndate;
}
my $branchcode = _GetCircControlBranch( $item, $borrower );
- my $calendar = C4::Calendar->new( branchcode => $branchcode );
+ my $calendar = Koha::Calendar->new( branchcode => $branchcode );
my $today = C4::Dates->new();
my $deltadays = $calendar->daysBetween( $datedue, C4::Dates->new() );
}
my $calendar = Koha::Calendar->new( branchcode => $branch );
$datedue = $calendar->addDate( $startdate, $dur, $loanlength->{lengthunit} );
+ if ($loanlength->{lengthunit} eq 'days') {
+ $datedue->set_hour(23);
+ $datedue->set_minute(59);
+ }
}
}