production/Controleur/ControleurAjaxfacturerpolice.php
2025-12-02 11:29:44 +00:00

311 lines
10 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Beneficiaire.php';
require_once 'Modele/Echeancier_temp.php';
require_once 'Modele/Typeecheancier.php';
require_once 'Modele/Avenant.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurAjaxfacturerpolice extends Controleur {
private $beneficiaire;
private $echeancier;
private $typeecheancier;
private $avenant;
public function __construct() {
$this->beneficiaire = new Beneficiaire();
$this->echeancier = new Echeancier_temp();
$this->typeecheancier = new Typeecheancier();
$this->avenant = new Avenant();
}
public function index()
{
$idAvenant = $this->requete->getParametreFormulaire("idAvenant", "numerique");
$_SESSION['idAvenant'] = $idAvenant;
$debut = $this->requete->getParametreDate("debut");
$fin = $this->requete->getParametreDate("fin");
$beneficiaires = $this->beneficiaire->afficherfacturationpolice($debut, $fin, $idAvenant);
if(count($beneficiaires)=="0"){
$this->beneficiaire->initfacturationpolice();
$beneficiaires = $this->beneficiaire->afficherfacturationpolice($debut, $fin, $idAvenant);
}
$total_a_facturer = $this->beneficiaire->affichertotalfacturationpolice($debut, $fin, $idAvenant);
$this->genererVueAjax(array('beneficiaires' => $beneficiaires, 'total_a_facturer' => $total_a_facturer));
}
public function afficherdetailfacturationprime()
{
$beneficiaires = $this->beneficiaire->afficherDetailFacturationPrime();
$total_a_facturer = $this->beneficiaire->affichertotalfacturationpoliceprime();
$this->genererVueAjax(array('beneficiaires' => $beneficiaires, 'total_a_facturer' => $total_a_facturer));
}
public function selectionnertoutlignesafacturer()
{
$debut = $this->requete->getParametreDate("debut");
$fin = $this->requete->getParametreDate("fin");
$choix = $this->requete->getParametre("choix");
$idAvenant = $this->requete->getParametreFormulaire("idAvenant", "numerique");
$_SESSION['idAvenant'] = $idAvenant;
$this->beneficiaire->selectionnertoutlignesafacturer($choix, $debut, $fin, $idAvenant);
}
public function selectionner()
{
$debut = $this->requete->getParametreDate("debut");
$fin = $this->requete->getParametreDate("fin");
$idBeneficiairePrimeTemp = $this->requete->getParametre("idBeneficiairePrimeTemp");
$choix = $this->requete->getParametre("choix");
$idAvenant = $this->requete->getParametreFormulaire("idAvenant", "numerique");
$_SESSION['idAvenant'] = $idAvenant;
$total_a_facturer = $this->beneficiaire->selectionnerunelignesafacturer($idBeneficiairePrimeTemp, $choix, $debut, $fin, $idAvenant);
$this->genererVueAjax(array('total_a_facturer' => $total_a_facturer));
}
public function initecheancierfacturation()
{
$debut = $this->requete->getParametreDate("debut");
$fin = $this->requete->getParametreDate("fin");
$idAvenant = $_SESSION['idAvenant'];
$idEmission_temp = $this->beneficiaire->initecheancierfacturation($debut, $fin, $idAvenant);
$_SESSION['idEmission_temp'] = $idEmission_temp;
}
public function initecheancierfacturationprime()
{
$idEmission_temp = $this->beneficiaire->initecheancierfacturationprime();
$_SESSION['idEmission_temp'] = $idEmission_temp;
}
public function getnbecheancier()
{
$codeTypeEcheancier = $this->requete->getParametreFormulaire("codeTypeEcheancier");
$nbEcheance_info = $this->typeecheancier->getNbEcheancier($codeTypeEcheancier);
$this->genererVueAjax(array('nbEcheance_info' => $nbEcheance_info));
}
public function majecheancier()
{
$idEmission_temp = $_SESSION['idEmission_temp'];
$codeTypeEcheancier = $this->requete->getParametreFormulaire("codeTypeEcheancier");
$nbEcheance = $this->requete->getParametreFormulaire("nbEcheance");
$tauxInteret = $this->requete->getParametreFormulaire("tauxInteret");
$this->echeancier->majEcheancier_temp($idEmission_temp, $codeTypeEcheancier, $nbEcheance, $tauxInteret);
}
public function enregistrer()
{
$debut = $this->requete->getParametreDate("debut");
$fin = $this->requete->getParametreDate("fin");
$dateemission = $this->requete->getParametreDate("dateemission");
//highlight_string("<?php\n\$datas =\n" . var_export($dateemission , true) . ";\n>");
//highlight_string("<?php\n\$datas =\n" . var_export($_SESSION['idemission'] , true) . ";\n>");
$this->echeancier->enregistrer($debut, $fin,$dateemission);
// $this->rediriger("Facturerpolice");
}
public function enregistrerprime()
{
$dateemission = $this->requete->getParametreDate("dateemission");
//highlight_string("<?php\n\$datas =\n" . var_export($dateemission , true) . ";\n>");
//highlight_string("<?php\n\$datas =\n" . var_export($_SESSION['idemission'] , true) . ";\n>");
$this->echeancier->enregistrerprime($dateemission);
// $this->rediriger("Facturerpolice");
}
public function majlibelle()
{
$idEcheancier = $this->requete->getParametreFormulaire("idEcheancier");
$libelleEcheance = $this->requete->getParametreFormulaire("libelleEcheance");
$this->echeancier->majlibelle($idEcheancier, $libelleEcheance);
}
public function majdatepaiement()
{
$idEcheancier = $this->requete->getParametreFormulaire("idEcheancier");
$datePaiement = $this->requete->getParametreDate("datePaiement");
$this->echeancier->majdatepaiement($idEcheancier, $datePaiement);
}
public function majtauxecheance()
{
$idEcheancier = $this->requete->getParametreFormulaire("idEcheancier");
$tauxEcheance = $this->requete->getParametreFormulaire("tauxEcheance");
$nbEcheance = $this->requete->getParametreFormulaire("nbEcheance");
$this->echeancier->majtauxecheance($idEcheancier, $tauxEcheance, $nbEcheance);
}
public function afficherecheancierfacturation()
{
$typeecheancier = $this->typeecheancier->getListe();
$entete_echeancier = $this->echeancier->getEntete_echeancier_temp();
$echeanciers = $this->echeancier->getEcheancier_temp();
$total_echeancier = $this->echeancier->getTotalEcheancier_temp();
$this->genererVueAjax(array('typeecheancier' => $typeecheancier, 'entete_echeancier' => $entete_echeancier,
'echeanciers' => $echeanciers, 'total_echeancier' => $total_echeancier));
}
public function majaccessoiresfacturation()
{
$debut = $this->requete->getParametreDate("debut");
$fin = $this->requete->getParametreDate("fin");
$fraisCarte = $this->requete->getParametreFormulaire("fraisCarte", "numerique");
$this->beneficiaire->majaccessoiresfacturation($fraisCarte, $debut, $fin);
}
public function majprimesfacturation()
{
$debut = $this->requete->getParametreDate("debut");
$fin = $this->requete->getParametreDate("fin");
$idCollege = $this->requete->getParametreFormulaire("idCollege");
$old_primeNette = $this->requete->getParametreFormulaire("old_primeNette", "numerique");
$nv_primeNette = $this->requete->getParametreFormulaire("nv_primeNette", "numerique");
$this->beneficiaire->majprimesfacturation($idCollege, $old_primeNette, $nv_primeNette, $debut, $fin);
}
// majaccessoirefacturationprime
public function majaccessoirefacturationprime()
{
$debut = $this->requete->getParametreDate("debut");
$fin = $this->requete->getParametreDate("fin");
$accesoireTotal = $this->requete->getParametreFormulaire("accesoireTotal", "numerique");
$total_a_facturer = $this->beneficiaire->majaccessoirefacturationprime($accesoireTotal, $debut, $fin);
$this->genererVueAjax(array('total_a_facturer' => $total_a_facturer));
}
// 10/05/2021
public function affichereffetavenant()
{
$idAvenant = $this->requete->getParametreFormulaire("idAvenant");
$dateEffetAvenant = $this->avenant->getdateavenant($idAvenant, $_SESSION['idPolice_C']);
echo $dateEffetAvenant;
}
public function listeravenantafacturer()
{
$dateDebut = $this->requete->getParametreDate("debut");
$dateFin = $this->requete->getParametreDate("fin");
$avenants = $this->avenant->getAvenantAfacturer($dateDebut,$dateFin);
$this->genererVueAjax(array('avenants' => $avenants));
}
public function selectionavenant()
{
$id = $this->requete->getParametreFormulaire("id");
$choix = $this->requete->getParametreFormulaire("choix");
$this->avenant->selectionnerAvenant($id,$choix);
}
public function majAccessoirePrime()
{
$id= $this->requete->getParametreFormulaire("id");
$accessoire = $this->requete->getParametreFormulaire("accessoire");
$this->avenant->majAccessoirePrime($id,$accessoire);
}
public function majAccessoirePrimeGarant()
{
$id= $this->requete->getParametreFormulaire("id");
$accessoire = $this->requete->getParametreFormulaire("accessoire");
$this->avenant->majAccessoirePrimeGarant($id,$accessoire);
}
public function majAccessoirePrimeGestionnaire()
{
$id= $this->requete->getParametreFormulaire("id");
$accessoire = $this->requete->getParametreFormulaire("accessoire");
$this->avenant->majAccessoirePrimeGestionnaire($id,$accessoire);
}
public function selectionnertoutlignesafacturerprime()
{
$choix = $this->requete->getParametre("choix");
$this->beneficiaire->selectionnertoutlignesafacturerprime($choix);
}
public function affichertoutfacturationprime()
{
$avenants = $this->avenant->listerAvenantAfacturer();
$beneficiaires = $this->beneficiaire->afficherDetailFacturationPrime();
$total_a_facturer = $this->beneficiaire->affichertotalfacturationpoliceprime();
$this->genererVueAjax(array('avenants' => $avenants, 'beneficiaires' => $beneficiaires, 'total_a_facturer' => $total_a_facturer));
}
public function listeravenantsanprime()
{
$dateDebut = $this->requete->getParametreDate("debut");
$dateFin = $this->requete->getParametreDate("fin");
$avenants = $this->avenant->getAvenantSansPrime($dateDebut,$dateFin);
$this->genererVueAjax(array('avenants' => $avenants));
}
public function clotureravenantsansprime()
{
$idAvenant = $this->requete->getParametreFormulaire("idAvenant", "numerique");
$this->avenant->clotureravenantsansprime($idAvenant);
}
}