Currency conversion on dashboard completed payments is incorrect. #562
This commit is contained in:
parent
9b8d6ea8d4
commit
5fef99ac1b
|
|
@ -458,11 +458,19 @@ List<ChartDataGroup> chartPayments(
|
||||||
double completedAmount = payment.completedAmount;
|
double completedAmount = payment.completedAmount;
|
||||||
double refunded = payment.refunded;
|
double refunded = payment.refunded;
|
||||||
|
|
||||||
|
var invoice = InvoiceEntity();
|
||||||
|
if (payment.invoicePaymentables.isNotEmpty) {
|
||||||
|
final paymentable = payment.invoicePaymentables.first;
|
||||||
|
invoice = invoiceMap[paymentable.invoiceId] ?? InvoiceEntity();
|
||||||
|
}
|
||||||
|
|
||||||
// Handle "All"
|
// Handle "All"
|
||||||
if (settings.currencyId == kCurrencyAll &&
|
if (settings.currencyId == kCurrencyAll &&
|
||||||
client.currencyId != company.currencyId) {
|
client.currencyId != company.currencyId) {
|
||||||
final exchangeRate = payment.hasExchangeRate
|
final exchangeRate = payment.hasExchangeRate
|
||||||
? payment.exchangeRate
|
? payment.exchangeRate
|
||||||
|
: invoice.hasExchangeRate
|
||||||
|
? invoice.exchangeRate
|
||||||
: getExchangeRate(currencyMap,
|
: getExchangeRate(currencyMap,
|
||||||
fromCurrencyId: client.currencyId,
|
fromCurrencyId: client.currencyId,
|
||||||
toCurrencyId: company.currencyId);
|
toCurrencyId: company.currencyId);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue