Clean duplicate code
This commit is contained in:
parent
e7d4956f5b
commit
7b1a705be4
@ -1574,10 +1574,10 @@ class Propal extends CommonObject
|
|||||||
$sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,';
|
$sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,';
|
||||||
$sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,';
|
$sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,';
|
||||||
$sql.= ' d.fk_unit,';
|
$sql.= ' d.fk_unit,';
|
||||||
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,';
|
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tobach as product_batch,';
|
||||||
$sql.= ' p.weight, p.weight_units, p.volume, p.volume_units,';
|
$sql.= ' p.weight, p.weight_units, p.volume, p.volume_units,';
|
||||||
$sql.= ' d.date_start, d.date_end';
|
$sql.= ' d.date_start, d.date_end,';
|
||||||
$sql.= ' ,d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc';
|
$sql.= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as d';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as d';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (d.fk_product = p.rowid)';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (d.fk_product = p.rowid)';
|
||||||
$sql.= ' WHERE d.fk_propal = '.$this->id;
|
$sql.= ' WHERE d.fk_propal = '.$this->id;
|
||||||
@ -1639,7 +1639,8 @@ class Propal extends CommonObject
|
|||||||
$line->libelle = $objp->product_label; // TODO deprecated
|
$line->libelle = $objp->product_label; // TODO deprecated
|
||||||
$line->product_label = $objp->product_label;
|
$line->product_label = $objp->product_label;
|
||||||
$line->product_desc = $objp->product_desc; // Description produit
|
$line->product_desc = $objp->product_desc; // Description produit
|
||||||
$line->fk_product_type = $objp->fk_product_type;
|
$line->product_tobatch = $objp->product_tobatch;
|
||||||
|
$line->fk_product_type = $objp->fk_product_type; // TODO deprecated
|
||||||
$line->fk_unit = $objp->fk_unit;
|
$line->fk_unit = $objp->fk_unit;
|
||||||
$line->weight = $objp->weight;
|
$line->weight = $objp->weight;
|
||||||
$line->weight_units = $objp->weight_units;
|
$line->weight_units = $objp->weight_units;
|
||||||
@ -3511,8 +3512,8 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function getLinesArray()
|
function getLinesArray()
|
||||||
{
|
{
|
||||||
// TODO Duplicate with fetch_lines ? Wich one to keep ?
|
return $this->fetch_lines();
|
||||||
|
/*
|
||||||
$this->lines = array();
|
$this->lines = array();
|
||||||
|
|
||||||
$sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,';
|
$sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,';
|
||||||
@ -3601,7 +3602,7 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user