2
0
forked from Wavyzz/dolibarr

modification de la description produit

This commit is contained in:
Regis Houssin
2006-02-12 12:08:04 +00:00
parent e34d27a3ff
commit aa14cefed1
2 changed files with 13 additions and 5 deletions

View File

@@ -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);

View File

@@ -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) )
{