AliasNbPages();
$pdf->AddPage();
// function hautDePage($raisonSoc, $add, $villeAdm, $cp, $pays, $tel, $idCde, $dateCdeCrea, $descriptionMP, $civ, $nom, $prenom, $adresseCli, $adresseCli2, $codePostCli, $ville, $libPaysFact, $civLiv, $nomLiv, $prenomLiv, $adrLiv, $adrLiv2, $codePostLiv, $villeLiv, $libellepaysliv, $txRemiseCli, $adresseLivOui, $telCli, $libDateEmission) {
$pdf->hautDePage(mb_convert_encoding(ltrim($_SESSION['nomSiteAff']), 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($contactMsg[12], 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($contactMsg[13], 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($contactMsg[14], 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($contactMsg[6]. '' .$contactMsg[15], 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($contactMsg[7]. '' .$telAdmin, 'ISO-8859-1', 'UTF-8'), $idCde, $dateCdeCrea, mb_convert_encoding($descriptionMP, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($civ, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($nom, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($prenom, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($adresseCli, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($adresseCli2, 'ISO-8859-1', 'UTF-8'), $codePostCli, mb_convert_encoding($ville, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($libPaysFact, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($civLiv, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($nomLiv, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($prenomLiv, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($adrLiv, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($adrLiv2, 'ISO-8859-1', 'UTF-8'), $codePostLiv, mb_convert_encoding($villeLiv, 'ISO-8859-1', 'UTF-8'), mb_convert_encoding($libellepaysliv, 'ISO-8859-1', 'UTF-8'), $txRemiseCli, $adresseLivOui, mb_convert_encoding($contactMsg[7], 'ISO-8859-1', 'UTF-8') .$telAff, mb_convert_encoding($cdeMsg[93]) , 'ISO-8859-1', 'UTF-8');
// define("TVA",0.055);
$refresh='Oui';
// atester sans refresh, je pense qu'à l'époque le nom du fichier etait faux.
include ("../../_include/req/07-init.cdeMsgList.php");
include ("../../_include/req/04-init.catMsgList.php");
$refresh='N';
if (!isset($prixTotHT)) $prixTotHT='';
if (!isset($tvaMontant)) $tvaMontant='';
if (!isset($datasOpt)) $datasOpt='';
$fpCdeHt=formatNB($fpCdeHt,$lg);
$fpCdeTVA=formatNB($fpCdeTVA,$lg);
$fpCdeTTC=formatNB($fpCdeTTC,$lg);
// $prixTotTTC=formatNB($prixTotTTC,$lg);
$pdf->tableArticles($refPrdTab, $nomPrdTab, $prixUnitRemiseHtTab, $qteLigneTab, $nbLignes, $montantTvaLigneTab, $ttcLignesTab, $totalCde, $libelleModeLiveCde, $fpCdeHt, $fpCdeTVA, $fpCdeTTC, $catalogMsg[15], $catalogMsg[9], $cdeMsg[25], $cdeMsg[26], $cdeMsg[0], $cdeMsg[16], $cdeMsg[90], $cdeMsg[91], $cdeMsg[92], $cdeMsg[31], $libTraduit, $quantite, $prixTotTTC, $prixTotHT,$tvaMontant, $lg);
$fpdfFile=$_SESSION['nomSiteAff']. '_' .$_SESSION['nom_facture']. '_' .$idCde. '.pdf';
// Essai avec chemin absolu, mais a priori pas besoin fonctionne en relatif
// $test=str_replace("./","/",$includePathVar);
// $fpdfPath = "/datas/07Prod/wwwRoot/" .$_SESSION['siteDossier'].$test. "/facturesSite/" .$fpdfFile;
$fpdfPath = $includePathVar. "/facturesSite/" .$fpdfFile;
try {
$test=$pdf->Output($fpdfPath,'F');
}
catch (Exception $e) {
if (isset($debug[2]) && $debug[2] == '1' ) $debugMsg .= '
Erreur lors de la génération de la facture ' .$e;
}
if (isset($debug[2]) && $debug[2] == '1' ) $debugMsg .= '
Facture faite ? (test) =' .$test. ' | Chemin = ' .$fpdfPath;
$_SESSION['fpdfPath']=$fpdfPath;
$_SESSION['fpdfFile']=$fpdfFile;
?>