Bugfixes
This commit is contained in:
parent
35ad01f9b7
commit
4b555a3689
@ -353,6 +353,9 @@ class FactureFourn
|
|||||||
*/
|
*/
|
||||||
Function updateprice($facid)
|
Function updateprice($facid)
|
||||||
{
|
{
|
||||||
|
$total_ht = 0;
|
||||||
|
$total_tva = 0;
|
||||||
|
$total_ttc = 0;
|
||||||
|
|
||||||
$sql = "SELECT sum(total_ht), sum(tva), sum(total_ttc) FROM ".MAIN_DB_PREFIX."facture_fourn_det";
|
$sql = "SELECT sum(total_ht), sum(tva), sum(total_ttc) FROM ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||||
$sql .= " WHERE fk_facture_fourn = $facid;";
|
$sql .= " WHERE fk_facture_fourn = $facid;";
|
||||||
@ -367,13 +370,22 @@ class FactureFourn
|
|||||||
$total_ht = $row[0];
|
$total_ht = $row[0];
|
||||||
$total_tva = $row[1];
|
$total_tva = $row[1];
|
||||||
$total_ttc = $row[2];
|
$total_ttc = $row[2];
|
||||||
|
|
||||||
|
if ($total_ht == '')
|
||||||
|
$total_ht = 0;
|
||||||
|
|
||||||
|
if ($total_tva == '')
|
||||||
|
$total_tva = 0;
|
||||||
|
|
||||||
|
if ($total_ttc == '')
|
||||||
|
$total_ttc = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn SET total_ht = $total_ht, total_tva = $total_tva, total_ttc = $total_ttc";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn SET total_ht = $total_ht, total_tva = $total_tva, total_ttc = $total_ttc";
|
||||||
$sql .= " WHERE rowid = $facid ;";
|
$sql .= " WHERE rowid = $facid ;";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user