Try fix rounding
This commit is contained in:
parent
8f7f104806
commit
90dbb93388
@ -3716,6 +3716,13 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Clean total
|
||||
$this->total_ht = (float) price2num($this->total_ht);
|
||||
$this->total_tva = (float) price2num($this->total_tva);
|
||||
$this->total_localtax1 = (float) price2num($this->total_localtax1);
|
||||
$this->total_localtax2 = (float) price2num($this->total_localtax2);
|
||||
$this->total_ttc = (float) price2num($this->total_ttc);
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
// Now update global field total_ht, total_ttc, total_tva, total_localtax1, total_localtax2, multicurrency_total_*
|
||||
@ -3749,11 +3756,11 @@ abstract class CommonObject
|
||||
|
||||
if (empty($nodatabaseupdate)) {
|
||||
$sql = "UPDATE ".$this->db->prefix().$this->table_element.' SET';
|
||||
$sql .= " ".$fieldht." = ".((float) price2num($this->total_ht)).",";
|
||||
$sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva)).",";
|
||||
$sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1)).",";
|
||||
$sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2)).",";
|
||||
$sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc));
|
||||
$sql .= " ".$fieldht." = ".((float) price2num($this->total_ht, 'MT', 1)).",";
|
||||
$sql .= " ".$fieldtva." = ".((float) price2num($this->total_tva, 'MT', 1)).",";
|
||||
$sql .= " ".$fieldlocaltax1." = ".((float) price2num($this->total_localtax1, 'MT', 1)).",";
|
||||
$sql .= " ".$fieldlocaltax2." = ".((float) price2num($this->total_localtax2, 'MT', 1)).",";
|
||||
$sql .= " ".$fieldttc." = ".((float) price2num($this->total_ttc, 'MT', 1));
|
||||
$sql .= ", multicurrency_total_ht = ".((float) price2num($this->multicurrency_total_ht, 'MT', 1));
|
||||
$sql .= ", multicurrency_total_tva = ".((float) price2num($this->multicurrency_total_tva, 'MT', 1));
|
||||
$sql .= ", multicurrency_total_ttc = ".((float) price2num($this->multicurrency_total_ttc, 'MT', 1));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user