This commit is contained in:
afornerot 2022-03-02 11:10:27 +01:00
parent 8170e02dab
commit ba8a19307e
1 changed files with 7 additions and 5 deletions

View File

@ -186,15 +186,17 @@ class TallydayController extends AbstractController
$dates[$user->getId()]["validates"][0]["timeweek"]=$timeweek;
}
// On recherche le pointage à valider
if(isset($datenow))
$datenow->add(new \DateInterval('P1D'));
// On recherche le premier pointage non validé
$tallyday=$em->getRepository(("App:Tallyday"))->findOneBy(["user"=>$user,"validatemaster"=>false],["dateof"=>"ASC"]);
if($tallyday)
$datenow= $tallyday->getDateof();
else
$datenow=new \DateTime();
$datenow=new \DateTime("now");
$datenow->modify("monday this week");
$dateend=new \DateTime("now");
$dateend->modify("last day of this month");
$dateend->add(new \DateInterval("P14D"));
$dateend->modify("next sunday");
$i=0;