garant/Modele/Demandedecompte.php
2025-12-01 19:18:15 +00:00

208 lines
6.2 KiB
PHP

<?php
require_once 'Framework/Modele.php';
class Demandedecompte extends Modele {
public function get_idDemandeDecompte($codePrestataire, $codeExercice, $codeMois)
{
$sql = 'select fn_get_idDemandeDecompte(?, ?, ?) as idDemandeDecompte';
$resultat = $this->executerRequete($sql, array($codePrestataire, $codeExercice, $codeMois));
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
return $ligne['idDemandeDecompte'];
}
public function initdemandedecompte()
{
$codeSociete = $_SESSION['codeSociete'];
$user = $_SESSION['login'];
$codePrestataire = $_SESSION['codePrestataire_C'];
$codeExercice = $_SESSION['codeExercice_C'];
$codeMois = $_SESSION['codeMois_C'];
$sql = 'call sp_p_init_demande_decompte(?, ?, ?, ?, ?);';
$this->executerRequete($sql, array($codeSociete, $codePrestataire, $user, $codeExercice, $codeMois));
}
public function getinfosdemandedecompte($idDemandeDecompte)
{
$sql = 'call sp_p_get_infos_demande_decompte(?)';
$resultat = $this->executerRequete($sql, array($idDemandeDecompte));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
public function getdemandedecompte($idDemandeDecompte)
{
$sql = 'call sp_p_get_demandedecompte(?)';
$resultat = $this->executerRequete($sql, array($idDemandeDecompte));
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
$_SESSION['numeroDemandeDecompte_C'] = $ligne['numeroDemandeDecompte'];
return $ligne;
}
public function rechargerdemandedecompte($idDemandeDecompte, $numeroDemandeDecompte, $codePrestataire, $codeExercice, $codeMois)
{
$user = $_SESSION['login'];
$sql = 'call sp_p_recharger_demande_decompte(?, ?, ?, ?, ?, ?);';
$this->executerRequete($sql, array($idDemandeDecompte, $numeroDemandeDecompte, $codePrestataire, $codeExercice, $codeMois, $user));
}
public function get_numerodecompte($idReglement)
{
$sql = 'select fn_get_numerodecompte(?) as numeroDecompte';
$resultat = $this->executerRequete($sql, array($idReglement));
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
return $ligne['numeroDecompte'];
}
public function getdetaildemandedecompte($numeroDemandeDecompte)
{
$sql = 'call sp_p_get_detail_demandedecompte(?)';
$resultat = $this->executerRequete($sql, array($numeroDemandeDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function recapdecompte($idReglement, $numeroDecompte)
{
$sql = 'call sp_r_recap_decompte(?, ?)';
$this->executerRequete($sql, array($idReglement, $numeroDecompte));
}
public function getdecomptes($codePrestataire, $codeExercice, $codeMois, $codeEtatDecompte)
{
$codePrestataire = contruireParamLike($codePrestataire);
$codeEtatDecompte = contruireParamLike($codeEtatDecompte);
$sql = 'call sp_r_get_decomptes(?, ?, ?, ?)';
$resultat = $this->executerRequete($sql, array($codePrestataire, $codeExercice, $codeMois, $codeEtatDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildecompteexport($numeroDecompte)
{
$sql = 'call sp_p_bordereau_decompte_export(?)';
$resultat = $this->executerRequete($sql, array($numeroDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildecompteexportcso($numeroDecompte)
{
$sql = 'call sp_p_bordereau_decompte_export_cso(?)';
$resultat = $this->executerRequete($sql, array($numeroDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildecompteexportcsoid($idReglement)
{
$sql = 'call sp_p_bordereau_decompte_export_cso_id(?)';
$resultat = $this->executerRequete($sql, array($idReglement));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildecompteexportpha($numeroDecompte)
{
$sql = 'call sp_p_bordereau_decompte_export_pha(?)';
$resultat = $this->executerRequete($sql, array($numeroDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildecompteexportopt($numeroDecompte)
{
$sql = 'call sp_p_bordereau_decompte_export_opt(?)';
$resultat = $this->executerRequete($sql, array($numeroDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildecompteexportlab($numeroDecompte)
{
$sql = 'call sp_p_bordereau_decompte_export_lab(?)';
$resultat = $this->executerRequete($sql, array($numeroDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildecompteexportsea($numeroDecompte)
{
$sql = 'call sp_p_bordereau_decompte_export_sea(?)';
$resultat = $this->executerRequete($sql, array($numeroDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
// DEMANDE DE DECOMPTE
public function getdetaildemandedecompteexportcso($numeroDemandeDecompte)
{
$sql = 'call sp_p_demande_decompte_export_cso(?)';
$resultat = $this->executerRequete($sql, array($numeroDemandeDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildemandedecompteexportpha($numeroDemandeDecompte)
{
$sql = 'call sp_p_demande_decompte_export_pha(?)';
$resultat = $this->executerRequete($sql, array($numeroDemandeDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildemandedecompteexportopt($numeroDemandeDecompte)
{
$sql = 'call sp_p_demande_decompte_export_opt(?)';
$resultat = $this->executerRequete($sql, array($numeroDemandeDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildemandedecompteexportlab($numeroDemandeDecompte)
{
$sql = 'call sp_p_demande_decompte_export_lab(?)';
$resultat = $this->executerRequete($sql, array($numeroDemandeDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getdetaildemandedecompteexportsea($numeroDemandeDecompte)
{
$sql = 'call sp_p_demande_decompte_export_sea(?)';
$resultat = $this->executerRequete($sql, array($numeroDemandeDecompte));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
}