Compare commits
No commits in common. "99ea7ad9a595034f608543d24ff0e99c65850c1d" and "5416f122d51624f49889801db7d46c3b5a4d78d2" have entirely different histories.
99ea7ad9a5
...
5416f122d5
|
@ -916,30 +916,30 @@ class TallydayController extends AbstractController
|
|||
// On recherche le dernier pointage de la journée non terminé et on simule le créneau avec la date du moment
|
||||
$data = $em->getRepository($this->entity)->findOneBy(["user"=>$this->getUser(),"dateof"=>$datenow],["datestart"=>"DESC"]);
|
||||
if($data&&$data->getDatestart()&&!$data->getDateend()) {
|
||||
$interval2 = $data->getDatestart()->diff($datenow);
|
||||
$interval2 = $datenow->diff($data->getDatestart());
|
||||
$e->add($interval2);
|
||||
}
|
||||
|
||||
// Calcul de temps global de la journée = réel + simulé
|
||||
$interval = $f->diff($e);
|
||||
$interval = $e->diff($f);
|
||||
$timeday = $interval->format("%R").(($interval->days*24) + $interval->h).":".sprintf("%02s",$interval->i);
|
||||
|
||||
// On récupère le capital
|
||||
$capital=$em->getRepository("App:Tallyday")->getCapitaltimeinterval($this->getUser());
|
||||
$e = new \DateTime('00:00');
|
||||
|
||||
|
||||
// Si la journée n'est finalisé on ajoute le créneau simulé
|
||||
if($data&&$data->getDatestart()&&!$data->getDateend()) {
|
||||
$f = new \DateTime('00:00');
|
||||
$f->add($interval);
|
||||
$f->add($capital);
|
||||
$f->sub(new \DateInterval('PT7H'));
|
||||
|
||||
$f->add($capital);
|
||||
|
||||
$interval = $e->diff($f);
|
||||
$newcapital = $interval->format("%R").(($interval->days*24) + $interval->h).":".sprintf("%02s",$interval->i);
|
||||
|
||||
}
|
||||
|
||||
// Si la journée n'est pas encore validé : on ajoute la journée à la simulation
|
||||
else if($data && (!$data->getValidateuser()||!$data->getValidateuser())) {
|
||||
$interval=$em->getRepository("App:Tallyday")->getCapitaltimeinterval($this->getUser(),true);
|
||||
|
|
Loading…
Reference in New Issue