From 0fba80cc6f6cdbbe4d06979ee7721b54ced5f6e8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 27 Jan 2010 13:36:46 +0000 Subject: [PATCH] Fix: product_type is lost --- htdocs/commande/commande.class.php | 1 + htdocs/compta/facture.php | 14 ++++++++++---- htdocs/propal.class.php | 9 +++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 97b738d9b34..098a4a9fa86 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -131,6 +131,7 @@ class Commande extends CommonObject $CommLigne->remise_percent = $propal->lignes[$i]->remise_percent; $CommLigne->fk_product = $propal->lignes[$i]->fk_product; $CommLigne->info_bits = $propal->lignes[$i]->info_bits; + $CommLigne->product_type = $propal->lignes[$i]->product_type; $this->lines[$i] = $CommLigne; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index f473b3f94b4..a5e368291e1 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3,7 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * * This program is free software; you can redistribute it and/or modify @@ -698,7 +698,10 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer) $date_end, 0, $prop->lignes[$i]->info_bits, - $prop->lignes[$i]->fk_remise_except + $prop->lignes[$i]->fk_remise_except, + 'HT', + 0, + $prop->lignes[$i]->product_type ); if ($result < 0) @@ -753,7 +756,10 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer) $date_end, 0, $lines[$i]->info_bits, - $lines[$i]->fk_remise_except + $lines[$i]->fk_remise_except, + 'HT', + 0, + $lines[$i]->product_type ); if ($result < 0) @@ -1892,7 +1898,7 @@ if ($_GET['action'] == 'create') { $title=$langs->trans('Products'); - $sql = 'SELECT pt.rowid, pt.subprice, pt.tva_tx, pt.qty, pt.fk_remise_except, pt.remise_percent,'; + $sql = 'SELECT pt.rowid, pt.subprice, pt.tva_tx, pt.qty, pt.fk_remise_except, pt.remise_percent, pt.product_type,'; $sql.= ' pt.description, pt.info_bits, pt.date_start as date_debut_prevue, pt.date_end as date_fin_prevue,'; $sql.= ' p.label as product, p.ref, p.rowid as prodid'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as pt'; diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 98eaa7d3ad5..33e8b4f1b58 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -870,7 +870,7 @@ class Propal extends CommonObject * Lignes propales liees a un produit ou non */ $sql = "SELECT d.description, d.price, d.tva_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,"; - $sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_ttc, d.marge_tx, d.marque_tx, d.special_code, d.rang,"; + $sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_ttc, d.marge_tx, d.marque_tx, d.special_code, d.rang, d.product_type,"; $sql.= " p.ref, p.label, p.description as product_desc"; $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as d"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid"; @@ -889,6 +889,7 @@ class Propal extends CommonObject $ligne = new PropaleLigne($this->db); + $ligne->product_type = $objp->product_type; $ligne->desc = $objp->description; // Description ligne $ligne->qty = $objp->qty; $ligne->tva_tx = $objp->tva_tx; @@ -1121,7 +1122,7 @@ class Propal extends CommonObject } /** - * \brief D�finit une remise globale relative sur la proposition + * \brief Definit une remise globale relative sur la proposition * \param user Objet utilisateur qui modifie * \param remise Montant remise * \return int <0 si ko, >0 si ok @@ -1154,7 +1155,7 @@ class Propal extends CommonObject /** - * \brief D�finit une remise globale absolue sur la proposition + * \brief Definit une remise globale absolue sur la proposition * \param user Objet utilisateur qui modifie * \param remise Montant remise * \return int <0 si ko, >0 si ok @@ -2149,7 +2150,7 @@ class PropaleLigne } /** - * \brief Recup�re l'objet ligne de propal + * \brief Recupere l'objet ligne de propal * \param rowid id de la ligne de propal */ function fetch($rowid)