forked from Wavyzz/dolibarr
modification de la description produit
This commit is contained in:
@@ -318,7 +318,7 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
|
||||
$_POST['idprod'],
|
||||
$_POST['qty'],
|
||||
$_POST['remise'],
|
||||
$_POST['np_desc']),
|
||||
$_POST['np_desc'],
|
||||
$_POST['np_product_desc']);
|
||||
}
|
||||
propale_pdf_create($db, $_POST['propalid'], $propal->modelpdf);
|
||||
|
||||
@@ -132,7 +132,7 @@ class Propal
|
||||
* \return int >0 si ok, <0 si ko
|
||||
* \see add_product
|
||||
*/
|
||||
function insert_product($idproduct, $qty, $remise_percent=0, $p_desc='')
|
||||
function insert_product($idproduct, $qty, $remise_percent=0, $p_desc='', $p_product_desc)
|
||||
{
|
||||
global $conf;
|
||||
dolibarr_syslog("propal.class.php::insert_product $idproduct, $qty, $remise_percent, $p_desc");
|
||||
@@ -171,9 +171,17 @@ class Propal
|
||||
$remise = round(($prod->price * $remise_percent / 100), 2);
|
||||
$price = $prod->price - $remise;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propaldet (fk_propal, fk_product, qty, price, tva_tx, description, remise_percent, subprice) VALUES ";
|
||||
$sql .= " (".$this->id.",". $idproduct.",'". $qty."','". $price."','".$txtva."','".addslashes($p_desc?$p_desc:$prod->label)."','".price2num($remise_percent)."','".price2num($subprice)."')";
|
||||
|
||||
if ($conf->global->CHANGE_PROD_DESC)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propaldet (fk_propal, fk_product, qty, price, tva_tx, description, remise_percent, subprice) VALUES ";
|
||||
$sql .= " (".$this->id.",". $idproduct.",'". $qty."','". $price."','".$txtva."','".addslashes($prod->product_desc)."','".price2num($remise_percent)."','".price2num($subprice)."')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."propaldet (fk_propal, fk_product, qty, price, tva_tx, description, remise_percent, subprice) VALUES ";
|
||||
$sql .= " (".$this->id.",". $idproduct.",'". $qty."','". $price."','".$txtva."','".addslashes($p_desc?$p_desc:$prod->label)."','".price2num($remise_percent)."','".price2num($subprice)."')";
|
||||
}
|
||||
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user