AliasNbPages();
$factPdf->AddPage();
$factPdf->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')
);
$refresh='Oui';
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='';
// $prixUnitRemiseHtTab=formatNB($prixUnitRemiseHtTab,$lg);
// $montantTvaLigneTab=formatNB($montantTvaLigneTab,$lg);
// $ttcLignesTab=formatNB($ttcLignesTab,$lg);
// $totalCde=formatNB($totalCde,$lg);
// $prixTotHT=formatNB($prixTotHT,$lg);
// $fpCdeTVA=formatNB($fpCdeTVA,$lg);
// $fpCdeTTC=formatNB($fpCdeTTC,$lg);
$fpCdeHt=formatNB($fpCdeHt,$lg);
$fpCdeTVA=formatNB($fpCdeTVA,$lg);
$fpCdeTTC=formatNB($fpCdeTTC,$lg);
// $prixTotTTC=formatNB($prixTotTTC,$lg);
$factPdf->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);
// I: send the file inline to the browser. The PDF viewer is used if available.
// D: send to the browser and force a file download with the name given by name.
// F: save to a local file with the name given by name (may include a path).
// S: return the document as a string.
// $pdf->Output($pdfPath,'F');
$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=$factPdf->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;
?>