mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-29 04:03:20 +01:00
Merge pull request #6157 from atm-ph/new_develop_use_rate_on_document_date
NEW get multicurrency rate from document date (propal, order)
This commit is contained in:
@@ -704,9 +704,12 @@ class Commande extends CommonOrder
|
||||
|
||||
// Clean parameters
|
||||
$this->brouillon = 1; // set command as draft
|
||||
|
||||
|
||||
// $date_commande is deprecated
|
||||
$date = ($this->date_commande ? $this->date_commande : $this->date);
|
||||
|
||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
|
||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||
if (empty($this->fk_multicurrency))
|
||||
{
|
||||
@@ -745,9 +748,6 @@ class Commande extends CommonOrder
|
||||
return -1;
|
||||
}
|
||||
|
||||
// $date_commande is deprecated
|
||||
$date = ($this->date_commande ? $this->date_commande : $this->date);
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
Reference in New Issue
Block a user