From 1d2ad8728f884f0f99592ce6fe72a10ca4979299 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 15 Sep 2003 16:06:16 +0000 Subject: [PATCH] Modif arrondis --- htdocs/facture.class.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 1835a1c4a2b..3d3676dfd82 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -488,12 +488,19 @@ class Facture } $total_ht = $amount - $total_remise; - $total_tva = $total_tva + tva($lprice, $obj->tva_taux); + + $ligne_tva = ($lprice * ($obj->tva_tx / 100)); + + $total_tva = $total_tva + $ligne_tva; $i++; } $this->db->free(); - $this->total_ttc = $total_ht + $total_tva; + /* + * Sommes et arrondis + */ + + $this->total_ttc = round($total_ht, 2) + round($total_tva, 2); $sql = "UPDATE llx_facture SET amount = $amount, remise=$total_remise, total=$total_ht, tva=$total_tva, total_ttc=$this->total_ttc"; $sql .= " WHERE rowid = $facid ;";