Commit 4c4ba970 authored by Stéphane Bouvry's avatar Stéphane Bouvry
Browse files

Fix : Calcule du total pour les périodes hors activités

parent f7a42d99
Loading
Loading
Loading
Loading
+13 −2
Changes for module/Oscar/src/Oscar/Service/TimesheetService.php: 13 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1057,8 +1057,13 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
        foreach ($timesheets as $timesheet) {
            $period = $timesheet->getPeriodCode();
            if( !array_key_exists($period, $periodsDetails) ){
                $year = $timesheet->getDateFrom()->format('Y');
                $month = $timesheet->getDateFrom()->format('m');
                $periodsDetails[$period] = [
                    'period' => $period,
                    'month'             => $month,
                    'year'              => $year,
                    'periodDuration'    => $this->getPeriodDuration($person, $year, $month),
                    'activities_id'     => [],
                    'workpackages_id'   => [],
                    'unexpected'        => true,
@@ -1102,6 +1107,14 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
                    $periodsDetails[$period]['validators'][] = (string)$validator;
                }
            }
            else if( $declarationStatusIndex == $currentStatusIndex ){
                foreach ( $declaration->getCurrentValidators() as $validator ){
                    $validatorStr = (string)$validator;
                    if( !in_array($validatorStr, $periodsDetails[$period]['validators']) ){
                        $periodsDetails[$period]['validators'][] = (string)$validator;
                    }
                }
            }

            $periodsDetails[$period]['validations_id'][] = $declaration->getId();
            $datas['validations'][$declaration->getId()] = $declaration->toJson();
@@ -1145,8 +1158,6 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
            $daysDetails = json_decode($declarations[0]->getSchedule(), JSON_OBJECT_AS_ARRAY);
        }

       // var_dump($daysDetails); die();

        for ($i = $decaleDay; $i < $nbr + $decaleDay; $i++) {
            $day = $i - $decaleDay + 1;
            $dayIndex = ($i % 7);
+1 −1
Changes for public/css/_common.scss: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@
}

.declarations-resume {
  .heading-year {
  .heading-year th {
    font-size: 2em;
    text-align: right;
  }
+1 −1
Changes for public/css/adaj.css: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -5384,7 +5384,7 @@ button.close {
  .options-menu.right > :first-child {
    margin-left: auto; }

.declarations-resume .heading-year {
.declarations-resume .heading-year th {
  font-size: 2em;
  text-align: right; }

+1 −1
Changes for public/css/app-beta.css: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -5384,7 +5384,7 @@ button.close {
  .options-menu.right > :first-child {
    margin-left: auto; }

.declarations-resume .heading-year {
.declarations-resume .heading-year th {
  font-size: 2em;
  text-align: right; }

+1 −1
Changes for public/css/app.css: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -5384,7 +5384,7 @@ button.close {
  .options-menu.right > :first-child {
    margin-left: auto; }

.declarations-resume .heading-year {
.declarations-resume .heading-year th {
  font-size: 2em;
  text-align: right; }

Loading