Fix: for special_code=3
This commit is contained in:
parent
6046feda11
commit
091966902e
@ -2236,6 +2236,7 @@ class Commande extends CommonOrder
|
||||
$this->line->remise_percent=$remise_percent;
|
||||
$this->line->subprice=$subprice;
|
||||
$this->line->info_bits=$info_bits;
|
||||
$this->line->special_code=0; // To remove special_code=3 coming from proposals copy
|
||||
$this->line->total_ht=$total_ht;
|
||||
$this->line->total_tva=$total_tva;
|
||||
$this->line->total_localtax1=$total_localtax1;
|
||||
@ -3116,6 +3117,7 @@ class OrderLine
|
||||
if (empty($this->remise)) $this->remise=0;
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->product_type)) $this->product_type=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
@ -3151,6 +3153,7 @@ class OrderLine
|
||||
$sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?$this->fk_fournprice:"null");
|
||||
$sql.= " , buy_price_ht='".price2num($this->pa_ht)."'";
|
||||
$sql.= " , info_bits=".$this->info_bits;
|
||||
$sql.= " , special_code=".$this->special_code;
|
||||
$sql.= " , date_start=".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null");
|
||||
$sql.= " , date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
|
||||
$sql.= " , product_type=".$this->product_type;
|
||||
|
||||
@ -994,6 +994,10 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
||||
$price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT');
|
||||
|
||||
// Define special_code for special lines
|
||||
$special_code=0;
|
||||
//if (empty($_POST['qty'])) $special_code=3; // Options should not exists on invoices
|
||||
|
||||
// Ecrase $pu par celui du produit
|
||||
// Ecrase $desc par celui du produit
|
||||
// Ecrase $txtva par celui du produit
|
||||
@ -1135,7 +1139,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
$pu_ttc,
|
||||
$type,
|
||||
-1,
|
||||
0,
|
||||
$special_code,
|
||||
'',
|
||||
0,
|
||||
GETPOST('fk_parent_line'),
|
||||
|
||||
@ -2119,6 +2119,7 @@ class Facture extends CommonInvoice
|
||||
$this->line->total_localtax2=(($this->type==2||$qty<0)?-abs($total_localtax2):$total_localtax2);
|
||||
$this->line->total_ttc= (($this->type==2||$qty<0)?-abs($total_ttc):$total_ttc);
|
||||
$this->line->info_bits = $info_bits;
|
||||
$this->line->special_code=0; // To remove special_code=3 coming from proposals copy
|
||||
$this->line->product_type = $type;
|
||||
$this->line->fk_parent_line = $fk_parent_line;
|
||||
$this->line->skip_update_total = $skip_update_total;
|
||||
@ -3413,6 +3414,7 @@ class FactureLigne
|
||||
if (empty($this->total_localtax2)) $this->total_localtax2=0;
|
||||
if (empty($this->remise_percent)) $this->remise_percent=0;
|
||||
if (empty($this->info_bits)) $this->info_bits=0;
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->product_type)) $this->product_type=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
|
||||
@ -3445,6 +3447,7 @@ class FactureLigne
|
||||
$sql.= ",date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
|
||||
$sql.= ",product_type=".$this->product_type;
|
||||
$sql.= ",info_bits='".$this->info_bits."'";
|
||||
$sql.= ",special_code='".$this->special_code."'";
|
||||
if (empty($this->skip_update_total))
|
||||
{
|
||||
$sql.= ",total_ht=".price2num($this->total_ht)."";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user