commit
11640d05b4
@ -1432,7 +1432,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->special_code = $line->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
//$this->special_code = $line->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
||||||
|
|
||||||
// This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
// This include test on qty if option SUPPLIER_ORDER_WITH_NOPRICEDEFINED is not set
|
||||||
$result = $this->addline(
|
$result = $this->addline(
|
||||||
@ -1454,7 +1454,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$line->date_start,
|
$line->date_start,
|
||||||
$line->date_end,
|
$line->date_end,
|
||||||
$line->array_options,
|
$line->array_options,
|
||||||
$line->fk_unit
|
$line->fk_unit,
|
||||||
|
$line->special_code
|
||||||
);
|
);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error
|
dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); // do not use dol_print_error here as it may be a functionnal error
|
||||||
@ -1745,9 +1746,10 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* @param string $origin 'order', ...
|
* @param string $origin 'order', ...
|
||||||
* @param int $origin_id Id of origin object
|
* @param int $origin_id Id of origin object
|
||||||
* @param int $rang Rank
|
* @param int $rang Rank
|
||||||
|
* @param int $special_code Special code
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $fk_prod_fourn_price = 0, $ref_supplier = '', $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $type = 0, $info_bits = 0, $notrigger = false, $date_start = null, $date_end = null, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $origin = '', $origin_id = 0, $rang = -1)
|
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $fk_prod_fourn_price = 0, $ref_supplier = '', $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $type = 0, $info_bits = 0, $notrigger = false, $date_start = null, $date_end = null, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $origin = '', $origin_id = 0, $rang = -1, $special_code = 0)
|
||||||
{
|
{
|
||||||
global $langs, $mysoc, $conf;
|
global $langs, $mysoc, $conf;
|
||||||
|
|
||||||
@ -1957,7 +1959,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$this->line->total_localtax2 = $total_localtax2;
|
$this->line->total_localtax2 = $total_localtax2;
|
||||||
$this->line->total_ttc = $total_ttc;
|
$this->line->total_ttc = $total_ttc;
|
||||||
$this->line->product_type = $type;
|
$this->line->product_type = $type;
|
||||||
$this->line->special_code = $this->special_code;
|
$this->line->special_code = $special_code;
|
||||||
$this->line->origin = $origin;
|
$this->line->origin = $origin;
|
||||||
$this->line->origin_id = $origin_id;
|
$this->line->origin_id = $origin_id;
|
||||||
$this->line->fk_unit = $fk_unit;
|
$this->line->fk_unit = $fk_unit;
|
||||||
|
|||||||
@ -555,13 +555,15 @@ if (empty($reshook)) {
|
|||||||
$ref_supplier = $productsupplier->ref_supplier;
|
$ref_supplier = $productsupplier->ref_supplier;
|
||||||
|
|
||||||
// Get vat rate
|
// Get vat rate
|
||||||
|
$tva_npr = 0;
|
||||||
if (!GETPOSTISSET('tva_tx')) { // If vat rate not provided from the form (the form has the priority)
|
if (!GETPOSTISSET('tva_tx')) { // If vat rate not provided from the form (the form has the priority)
|
||||||
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha'));
|
$tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha'));
|
||||||
$tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha'));
|
$tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha'));
|
||||||
|
if (empty($tva_tx)) {
|
||||||
|
$tva_npr = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (empty($tva_tx)) {
|
|
||||||
$tva_npr = 0;
|
|
||||||
}
|
|
||||||
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr);
|
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr);
|
||||||
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr);
|
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr);
|
||||||
|
|
||||||
@ -667,10 +669,10 @@ if (empty($reshook)) {
|
|||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang = '';
|
$newlang = '';
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
||||||
$newlang = GETPOST('lang_id', 'aZ09');
|
$newlang = GETPOST('lang_id', 'aZ09');
|
||||||
}
|
}
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
|
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
|
||||||
$newlang = $object->thirdparty->default_lang;
|
$newlang = $object->thirdparty->default_lang;
|
||||||
}
|
}
|
||||||
if (!empty($newlang)) {
|
if (!empty($newlang)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user