View | Details | Raw Unified | Return to bug 12847
Collapse All | Expand All

(-)a/C4/Members.pm (-9 / +16 lines)
Lines 2346-2365 sub DeleteMessage { Link Here
2346
sub IssueSlip {
2346
sub IssueSlip {
2347
    my ($branch, $borrowernumber, $quickslip) = @_;
2347
    my ($branch, $borrowernumber, $quickslip) = @_;
2348
2348
2349
#   return unless ( C4::Context->boolean_preference('printcirculationslips') );
2349
    my $now = dt_from_string();
2350
2350
    $now->truncate( to => 'day' );
2351
    my $now       = POSIX::strftime("%Y-%m-%d", localtime);
2352
2351
2353
    my $issueslist = GetPendingIssues($borrowernumber);
2352
    my $issueslist = GetPendingIssues($borrowernumber);
2354
    foreach my $it (@$issueslist){
2353
    foreach my $it (@$issueslist) {
2355
        if ((substr $it->{'issuedate'}, 0, 10) eq $now || (substr $it->{'lastreneweddate'}, 0, 10) eq $now) {
2354
2355
        my $dt_issuedate = dt_from_string( $it->{'issuedate'} );
2356
        $dt_issuedate->truncate( to => 'day' );
2357
        my $dt_lastreneweddate = dt_from_string( $it->{'lastreneweddate'} );
2358
        $dt_lastreneweddate->truncate( to => 'day' );
2359
        my $dt_date_due = dt_from_string( $it->{'date_due'} );
2360
        $dt_date_due->truncate( to => 'day' );
2361
2362
        if ( $dt_issuedate == $now || $dt_lastreneweddate == $now ) {
2356
            $it->{'now'} = 1;
2363
            $it->{'now'} = 1;
2357
        }
2364
        }
2358
        elsif ((substr $it->{'date_due'}, 0, 10) le $now) {
2365
        elsif ( $dt_date_due < $now ) {
2359
            $it->{'overdue'} = 1;
2366
            $it->{'overdue'} = 1;
2360
        }
2367
        }
2361
        my $dt = dt_from_string( $it->{'date_due'} );
2368
2362
        $it->{'date_due'} = output_pref( $dt );;
2369
        # Recreate date_due as DateTime because we truncated the hours
2370
        $it->{'date_due'} = output_pref( dt_from_string( $it->{'date_due'} ) );
2363
    }
2371
    }
2364
    my @issues = sort { $b->{'timestamp'} <=> $a->{'timestamp'} } @$issueslist;
2372
    my @issues = sort { $b->{'timestamp'} <=> $a->{'timestamp'} } @$issueslist;
2365
2373
2366
- 

Return to bug 12847