Code is shorter
This commit is contained in:
parent
48f28a1ab8
commit
8ec6346bf3
@ -1049,28 +1049,13 @@ class CommonObject
|
|||||||
|
|
||||||
// Now update field total_ht, total_ttc and tva
|
// Now update field total_ht, total_ttc and tva
|
||||||
$fieldht='total_ht';
|
$fieldht='total_ht';
|
||||||
|
|
||||||
$fieldtva='tva';
|
$fieldtva='tva';
|
||||||
|
|
||||||
$fieldlocaltax1='localtax1';
|
$fieldlocaltax1='localtax1';
|
||||||
$fieldlocaltax2='localtax2';
|
$fieldlocaltax2='localtax2';
|
||||||
|
|
||||||
$fieldttc='total_ttc';
|
$fieldttc='total_ttc';
|
||||||
|
if ($this->element == 'facture' || $this->element == 'facturerec') $fieldht='total';
|
||||||
if ($this->element == 'facture' || $this->element == 'facturerec')
|
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='total_tva';
|
||||||
{
|
if ($this->element == 'propal') $fieldttc='total';
|
||||||
$fieldht='total';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier')
|
|
||||||
{
|
|
||||||
$fieldtva='total_tva';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->element == 'propal')
|
|
||||||
{
|
|
||||||
$fieldttc='total';
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET';
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET';
|
||||||
$sql .= " ".$fieldht."='".price2num($this->total_ht)."',";
|
$sql .= " ".$fieldht."='".price2num($this->total_ht)."',";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user