FIX multicurrency price always display and update line price if rate is
update
This commit is contained in:
parent
148a5947a7
commit
21db62d645
@ -2101,6 +2101,8 @@ if ($action == 'create')
|
|||||||
print '<td class="nowrap" colspan="2">' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
|
print '<td class="nowrap" colspan="2">' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
if (!empty($conf->multicurrency->enabled))
|
||||||
|
{
|
||||||
// Multicurrency Amount HT
|
// Multicurrency Amount HT
|
||||||
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountHT','multicurrency_total_ht') . '</td>';
|
||||||
print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||||
@ -2115,6 +2117,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
print '<tr><td height="10">' . fieldLabel('MulticurrencyAmountTTC','multicurrency_total_ttc') . '</td>';
|
||||||
print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
print '<td class="nowrap" colspan="2">' . price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)) . '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
print '<tr><td height="10">' . $langs->trans('Status') . '</td><td align="left" colspan="2">' . $object->getLibStatut(4) . '</td></tr>';
|
print '<tr><td height="10">' . $langs->trans('Status') . '</td><td align="left" colspan="2">' . $object->getLibStatut(4) . '</td></tr>';
|
||||||
|
|||||||
@ -792,7 +792,7 @@ class Propal extends CommonObject
|
|||||||
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
{
|
{
|
||||||
$this->multicurrency_code = '';
|
$this->multicurrency_code = $conf->currency;
|
||||||
$this->fk_multicurrency = 0;
|
$this->fk_multicurrency = 0;
|
||||||
$this->multicurrency_tx = 1;
|
$this->multicurrency_tx = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1471,6 +1471,13 @@ abstract class CommonObject
|
|||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
$this->multicurrency_tx = $rate;
|
$this->multicurrency_tx = $rate;
|
||||||
|
|
||||||
|
// Update line price
|
||||||
|
if (!empty($this->lines))
|
||||||
|
{
|
||||||
|
foreach ($this->lines as &$line) $this->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, $line->skip_update_total, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit);
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user