Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

Money Conversion

Ahmad   ( User )

Commented 5 years ago

Hello,


My problem is with the money conversion (from USD to another currency [LBP in my case])(../reports/expense_summary in this page for example).


For USD, the currency rate is set to "1", for LBP I try 2 numbers:



  1. "1508.7": so for 10,000LBP the result is 15,080,000.7$=10,000*1508.7 bu it should equal to 6.62$=10,000÷1508.7

  2. "0.00066" (1÷1508.7): so for 10,000LBP the result is 15,080,000.7$=10,000÷0.00066 but it should equal to 6.62$=10,000*0.00066


So why if the currency_rate > 1 the values are multiplied *, but if the currency_rate < 1 the values are divided ÷.


In which file the conversion method is placed, so I can change it?


Thank you.

Volodymyr Svitelsky   ( User )

Commented 5 years ago

Looks like the problem is still not resolved, as I see the similar problem.

Ahmad   ( User )

Commented 5 years ago

I think I solve this problem by removing some code in this file ("vendor/akaunting/money/src/Money.php")

I change this (In "public function convert" at line 531):
if ($ratio < 1) {
return $this->divide($ratio, $roundingMode);
}

return $this->multiply($ratio, $roundingMode);

To this:
return $this->divide($ratio, $roundingMode);

Please login or register to leave a response.

Showing 1 to 3 of 3 discussions