From d6b8ce9a1d1236108b515bea5f936bf522d537e6 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 7 Sep 2005 10:11:56 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20factures=20d=E9taill=E9es=20externes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/facturation-emission.php | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/htdocs/telephonie/script/facturation-emission.php b/htdocs/telephonie/script/facturation-emission.php index b90a2a6aa4b..84f796666f8 100644 --- a/htdocs/telephonie/script/facturation-emission.php +++ b/htdocs/telephonie/script/facturation-emission.php @@ -522,10 +522,10 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact $error++; } + /* Facture détaillée standard */ if (!$error) { - $facok = 0; // Différents modèles de factures détaillées @@ -551,6 +551,34 @@ function facture_contrat($db, $user, $contrat_id, $factel_ids, $datetime, &$fact $error = 19; } } + + /* Factures détaillées autres */ + + if (!$error) + { + // Recherche des factures détaillées + // et copie dans le répertoire de la facture + // ID facture telephonique $factel_id + $fdefacid = substr('0000'.$factel_id, -4); + $fdedir = DOL_DATA_ROOT.'/telephonie/facture/'; + + $fdedir .= substr($fdefacid,0,1)."/"; + $fdedir .= substr($fdefacid,1,1)."/"; + $fdedir .= substr($fdefacid,2,1)."/"; + $fdedir .= substr($fdefacid,3,1)."/"; + + $fname = $fdedir . $fdefacid . "-detail.xls"; + + if (file_exists($fname)) + { + $fdefac = new Facture($db,"",$factel->fk_facture); + $fdefac->fetch($factel->fk_facture); + + $dest = FAC_OUTPUTDIR ."/".$fdefac->ref."/".$fdefac->ref."-".$fdefacid."-".$ligne->numero."-detail.xls"; + + copy($fname, $dest); + } + } } }