Commit 10bd8d50 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Ajout d'une colonne proposant un sous-total avec le temps actif (exclusion des créneaux ABS)

parent d93650b3
Loading
Loading
Loading
Loading
+4 −1
Changes for module/Oscar/src/Oscar/Formatter/TimesheetActivityPeriodFormatter.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -488,9 +488,10 @@ class TimesheetActivityPeriodFormatter
            $this->drawCell($r['label'], 0, true, 'headOther');
        }

        $this->drawCell('TOTAL', 0, true, 'person');
        $this->drawCell('Total actif', 0, true, 'person');

        $colSign = $this->getCurrentCol();
        $this->drawCell('TOTAL', 0, true, 'person');
        $this->drawCell('Signature', 0, true, 'person');

        $this->nextLine();
@@ -536,6 +537,7 @@ class TimesheetActivityPeriodFormatter
                $this->drawCell($line['others'][$r['code']], 0, true, $line['others'][$r['code']] ? 'withValue' : 'noValue');
            }

            $this->drawCell($line['totaux']['totalWork'], 0, true, 'totalColumn');
            $this->drawCell($line['totaux']['total'], 0, true, 'totalColumn');
            $this->drawCell(' ', 0, true, 'person');
            $this->nextLine();
@@ -582,6 +584,7 @@ class TimesheetActivityPeriodFormatter
            $this->drawCell($value, 0, true, 'cellTotalBottom');
        }

        $this->drawCell($totaux['totalWork'], 0, true, 'cellTotalBottom');
        $this->drawCell($totaux['total'], 0, true, 'cellTotalBottom');

        $this->nextLine();
+14 −0
Changes for module/Oscar/src/Oscar/Service/TimesheetService.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1279,6 +1279,9 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
            // Total
            'total'     => 0.0,

            // Total (hors ABS)
            'totalWork' => 0.0,

            'comments' => []
        ];

@@ -1382,6 +1385,7 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
                'totalMain' => 0.0,
                'totalProjects' => 0.0,
                'totalResearch' => 0.0,
                'totalWork' => 0.0
            ];

            foreach ($lotsStr as $l){
@@ -1429,6 +1433,12 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
                    $strData[$person]['totalResearch'] += $duration;
                    $totaux['totalResearch'] += $duration;
                }

                // sous total travaillé
                if( $group != 'abs' ){
                    $totaux['totalWork'] += $duration;
                    $strData[$person]['totaux']['totalWork'] += $duration;
                }
                $totaux['groups'][$group] += $duration;
                $totaux['others'][$key] += $duration;

@@ -1446,11 +1456,15 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
                    $acronym = $d['acronym'];
                    $strData[$person]['ce'][$acronym] += $duration;
                    $strData[$person]['totalProjects'] += $duration;
                    $strData[$person]['totalWork'] += $duration;
                    $totaux['totalCe'] += $duration;
                    $totaux['ce'][$acronym] += $duration;
                    $totaux['totalWork'] += $duration;
                }
                $totaux['totalResearch'] += $duration;
                $strData[$person]['totalResearch'] += $duration;
                $strData[$person]['totaux']['totalWork'] += $duration;
                $totaux['totalWork'] += $duration;
            }
            $strData[$person]['totaux']['total'] += $duration;
            $totaux['total'] += $duration;
+8 −1
Changes for module/Oscar/view/oscar/timesheet/synthesis-activity-period.phtml: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -218,6 +218,10 @@ $labels = [
                <?php endif; ?>
            <?php endforeach; ?>

            <td class="duration">
                <strong><?= $this->duration($line['totaux']['totalWork']) ?></strong>
            </td>

            <td style="background: #fff" class="duration">
                <strong><?= $this->duration($line['totaux']['total']) ?></strong>
            </td>
@@ -283,7 +287,10 @@ $labels = [
            <?php endif; ?>
        <?php endforeach; ?>
        <td class="duration">
            <strong><?= $this->duration($totaux['total']) ?></strong>
            <strong><?= $this->duration($totaux['totalWork']) ?></strong>
        </td>
        <td class="duration">
            <em><?= $this->duration($totaux['total']) ?></em>
        </td>