Commit 555abaf4 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Finalisation pré-liquidation SIHAM

parent 0972e7ee
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
CREATE
OR REPLACE FORCE VIEW V_EXPORT_PAIEMENT_SIHAM AS
SELECT 'P'                                                                   type,
SELECT annee_id,
       type_intervenant_id,
       structure_id,
       periode_id,
       'P'                                                                   type,
       code_rh                                                               matricule,
       CASE WHEN type_intervenant_code = 'P' THEN '200204' ELSE '202251' END retenue,
       ose_paiement.get_format_mois_du()                                     du_mois,
+71 −0
Original line number Diff line number Diff line
<?php

return [
    [
        'CODE'           => 'preliquidation-siham',
        'LIBELLE'        => 'Préliquidation SIHAM',
        'PDF_TRAITEMENT' => null,
        'AUTO_BREAK'     => false,
        'REQUETE'        => 'SELECT * FROM v_export_paiement_siham',
        'CSV_PARAMS'     => '{
    "ANNEE_ID": {
        "visible": false
    },
    "TYPE_INTERVENANT_ID": {
        "visible": false
    },
    "STRUCTURE_ID": {
        "visible": false
    },
    "PERIODE_ID": {
        "visible": false
    },
    "INTERVENANT_ID": {
        "visible": false
    },
    "TYPE": {
        "libelle": "type"
    },
    "MATRICULE": {
        "libelle": "Matricule"
    },
     "RETENUE": {
        "libelle": "Retenue"
    },
     "DU_MOIS": {
        "libelle": "Du mois (AAAA-MM)"
    },
     "ANNEE_DE_PAYE": {
        "libelle": "Année de paye (AA)"
    },
     "MOIS_DE_PAYE": {
        "libelle": "Mois de paye (MM)"
    },
    "NUMERO_DE_REMISE": {
        "libelle": "Numéro de remise"
    },
    "TG_SPECIFIQUE": {
        "libelle": "TG spécifique"
    },
    "DOSSIER_DE_PAYE": {
        "libelle": "Dossier de paye"
    },
    "DATE_PECUNIAIRE": {
        "libelle": "Date pécuniaire"
    },
    "NOMBRE_D_UNITES": {
        "libelle": "Nombre d’unités",
        "type": "float"
    },
    "MONTANT": {
        "libelle": "Montant",
        "type": "float"
    },
    "LIBELLE": {
        "libelle": "Libellé"
    },
    "MODE_DE_CALCUL": {
        "libelle": "Mode de calcul"
    },
    "CODE_ORIGINE": {
        "libelle": "Code origine"
    }
}',
    ],
    [
        'CODE'           => 'winpaie',
        'LIBELLE'        => 'Extraction Winpaie',
+8 −7
Original line number Diff line number Diff line
@@ -130,11 +130,7 @@ class EtatSortieService extends AbstractEntityService
        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->setAnneePaie($filtres['ANNEE_ID'], $periode->getCode());
            $this->setMoisPaie($periode->getCode());
        }

@@ -379,10 +375,14 @@ class EtatSortieService extends AbstractEntityService
        return $this;
    }

    public function setAnneePaie(string $annee)
    public function setAnneePaie(string $annee, string $periode)
    {
        $connection = $this->getEntityManager()->getConnection();
        $anneeFormatted = (string)($annee - 2000);
        $anneeFormatted = $annee - 2000;
        //on ajouter +1 à l'année courante si on est sur une période après le mois de décembre
        if (!in_array($periode, ['P01', 'P02', 'P03', 'P04'])) {
            $anneeFormatted++;
        }


        $query = "begin
@@ -430,4 +430,5 @@ class EtatSortieService extends AbstractEntityService

    }


}
 No newline at end of file