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

Fix de l'affichage, encore beaucoup de chose à faire pour la synthèse des...

Fix de l'affichage, encore beaucoup de chose à faire pour la synthèse des déclarations dans l'activité
parent f3e3c082
Loading
Loading
Loading
Loading
+12 −18
Changes for module/Oscar/src/Oscar/Service/TimesheetService.php: 12 added lines, 18 removed lines.
Original line number Diff line number Diff line
@@ -1192,6 +1192,17 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
                'workpackages' => [],
                'persons' => []
            ];
            foreach ($persons as $person) {
                $personId = $person['id'];
                $periods[$period]['persons'][$personId] = [
                    'total' => 0.0,
                    'displayname' => $person['displayname'],
                    'workpackages' => [],
                ];
                foreach ($workPackages as $wp) {
                    $periods[$period]['persons'][$personId]['workpackages'][$wp['id']] = 0.0;
                }
            }
        }

        $timessheets = $this->getEntityManager()->getRepository(TimeSheet::class)->createQueryBuilder('t')
@@ -1215,27 +1226,10 @@ class TimesheetService implements ServiceLocatorAwareInterface, EntityManagerAwa
            $total += $duration;
            $workPackages[$wpId]['total'] += $duration;
            $persons[$personId]['total'] += $duration;

            $periods[$period]['total'] += $duration;

            if( !array_key_exists($personId, $periods[$period]['persons']) ){
                $periods[$period]['persons'][$personId] = [
                    'workpackages' => [],
                    'total' => 0.0
                ];
            }
            if( !array_key_exists($wpId, $periods[$period]['persons'][$personId]) ){
                $periods[$period]['persons'][$personId]['workpackages'][$wpId] = 0.0;
            }
            $periods[$period]['persons'][$personId]['workpackages'][$wpId] += $duration;

            $periods[$period]['persons'][$personId]['total'] += $duration;

            if( !array_key_exists($wpId, $periods[$period]['workpackages']) ){
                $periods[$period]['workpackages'][$wpId] = 0.0;
            }

            $periods[$period]['workpackages'][$wpId] += $duration;
            $periods[$period]['persons'][$personId]['workpackages'][$wpId] += $duration;
        }

        $datas = [
+2 −137

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0

File added.

Preview size limit exceeded, changes collapsed.

+12 −16
Changes for public/js/oscar/src/ResumeActivity.vue: 12 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -11,26 +11,22 @@
                        </th>
                        <th>Total</th>
                    </tr>
                    <tbody v-if="p.persons">
                        <tr v-for="person, personId in p.persons">
                            <th>{{ datas.persons[personId].displayname }} - {{ person }}</th>
                            <td v-for="wpCode in datas.workspackages">
                                <strong v-if="person.workpackages[wpCode]">{{ person.workpackages[wpCode] }}</strong>
                                <em v-else> ~ </em>
                                 (WPID: {{ wpCode.id }})
                    <tbody>
                        <tr v-for="person in p.persons" v-if="person.total > 0">
                            <th>{{ person.displayname }}</th>
                            <td v-for="wp in person.workpackages">
                                <strong v-if="wp">{{ wp | duration}}</strong>
                                <small v-else>0.0</small>
                            </td>

                            <td class="total">
                                <strong v-if="person.total">{{ person.total | duration }}</strong>
                                <small v-else>0.0</small>

                            </td>
                            <td class="total">- {{ person.total }}</td>
                        </tr>
                    </tbody>
                        <tr>
                            <th>{{ period | period }}</th>
                            <th v-for="wp in datas.workspackages">
                                {{ wp.total }}
                            </th>
                            <th>Total</th>
                        </tr>
                </table>
                <pre>{{ p }}</pre>
                <hr>
            </div>
        </template>