use special_code on order_supplier lines

This commit is contained in:
atm-greg 2018-04-12 16:12:23 +02:00
parent 7bf9801b80
commit 58535993c1

View File

@ -2961,6 +2961,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
public $fk_facture;
public $label;
public $rang = 0;
public $special_code = 0;
/**
* Unit price without taxes
@ -3000,7 +3001,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
*/
public function fetch($rowid)
{
$sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx,';
$sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx, cd.special_code';
$sql.= ' cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.ref,';
$sql.= ' cd.remise, cd.remise_percent, cd.subprice,';
$sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc,';
@ -3039,6 +3040,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
$this->total_localtax2 = $objp->total_localtax2;
$this->total_ttc = $objp->total_ttc;
$this->product_type = $objp->product_type;
$this->special_code = $objp->special_code;
$this->ref = $objp->product_ref;
$this->product_ref = $objp->product_ref;
@ -3145,7 +3147,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
// Insertion dans base de la ligne
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.$this->table_element;
$sql.= " (fk_commande, label, description, date_start, date_end,";
$sql.= " fk_product, product_type,";
$sql.= " fk_product, product_type, special_code,";
$sql.= " qty, vat_src_code, tva_tx, localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, remise_percent, subprice, ref,";
$sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_unit,";
$sql.= " fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc";
@ -3156,6 +3158,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
if ($this->fk_product) { $sql.= $this->fk_product.","; }
else { $sql.= "null,"; }
$sql.= "'".$this->product_type."',";
$sql.= "'".$this->special_code."',";
$sql.= "'".$this->qty."', ";
$sql.= " ".(empty($this->vat_src_code)?"''":"'".$this->vat_src_code."'").",";
@ -3259,6 +3262,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
$sql.= ", total_localtax2='".price2num($this->total_localtax2)."'";
$sql.= ", total_ttc='".price2num($this->total_ttc)."'";
$sql.= ", product_type=".$this->product_type;
$sql.= ", special_code=".(!empty($this->special_code) ? $this->special_code : 0);
$sql.= ($this->fk_unit ? ", fk_unit='".$this->db->escape($this->fk_unit)."'":", fk_unit=null");
// Multicurrency