Fix: do not update price with special product 9

This commit is contained in:
Regis Houssin 2011-04-10 18:44:58 +00:00
parent a3eebde120
commit fba4111f44
5 changed files with 15 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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<!-- ".$classname." info -->";

View File

@ -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<!-- ".$classname." info -->";

View File

@ -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<43>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)