acte = new Detailtarifacte(); } public function index() { $codeActe = $this->requete->getParametreFormulaire("codeActe"); $tm = ($_SESSION['p_tm_TP']>"0") ? $_SESSION['p_tm_TP'] : $_SESSION['p_tm_C']; $referencementpolice = $this->acte->getReferencementPolice($_SESSION['p_idPolice_C']); $avecReferencement = $referencementpolice['avecReferencement']; $tauxAvecReferencement = $referencementpolice['tauxAvecReferencement']; $tauxSansReferencement = $referencementpolice['tauxSansReferencement']; $dateFinDelaiCarenceActe = $this->acte->getDateFinDelaiCarenceActe($codeActe); //var_dump($dateFinDelaiCarenceActe); //die(); $situation = $this->acte->getSituationActeBeneficiaire($codeActe); $plafondActe = $this->acte->getplafondacte($codeActe); $prixActeTarifPolice = $this->acte->getprixactetarifpolice($codeActe); $prixActeTarifPrestataire = $this->acte->getprixactetarifprestataire($codeActe); $prixActeTarifCollege = $this->acte->getprixactetarifcollege($codeActe); $prixActeTarifPolicePrestataire = $this->acte->getprixactetarifpoliceprestataire($codeActe); if (($plafondActe > "0") && ($plafondActe !="9999999999")) { if ($prixActeTarifPolicePrestataire > "0") { $prixActe = min($plafondActe,$prixActeTarifPolicePrestataire); }else{ if ($prixActeTarifPolice > "0") { if ($prixActeTarifPrestataire > "0") { $prixActe = min($plafondActe,$prixActeTarifPrestataire); }else{ $prixActe = min($plafondActe,$prixActeTarifCollege); } }else{ if ($prixActeTarifPrestataire > "0") { $prixActe = min($plafondActe,$prixActeTarifPrestataire); }else{ if($prixActeTarifCollege > "0"){ $prixActe = min($plafondActe,$prixActeTarifCollege); }else{ $prixActe = $plafondActe; } } } } }else{ if ($prixActeTarifPolicePrestataire > "0") { $prixActe = $prixActeTarifPolicePrestataire; }else{ if ($prixActeTarifPolice > "0") { if ($prixActeTarifPrestataire > "0") { $prixActe = $prixActeTarifPrestataire; }else{ $prixActe = $prixActeTarifCollege; } }else{ if ($prixActeTarifPrestataire > "0") { $prixActe = $prixActeTarifPrestataire; }else{ $prixActe = $prixActeTarifCollege; } } } } if($prixActeTarifPolice > "0"){ $prixBase = $prixActeTarifPolice; if($prixActeTarifCollege > "0" && $prixActeTarifPrestataire > "0"){ $depassement = min($prixActeTarifCollege,$prixActeTarifPrestataire)-$prixBase; }else{ $depassement = $prixActe-$prixBase; } $_SESSION['prixBase'] = $prixBase; $_SESSION['depassement'] = $depassement; }else{ $prixBase = $prixActe; $depassement = 0; $_SESSION['prixBase'] = 0; $_SESSION['depassement'] = 0; } //$montantTm = round(($prixBase*$tm)/100); //$aRembourser = $prixBase-$montantTm; //var_dump($dateFinDelaiCarenceActe); //die(); if ($situation['soldeConsommation'] <= "0" || $dateFinDelaiCarenceActe!="1970-01-01") { if($prixBase > $situation['soldeConsommation']) { $montantTm = $prixBase-$situation['soldeConsommation']; $aRembourser = $situation['soldeConsommation']; } else { $montantTm = $prixBase; $aRembourser = "0"; } } else { if($situation['nbreTransaction'] > "0") { if($situation['soldeNbreTransaction'] <= "0") { if($prixBase > $situation['soldeConsommation']) { $montantTm = $prixBase-$situation['soldeConsommation']; $aRembourser = $situation['soldeConsommation']; } else { $montantTm = $prixBase; $aRembourser = "0"; } }else { $montantTm = round(($prixBase*$tm)/100); $aRembourser = $prixBase-$montantTm; } } else { $montantTm = round(($prixBase*$tm)/100); $aRembourser = $prixBase-$montantTm; } } $delaiCarenceActe = $this->acte->getdelaicarenceacte($codeActe) ; $this->genererVueAjax(array('prixActe' => $prixActe, 'montantTm' => $montantTm, 'aRembourser' => $aRembourser, 'delaiCarenceActe' => $delaiCarenceActe, 'prixBase' => $prixBase, 'depassement' => $depassement, 'situation' => $situation, 'dateFinDelaiCarenceActe' => $dateFinDelaiCarenceActe)); } }