Ignore:
Timestamp:
12/20/15 22:51:02 (9 years ago)
Author:
nanardon
Message:

Add a configurable delay to allow between two employment

File:
1 edited

Legend:

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

    r1506 r1508  
    219219                        SELECT * FROM employment WHERE "user" = ? and 
    220220                            (lastday is null or lastday >= now() - '1 days'::interval)  
     221                            order by firstday asc 
    221222                    }); 
    222223                    $list_empl->execute($self->id); 
     
    230231                        if ($end) { 
    231232                            my $nextstart = DateTime->from_epoch(epoch => str2time($res->{firstday})); 
    232                             if ($end->ymd lt $nextstart->ymd) { 
     233                            my $tend = $end->clone; 
     234                            if (my $days = $self->base->config('employment_delay')) { 
     235                                $tend->add(days => $days); 
     236                            } 
     237                            if ($tend->ymd lt $nextstart->ymd) { 
    233238                                last; 
    234239                            } 
Note: See TracChangeset for help on using the changeset viewer.