Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
This commit is contained in:
commit
b5a287875c
@ -244,6 +244,8 @@ if ($id > 0) {
|
|||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
if (!empty($conf->agenda->enabled)) {
|
if (!empty($conf->agenda->enabled)) {
|
||||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||||
|
$backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||||
|
$out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage);
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1360,29 +1360,35 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
// insert products details into database
|
// insert products details into database
|
||||||
for ($i = 0; $i < $num; $i++) {
|
for ($i = 0; $i < $num; $i++) {
|
||||||
$this->special_code = $this->lines[$i]->special_code; // TODO : remove this in 9.0 and add special_code param to addline()
|
$line = $this->lines[$i];
|
||||||
|
if (!is_object($line)) {
|
||||||
|
$line = (object) $line;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$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(
|
||||||
$this->lines[$i]->desc,
|
$line->desc,
|
||||||
$this->lines[$i]->subprice,
|
$line->subprice,
|
||||||
$this->lines[$i]->qty,
|
$line->qty,
|
||||||
$this->lines[$i]->tva_tx,
|
$line->tva_tx,
|
||||||
$this->lines[$i]->localtax1_tx,
|
$line->localtax1_tx,
|
||||||
$this->lines[$i]->localtax2_tx,
|
$line->localtax2_tx,
|
||||||
$this->lines[$i]->fk_product,
|
$line->fk_product,
|
||||||
0,
|
0,
|
||||||
$this->lines[$i]->ref_fourn, // $this->lines[$i]->ref_fourn comes from field ref into table of lines. Value may ba a ref that does not exists anymore, so we first try with value of product
|
$line->ref_fourn, // $line->ref_fourn comes from field ref into table of lines. Value may ba a ref that does not exists anymore, so we first try with value of product
|
||||||
$this->lines[$i]->remise_percent,
|
$line->remise_percent,
|
||||||
'HT',
|
'HT',
|
||||||
0,
|
0,
|
||||||
$this->lines[$i]->product_type,
|
$line->product_type,
|
||||||
$this->lines[$i]->info_bits,
|
$line->info_bits,
|
||||||
false,
|
false,
|
||||||
$this->lines[$i]->date_start,
|
$line->date_start,
|
||||||
$this->lines[$i]->date_end,
|
$line->date_end,
|
||||||
$this->lines[$i]->array_options,
|
$line->array_options,
|
||||||
$this->lines[$i]->fk_unit
|
$line->fk_unit
|
||||||
);
|
);
|
||||||
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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user