Nettoyage du code
This commit is contained in:
parent
12360f47d4
commit
23ad185791
@ -152,7 +152,7 @@ class Propal
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propaldet (fk_propal, fk_product, qty, price, tva_tx, description, remise_percent, subprice) VALUES ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propaldet (fk_propal, fk_product, qty, price, tva_tx, description, remise_percent, subprice) VALUES ";
|
||||||
$sql .= " (".$this->id.", 0,". $p_qty.",". $price.",".$p_tva_tx.",'".$p_desc."',$remise_percent, $subprice) ; ";
|
$sql .= " (".$this->id.", 0,'". $p_qty."','". $price."','".$p_tva_tx."','".$p_desc."','$remise_percent', '$subprice') ; ";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@ -272,7 +272,8 @@ class Propal
|
|||||||
}
|
}
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
|
* Mets à jour le prix total de la proposition
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -300,19 +301,14 @@ class Propal
|
|||||||
}
|
}
|
||||||
$calculs = calcul_price($products, $this->remise_percent);
|
$calculs = calcul_price($products, $this->remise_percent);
|
||||||
|
|
||||||
$totalht = $calculs[0];
|
$this->remise = $calculs[3];
|
||||||
$totaltva = $calculs[1];
|
$this->total_ht = $calculs[0];
|
||||||
$totalttc = $calculs[2];
|
$this->total_tva = $calculs[1];
|
||||||
$total_remise = $calculs[3];
|
$this->total_ttc = $calculs[2];
|
||||||
|
|
||||||
$this->remise = $total_remise;
|
|
||||||
$this->total_ht = $totalht;
|
|
||||||
$this->total_tva = $totaltva;
|
|
||||||
$this->total_ttc = $totalttc;
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal set price='$this->total_ht', tva='$totaltva', total='$totalttc', remise='$total_remise' WHERE rowid = $this->id";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal set price='$this->total_ht', tva='$this->total_tva', total='$this->total_ttc', remise='$this->total_remise' WHERE rowid = $this->id";
|
||||||
if ( $this->db->query($sql) )
|
if ( $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user