Lines 36-42
use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable);
Link Here
|
36 |
use C4::Members::Attributes qw(SearchIdMatchingAttribute UpdateBorrowerAttribute); |
36 |
use C4::Members::Attributes qw(SearchIdMatchingAttribute UpdateBorrowerAttribute); |
37 |
use C4::NewsChannels; #get slip news |
37 |
use C4::NewsChannels; #get slip news |
38 |
use DateTime; |
38 |
use DateTime; |
39 |
use DateTime::Format::DateParse; |
|
|
40 |
use Koha::Database; |
39 |
use Koha::Database; |
41 |
use Koha::DateUtils; |
40 |
use Koha::DateUtils; |
42 |
use Koha::Borrower::Debarments qw(IsDebarred); |
41 |
use Koha::Borrower::Debarments qw(IsDebarred); |
Lines 1195-1208
sub GetPendingIssues {
Link Here
|
1195 |
my $sth = C4::Context->dbh->prepare($query); |
1194 |
my $sth = C4::Context->dbh->prepare($query); |
1196 |
$sth->execute(@borrowernumbers); |
1195 |
$sth->execute(@borrowernumbers); |
1197 |
my $data = $sth->fetchall_arrayref({}); |
1196 |
my $data = $sth->fetchall_arrayref({}); |
1198 |
my $tz = C4::Context->tz(); |
1197 |
my $today = dt_from_string; |
1199 |
my $today = DateTime->now( time_zone => $tz); |
|
|
1200 |
foreach (@{$data}) { |
1198 |
foreach (@{$data}) { |
1201 |
if ($_->{issuedate}) { |
1199 |
if ($_->{issuedate}) { |
1202 |
$_->{issuedate} = dt_from_string($_->{issuedate}, 'sql'); |
1200 |
$_->{issuedate} = dt_from_string($_->{issuedate}, 'sql'); |
1203 |
} |
1201 |
} |
1204 |
$_->{date_due} or next; |
1202 |
$_->{date_due} or next; |
1205 |
$_->{date_due} = DateTime::Format::DateParse->parse_datetime($_->{date_due}, $tz->name()); |
1203 |
$_->{date_due} = dt_from_string($_->{date_due}, 'sql'); |
1206 |
if ( DateTime->compare($_->{date_due}, $today) == -1 ) { |
1204 |
if ( DateTime->compare($_->{date_due}, $today) == -1 ) { |
1207 |
$_->{overdue} = 1; |
1205 |
$_->{overdue} = 1; |
1208 |
} |
1206 |
} |
1209 |
- |
|
|