From fba4111f4469aa7df5c4ae0313b60cddb4e468c2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 10 Apr 2011 18:44:58 +0000 Subject: [PATCH] Fix: do not update price with special product 9 --- htdocs/comm/propal/class/propal.class.php | 8 ++++---- htdocs/commande/class/commande.class.php | 6 +++--- htdocs/commande/fiche.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/compta/facture/class/facture.class.php | 11 ++++++----- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c5b4e6acee6..0e6ea992249 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -250,7 +250,7 @@ class Propal extends CommonObject $result=$propalligne->insert(); if ($result > 0) { - $result=$this->update_price(); + $result=$this->update_price(1); if ($result > 0) { $this->db->commit(); @@ -750,7 +750,7 @@ class Propal extends CommonObject if (! $error) { // Mise a jour infos denormalisees - $resql=$this->update_price(); + $resql=$this->update_price(1); if ($resql) { if (! $notrigger) @@ -1336,7 +1336,7 @@ class Propal extends CommonObject if ($this->db->query($sql) ) { $this->remise_percent = $remise; - $this->update_price(); + $this->update_price(1); return 1; } else @@ -1370,7 +1370,7 @@ class Propal extends CommonObject if ($this->db->query($sql) ) { $this->remise_absolue = $remise; - $this->update_price(); + $this->update_price(1); return 1; } else diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1e21670671e..24fee33b743 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1271,7 +1271,7 @@ class Commande extends CommonObject $result=$line->insert(); if ($result > 0) { - $result=$this->update_price(); + $result=$this->update_price(1); if ($result > 0) { $this->db->commit(); @@ -1610,7 +1610,7 @@ class Commande extends CommonObject if ($this->db->query($sql)) { $this->remise_percent = $remise; - $this->update_price(); + $this->update_price(1); return 1; } else @@ -1645,7 +1645,7 @@ class Commande extends CommonObject if ($this->db->query($sql)) { $this->remise_absolue = $remise; - $this->update_price(); + $this->update_price(1); return 1; } else diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 911fe4b46f8..9b007d28c4b 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1298,7 +1298,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) // Calcul contrat->price (HT), contrat->total (TTC), contrat->tva $objectsrc->remise_absolue=$remise_absolue; $objectsrc->remise_percent=$remise_percent; - $objectsrc->update_price(); + $objectsrc->update_price(1); } print "\n"; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index ddd9feb6142..9a1d340c65e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1714,7 +1714,7 @@ if ($_GET['action'] == 'create') // Calcul contrat->price (HT), contrat->total (TTC), contrat->tva $objectsrc->remise_absolue=$remise_absolue; $objectsrc->remise_percent=$remise_percent; - $objectsrc->update_price(); + $objectsrc->update_price(1); } print "\n"; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5fcea2f456e..d807642495d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1022,7 +1022,7 @@ class Facture extends CommonObject $lineid=$facligne->insert(); if ($lineid > 0) { - $result=$this->update_price(); + $result=$this->update_price(1); if ($result > 0) { // Cr�e lien entre remise et ligne de facture @@ -1499,7 +1499,7 @@ class Facture extends CommonObject if ($num) { - $this->update_price(); + $this->update_price(1); // Validate $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; @@ -2037,7 +2037,7 @@ class Facture extends CommonObject if ($this->db->query($sql)) { $this->remise_percent = $remise; - $this->update_price($this->id); + $this->update_price(1); return 1; } else @@ -2073,7 +2073,7 @@ class Facture extends CommonObject if ($this->db->query($sql)) { $this->remise_absolue = $remise; - $this->update_price($this->id); + $this->update_price(1); return 1; } else @@ -3388,7 +3388,6 @@ class FactureLigne // Check parameters if ($this->product_type < 0) return -1; - $this->db->begin(); // Mise a jour ligne en base @@ -3500,6 +3499,8 @@ class FactureLigne $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; $sql.= ",total_ttc=".price2num($this->total_ttc).""; $sql.= " WHERE rowid = ".$this->rowid; + + dol_syslog("PropaleLigne::update_total sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql)