Commit fccabfaa authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

travail sur les MEP pour traiter les contrats en structures hiérarchiques

parent e2b9c687
Loading
Loading
Loading
Loading
+1 −1
Changes for module/Paiement/src/Assertion/PaiementAssertion.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -155,7 +155,7 @@ class PaiementAssertion extends AbstractAssertion

        return $this->asserts([
            $this->assertEtapeAtteignable(WfEtape::CODE_DEMANDE_MEP, $serviceAPayer->getIntervenant(), $destStructure),
            empty($oriStructure) || empty($destStructure) || $oriStructure === $destStructure,
            empty($oriStructure) || empty($destStructure) || $destStructure->inStructure($oriStructure),
        ]);
    }

+2 −2
Changes for module/Paiement/src/Controller/PaiementController.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ class PaiementController extends AbstractController
        $etapes         = $workflowEtape->getEtapes();
        $whyNotEditable = [];
        foreach ($etapes as $we) {
            if (!$role->getStructure() || !$we->getStructure() || $role->getStructure() == $we->getStructure()) {
            if (!$role->getStructure() || !$we->getStructure() || $we->getStructure()->inStructure($role->getStructure())) {
                $sid  = $we->getStructure() ? $we->getStructure()->getId() : 0;
                $deps = $we->getEtapeDeps();
                foreach ($deps as $dep) {
@@ -167,7 +167,7 @@ class PaiementController extends AbstractController
        $structures      = [];

        foreach ($servicesAPayer as $sap) {
            if (null == $role->getStructure() || $sap->getStructure() == $role->getStructure()) {
            if (null == $role->getStructure() || $sap->getStructure()->inStructure($role->getStructure())) {
                $structures[$sap->getStructure()->getId()] = $sap->getStructure();
            }
            $mepListe = $sap->getMiseEnPaiement();
+6 −5
Changes for module/Paiement/src/Service/MiseEnPaiementService.php: 6 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -441,13 +441,14 @@ class MiseEnPaiementService extends AbstractEntityService

        $sql = "
        SELECT
          type_ressource_id,
          heures
          tdl.type_ressource_id,
          tdl.heures
        FROM
          v_tbl_dmep_liquidation
          v_tbl_dmep_liquidation tdl
          JOIN structure str ON str.id = tdl.structure_id
        WHERE
          annee_id = :annee
          AND structure_id = :structure";
          tdl.annee_id = :annee
          AND str.ids LIKE '%-' || :structure || '-%'";

        $params = [
            'annee'     => $annee->getId(),