Loading module/Application/config/paiement.config.php +19 −1 Changes for module/Application/config/paiement.config.php: 19 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -76,6 +76,18 @@ return [ ], ], ], 'imputation-siham' => [ 'type' => 'Literal', 'may_terminate' => true, 'options' => [ 'route' => '/imputation-siham', 'defaults' => [ 'action' => 'imputationSiham', 'etat' => Entity\Db\MiseEnPaiement::IMPUTATION_BUDGETAIRE, ], ], ], ], ], ], Loading Loading @@ -161,6 +173,12 @@ return [ 'route' => 'paiement/extraction-winpaie', 'resource' => Privileges::getResourceId(Privileges::MISE_EN_PAIEMENT_EXPORT_PAIE), ], 'imputation-siham' => [ 'label' => "Imputation budgétaire SIHAM", 'title' => "Export des données pour chargement en masse des imputations budgétaires dans SIHAM", 'route' => 'paiement/imputation-siham', 'resource' => Privileges::getResourceId(Privileges::MISE_EN_PAIEMENT_EXPORT_PAIE), ], ], ], ], Loading Loading @@ -227,7 +245,7 @@ return [ ], [ 'controller' => 'Application\Controller\Paiement', 'action' => ['extractionWinpaie'], 'action' => ['extractionWinpaie', 'imputationSiham'], 'privileges' => [Privileges::MISE_EN_PAIEMENT_EXPORT_PAIE], ], ], Loading module/Application/src/Controller/PaiementController.php +67 Changes for module/Application/src/Controller/PaiementController.php: 67 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -407,6 +407,8 @@ class PaiementController extends AbstractController { if ($recherche->getEtat() == MiseEnPaiement::A_METTRE_EN_PAIEMENT) { $filename = 'demande_mise_en_paiement'; } elseif ($recherche->getEtat() == 'imputation-budgetaire') { $filename = 'imputation-budgetaire'; } else { $filename = 'etat_paiement'; } Loading Loading @@ -481,6 +483,71 @@ class PaiementController extends AbstractController public function imputationSihamAction() { $title = 'Export des données pour le chargement en masse des imputations budgétaires dans SIHAM'; $this->initFilters(); $role = $this->getServiceContext()->getSelectedIdentityRole(); $recherche = new MiseEnPaiementRecherche; $recherche->setEtat(MiseEnPaiement::MIS_EN_PAIEMENT); // données à mettre en paiement uniquement $recherche->setAnnee($this->getServiceContext()->getAnnee()); $recherche->setTypeIntervenant($this->context()->typeIntervenantFromPost('type-intervenant')); $rechercheForm = $this->getFormPaiementMiseEnPaiementRecherche(); $rechercheForm->bind($recherche); $qb = $this->getServicePeriode()->finderByMiseEnPaiement(); $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb); $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb); $periodes = $this->getServicePeriode()->getList($qb); $rechercheForm->populatePeriodes($periodes); if (count($periodes) == 1) { $recherche->setPeriode(current($periodes)); $rechercheForm->get('periode')->setValue($recherche->getPeriode()->getId()); } else { $recherche->setPeriode($this->context()->periodeFromPost()); } $qb = $this->getServiceIntervenant()->finderByMiseEnPaiement(null, $recherche->getPeriode()); $this->getServiceIntervenant()->finderByAnnee($recherche->getAnnee(), $qb); $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb); $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb); $intervenants = $this->getServiceIntervenant()->getList($qb); $rechercheForm->populateIntervenants($intervenants); $noData = count($intervenants) == 0; $request = $this->getRequest(); if ($request->isPost()) { $rechercheForm->setData($request->getPost()); $rechercheForm->isValid(); } $etatSortie = $this->getServiceEtatSortie()->getRepo()->findOneBy(['code' => 'imputation-budgetaire']); //creation d'un privilege specifique aux imputations budgétaire if ($this->params()->fromPost('exporter-csv-imputation') !== null && $this->isAllowed(Privileges::getResourceId(Privileges::MISE_EN_PAIEMENT_EXPORT_CSV))) { $csvModel = $this->getServiceEtatSortie()->genererCsv($etatSortie, $recherche->getFilters()); $csvModel->setFilename($this->makeFilenameFromRecherche($recherche) . '.csv'); return $csvModel; } else { $etatPaiement = null; if ($recherche->getIntervenants()->count() > 0) { $etatPaiement = $this->getServiceMiseEnPaiement()->getEtatPaiement($recherche); } return compact('recherche', 'rechercheForm', 'etatPaiement', 'noData'); } } public function miseEnPaiementAction() { $this->initFilters(); Loading module/Application/src/Entity/Db/MiseEnPaiement.php +1 Changes for module/Application/src/Entity/Db/MiseEnPaiement.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ class MiseEnPaiement implements HistoriqueAwareInterface, ResourceInterface const A_METTRE_EN_PAIEMENT = 'a-mettre-en-paiement'; const MIS_EN_PAIEMENT = 'mis-en-paiement'; const IMPUTATION_BUDGETAIRE = 'imputation-budgetaire'; /** * @var \DateTime Loading module/Application/src/Form/Paiement/MiseEnPaiementRechercheForm.php +8 Changes for module/Application/src/Form/Paiement/MiseEnPaiementRechercheForm.php: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -136,6 +136,14 @@ class MiseEnPaiementRechercheForm extends AbstractForm 'class' => 'btn btn-default', ], ]); $this->add([ 'name' => 'exporter-csv-imputation', 'type' => 'Submit', 'attributes' => [ 'class' => 'btn btn-default', ], ]); } Loading module/Application/src/Service/ModeleContratService.php +2 −2 Changes for module/Application/src/Service/ModeleContratService.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -188,9 +188,9 @@ class ModeleContratService extends AbstractEntityService $params = ['contrat' => $contrat->getId()]; $mainData = $connection->fetchAssoc('SELECT * FROM V_CONTRAT_MAIN WHERE CONTRAT_ID = :contrat', $params); $mainData = $connection->fetchAssociative('SELECT * FROM V_CONTRAT_MAIN WHERE CONTRAT_ID = :contrat', $params); if ($modele->getRequete()) { $mainDataPerso = $connection->fetchAssoc($modele->getRequete(), $params); $mainDataPerso = $connection->fetchAssociative($modele->getRequete(), $params); foreach ($mainDataPerso as $key => $value) { if ($value) { $mainData[$key] = $value; Loading Loading
module/Application/config/paiement.config.php +19 −1 Changes for module/Application/config/paiement.config.php: 19 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -76,6 +76,18 @@ return [ ], ], ], 'imputation-siham' => [ 'type' => 'Literal', 'may_terminate' => true, 'options' => [ 'route' => '/imputation-siham', 'defaults' => [ 'action' => 'imputationSiham', 'etat' => Entity\Db\MiseEnPaiement::IMPUTATION_BUDGETAIRE, ], ], ], ], ], ], Loading Loading @@ -161,6 +173,12 @@ return [ 'route' => 'paiement/extraction-winpaie', 'resource' => Privileges::getResourceId(Privileges::MISE_EN_PAIEMENT_EXPORT_PAIE), ], 'imputation-siham' => [ 'label' => "Imputation budgétaire SIHAM", 'title' => "Export des données pour chargement en masse des imputations budgétaires dans SIHAM", 'route' => 'paiement/imputation-siham', 'resource' => Privileges::getResourceId(Privileges::MISE_EN_PAIEMENT_EXPORT_PAIE), ], ], ], ], Loading Loading @@ -227,7 +245,7 @@ return [ ], [ 'controller' => 'Application\Controller\Paiement', 'action' => ['extractionWinpaie'], 'action' => ['extractionWinpaie', 'imputationSiham'], 'privileges' => [Privileges::MISE_EN_PAIEMENT_EXPORT_PAIE], ], ], Loading
module/Application/src/Controller/PaiementController.php +67 Changes for module/Application/src/Controller/PaiementController.php: 67 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -407,6 +407,8 @@ class PaiementController extends AbstractController { if ($recherche->getEtat() == MiseEnPaiement::A_METTRE_EN_PAIEMENT) { $filename = 'demande_mise_en_paiement'; } elseif ($recherche->getEtat() == 'imputation-budgetaire') { $filename = 'imputation-budgetaire'; } else { $filename = 'etat_paiement'; } Loading Loading @@ -481,6 +483,71 @@ class PaiementController extends AbstractController public function imputationSihamAction() { $title = 'Export des données pour le chargement en masse des imputations budgétaires dans SIHAM'; $this->initFilters(); $role = $this->getServiceContext()->getSelectedIdentityRole(); $recherche = new MiseEnPaiementRecherche; $recherche->setEtat(MiseEnPaiement::MIS_EN_PAIEMENT); // données à mettre en paiement uniquement $recherche->setAnnee($this->getServiceContext()->getAnnee()); $recherche->setTypeIntervenant($this->context()->typeIntervenantFromPost('type-intervenant')); $rechercheForm = $this->getFormPaiementMiseEnPaiementRecherche(); $rechercheForm->bind($recherche); $qb = $this->getServicePeriode()->finderByMiseEnPaiement(); $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb); $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb); $periodes = $this->getServicePeriode()->getList($qb); $rechercheForm->populatePeriodes($periodes); if (count($periodes) == 1) { $recherche->setPeriode(current($periodes)); $rechercheForm->get('periode')->setValue($recherche->getPeriode()->getId()); } else { $recherche->setPeriode($this->context()->periodeFromPost()); } $qb = $this->getServiceIntervenant()->finderByMiseEnPaiement(null, $recherche->getPeriode()); $this->getServiceIntervenant()->finderByAnnee($recherche->getAnnee(), $qb); $this->getServiceMiseEnPaiement()->finderByTypeIntervenant($recherche->getTypeIntervenant(), $qb); $this->getServiceMiseEnPaiement()->finderByEtat($recherche->getEtat(), $qb); $intervenants = $this->getServiceIntervenant()->getList($qb); $rechercheForm->populateIntervenants($intervenants); $noData = count($intervenants) == 0; $request = $this->getRequest(); if ($request->isPost()) { $rechercheForm->setData($request->getPost()); $rechercheForm->isValid(); } $etatSortie = $this->getServiceEtatSortie()->getRepo()->findOneBy(['code' => 'imputation-budgetaire']); //creation d'un privilege specifique aux imputations budgétaire if ($this->params()->fromPost('exporter-csv-imputation') !== null && $this->isAllowed(Privileges::getResourceId(Privileges::MISE_EN_PAIEMENT_EXPORT_CSV))) { $csvModel = $this->getServiceEtatSortie()->genererCsv($etatSortie, $recherche->getFilters()); $csvModel->setFilename($this->makeFilenameFromRecherche($recherche) . '.csv'); return $csvModel; } else { $etatPaiement = null; if ($recherche->getIntervenants()->count() > 0) { $etatPaiement = $this->getServiceMiseEnPaiement()->getEtatPaiement($recherche); } return compact('recherche', 'rechercheForm', 'etatPaiement', 'noData'); } } public function miseEnPaiementAction() { $this->initFilters(); Loading
module/Application/src/Entity/Db/MiseEnPaiement.php +1 Changes for module/Application/src/Entity/Db/MiseEnPaiement.php: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ class MiseEnPaiement implements HistoriqueAwareInterface, ResourceInterface const A_METTRE_EN_PAIEMENT = 'a-mettre-en-paiement'; const MIS_EN_PAIEMENT = 'mis-en-paiement'; const IMPUTATION_BUDGETAIRE = 'imputation-budgetaire'; /** * @var \DateTime Loading
module/Application/src/Form/Paiement/MiseEnPaiementRechercheForm.php +8 Changes for module/Application/src/Form/Paiement/MiseEnPaiementRechercheForm.php: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -136,6 +136,14 @@ class MiseEnPaiementRechercheForm extends AbstractForm 'class' => 'btn btn-default', ], ]); $this->add([ 'name' => 'exporter-csv-imputation', 'type' => 'Submit', 'attributes' => [ 'class' => 'btn btn-default', ], ]); } Loading
module/Application/src/Service/ModeleContratService.php +2 −2 Changes for module/Application/src/Service/ModeleContratService.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -188,9 +188,9 @@ class ModeleContratService extends AbstractEntityService $params = ['contrat' => $contrat->getId()]; $mainData = $connection->fetchAssoc('SELECT * FROM V_CONTRAT_MAIN WHERE CONTRAT_ID = :contrat', $params); $mainData = $connection->fetchAssociative('SELECT * FROM V_CONTRAT_MAIN WHERE CONTRAT_ID = :contrat', $params); if ($modele->getRequete()) { $mainDataPerso = $connection->fetchAssoc($modele->getRequete(), $params); $mainDataPerso = $connection->fetchAssociative($modele->getRequete(), $params); foreach ($mainDataPerso as $key => $value) { if ($value) { $mainData[$key] = $value; Loading