Commit 90dacf81 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Vérifier pour demande de mise en paiement par lot si pour une mission ou du...

Vérifier pour demande de mise en paiement par lot si pour une mission ou du référentiel on a bien un domaine fonctionnel de renseigné par défaut.
parent 4f1b2bcf
Loading
Loading
Loading
Loading
+28 −12
Changes for front/Paiement/DemandeMiseEnPaiementLot.vue: 28 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -91,8 +91,8 @@
                                <th scope="col"><input id="allPermanents" checked="checked" class="checkbox-permanent" name="allPermanents" type="checkbox"
                                                       @click="toggleCheckbox"></th>
                                <th scope="col">Intervenant</th>
                                <th scope="col">HETD avec centre coût</th>
                                <th scope="col">HETD sans centre coût</th>
                                <th>HETD payables</th>
                                <th>HETD non payables</th>
                            </tr>
                            </thead>
                            <tbody>
@@ -115,7 +115,7 @@
                                    style="text-decoration:underline dotted;cursor: help;">
                                    {{ totalPayable(intervenant.heures) }} h</span></td>
                                <td><span style="text-decoration:underline dotted;cursor: help;"
                                          title="Aucun centre de coût">{{ totalNonPayable(intervenant.heures) }} h</span></td>
                                          title="Manque un centre de coût et/ou un domaine fonctionnel">{{ totalNonPayable(intervenant.heures) }} h</span></td>
                            </tr>
                            </tbody>
                        </table>
@@ -139,8 +139,8 @@
                                <th><input id="allVacataire" checked="checked" class="checkbox-vacataire" name="allVacataire" type="checkbox"
                                           @click="toggleCheckbox"></th>
                                <th>Intervenant</th>
                                <th>HETD avec centre coût</th>
                                <th>HETD sans centre coût</th>
                                <th>HETD payables</th>
                                <th>HETD non payables</th>
                            </tr>
                            </thead>
                            <tbody>
@@ -165,7 +165,7 @@
                                        totalPayable(intervenant.heures)
                                    }} h</span></td>
                                <td><span style="text-decoration:underline dotted;cursor: help;"
                                          title="Aucun centre de coût">{{ totalNonPayable(intervenant.heures) }} h</span></td>
                                          title="Manque un centre de coût et/ou un domaine fonctionnel">{{ totalNonPayable(intervenant.heures) }} h</span></td>

                            </tr>
                            </tbody>
@@ -190,8 +190,8 @@
                                <th><input id="allEtudiants" checked="checked" class="checkbox-etudiant" name="allEtudiants" type="checkbox"
                                           @click="toggleCheckbox"></th>
                                <th>Intervenant</th>
                                <th>HETD avec centre coût</th>
                                <th>HETD sans centre coût</th>
                                <th>HETD payables</th>
                                <th>HETD non payables</th>
                            </tr>
                            </thead>
                            <tbody>
@@ -212,7 +212,7 @@
                                    style="text-decoration:underline dotted;cursor: help;">
                                    {{ totalPayable(intervenant.heures) }} h</span></td>
                                <td><span style="text-decoration:underline dotted;cursor: help;"
                                          title="Aucun centre de coût">{{ totalNonPayable(intervenant.heures) }} h</span></td>
                                          title="Manque un centre de coût et/ou un domaine fonctionnel">{{ totalNonPayable(intervenant.heures) }} h</span></td>
                            </tr>
                            </tbody>
                        </table>
@@ -236,8 +236,8 @@
                                <th><input id="allAutres" checked="checked" class="checkbox-autre" name="allAutres" type="checkbox" @click="toggleCheckbox">
                                </th>
                                <th>Intervenant</th>
                                <th>HETD avec centre coût</th>
                                <th>HETD sans centre coût</th>
                                <th>HETD payables</th>
                                <th>HETD non payables</th>
                            </tr>
                            </thead>
                            <tbody>
@@ -260,7 +260,7 @@
                                    style="text-decoration:underline dotted;cursor: help;">
                                    {{ totalPayable(intervenant.heures) }} h</span></td>
                                <td><span style="text-decoration:underline dotted;cursor: help;"
                                          title="Aucun centre de coût">{{ totalNonPayable(intervenant.heures) }} h</span></td>
                                          title="Manque un centre de coût et/ou un domaine fonctionnel">{{ totalNonPayable(intervenant.heures) }} h</span></td>
                            </tr>
                            </tbody>
                        </table>
@@ -448,7 +448,15 @@ export default {
            let total = 0;
            heures.forEach((item, index) => {
                if (item.centreCout.code != '') {
                    if (item.missionId != '' || item.serviceRefId != '') {
                        if (item.domaineFonctionnel.code != '') {
                            total += item.heuresAPayer;

                        }
                    } else {
                        total += item.heuresAPayer;
                    }

                }
            })
            return total.toLocaleString('fr-FR', {maximumFractionDigits: 2});
@@ -460,7 +468,15 @@ export default {
            heures.forEach((item, index) => {
                if (item.centreCout.code == '') {
                    total += item.heuresAPayer;
                } else {
                    if (item.missionId != '' || item.serviceRefId != '') {
                        if (item.domaineFonctionnel.code == '') {
                            total += item.heuresAPayer;

                        }
                    }
                }

            })
            return total.toLocaleString('fr-FR', {maximumFractionDigits: 2});
        },
+6
Changes for module/Paiement/src/Service/ServiceAPayerService.php: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -107,11 +107,17 @@ class ServiceAPayerService extends AbstractService

                $dmep[$intervenant->getId()]['heures'][] = [
                    'heuresAPayer'       => $value->getHeuresAPayerAC() + $value->getHeuresAPayerAA(),
                    'missionId'          => $value->getMission()->getId(),
                    'serviceId'          => ($value->getFormuleResultatService()) ? $value->getFormuleResultatService()->getService()->getId() : '',
                    'serviceRefId'       => ($value->getFormuleResultatServiceReferentiel()) ? $value->getFormuleResultatServiceReferentiel()->getServiceReferentiel()->getId() : '',
                    'centreCout'         => ['libelle'              => ($value->getCentreCout()) ? $value->getCentreCout()->getLibelle() : '',
                                             'code'                 => ($value->getCentreCout()) ? $value->getCentreCout()->getCode() : '',
                                             'typeRessourceCode'    => ($value->getCentreCout()) ? $value->getCentreCout()->getTypeRessource()->getCode() : '',
                                             'typeRessourceLibelle' => ($value->getCentreCout()) ? $value->getCentreCout()->getTypeRessource()->getLibelle() : '',
                    ],
                    'domaineFonctionnel' => ['libelle' => ($value->getDomaineFonctionel()) ? $value->getDomaineFonctionel()->getLibelle() : '',
                                             'code'    => ($value->getDomaineFonctionel()) ? $value->getDomaineFonctionel()->getSourceCode() : '',
                    ],
                ];
            }
        }