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

(-)a/C4/Members.pm (-9 / +16 lines)
Lines 2434-2453 sub DeleteMessage { Link Here
2434
sub IssueSlip {
2434
sub IssueSlip {
2435
    my ($branch, $borrowernumber, $quickslip) = @_;
2435
    my ($branch, $borrowernumber, $quickslip) = @_;
2436
2436
2437
#   return unless ( C4::Context->boolean_preference('printcirculationslips') );
2437
    my $now = dt_from_string();
2438
2438
    $now->truncate( to => 'day' );
2439
    my $now       = POSIX::strftime("%Y-%m-%d", localtime);
2440
2439
2441
    my $issueslist = GetPendingIssues($borrowernumber);
2440
    my $issueslist = GetPendingIssues($borrowernumber);
2442
    foreach my $it (@$issueslist){
2441
    foreach my $it (@$issueslist) {
2443
        if ((substr $it->{'issuedate'}, 0, 10) eq $now || (substr $it->{'lastreneweddate'}, 0, 10) eq $now) {
2442
2443
        my $dt_issuedate = dt_from_string( $it->{'issuedate'} );
2444
        $dt_issuedate->truncate( to => 'day' );
2445
        my $dt_lastreneweddate = dt_from_string( $it->{'lastreneweddate'} );
2446
        $dt_lastreneweddate->truncate( to => 'day' );
2447
        my $dt_date_due = dt_from_string( $it->{'date_due'} );
2448
        $dt_date_due->truncate( to => 'day' );
2449
2450
        if ( $dt_issuedate == $now || $dt_lastreneweddate == $now ) {
2444
            $it->{'now'} = 1;
2451
            $it->{'now'} = 1;
2445
        }
2452
        }
2446
        elsif ((substr $it->{'date_due'}, 0, 10) le $now) {
2453
        elsif ( $dt_date_due < $now ) {
2447
            $it->{'overdue'} = 1;
2454
            $it->{'overdue'} = 1;
2448
        }
2455
        }
2449
        my $dt = dt_from_string( $it->{'date_due'} );
2456
2450
        $it->{'date_due'} = output_pref( $dt );;
2457
        # Recreate date_due as DateTime because we truncated the hours
2458
        $it->{'date_due'} = output_pref( dt_from_string( $it->{'date_due'} ) );
2451
    }
2459
    }
2452
    my @issues = sort { $b->{'timestamp'} <=> $a->{'timestamp'} } @$issueslist;
2460
    my @issues = sort { $b->{'timestamp'} <=> $a->{'timestamp'} } @$issueslist;
2453
2461
2454
- 

Return to bug 12847