parent
3feda06988
commit
487a76bafe
@ -380,7 +380,14 @@ class FactureRec
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facturedet_rec (fk_facture,description,price,qty,tva_taux, fk_product, remise_percent, subprice, remise)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facturedet_rec (fk_facture,description,price,qty,tva_taux, fk_product, remise_percent, subprice, remise)";
|
||||||
$sql .= " VALUES ('$facid', '$desc', '$price', '$qty', '$txtva', '$fk_product', '$remise_percent', '$subprice', '$remise') ;";
|
$sql .= " VALUES ('$facid', '$desc'";
|
||||||
|
$sql .= ",".ereg_replace(",",".",$price);
|
||||||
|
$sql .= ",".ereg_replace(",",".",$qty);
|
||||||
|
$sql .= ",".ereg_replace(",",".",$txtva);
|
||||||
|
$sql .= ",'$fk_product'";
|
||||||
|
$sql .= ",'".ereg_replace(",",".",$remise_percent)."'";
|
||||||
|
$sql .= ",'".ereg_replace(",",".",$subprice)."'";
|
||||||
|
$sql .= ",'".ereg_replace(",",".",$remise)."') ;";
|
||||||
|
|
||||||
if ( $this->db->query( $sql) )
|
if ( $this->db->query( $sql) )
|
||||||
{
|
{
|
||||||
@ -419,7 +426,14 @@ class FactureRec
|
|||||||
$remise_percent=0;
|
$remise_percent=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set description='$desc',price=$price,subprice=$subprice,remise=$remise,remise_percent=$remise_percent,qty=$qty WHERE rowid = $rowid ;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set description='$desc'";
|
||||||
|
$sql .= ",price=".ereg_replace(",",".",$price);
|
||||||
|
$sql .= ",subprice=".ereg_replace(",",".",$subprice);
|
||||||
|
$sql .= ",remise=".ereg_replace(",",".",$remise);
|
||||||
|
$sql .= ",remise_percent=".ereg_replace(",",".",$remise_percent);
|
||||||
|
$sql .= ",qty=".ereg_replace(",",".",$qty);
|
||||||
|
$sql .= " WHERE rowid = $rowid ;";
|
||||||
|
|
||||||
$result = $this->db->query( $sql);
|
$result = $this->db->query( $sql);
|
||||||
|
|
||||||
$this->updateprice($this->id);
|
$this->updateprice($this->id);
|
||||||
@ -477,7 +491,13 @@ class FactureRec
|
|||||||
$this->total_ttc = $calculs[2];
|
$this->total_ttc = $calculs[2];
|
||||||
$tvas = $calculs[5];
|
$tvas = $calculs[5];
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET amount = $this->amount_ht, remise=$this->total_remise, total=$this->total_ht, tva=$this->total_tva, total_ttc=$this->total_ttc";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET ";
|
||||||
|
$sql .= " amount = ".ereg_replace(",",".",$this->amount_ht);
|
||||||
|
$sql .= ", remise=".ereg_replace(",",".",$this->total_remise);
|
||||||
|
$sql .= ", total=".ereg_replace(",",".",$this->total_ht);
|
||||||
|
$sql .= ", tva=".ereg_replace(",",".",$this->total_tva);
|
||||||
|
$sql .= ", total_ttc=".ereg_replace(",",".",$this->total_ttc);
|
||||||
|
|
||||||
$sql .= " WHERE rowid = $facid ;";
|
$sql .= " WHERE rowid = $facid ;";
|
||||||
|
|
||||||
if ( $this->db->query($sql) )
|
if ( $this->db->query($sql) )
|
||||||
@ -529,7 +549,5 @@ class FactureRec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user