From 80b26d633337e824eb6f503ee8c7fbf14e55d319 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 8 Feb 2006 09:45:18 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20envoi=20des=20d=E9tails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/telephonie/client/facture.php | 64 +++++++++++----------------- 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/htdocs/telephonie/client/facture.php b/htdocs/telephonie/client/facture.php index 1edd9e492fa..f4d5e289896 100644 --- a/htdocs/telephonie/client/facture.php +++ b/htdocs/telephonie/client/facture.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004 Éric Seigne +/* Copyright (C) 2002-2006 Rodolphe Quiedeville * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004 Éric Seigne * * 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 @@ -22,12 +22,11 @@ */ /** - \file htdocs/compta/facture.php - \ingroup facture - \brief Page de création d'une facture - \version $Revision$ + \file htdocs/telephonie/client/facture.php + \ingroup telephonie/facture + \brief Page de visualisation d'une facture + \version $Revision$ */ - require("./pre.inc.php"); $user->getrights('facture'); @@ -40,7 +39,8 @@ $warning_delay=31*24*60*60; // Delai affichage warning retard (si retard paiemen require_once DOL_DOCUMENT_ROOT."/facture.class.php"; require_once DOL_DOCUMENT_ROOT."/paiement.class.php"; require_once DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"; - +include_once DOL_DOCUMENT_ROOT."/contact.class.php"; +include_once DOL_DOCUMENT_ROOT."/actioncomm.class.php"; if ($_GET["socidp"]) { $socidp=$_GET["socidp"]; } if (isset($_GET["msg"])) { $msg=urldecode($_GET["msg"]); } @@ -52,10 +52,6 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } -// Nombre de ligne pour choix de produit/service prédéfinis -$NBLINES=4; - - /* * Action envoi de mail */ @@ -117,6 +113,21 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') $filename[1] = $_FILES['addedfile']['name']; $mimetype[1] = $_FILES['addedfile']['type']; + $dir = $conf->facture->dir_output . "/" . $fac->ref . "/"; + $handle=opendir($dir); + $ifi = 2; + while (($dfile = readdir($handle))!==false) + { + if (is_readable($dir.$dfile) && substr($dfile, -10) == 'detail.pdf') + { + $filepath[$ifi] = $conf->facture->dir_output . "/" . $fac->ref . "/" . $dfile; + $filename[$ifi] = $dfile; + $mimetype[$ifi] = "application/pdf"; + $ifi++; + } + } + + // Envoi de la facture $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc); @@ -125,8 +136,7 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') $msg='
'.$langs->trans("MailSuccessfulySent",$from,$sendto).'.
'; // Insertion action - include_once("../contact.class.php"); - include_once("../actioncomm.class.php"); + $actioncomm = new ActionComm($db); $actioncomm->type_id = $actiontypeid; $actioncomm->label = $actionmsg2; @@ -174,16 +184,10 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') } } - - - llxHeader('',$langs->trans("Bill"),'Facture'); $html = new Form($db); - - - if ($_GET["facid"] > 0) { if ($msg) print "$msg
"; @@ -464,8 +468,6 @@ if ($_GET["facid"] > 0) } - - $total = $total + ($objp->qty * $objp->price); $i++; } @@ -476,17 +478,13 @@ if ($_GET["facid"] > 0) { dolibarr_print_error($db); } - /* * Ajouter une ligne */ print "\n"; - - print "\n"; - /* * Boutons actions */ @@ -495,10 +493,6 @@ if ($_GET["facid"] > 0) { print "
\n"; - - - - // Envoyer if ($fac->statut == 1 && $user->rights->facture->envoyer) { @@ -506,14 +500,12 @@ if ($_GET["facid"] > 0) } // Envoyer une relance + /* if ($fac->statut == 1 && price($resteapayer) > 0 && $user->rights->facture->envoyer) { print " id&action=prerelance\">".$langs->trans("SendRemind")."\n"; } - - - - + */ print "
\n"; @@ -546,7 +538,6 @@ if ($_GET["facid"] > 0) print ''.strftime("%d %b %Y %H:%M:%S",filemtime($file)).''; print ''; - $dir = $conf->facture->dir_output . "/" . $facref . "/"; $handle=opendir($dir); @@ -736,15 +727,12 @@ if ($_GET["facid"] > 0) } } - - } else { /* Facture non trouvée */ print $langs->trans("ErrorBillNotFound",$_GET["facid"]); } - } $db->close();