Commit 14f9c964 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

WIP préliquidation siham

parent 7807b6c8
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ class IntervenantController extends AbstractController
    }



    public function rechercherAction()
    {
        $recents = $this->getIntervenantsRecents();
@@ -100,7 +99,6 @@ class IntervenantController extends AbstractController
    }



    public function rechercheAction()
    {
        $this->em()->getFilters()->enable('historique')->init([
@@ -119,7 +117,6 @@ class IntervenantController extends AbstractController
    }



    public function voirAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -144,7 +141,6 @@ class IntervenantController extends AbstractController
    }



    public function definirParDefautAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -157,7 +153,6 @@ class IntervenantController extends AbstractController
    }



    public function servicesPrevusAction()
    {
        $typeVolumeHoraire = $this->getServiceTypeVolumeHoraire()->getPrevu();
@@ -166,7 +161,6 @@ class IntervenantController extends AbstractController
    }



    public function servicesRealisesAction()
    {
        $typeVolumeHoraire = $this->getServiceTypeVolumeHoraire()->getRealise();
@@ -175,7 +169,6 @@ class IntervenantController extends AbstractController
    }



    private function servicesAction(TypeVolumehoraire $typeVolumeHoraire)
    {
        $this->em()->getFilters()->enable('historique')->init([
@@ -206,7 +199,6 @@ class IntervenantController extends AbstractController
        }

        $campagneSaisie = $this->getServiceCampagneSaisie()->getBy($intervenant->getStatut()->getTypeIntervenant(), $typeVolumeHoraire);

        if (!$campagneSaisie->estOuverte()) {

            $role = $this->getServiceContext()->getSelectedIdentityRole();
@@ -262,7 +254,6 @@ class IntervenantController extends AbstractController
    }



    public function cloturerAction()
    {
        $this->em()->getFilters()->enable('historique')->init([
@@ -304,7 +295,6 @@ class IntervenantController extends AbstractController
    }



    public function ficheAction()
    {
        $role = $this->getServiceContext()->getSelectedIdentityRole();
@@ -314,7 +304,6 @@ class IntervenantController extends AbstractController
    }



    public function saisirAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -404,7 +393,6 @@ class IntervenantController extends AbstractController
    }



    public function synchronisationAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -429,7 +417,6 @@ class IntervenantController extends AbstractController
    }



    public function synchroniserAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -440,7 +427,6 @@ class IntervenantController extends AbstractController
    }



    public function voirHeuresCompAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -479,7 +465,6 @@ class IntervenantController extends AbstractController
    }



    public function formuleTotauxHetdAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -492,7 +477,6 @@ class IntervenantController extends AbstractController
    }



    public function supprimerAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -530,7 +514,6 @@ class IntervenantController extends AbstractController
    }



    public function historiserAction()
    {
        /* @var $intervenant \Application\Entity\Db\Intervenant */
@@ -545,7 +528,6 @@ class IntervenantController extends AbstractController
    }



    public function restaurerAction()
    {
        /* @var $intervenant \Application\Entity\Db\Intervenant */
@@ -562,7 +544,6 @@ class IntervenantController extends AbstractController
    }



    public function validationVolumeHoraireTypeIntervenantAction()
    {
        $serviceRVS = $this->getServiceRegleStructureValidation();
@@ -572,7 +553,6 @@ class IntervenantController extends AbstractController
    }



    public function validationVolumeHoraireTypeIntervenantSaisieAction()
    {
        $regleStructureValidation = $this->getEvent()->getParam('regleStructureValidation');
@@ -597,7 +577,6 @@ class IntervenantController extends AbstractController
    }



    /**
     *
     * @return array
@@ -627,7 +606,6 @@ class IntervenantController extends AbstractController
    }



    /**
     *
     * @param \Application\Entity\Db\Intervenant $intervenant
+1 −1
Original line number Diff line number Diff line
@@ -470,7 +470,7 @@ class PaiementController extends AbstractController
            $filters = $recherche->getFilters();

            $etatSortie = $this->getServiceEtatSortie()->getByParametre('es_extraction_paie');
            $csvModel = $this->getServiceEtatSortie()->genererCsv($etatSortie, $filters);
            $csvModel = $this->getServiceEtatSortie()->genererCsv($etatSortie, $filters, ['periode' => $periode, 'annee' => $annee]);
            $csvModel->setFilename(str_replace(' ', '_', 'ose-export-paie-' . strtolower($recherche->getPeriode()->getLibelleAnnuel($recherche->getAnnee())) . '-' . strtolower($recherche->getTypeIntervenant()->getLibelle()) . '.csv'));

            return $csvModel;
+62 −12
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ class EtatSortieService extends AbstractEntityService
    private $config;



    /**
     * retourne la classe des entités
     *
@@ -41,7 +40,6 @@ class EtatSortieService extends AbstractEntityService
    }



    /**
     * Retourne l'alias d'entité courante
     *
@@ -53,7 +51,6 @@ class EtatSortieService extends AbstractEntityService
    }



    /**
     * @param string $param
     *
@@ -72,7 +69,6 @@ class EtatSortieService extends AbstractEntityService
    }



    /***
     * @param EtatSortie $etatSortie
     * @param array $filtres
@@ -119,7 +115,6 @@ class EtatSortieService extends AbstractEntityService
    }



    /**
     * @param EtatSortie $etatSortie
     * @param array $filtres
@@ -131,6 +126,17 @@ class EtatSortieService extends AbstractEntityService
    public function genererCsv(EtatSortie $etatSortie, array $filtres, array $options = []): CsvModel
    {
        $csv = new CsvModel();
        //Uniquement dans le cas de la préliquidation siham
        if ($etatSortie->getCode() == 'preliquidation-siham') {
            $periode = $options['periode'];
            $annee = $options['annee'];
            var_dump($periode->getDatePaiement($annee));
            die;
            var_dump($filtres['ANNEE_ID']);
            die;
            $this->setAnneePaie($filtres['ANNEE_ID']);
            $this->setMoisPaie($periode->getCode());
        }

        $entityManager = $this->getEntityManager();
        $data = $this->generateData($etatSortie, $filtres);
@@ -202,7 +208,6 @@ class EtatSortieService extends AbstractEntityService
    }



    private function filterData(array $line, array $params): array
    {
        foreach ($line as $k => $v) {
@@ -229,7 +234,6 @@ class EtatSortieService extends AbstractEntityService
    }



    private function generateData(EtatSortie $etatSortie, array $filtres)
    {
        if ($etatSortie->getCle()) return $this->generateDataWithCle($etatSortie, $filtres);
@@ -247,7 +251,6 @@ class EtatSortieService extends AbstractEntityService
    }



    private function generateDataWithCle(EtatSortie $etatSortie, array $filtres)
    {
        $cle = $etatSortie->getCle();
@@ -284,7 +287,6 @@ class EtatSortieService extends AbstractEntityService
    }



    private function connFetch(string $sql, array $filtres)
    {
        $connection = $this->getEntityManager()->getConnection();
@@ -327,7 +329,6 @@ class EtatSortieService extends AbstractEntityService
    }



    private function connBlocFetch(string $sql, string $mainSql, string $cle, array $filtres)
    {
        $connection = $this->getEntityManager()->getConnection();
@@ -357,7 +358,6 @@ class EtatSortieService extends AbstractEntityService
    }



    /**
     * @return array
     */
@@ -367,7 +367,6 @@ class EtatSortieService extends AbstractEntityService
    }



    /**
     * @param array $config
     *
@@ -380,4 +379,55 @@ class EtatSortieService extends AbstractEntityService
        return $this;
    }

    public function setAnneePaie(string $annee)
    {
        $connection = $this->getEntityManager()->getConnection();
        $anneeFormatted = (string)($annee - 2000);


        $query = "begin
         ose_paiement.set_annee_extraction_paie('$anneeFormatted');
         END;";

        $connection->executeQuery($query);

        return $this;

    }

    public function setMoisPaie($periode)
    {
        $connection = $this->getEntityManager()->getConnection();

        $mappingPeriode = [
            'P01' => '09',
            'P02' => '10',
            'P03' => '11',
            'P04' => '12',
            'P05' => '01',
            'P06' => '02',
            'P07' => '03',
            'P08' => '04',
            'P09' => '05',
            'P10' => '06',
            'P11' => '07',
            'P12' => '08',
            'P13' => '09',
            'P14' => '10',
            'P15' => '11',
            'P16' => '12',
        ];

        $mois = (array_key_exists($periode, $mappingPeriode)) ? $mappingPeriode[$periode] : '09';

        $query = "begin
         ose_paiement.set_mois_extraction_paie('$mois');
         END;";

        $connection->executeQuery($query);

        return $this;

    }

}
 No newline at end of file