Ignore:
Timestamp:
08/01/16 09:20:51 (8 years ago)
Author:
nanardon
Message:

Fix endEmployement detection during autorized employment break

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm

    r1826 r1827  
    15891589        }); 
    15901590    $list_empl->execute($self->id); 
    1591     my $res; 
    1592     while ($res = $list_empl->fetchrow_hashref) { 
     1591    while (my $res = $list_empl->fetchrow_hashref) { 
    15931592        if (!$res->{lastday}) { 
    15941593            # Ultimate employment. 
     
    16051604                last; 
    16061605            } 
     1606        } elsif ($pend) { 
     1607            my $nextstart = DateTime->from_epoch(epoch => str2time($res->{firstday})); 
     1608            $nextstart->set_time_zone( DateTime::TimeZone->new( name => 'local' ) ); 
     1609            my $tend = $pend->clone; 
     1610            $tend->add(days => $delay + 1); 
     1611            if ($tend->ymd lt $nextstart->ymd) { 
     1612                last; 
     1613            } 
     1614            $end = $tend 
    16071615        } elsif ((!$res->{current}) && (!$any)) { 
    16081616            last; 
Note: See TracChangeset for help on using the changeset viewer.