<?php
/****************************************************************************************
 * SMI (Services Maintenance Interventions) est une gestion libre de maintenance et de SAV
 *
 * Version 1.0.0
 *
 * Copyright (C) 2006-2014  Sylvain FATOME
 * This program is free software; you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation;
 * either version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program
 * (in the directory docs);
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 *
 * Contact : galawa@free.fr
 *
 * Web : http://smi.no-ip.org
 ****************************************************************************************/


// Vérification des tentatives de hack
$pos = strpos($_SERVER['PHP_SELF'], "inc.php");
if ($pos === FALSE)
    $ok_inc = TRUE;
else
    $ok_inc = FALSE;
if ($ok_inc == FALSE) header("Location: ../index.php");

if ($nbartint <> 0) // S'il y a des articles facturés, on les affiche
{
    if ($aff_fait == TRUE) {
        $totalint = 0;

        // Type de facturation
        $factTTC = TRUE;
        if (($cli_modfact == "0") OR ($cli_modfact == "2"))
            $factTTC = FALSE;

        $pdf->SetFont('', 'B', 8);
        $pdf->SetFillColor(0);
        $pdf->SetTextColor(255);

        $pdf->Cell(30, 5, _("Code"), 1, 0, 'C', 1);
        $pdf->Cell(85, 5, _("Désignation + NS"), 1, 0, 'C', 1);
        if ($factTTC == TRUE)
            $txt = _("PU TTC");
        else
            $txt = _("PU HT");
        $pdf->Cell(20, 5, $txt, 1, 0, 'C', 1);
        $pdf->Cell(15, 5, _("Qté"), 1, 0, 'C', 1);
        if ($factTTC == TRUE)
            $txt = _("Total TTC");
        else
            $txt = _("Total HT");
        $pdf->Cell(25, 5, $txt, 1, 0, 'C', 1);
        $pdf->Cell(15, 5, _("TVA"), 1, 1, 'C', 1);

        $pdf->SetFillColor(255);
        $pdf->SetTextColor(0);

        $db = open_database(DBUSER, DBPASS, DBNAME, DBHOST);

        // Lignes des articles sur historiques
        $rech = "SELECT * FROM `" . TBPDTIH . "` WHERE pdtih_codeint='" . $db->escape($int_code) . "' ORDER BY pdtih_codeint,pdtih_id";
        $rows = $db->get_results($rech, ARRAY_A);
        $i = 0;
        $idinth = 0;
        $entete_inth = FALSE;

        if (($rows) AND (count($rows) > 0)) {
            foreach ($rows as $row) {
                $row = encode_str($row);
                extract($row);

                if ($idinth <> $pdtih_idhisto) {
                    // Titre
                    // On récupère les éléments pour fabriquer le titre
                    $titre_detail = _("Détail par intervention");
                    $row2 = lit_enr_inth($pdtih_idhisto, FALSE);
                    if (is_array($row2)) {
                        $row2 = encode_str($row2);
                        extract($row2);
                        // récupération lieu
                        $lieu_desc = '$inth_codelieu';
                        $rech3 = "SELECT lieu_desc FROM `" . TBLIEU . "` WHERE `lieu_code` = '" . $db->escape($inth_codelieu) . "'";
                        $row3 = $db->get_row($rech3, ARRAY_A);
                        if ($row3) {
                            $row3 = encode_str($row3);
                            extract($row3);
                        }
                        $titre_detail = _("Intervention du") . " " . datetolocal($inth_date) . " " . _("de") . " " . substr($inth_heurea, 0, 5) . " " . _("à") . " " . substr($inth_heured, 0, 5) . " (" . $lieu_desc . ")";

                        $entete_inth = TRUE;
                    }

                    $pdf->SetFillColor(255);
                    $pdf->SetFont('', 'BI', 8);
                    $pdf->Cell(190, 5, $titre_detail, 'LR', 1, 'L', 1);

                    $entete_inth = TRUE;
                }

                // Couleurs alternées
                if ($i % 2 == 0)
                    $pdf->SetFillColor(200);
                else
                    $pdf->SetFillColor(255);

                $pdf->SetFont('', '', 8);

                // Code
                $pdf->Cell(30, 5, $row["pdtih_codepdt"], 'LR', 0, 'L', 1);

                if ($row["pdtih_frompdt"] <> "") // C'est une taxe
                    $rech2 = "SELECT tpf_desc,tpf_typmt FROM `" . TBTPF . "` WHERE tpf_code='" . $db->escape($row["pdtih_codepdt"]) . "'";
                else // C'est un produit
                    $rech2 = "SELECT pdt_des,pdt_codepdtu FROM `" . TBPDT . "` WHERE pdt_code='" . $db->escape($row["pdtih_codepdt"]) . "'";
                $row2 = $db->get_row($rech2, ARRAY_A);
                if ($row2) {
                    $row2 = encode_str($row2);
                    extract($row2);
                }

                // Désignation
                if ($row["pdtih_frompdt"] <> "")
                    $txt = $tpf_desc;
                else {
                    $txt = $pdt_des;
                    $desart = $pdt_des;
                }
                $pdf->Cell(85, 5, $txt, 'LR', 0, 'L', 1);

                $pv_det_art = $pdf->GetY();

                // Prix
                // On récupère la TVA du produit
                $rech2 = "SELECT tva_tx FROM `" . TBTVA . "` WHERE tva_code='" . $db->escape($row["pdtih_codetva"]) . "'";
                $row2 = $db->get_row($rech2, ARRAY_A);

                if ($row2) {
                    $row2 = encode_str($row2);
                    extract($row2);
                }

                $txtva = $tva_tx / 100;

                if ($row["pdtih_facture"] == 0)
                    $row["pdtih_puttc"] = 0;

                $puht = round($row["pdtih_puttc"] / (1 + $txtva), 2);

                if ($factTTC == TRUE)
                    $txt = full_num_format($row["pdtih_puttc"], '', '', TRUE, '', FALSE, TRUE);
                else
                    $txt = full_num_format($puht, '', '', TRUE, '', FALSE, TRUE);

                $pdf->Cell(20, 5, $txt, 'LR', 0, 'R', 1);


                // Quantité
                $rech2 = "SELECT pdtu_abr FROM `" . TBPDTU . "` WHERE pdtu_code='" . $db->escape($row["pdt_codepdtu"]) . "'";
                $row2 = $db->get_row($rech2, ARRAY_A);

                if ($row2) {
                    $row2 = encode_str($row2);
                    extract($row2);
                }

                if ($row["pdtih_frompdt"] <> "")
                    $txt = $row["pdtih_qte"];
                else
                    $txt = $row["pdtih_qte"] . " " . $pdtu_abr;

                $pdf->Cell(15, 5, $txt, 'LR', 0, 'R', 1);

                // Total ligne
                if ($factTTC == TRUE) {
                    $totalligneTTC = round($row["pdtih_puttc"] * $row["pdtih_qte"], 2);
                    $totalligneHT = round($totalligneTTC / (1 + $txtva), 2);
                    $txt = full_num_format($totalligneTTC, '', '', TRUE, '', FALSE, TRUE);
                } else {
                    $totalligneHT = round($puht * $row["pdtih_qte"], 2);
                    $totalligneTTC = round($totalligneHT * (1 + $txtva), 2);
                    $txt = full_num_format($totalligneHT, '', '', TRUE, '', FALSE, TRUE);
                }
                $pdf->Cell(25, 5, $txt, 'LR', 0, 'R', 1);

                // Taux TVA
                $pdf->Cell(15, 5, full_num_format($tva_tx, '', '', FALSE, '', FALSE, TRUE) . "%", 'LR', 1, 'R', 1);


                // Lignes complémentaires
                if ($row["pdtih_frompdt"] <> "") // Si c'est une taxe, sur quel produit ?
                {
                    $txt = " " . _("Sur") . " " . $desart;

                    $pdf->SetFont('', 'I', 7);

                    $ligne_cesure = cesuretxt_tab($txt, 100);
                    foreach ($ligne_cesure as $index_ligne => $ligne) {
                        $pdf->Cell(30, 3, "", 'LR', 0, 'L', 1);
                        $pdf->Cell(85, 3, $txt, 'LR', 0, 'L', 1);
                        $pdf->Cell(20, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(25, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 1, 'R', 1);
                    }
                }

                if ($row["pdtih_ns"] <> "") // Numéro de série
                {
                    $pdf->SetFont('', 'I', 7);

                    $ligne_cesure = cesuretxt_tab($row["pdtih_ns"], 100);
                    foreach ($ligne_cesure as $index_ligne => $ligne) {
                        $pdf->Cell(30, 3, "", 'LR', 0, 'L', 1);
                        $pdf->Cell(85, 3, ">> N/S : " . $ligne, 'LR', 0, 'L', 1);
                        $pdf->Cell(20, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(25, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 1, 'R', 1);
                    }
                }


                if ($row["pdtih_texte"] <> "") // Commentaire
                {
                    $ligne_cesure = cesuretxt_tab($row["pdtih_texte"], 100);
                    foreach ($ligne_cesure as $index_ligne => $ligne) {
                        $pdf->Cell(30, 3, "", 'LR', 0, 'L', 1);
                        $pdf->Cell(85, 3, $ligne, 'LR', 0, 'L', 1);
                        $pdf->Cell(20, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(25, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 1, 'R', 1);
                    }
                }

                $totalintHT = $totalintHT + $totalligneHT;
                $totalintTTC = $totalintTTC + $totalligneTTC;
                $totalintTVA = $totalintTVA + $totalligneTVA;

                if ($pdtih_frompdt == "")
                    $totalTTCpdt = $totalTTCpdt + $totalligneTTC;

                $idinth = $pdtih_idhisto;

                $i++;
            }
        }

        // Produits complémentaires
        $rech = "SELECT * FROM `" . TBPDTI . "` WHERE pdti_codeint='" . $int_code . "' ORDER BY pdti_id";
        $rows = $db->get_results($rech, ARRAY_A);
        $i = 0;

        if (($rows) AND (count($rows) > 0)) {
            // On a déjà affiché des articles sur historique interventions : on crée un séparateur
            if ($entete_inth == TRUE) {
                // On récupère les éléments pour fabriquer le titre
                $titre_detail = _("Articles complémentaires");

                $pdf->SetFillColor(255);
                $pdf->SetFont('', 'BI', 8);
                $pdf->Cell(190, 5, $titre_detail, 'LR', 1, 'L', 1);
            }

            $pdf->SetFont('', '', 8);

            foreach ($rows as $row) {
                $row = encode_str($row);
                // On a déjà affiché des articles sur historique interventions : on crée un séparateur
                if ($entete_inth == TRUE) {
                    // Titre
                    $str_html .= "<tr style=\"color:white; font-style: italic; font-weight: bold;font-size: 9px; background-color: brown;\">";

                    $str_html .= "<td class=\"tdlst\" valign=\"top\"";
                    if ($td == "edit")
                        $str_html .= " colspan=\"7\"";
                    else
                        $str_html .= " colspan=\"6\"";
                    $str_html .= ">";

                    // On récupère les éléments pour fabriquer le titre
                    $titre_detail = _("Articles complémentaires");
                    $str_html .= $titre_detail;
                    $str_html .= "</td>";
                    $str_html .= "</tr>";
                }

                // Couleurs alternées
                if ($i % 2 == 0)
                    $pdf->SetFillColor(200);
                else
                    $pdf->SetFillColor(255);

                $pdf->SetFont('', '', 8);

                // Code
                $pdf->Cell(30, 5, $row["pdti_codepdt"], 'LR', 0, 'L', 1);

                if (trim($row["pdti_frompdt"]) <> "") // C'est une taxe
                    $rech2 = "SELECT tpf_desc,tpf_typmt FROM `" . TBTPF . "` WHERE `tpf_code`= '" . $row["pdti_codepdt"] . "'";
                else // C'est un produit
                    $rech2 = "SELECT pdt_des,pdt_codepdtu FROM `" . TBPDT . "` WHERE `pdt_code` = '" . $row["pdti_codepdt"] . "'";
                $row2 = $db->get_row($rech2, ARRAY_A);
                if ($row2) {
                    $row2 = encode_str($row2);
                    extract($row2);
                }

                // Désignation
                if (trim($row["pdti_frompdt"]) <> "")
                    $txt = $tpf_desc;
                else {
                    $txt = $pdt_des;
                    $desart = $pdt_des;
                }
                $pdf->Cell(85, 5, $txt, 'LR', 0, 'L', 1);


                $rech2 = "SELECT pdtu_abr FROM `" . TBPDTU . "` WHERE pdtu_code = '" . $row["pdt_codepdtu"] . "'";
                $row2 = $db->get_row($rech2, ARRAY_A);
                if ($row2) {
                    $row2 = encode_str($row2);
                    extract($row2);
                }

                $pv_det_art = $pdf->GetY();

                // Prix
                // On récupère la TVA du produit
                $rech2 = "SELECT tva_tx FROM `" . TBTVA . "` WHERE tva_code='" . $row["pdti_codetva"] . "'";
                $row2 = $db->get_row($rech2, ARRAY_A);

                if ($row2) {
                    $row2 = encode_str($row2);
                    extract($row2);
                }

                $txtva = $tva_tx / 100;

                if ($row["pdti_facture"] == 0)
                    $row["pdti_puttc"] = 0;

                $puht = round($row["pdti_puttc"] / (1 + $txtva), 2);

                if ($factTTC == TRUE)
                    $txt = full_num_format($row["pdti_puttc"], '', '', TRUE, '', FALSE, TRUE);
                else
                    $txt = full_num_format($puht, '', '', TRUE, '', FALSE, TRUE);

                $pdf->Cell(20, 5, $txt, 'LR', 0, 'R', 1);


                // Quantité
                $rech2 = "SELECT pdtu_abr FROM `" . TBPDTU . "` WHERE pdtu_code='" . $row["pdt_codepdtu"] . "'";
                $row2 = $db->get_row($rech2, ARRAY_A);

                if ($row2) {
                    $row2 = encode_str($row2);
                    extract($row2);
                }

                if ($row["pdti_frompdt"] <> "")
                    $txt = $row["pdti_qte"];
                else
                    $txt = $row["pdti_qte"] . " " . $pdtu_abr;

                $pdf->Cell(15, 5, $txt, 'LR', 0, 'R', 1);


                // Total ligne
                if ($factTTC == TRUE) {
                    $totalligneTTC = round($row["pdti_puttc"] * $row["pdti_qte"], 2);
                    $totalligneHT = round($totalligneTTC / (1 + $txtva), 2);
                    $txt = full_num_format($totalligneTTC, '', '', TRUE, '', FALSE, TRUE);
                } else {
                    $totalligneHT = round($puht * $row["pdti_qte"], 2);
                    $totalligneTTC = round($totalligneHT * (1 + $txtva), 2);
                    $txt = full_num_format($totalligneHT, '', '', TRUE, '', FALSE, TRUE);
                }
                $pdf->Cell(25, 5, $txt, 'LR', 0, 'R', 1);

                // Taux TVA
                $pdf->Cell(15, 5, full_num_format($tva_tx, '', '', FALSE, '', FALSE, TRUE) . "%", 'LR', 1, 'R', 1);


                // Lignes complémentaires

                if ($row["pdti_frompdt"] <> "") // Si c'est une taxe, sur quel produit ?
                {
                    $txt = " " . _("Sur") . " " . $desart;

                    $pdf->SetFont('', 'I', 7);

                    $ligne_cesure = cesuretxt_tab($txt, 100);
                    foreach ($ligne_cesure as $index_ligne => $ligne) {
                        $pdf->Cell(30, 3, "", 'LR', 0, 'L', 1);
                        $pdf->Cell(85, 3, $txt, 'LR', 0, 'L', 1);
                        $pdf->Cell(20, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(25, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 1, 'R', 1);
                    }
                }

                if ($row["pdti_ns"] <> "") // Numéro de série
                {
                    $pdf->SetFont('', 'I', 7);

                    $ligne_cesure = cesuretxt_tab($row["pdti_ns"], 100);
                    foreach ($ligne_cesure as $index_ligne => $ligne) {
                        $pdf->Cell(30, 3, "", 'LR', 0, 'L', 1);
                        $pdf->Cell(85, 3, ">> " . _("N/S") . " : " . $ligne, 'LR', 0, 'L', 1);
                        $pdf->Cell(20, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(25, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 1, 'R', 1);
                    }
                }

                if ($row["pdti_texte"] <> "") // Commentaire
                {
                    $ligne_cesure = cesuretxt_tab($row["pdti_texte"], 100);
                    foreach ($ligne_cesure as $index_ligne => $ligne) {
                        $pdf->Cell(30, 3, "", 'LR', 0, 'L', 1);
                        $pdf->Cell(85, 3, $ligne, 'LR', 0, 'L', 1);
                        $pdf->Cell(20, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(25, 3, "", 'LR', 0, 'R', 1);
                        $pdf->Cell(15, 3, "", 'LR', 1, 'R', 1);
                    }
                }

                $totalintHT = $totalintHT + $totalligneHT;
                $totalintTTC = $totalintTTC + $totalligneTTC;

                $i++;
            }
        }

        $db->disconnect();

        // Si intervention non close, il faut éventuellement préparer des zones complémentaires
        if ($closed == FALSE) {
            // Si sur site (donc à effectuer), préparation d'une grille complémentaire de saisie articles & prestations
            if ($int_codelieu == "SITE") {
                while ($i <= 3) {

                    // Couleurs alternées
                    if ($i % 2 == 0)
                        $pdf->SetFillColor(200);
                    else
                        $pdf->SetFillColor(255);

                    $pdf->Cell(30, 4, '', 'LR', 0, 'L', 1);
                    $pdf->Cell(85, 4, '', 'LR', 0, 'L', 1);
                    $pdf->Cell(20, 4, full_num_format('', '', '', TRUE, '', TRUE, TRUE), 'LR', 0, 'R', 1);
                    $pdf->Cell(15, 4, '', 'LR', 0, 'R', 1);
                    $pdf->Cell(25, 4, full_num_format('', '', '', TRUE, '', TRUE, TRUE), 'LR', 0, 'R', 1);
                    $pdf->Cell(15, 4, '', 1, 1, 'R', 1);

                    $i++;
                }
            }
        }

        $pdf->SetFillColor(255);
        $pdf->SetFont('', '', 8);
        $pdf->Cell(150, 5, _("Total HT") . " :", 1, 0, 'R');
        $pdf->Cell(25, 5, full_num_format($totalintHT, '', '', TRUE, '', TRUE, TRUE), 1, 0, 'R');
        $pdf->Cell(15, 5, "", 'TL', 1, 'R', 1);
        $pdf->Cell(150, 5, _("Total TVA") . " :", 1, 0, 'R');
        $totalTVA = $totalintTTC - $totalintHT;
        $pdf->Cell(25, 5, full_num_format($totalTVA, '', '', TRUE, '', TRUE, TRUE), 1, 1, 'R');
        $pdf->Cell(150, 5, _("Total TTC") . " :", 1, 0, 'R');
        $pdf->Cell(25, 5, full_num_format($totalintTTC, '', '', TRUE, '', TRUE, TRUE), 1, 1, 'R');
        $pdf->Cell(150, 5, _("Acompte") . " :", 1, 0, 'R');
        if ($int_acpte <> 0)
            $pdf->Cell(25, 5, "-" . full_num_format($int_acpte, '', '', TRUE, '', TRUE, TRUE), 1, 1, 'R');
        else
            $pdf->Cell(25, 5, '-', 1, 1, 'R');
        $pdf->SetFont('', 'B', 8);
        $pdf->Cell(150, 5, _("Net à payer") . " :", 1, 0, 'R');
        $pdf->Cell(25, 5, full_num_format($totalintTTC - $int_acpte, '', '', TRUE, '', TRUE, TRUE), 1, 1, 'R');

        $pdf->ln(1);

        $pdf->SetFont('', 'B', 10);
        $pdf->Cell(60, 5, _("Pièces hors service") . " :", 0, 0, 'R');

        $pdf->SetFont('', '', 10);
        if ($int_pces == 0)
            $pdf->Cell(60, 5, _("Sans objet"), 0, 1, 'L');
        if ($int_pces == 1)
            $pdf->Cell(60, 5, _("Rendues"), 0, 1, 'L');
        if ($int_pces == 2)
            $pdf->Cell(60, 5, _("Conservées"), 0, 1, 'L');
    }
} else // Il n'y a pas d'articles
{
    // Si pas clot, on contrôle pour la grille d'articles et de prestations
    if ($closed == FALSE) {
        $pdf->SetFont('', 'B', 8);
        $pdf->SetFillColor(0);
        $pdf->SetTextColor(255);

        $pdf->Cell(30, 5, _("Code"), 1, 0, 'C', 1);
        $pdf->Cell(85, 5, _("Désignation + NS"), 1, 0, 'C', 1);
        $pdf->Cell(30, 5, _("PU TTC"), 1, 0, 'C', 1);
        $pdf->Cell(20, 5, _("Qté"), 1, 0, 'C', 1);
        $pdf->Cell(25, 5, _("Total"), 1, 1, 'C', 1);

        $pdf->SetFillColor(255);
        $pdf->SetTextColor(0);

        $i = 0;

        while ($i <= 3) {

            // Couleurs alternées
            if ($i % 2 == 0)
                $pdf->SetFillColor(200);
            else
                $pdf->SetFillColor(255);

            $pdf->Cell(30, 4, '', 'LR', 0, 'L', 1);
            $pdf->Cell(85, 4, '', 'LR', 0, 'L', 1);
            $pdf->Cell(30, 4, full_num_format('', '', '', TRUE, '', TRUE, TRUE), 'LR', 0, 'R', 1);
            $pdf->Cell(20, 4, '', 'LR', 0, 'R', 1);
            $pdf->Cell(25, 4, full_num_format('', '', '', TRUE, '', TRUE, TRUE), 'LR', 1, 'R', 1);

            $i++;
        }

        $pdf->SetFillColor(255);
        $pdf->SetFont('', 'B', 8);
        $pdf->Cell(165, 5, _("Total TTC") . " :", 1, 0, 'R');
        $pdf->Cell(25, 5, full_num_format('', '', '', TRUE, '', TRUE, TRUE), 1, 1, 'R');
        if ($int_acpte <> 0) {
            $pdf->Cell(165, 5, _("Acompte") . " :", 1, 0, 'R');
            $pdf->Cell(25, 5, "-" . full_num_format($int_acpte, '', '', TRUE, '', TRUE, TRUE), 1, 1, 'R');
            $pdf->Cell(165, 5, _("Net à payer") . " :", 1, 0, 'R');
            $pdf->Cell(25, 5, full_num_format('', '', '', TRUE, '', TRUE, TRUE), 1, 1, 'R');
        }

        $pdf->ln(1);

        $pdf->SetFont('', 'B', 10);
        $pdf->Cell(60, 5, _("Pièces hors service") . " :", 0, 0, 'R');

        $pdf->SetFont('', '', 10);
        $pdf->Cell(60, 5, _("Sans objet / Rendues / Conservées (Rayer inutile)"), 0, 1, 'L');
    } else {
        if ($int_durees <> 0) // On affiche ce texte s'il y a eu un traitement effectué
        {
            $pdf->SetFont('', 'BI', 8);
            $pdf->Cell(30, 5, _("Aucun article ou prestation"), 0, 1, 'L');
        }
    }
}
?>
