<?php

namespace Modules\Facture;

use Modules\Facture\Controller\BonAPayerSignatureController;
use Modules\Facture\Controller\WorkflowController;
use Skeleton\Router;
use Skeleton\Module;
use Skeleton\Renderer\RendererInterface;
use Psr\Container\ContainerInterface;
use Helpers\Parametres\Parametres;
use Modules\Facture\Controller\AjaxFactureController;
use Modules\Facture\Controller\ArchivageFactureController;
use Modules\Facture\Controller\CreationFactureController;
use Modules\Facture\Controller\DocumentsRattachesController;
use Modules\Facture\Controller\PiecesJointesController;
use Modules\Facture\Controller\GestionFactureController;
use Modules\Facture\Controller\PopupFactureController;
use Modules\Facture\Controller\ReglementFactureController;
use Modules\Facture\Controller\ImpressionGlobaleFactureController;
use Modules\Facture\Controller\CutOfStandardFactureController;
use Modules\Facture\Controller\ModificationFactureController;
use Modules\Facture\Controller\ImpressionFactureController;
use Modules\Facture\Controller\FactureImporterController;
use Modules\Facture\Controller\FactureArchiveController;
use Modules\Facture\Controller\ZedocController;
use Modules\Facture\Controller\ListesFactureController;
use Modules\Facture\Controller\EditionEtatCcaController;
use Modules\Facture\Controller\IndicateurFactureController;
use Modules\Facture\Controller\VideocodageController;
use Modules\Facture\Controller\EtatCommandeController;
use Modules\Facture\Controller\FacturesPortailController;
use Modules\Facture\Controller\ExportMasseController;
use Modules\Facture\Controller\ExportMasseViaExcelController;

class FactureModule extends Module
{

    const DEFINITIONS = __DIR__ . '/config.php';

    public function __construct(ContainerInterface $container)
    {
        // TODO : clean up
        $container->get(RendererInterface::class)->addPath('facture', __DIR__ . '/views/creation-facture');
        $container->get(RendererInterface::class)->addPath('modification-facture', __DIR__ . '/views/modification-facture');
        $container->get(RendererInterface::class)->addPath('gestion-facture', __DIR__ . '/views/gestion-facture');
        $container->get(RendererInterface::class)->addPath('ajax-facture', __DIR__ . '/views/ajax-facture');
        $container->get(RendererInterface::class)->addPath('popup-facture', __DIR__ . '/views/popup-facture');
        $container->get(RendererInterface::class)->addPath('reglement-facture', __DIR__ . '/views/reglement-facture');
        $container->get(RendererInterface::class)->addPath('archivage-facture', __DIR__ . '/views/archivage-facture');
        $container->get(RendererInterface::class)->addPath('impression-globale-facture', __DIR__ . '/views/impression-globale-facture');
        $container->get(RendererInterface::class)->addPath('cut-of-standard-facture', __DIR__ . '/views/cut-of-standard-facture');
        $container->get(RendererInterface::class)->addPath('lad', __DIR__ . '/views/lad');
        $container->get(RendererInterface::class)->addPath('impression', __DIR__ . '/views/impression');
        $container->get(RendererInterface::class)->addPath('Acquisition-des-Factures', __DIR__ . '/views/Acquisition-des-Factures');
        $container->get(RendererInterface::class)->addPath('Acquisition-des-Factures-popup', __DIR__ . '/views/Acquisition-des-Factures/popup');
        $container->get(RendererInterface::class)->addPath('listes-facture', __DIR__ . '/views/listes-facture');
        $container->get(RendererInterface::class)->addPath('edition-etat-cca-facture', __DIR__ . '/views/edition-etat-cca-facture');
        $container->get(RendererInterface::class)->addPath('etatCommande', __DIR__ . '/views/etatCommande');
        $container->get(RendererInterface::class)->addPath('factures-portail', __DIR__ . '/views/factures-portail');
        $container->get(RendererInterface::class)->addPath('mailFactures', __DIR__ . '/views/mail');
        $container->get(RendererInterface::class)->addPath('exportMasse', __DIR__ . '/views/ExportMasse');

        $container->get(RendererInterface::class)->addPath('Facture', __DIR__ . '/views');

        $router = $container->get(Router::class);

        $parametres     = new Parametres();
        $global         = $parametres->expression_global;
        $alpha          = $parametres->expression_alpha;
        $alpha_min      = $parametres->expression_point_tiret_underscore;
        $alpha_maj      = $parametres->expression_alpha_maj;
        $decimal        = $parametres->expression_decimal;
        $numFact        = $parametres->id_facture;
        $ficFacture     = $parametres->expression_point_tiret_underscore;
        $societe        = $parametres->id_societe;
        $fourniss       = $parametres->id_fournisseur;
        $commande       = $parametres->id_commande;
        $reglement      = $parametres->id_reglement;
        $cdeCreation    = $parametres->expression_global; // numéro de commande ou 'all'
        $idPdf          = $parametres->expression_point_tiret_underscore;
        $codeEvent      = $parametres->expression_point_tiret_underscore;
        $noOrdre = $parametres->ordre_document;
        $base_url = $container->get('baseUrl') . $container->get('Facture.prefix');


        // Controller GestionFacture
        $router->get($base_url . '/gestion-facture', GestionFactureController::class, 'Facture.GestionFacture.index', 'HA_FA_VISU && U8zXaa77yt');
        $router->get($base_url . '/detail/{numFact:' . $numFact . '+}', GestionFactureController::class, 'Facture.GestionFacture.detail', ['HA_FA_VISU', 'U8zXaa77yt']);
        $router->get($base_url . '/editionImage[/{numFact:' . $numFact . '+}]', GestionFactureController::class, 'Facture.GestionFacture.editionImage', ['HA_FA_LIS']);
        $router->get($base_url . '/impressionFacture/{numFact:' . $numFact . '+}/{codeSte:' . $societe . '+}', GestionFactureController::class, 'Facture.GestionFacture.impressionFacture', ['HA_FA_LIS']);
        $router->get($base_url . '/commande-de-regularisation/{numFact:' . $numFact . '+}/{codeSte:' . $societe . '+}/{codeFour:' . $fourniss . '+}', GestionFactureController::class, 'Facture.GestionFacture.commandeDeRegularisation');
        $router->get($base_url . '/incidentsMail/{numFact:' . $numFact . '+}/{codeSte:' . $societe . '+}', GestionFactureController::class, 'Facture.GestionFacture.incidentsMail');
        $router->get($base_url . '/suivi-evenements/{numFact:' . $numFact . '+}[/{MODULE:' . $global . '+}]', GestionFactureController::class, 'Facture.GestionFacture.suivi');
        $router->get($base_url . '/signataires-attendus/{numFact:' . $numFact . '+}', GestionFactureController::class, 'Facture.GestionFacture.popupListSignatPending');
        $router->get($base_url . '/export-factures/{type:' . $alpha . '+}', GestionFactureController::class, 'Facture.GestionFacture.exportFactures');
        $router->get($base_url . '/popupExport/{type:' . $alpha . '+}', GestionFactureController::class, 'Facture.GestionFacture.popupExport');
        $router->get($base_url . '/Export/{type:' . $alpha . '+}', GestionFactureController::class, 'Facture.GestionFacture.export');
        $router->get($base_url . '/imageFacture/{numFact:' . $numFact . '+}', GestionFactureController::class, 'Facture.GestionFacture.imageFacture');


        $router->get($base_url . '/indicateurFacture', IndicateurFactureController::class, 'IndicateurFacture.IndicateurFacture.index', ['HA_FA_VISU', 'U8zXaa77yt']);


        // Controller CreationFacture
        $router->get($base_url . '/nouvelle-facture', CreationFactureController::class, 'Facture.CreationFacture.nouvelleFacture', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/creationaffectation/{action:' . $alpha_min . '+}', CreationFactureController::class, 'Facture.CreationFacture.creationAffectation', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/choix-commande/{action:' . $alpha_min . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{numCde:' . $cdeCreation . '+}', CreationFactureController::class, 'Facture.CreationFacture.choixCommande', ['HA_FA_CMOD']);
        
        $router->get($base_url . '/nouvelle-facture/choix-avoir/{action:' . $alpha_min . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{numCde:' . $cdeCreation . '+}', CreationFactureController::class, 'Facture.CreationFacture.choixAvoir', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/choix-avoir/table-choix-commande/{action:' . $alpha_min . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{numCde:' . $cdeCreation . '+}', CreationFactureController::class, 'Facture.CreationFacture.tableChoixCommande');
        $router->get($base_url . '/nouvelle-facture/choix-avoir/table-choix-facture/{action:' . $alpha_min . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{numCde:' . $cdeCreation . '+}', CreationFactureController::class, 'Facture.CreationFacture.tableChoixFacture');
        
        $router->get($base_url . '/nouvelle-facture/choix-affectation-lad/{action:' . $alpha_min . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{numCde:' . $cdeCreation . '+}', CreationFactureController::class, 'Facture.CreationFacture.choixAffectationLad', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/affectation/{action:' . $alpha_min . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{numCde:' . $cdeCreation . '+}/{typeListeAffichee:' . $alpha . '+}/{choixLad:' . $decimal . '+}[/{nonAffichageChoixCommande:' . $decimal . '+}]', CreationFactureController::class, 'Facture.CreationFacture.affectation', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/wsdlAffectation/{action:' . $alpha_min . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{numCde:' . $cdeCreation . '+}/{typeListeAffichee:' . $alpha . '+}/{choixLad:' . $decimal . '+}[/{nonAffichageChoixCommande:' . $decimal . '+}]', CreationFactureController::class, 'Facture.CreationFacture.wsdlAffectation', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/easyDematAffectation/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}', CreationFactureController::class, 'Facture.CreationFacture.easyDematAffectation', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/transitionAffectation/{action:' . $alpha_min . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{numCde:' . $cdeCreation . '+}/{typeListeAffichee:' . $alpha . '+}/{choixLad:' . $decimal . '+}[/{nonAffichageChoixCommande:' . $decimal . '+}]', CreationFactureController::class, 'Facture.CreationFacture.transitionAffectation', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/enregistrerAffectation/{numFact:' . $numFact . '+}/{societe:' . $societe . '+}', CreationFactureController::class, 'Facture.CreationFacture.enregistrerAffectation', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/verifApresEnregistrementFacture/{numFact:' . $numFact . '+}', CreationFactureController::class, 'Facture.CreationFacture.verifApresEnregistrementFacture', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/validationViaAffectation/{numFact:' . $numFact . '+}', CreationFactureController::class, 'Facture.CreationFacture.validationViaAffectation', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/mail-acheteur/{numCde:' . $commande . '+}/{dest:' . $alpha_maj . '+}/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}/{societe:' . $societe . '+}/{page:' . $alpha . '+}/{action:' . $alpha . '+}', CreationFactureController::class, 'Facture.CreationFacture.mailAcheteurDemandeur');
        $router->get($base_url . '/nouvelle-facture/validationFacture/{numFact:' . $numFact . '+}', CreationFactureController::class, 'Facture.CreationFacture.validationFacture', ['HA_FA_VALI']);
        $router->get($base_url . '/nouvelle-facture/choixSignataireFacture/{numFact:' . $numFact . '+}[/{mode:' . $alpha . '+}]', CreationFactureController::class, 'Facture.CreationFacture.choixSignataireFacture', ['HA_FA_VALI']);
        $router->get($base_url . '/nouvelle-facture/confirmationValidationFacture/{numFact:' . $numFact . '+}[/{mode:' . $alpha . '+}]', CreationFactureController::class, 'Facture.CreationFacture.confirmationValidationFacture', ['HA_FA_VALI']);
        $router->get($base_url . '/nouvelle-facture/confirmationAsyncValidationFacture/{numFact:' . $numFact . '+}[/{mode:' . $alpha . '+}]', CreationFactureController::class, 'Facture.CreationFacture.confirmationAsyncValidationFacture', ['HA_FA_VALI']);
        $router->get($base_url . '/nouvelle-facture/suppressionAffectation/{numFact:' . $numFact . '+}', CreationFactureController::class, 'Facture.CreationFacture.supprimerAffectation', ['HA_FA_CMOD']);
        $router->get($base_url . '/nouvelle-facture/suppressionAffectationEnCours/{numFact:' . $numFact . '+}', CreationFactureController::class, 'Facture.CreationFacture.suppressionAffectationEnCours', ['HA_FA_CMOD']);


        // Controller ModificationFacture
        $router->get($base_url . '/modification-facture/{numFact:' . $numFact . '+}', ModificationFactureController::class, 'Facture.ModificationFacture.modificationFacture', ['HA_FA_CMOD']);
        $router->get($base_url . '/modification-facture/creationaffectation/{action:' . $alpha_min . '+}', ModificationFactureController::class, 'Facture.ModificationFacture.creationAffectation', ['HA_FA_CMOD']);


        // Controller ReglementFacture
        $router->get($base_url . '/reglement-facture', ReglementFactureController::class, 'Facture.ReglementFacture.reglement', ['HA_FA_REG']);
        $router->get($base_url . '/reglement/{numFact:' . $numFact . '+}', ReglementFactureController::class, 'Facture.ReglementFacture.reglementFacture', ['HA_FA_REG']);
        $router->get($base_url . '/deviseReglement', ReglementFactureController::class, 'Facture.ReglementFacture.deviseReglement');
        $router->get($base_url . '/verificationMontantReglement', ReglementFactureController::class, 'Facture.ReglementFacture.verificationMontantReglement');
        $router->get($base_url . '/ajout-reglement/{numFact:' . $numFact . '+}[/{confirmationCreation:' . $decimal . '+}]', ReglementFactureController::class, 'Facture.ReglementFacture.ajoutReglement', ['HA_FA_REG']);
        $router->get($base_url . '/modifier-reglement/{numFact:' . $numFact . '+}/{numReg:' . $reglement . '+}', ReglementFactureController::class, 'Facture.ReglementFacture.modifierReglement', ['HA_FA_REG']);
        $router->get($base_url . '/supprimer-reglement/{numFact:' . $numFact . '+}/{numReg:' . $reglement . '+}', ReglementFactureController::class, 'Facture.ReglementFacture.supprimerReglement', ['HA_FA_REG']);
        $router->get($base_url . '/export-reglements-facture', ReglementFactureController::class, 'Facture.ReglementFacture.exportReglements', ['HA_FA_REG']);


        // Controller ArchivageFacture
        $router->get($base_url . '/archivage-facture', ArchivageFactureController::class, 'Facture.ArchivageFactureController.archivage', ['HA_FAC_ARC']);


        // Controller DocumentsRattaches
        $router->get($base_url . '/documents-rattaches-facture/{numFact:' . $numFact . '+}', DocumentsRattachesController::class, 'Facture.DocumentsRattaches.docRattache');


        // Controller PiecesJointes
        $router->get($base_url . '/pieces-jointes-facture/{numFact:' . $numFact . '+}', PiecesJointesController::class, 'Facture.PiecesJointes.piecesJointes');
        $router->get($base_url . '/creation-pieces-jointes-facture/{numFact:' . $numFact . '+}', PiecesJointesController::class, 'Facture.PiecesJointes.creationPiecesJointes');
        $router->get($base_url . '/modification-pieces-jointes-facture/{numFact:' . $numFact . '+}', PiecesJointesController::class, 'Facture.PiecesJointes.modificationPiecesJointes');
        $router->get($base_url . '/suppression-pieces-jointes-facture/{numFact:' . $numFact . '+}', PiecesJointesController::class, 'Facture.PiecesJointes.suppressionPiecesJointes');


        // Controller ImpressionGlobaleFacture
        $router->get($base_url . '/impression-globale-facture', ImpressionGlobaleFactureController::class, 'Facture.ImpressionGlobaleFactureController.impressionGlobale', ['HA_FA_IMP']);
        $router->get($base_url . '/pdf-impression-globale-facture', ImpressionGlobaleFactureController::class, 'Facture.ImpressionGlobaleFactureController.pdfImpressionGlobale', ['HA_FA_IMP']);
        $router->get($base_url . '/download-facture/{idPdf:' . $idPdf . '+}', ImpressionGlobaleFactureController::class, 'Facture.ImpressionGlobaleFactureController.downloadFacture', ['HA_FA_IMP']);


        // Controller CutOfStandardFacture
        $router->get($base_url . '/cut-of-standard-facture', CutOfStandardFactureController::class, 'Facture.CutOfStandardFactureController.cutOfStandard', ['HA_FA_XT']);
        $router->get($base_url . '/pdf-cut-of-standard-facture', CutOfStandardFactureController::class, 'Facture.CutOfStandardFactureController.pdfCutOfStandard', ['HA_FA_XT']);
        $router->get($base_url . '/export-cut-of-standard-facture', CutOfStandardFactureController::class, 'Facture.CutOfStandardFactureController.exportCutOfStandard', ['HA_FA_XT']);


        // Impression entete/ligne facture
        $router->get($base_url . '/impressionEntete', ImpressionFactureController::class, 'Facture.ImpressionFacture.impressionEntete', ['HA_FA_LIS']);
        $router->get($base_url . '/pdf-entete-facture', ImpressionFactureController::class, 'Facture.ImpressionFactureController.pdfEnteteFacture', ['HA_FA_LIS']);
        $router->get($base_url . '/impressionLigne', ImpressionFactureController::class, 'Facture.ImpressionFacture.impressionLigne', ['HA_FA_LIS']);
        $router->get($base_url . '/pdf-ligne-facture', ImpressionFactureController::class, 'Facture.ImpressionFactureController.pdfLigneFacture', ['HA_FA_LIS']);
        $router->get($base_url . '/{factureId:' . $numFact . '+}/impression', ImpressionFactureController::class, 'Facture.ImpressionFactureController.impressionEntity');


        // Controller EditionEtatCca
        $router->get($base_url . '/edition-etat-cca', EditionEtatCcaController::class, 'Facture.EditionEtatCcaController.editionEtatCca', ['HA_FA_XT']);
        $router->get($base_url . '/pdf-etat-cca', EditionEtatCcaController::class, 'Facture.EditionEtatCcaController.pdfEtatCca', ['HA_FA_XT']);
        $router->get($base_url . '/export-etat-cca', EditionEtatCcaController::class, 'Facture.EditionEtatCcaController.exportEtatCca', ['HA_FA_XT']);


        // Controller ListesFacture
        $router->get($base_url . '/liste-entete-facture', ListesFactureController::class, 'Facture.ListesFactureController.listeEntete', ['HA_FA_LIS']);
        $router->get($base_url . '/liste-ligne-facture', ListesFactureController::class, 'Facture.ListesFactureController.listeLigne', ['HA_FA_LIS']);
        $router->get($base_url . '/liste-evenements-facture', ListesFactureController::class, 'Facture.ListesFactureController.listeEvenements', ['HA_FA_LIS']);
        $router->get($base_url . '/liste-globale-evenements-facture', ListesFactureController::class, 'Facture.ListesFactureController.listeGlobaleEvenements', ['HA_FA_LIS']);


        // Controller AjaxFacutre
        $router->get($base_url . '/ajax-facture/calcul-date-periode', AjaxFactureController::class, 'Facture.ajax.calculDatePeriode');
        $router->get($base_url . '/ajax-facture/verifQteLigne', AjaxFactureController::class, 'Facture.ajax.verifQteLigne');
        $router->get($base_url . '/ajax-facture/verifPuRemiseLigne', AjaxFactureController::class, 'Facture.ajax.verifPuRemiseLigne');
        $router->get($base_url . '/ajax-facture/verifHTLigne', AjaxFactureController::class, 'Facture.ajax.verifHTLigne');
        $router->get($base_url . '/ajax-facture/verifTVALigne', AjaxFactureController::class, 'Facture.ajax.verifTVALigne');
        $router->get($base_url . '/ajax-facture/detail-choix-des-commandes', AjaxFactureController::class, 'Facture.ajax.detailChoixDesCommandes');
        $router->get($base_url . '/{numFact:' . $numFact . '+}/ajax/detail-ligne-facture', AjaxFactureController::class, 'Facture.ajax.ligneFacture');
        $router->get($base_url . '/ajax-facture/setCG', AjaxFactureController::class, 'Facture.ajax.setCG');
        $router->get($base_url . '/ajax-facture/getLONGCP', AjaxFactureController::class, 'Facture.ajax.getLONGCP');
        $router->get($base_url . '/ajax-facture/detail-ligne-affectation', AjaxFactureController::class, 'Facture.ajax.ligneAffectation');
        $router->get($base_url . '/ajax-facture/validerEclatement', AjaxFactureController::class, 'Facture.ajax.validerEclatement');
        $router->get($base_url . '/ajax-facture/validationMail', AjaxFactureController::class, 'Facture.ajax.validationMail');
        $router->get($base_url . '/ajax-facture/detail-ligne-visualisation/{numFact:' . $numFact . '+}/{ligne:' . $decimal . '+}', AjaxFactureController::class, 'Facture.ajax.ligneDetail');
        $router->get($base_url . '/ajax-facture/detail-ligne-liste-entete', AjaxFactureController::class, 'Facture.ajax.ligneListeEntete');
        $router->get($base_url . '/ajax-facture/detail-ligne-liste-ligne', AjaxFactureController::class, 'Facture.ajax.ligneListeLigne');
        $router->get($base_url . '/ajax-facture/detail-ligne-liste-evenements', AjaxFactureController::class, 'Facture.ajax.ligneListeEvenements');
        $router->get($base_url . '/ajax-facture/specifiqueClient61', AjaxFactureController::class, 'Facture.ajax.specifiqueClient61');
        $router->get($base_url . '/ajax-facture/changeSousFamille', AjaxFactureController::class, 'Facture.ajax.changeSousFamille');
        $router->get($base_url . '/ajax-facture/changeArticle', AjaxFactureController::class, 'Facture.ajax.changeArticle');
        $router->get($base_url . '/ajax-facture/changeTypeTva', AjaxFactureController::class, 'Facture.ajax.changeTypeTva');
        $router->get($base_url . '/ajax-facture/ajaxInsertValue', AjaxFactureController::class, 'Facture.ajax.ajaxInsertValue');
        $router->get($base_url . '/ajax-facture/calcultotal/{numFact:' . $numFact . '+}', AjaxFactureController::class, 'Facture.ajax.calculTotal');
        $router->get($base_url . '/ajax-facture/ajaxModificationGroupe/{numFact:' . $numFact . '+}', AjaxFactureController::class, 'Facture.ajax.ajaxModificationGroupe');

        // Controller PopupFacture
        $router->get($base_url . '/popup/bloc-note/{numFact:' . $numFact . '+}', PopupFactureController::class, 'Facture.popup.blocNote');
        $router->get($base_url . '/popup/litige/{numFact:' . $numFact . '+}', PopupFactureController::class, 'Facture.popup.litige', ['HA_FA_LIT']);
        $router->get($base_url . '/popup/modifier-date-echeance/{numFact:' . $numFact . '+}', PopupFactureController::class, 'Facture.popup.modifierDateEcheance', ['HA_FA_VAEC']);
        $router->get($base_url . '/popup/upload-changer-image-facture/{numFact:' . $numFact . '+}', PopupFactureController::class, 'Facture.popup.uploadImageFacture');
        $router->get($base_url . '/popup/ajoutDocRattPJCreation', PopupFactureController::class, 'Facture.popup.ajoutDocRattPJCreation');
        $router->get($base_url . '/popup/interrogationAjoutCdeDeRegul', PopupFactureController::class, 'Facture.popup.interrogationAjoutCdeDeRegul');
        $router->get($base_url . '/popup/confirmationAjoutCdeDeRegul/{numCde:' . $commande . '+}', PopupFactureController::class, 'Facture.popup.confirmationAjoutCdeDeRegul');
        $router->get($base_url . '/popup/confirmation', PopupFactureController::class, 'Facture.popup.confirmation');
        $router->get($base_url . '/popup/erreurAjoutCdeDeRegul', PopupFactureController::class, 'Facture.popup.erreurAjoutCdeDeRegul');
        $router->get($base_url . '/popup/interrogation', PopupFactureController::class, 'Facture.popup.interrogation');
        $router->get($base_url . '/popup/interrogationPreaffectationMail', PopupFactureController::class, 'Facture.popup.interrogationPreaffectationMail');
        $router->get($base_url . '/popup/retourPreaffectationMail', PopupFactureController::class, 'Facture.popup.retourPreaffectationMail');
        $router->get($base_url . '/popup/gestionNonFacturable', PopupFactureController::class, 'Facture.popup.gestionNonFacturable');
        $router->get($base_url . '/popup/interrogationValidationFacture', PopupFactureController::class, 'Facture.popup.interrogationValidationFacture');
        $router->get($base_url . '/popup/choixValidationFacture/{numFact:' . $numFact . '+}/{fournisseur:' . $fourniss . '+}[/{mode:' . $alpha . '+}]', PopupFactureController::class, 'Facture.popup.choixValidationFacture', ['HA_FA_VALI']);
        $router->get($base_url . '/popup/ajoutEvenement/{numFact:' . $numFact . '+}', PopupFactureController::class, 'Facture.popup.ajoutEvenementFacture');
        $router->get($base_url . '/popup/modificationEvenement/{numFact:' . $numFact . '+}/{numEvent:' . $codeEvent . '+}', PopupFactureController::class, 'Facture.popup.modificationEvenementFacture');
        $router->get($base_url . '/popup/suppressionEvenement/{numFact:' . $numFact . '+}/{numEvent:' . $codeEvent . '+}', PopupFactureController::class, 'Facture.popup.suppresionEvenementFacture');
        $router->get($base_url . '/popup/supprimer/{numFact:' . $numFact . '+}/{page:' . $decimal . '+}', PopupFactureController::class, 'Facture.popup.supprimerFacture');
        $router->get($base_url . '/popup/commandesNonFacturables', PopupFactureController::class, 'Facture.popup.commandesNonFacturables', ['HA_FA_CMOD']);
        $router->get($base_url . '/popup/calculPourcentage', PopupFactureController::class, 'Facture.popup.calculPourcentage');
        $router->get($base_url . '/popup/differenceCondPaie/{numFact:' . $numFact . '+}/{action:' . $alpha_min . '+}', PopupFactureController::class, 'Facture.popup.differenceCondPaie');


        //// LAD
        // Controller ZEDOC
        $router->get($base_url . '/zedoc', ZedocController::class, 'Facture.Zedoc.zedoc');
        $router->get($base_url . '/zedoc/lad/facture', ZedocController::class, 'Facture.Zedoc.affichagPDFLAD');
        $router->get($base_url . '/videocodage', VideocodageController::class, 'Facture.videocodage.index');

        $router->get($base_url . '/listRejected', ZedocController::class, 'Facture.Zedoc.listRejected');
        $router->get($base_url . '/affichagPDFJRejected', ZedocController::class, 'Facture.Zedoc.affichagPDFJRejected');
        $router->get($base_url . '/ajax/actionRejected/{action:' . $alpha_min . '+}[/{secto:' . $numFact . '+}]', ZedocController::class, 'Facture.Zedoc.ajaxActionRejected');

        
        
        
        // ACQUISTION FACTURE // FACTURE IMPORTER
        $router->get($base_url . '/facture-a-importer', FactureImporterController::class, 'Facture.FactureImporter.listeFactureImport', ['HA_FA_LAD || HA_FA_LADA']);
        $router->get($base_url . '/facture-archivage', FactureImporterController::class, 'Facture.FactureImporter.archiver', ['HA_FA_LAD || HA_FA_LADA']);
        $router->get($base_url . '/facture-annuler-transfert', FactureImporterController::class, 'Facture.FactureImporter.annulerTransfert', ['HA_FA_LAD || HA_FA_LADA']);
        $router->get($base_url . '/alertePdfNotFound', FactureImporterController::class, 'Facture.FactureImporter.alertePdfNotFound', ['HA_FA_LAD || HA_FA_LADA']);
        $router->get($base_url . '/export-facture-importer', FactureImporterController::class, 'Facture.FactureImporter.exportFactureImport');


        // ACQUISTION FACTURE // FACTURE ARCHIVE
        $router->get($base_url . '/facture-liste-archive', FactureArchiveController::class, 'Facture.FactureArchive.listeFactureArchive', ['HA_FA_LAD || HA_FA_LADA']);
        $router->get($base_url . '/facture-annulerArchivage', FactureArchiveController::class, 'Facture.FactureArchive.annulerArchivage', ['HA_FA_LAD || HA_FA_LADA']);
        $router->get($base_url . '/export-facture-archive', FactureArchiveController::class, 'Facture.FactureArchive.exportFactureArchive');

        // POPUP ACQUISITION FACTURE
        $router->get($base_url . '/popup/popup-up-transfert-facture', FactureImporterController::class, 'Facture.FactureImporter.transfertFacture', ['HA_FA_LAD || HA_FA_LADA']);

        $router->get($base_url . '/etat/{numFact:' . $numFact . '+}', EtatCommandeController::class, 'Facture.EtatCommande.etat');

        // Factures issues du Portail
        $router->get($base_url . '/factures-portail', FacturesPortailController::class, 'Facture.FacturesPortail.suiviFacturesPortail');
        $router->get($base_url . '/factures-portail/detail-facture', FacturesPortailController::class, 'Facture.FacturesPortail.detailFacture');

        // Export de factures en masse
        $router->get($base_url . '/exportMasse', ExportMasseController::class, 'Facture.ExportMasse.exportMasse', ['HA_FA_EXPM']);
        $router->get($base_url . '/exportMasse/validationExport', ExportMasseController::class, 'Facture.ExportMasse.validationExport');
        $router->get($base_url . '/exportMasseViaExcel', ExportMasseViaExcelController::class, 'Facture.ExportMasseViaExcel.import', ['HA_FA_EXPM']);
        $router->get($base_url . '/exportMasseViaExcel/validationExport', ExportMasseViaExcelController::class, 'Facture.ExportMasseViaExcel.ajaxImport');
        
        // BBA Test Flexi
        $router->get($base_url . '/zedocBBA', ZedocController::class, 'Facture.Zedoc.zedocBBA', ['HA_FA_LAD || HA_FA_LADA']);

        // BonAPayer - workflow
        $router->get($base_url.'/{factureId:'.$numFact.'+}/workflow', WorkflowController::class, 'Facture.Workflow.summary');
        $router->get($base_url.'/{factureId:'.$numFact.'+}/workflow/{workflowId:'.$global.'+}', WorkflowController::class, 'Facture.Workflow.detail');
    }
}
