correction fuseau & affichage rapport mensuel
This commit is contained in:
parent
dfc348e650
commit
28dea4bb81
|
@ -65,25 +65,38 @@ class TallydayRepository extends ServiceEntityRepository
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCapitaltimeinterval($user,$getnovalidate=false) {
|
public function getCapitaltimeinterval($user,$getnovalidate=false) {
|
||||||
$datenow=new \DateTime('00:00');
|
|
||||||
|
// Calculer les jours travaillés sur la base du fuseau Paris
|
||||||
|
date_default_timezone_set("Europe/Paris");
|
||||||
$datas = $this->_em->getRepository('App:Tallyday')->findBy(["user"=>$user],["datestart"=>"DESC"]);
|
$datas = $this->_em->getRepository('App:Tallyday')->findBy(["user"=>$user],["datestart"=>"DESC"]);
|
||||||
$tbdays=[];
|
$tbdays=[];
|
||||||
$ework = new \DateTime('00:00');
|
$datenow=new \DateTime('00:00');
|
||||||
|
|
||||||
foreach($datas as $data) {
|
foreach($datas as $data) {
|
||||||
if($data->getDateof()<$datenow) {
|
if($data->getDateof()<$datenow) {
|
||||||
$iddayweek=$data->getDateof()->format("w");
|
$iddayweek=$data->getDateof()->format("w");
|
||||||
if($iddayweek>=1&&$iddayweek<=5) {
|
if($iddayweek>=1&&$iddayweek<=5) {
|
||||||
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
||||||
}
|
}
|
||||||
|
if($data->getDateof()==$datenow&&($getnovalidate||$data->getValidateuser()||$data->getValidatemaster())) {
|
||||||
|
$iddayweek=$data->getDateof()->format("w");
|
||||||
|
if($iddayweek>=1&&$iddayweek<=5) {
|
||||||
|
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Cumuler les temps de travail sans fuseau
|
||||||
|
date_default_timezone_set("UTC");
|
||||||
|
$datenow=new \DateTime('00:00');
|
||||||
|
$ework = clone $datenow;
|
||||||
|
foreach($datas as $data) {
|
||||||
|
if($data->getDateof()<$datenow) {
|
||||||
$ework->add($data->getTimeday());
|
$ework->add($data->getTimeday());
|
||||||
}
|
}
|
||||||
|
|
||||||
if($data->getDateof()==$datenow&&($getnovalidate||$data->getValidateuser()||$data->getValidatemaster())) {
|
if($data->getDateof()==$datenow&&($getnovalidate||$data->getValidateuser()||$data->getValidatemaster())) {
|
||||||
$iddayweek=$data->getDateof()->format("w");
|
|
||||||
if($iddayweek>=1&&$iddayweek<=5) {
|
|
||||||
if(!in_array($data->getDateof(),$tbdays)) array_push($tbdays,$data->getDateof());
|
|
||||||
}
|
|
||||||
$ework->add($data->getTimeday());
|
$ework->add($data->getTimeday());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,11 +109,12 @@ class TallydayRepository extends ServiceEntityRepository
|
||||||
|
|
||||||
// Nbday worked
|
// Nbday worked
|
||||||
$nbdaywork=count($tbdays);
|
$nbdaywork=count($tbdays);
|
||||||
$etowork = new \DateTime('00:00');
|
$etowork = clone $datenow;
|
||||||
$etowork->add(new \DateInterval("PT".($nbdaywork*7)."H"));
|
$etowork->add(new \DateInterval("PT".($nbdaywork*7)."H"));
|
||||||
|
|
||||||
$interval = $etowork->diff($ework);
|
$interval = $etowork->diff($ework);
|
||||||
|
|
||||||
|
date_default_timezone_set("Europe/Paris");
|
||||||
return $interval;
|
return $interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,13 +104,14 @@ td {
|
||||||
{{validate.dateof|date("W")}}
|
{{validate.dateof|date("W")}}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{% if loop.first %}
|
|
||||||
{% for i in 2..(validate.dateof|date("N")) %}
|
|
||||||
<td></td>
|
|
||||||
{% endfor %}
|
|
||||||
{%endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if loop.first and validate.dateof|date("l")!="Monday"%}
|
||||||
|
{% for i in 2..(validate.dateof|date("N")) %}
|
||||||
|
<td></td>
|
||||||
|
{% endfor %}
|
||||||
|
{%endif %}
|
||||||
|
|
||||||
<td style="align:top">
|
<td style="align:top">
|
||||||
<div class="date">{{validate.dateof|date("d/m")}}</div>
|
<div class="date">{{validate.dateof|date("d/m")}}</div>
|
||||||
<div class="datedetail" style="min-height:28px">
|
<div class="datedetail" style="min-height:28px">
|
||||||
|
|
Loading…
Reference in New Issue