mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
FIX : get multicurrency infos of propal when create order from propal with "WORKFLOW_PROPAL_AUTOCREATE_ORDER" conf
This commit is contained in:
@@ -1355,6 +1355,27 @@ class Commande extends CommonOrder
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (!empty($object->multicurrency_code)) {
|
||||
$this->multicurrency_code = $object->multicurrency_code;
|
||||
}
|
||||
if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($object->multicurrency_tx)) {
|
||||
$this->multicurrency_tx = $object->multicurrency_tx;
|
||||
}
|
||||
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) {
|
||||
list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date_commande);
|
||||
} else {
|
||||
$this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
}
|
||||
if (empty($this->fk_multicurrency)) {
|
||||
$this->multicurrency_code = $conf->currency;
|
||||
$this->fk_multicurrency = 0;
|
||||
$this->multicurrency_tx = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// get extrafields from original line
|
||||
$object->fetch_optionals();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user