From 3c6cf4dd0ad3c66e07f5567361c1d4f30f0eefc4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jul 2011 17:02:00 +0000 Subject: [PATCH] Can create invoice from an intervention --- htdocs/compta/facture.php | 7 ++++--- htdocs/fichinter/class/fichinter.class.php | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4d2df43896a..75f62a178a3 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -26,7 +26,7 @@ * \file htdocs/compta/facture.php * \ingroup facture * \brief Page to create/see an invoice - * \version $Id: facture.php,v 1.844 2011/07/02 16:48:32 eldy Exp $ + * \version $Id: facture.php,v 1.845 2011/07/02 17:02:00 eldy Exp $ */ require('../main.inc.php'); @@ -713,6 +713,7 @@ if ($action == 'add' && $user->rights->facture->creer) if ($element == 'order') { $element = $subelement = 'commande'; } if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } if ($element == 'contract') { $element = $subelement = 'contrat'; } + if ($element == 'inter') { $element = $subelement = 'ficheinter'; } $object->origin = $_POST['origin']; $object->origin_id = $_POST['originid']; @@ -1441,7 +1442,7 @@ if ($action == 'create') print_fiche_titre($langs->trans('NewBill')); - if ($mesg) print $mesg; + dol_htmloutput_mesg($mesg); $soc = new Societe($db); if ($socid) $res=$soc->fetch($socid); @@ -3235,5 +3236,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/02 16:48:32 $ - $Revision: 1.844 $'); +llxFooter('$Date: 2011/07/02 17:02:00 $ - $Revision: 1.845 $'); ?> diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 87f9ca8fcc9..9da927aefb1 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -22,7 +22,7 @@ /** \file htdocs/fichinter/class/fichinter.class.php * \ingroup ficheinter * \brief Fichier de la classe des gestion des fiches interventions - * \version $Id: fichinter.class.php,v 1.18 2011/07/02 16:48:32 eldy Exp $ + * \version $Id: fichinter.class.php,v 1.19 2011/07/02 17:02:00 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); @@ -813,9 +813,9 @@ class Fichinter extends CommonObject } /** - * \brief Initialise la fiche intervention avec valeurs fictives aleatoire - * Sert a generer une fiche intervention pour l'aperu des modeles ou demo - * \return int <0 OK, >0 KO + * Initialise la fiche intervention avec valeurs fictives aleatoire + * Sert a generer une fiche intervention pour l'aperu des modeles ou demo + * @return int <0 OK, >0 KO */ function fetch_lines() { @@ -840,6 +840,7 @@ class Fichinter extends CommonObject $line->qty = round($objp->duree/3600,2); $line->date = $this->db->jdate($objp->date); $line->rang = $objp->rang; + $line->product_type = 1; $this->lines[$i] = $line;