Currency conversion is not applied when company currency matches account currency
Akaunting version
3.2.2
PHP version
8.1.33
Operating system
Windows 11
Steps to reproduce
Currency conversion is not applied when company currency matches account currency
Description
When an invoice is issued in GBP (£) and a payment is made in USD ($), the currency conversion works correctly when the company's currency differs from the account currency.
However, when the company currency is the same as the account currency receiving the payment, the conversion is not applied. The payment is recorded using the original invoice amount instead of the converted amount.
Steps to reproduce
- Create an invoice in GBP (£).
- Make a payment in USD ($).
- Set the currency rate to 1.33267.
- Compare the payment amount recorded in the account under different company/account currency configurations.
Actual results
Case 1 — Company currency: USD ($)
- Invoice currency: GBP (£)
- Payment currency: USD ($)
- Amount: $253.00
- Currency Rate: 1.33267
- Amount credited to the account: $253.00
- Currency conversion is not applied.
- The Currency field does not work as expected.
Case 2 — Company currency: GBP (£)
- Invoice currency: GBP (£)
- Payment currency: USD ($)
- Amount: $337.17
- Currency Rate: 1.33267
- Amount credited to the account: $337.17
- Currency conversion works correctly.
Case 3 — Company currency: EUR (€)
- Invoice currency: GBP (£)
- Payment currency: USD ($)
- Amount: $337.17
- Currency Rate: 1.33267
- Amount credited to the account: $337.17
- Currency conversion works correctly.
Expected result
Expected result
The payment should be converted according to the specified currency rate regardless of whether the company currency matches the account currency.
For example, when the invoice/payment involves a currency conversion and the Currency Rate is 1.33267, the converted amount should be calculated and recorded accordingly.
Actual result
Bug
The issue appears to occur specifically when:
Company currency = Account currency
In this situation, Akaunting skips the currency conversion and records the original payment amount instead.
Additional comments
No response
Relevant log output
Source: akaunting/akaunting