Fix exchange rate parity across all document types

- Fix exchange-rate service types to match actual backend response shapes
  (exchangeRate array, activeProvider success/error, used currencies as strings)
- Add ExchangeRateConverter to payments, expenses, and recurring invoices
- Set currency_id from customer currency in invoice/estimate selectCustomer()
- Load globalStore.currencies in ExchangeRateConverter on mount
- Pass driver/key/driver_config params to getSupportedCurrencies in provider modal
- Fix OpenExchangeRateDriver validateConnection to use base=USD (free plan compat)
- Fix checkActiveCurrencies SQLite whereJsonContains with array values
- Remove broken currency/companyCurrency props from ExpenseCreateView, use stores
- Show base currency equivalent in document line items and totals when exchange
  rate is active
This commit is contained in:
Darko Gjorgjijoski
2026-04-06 21:07:50 +02:00
parent e64529468c
commit b0b7d40c73
12 changed files with 213 additions and 54 deletions

View File

@@ -212,11 +212,18 @@ async function fetchCurrencies(): Promise<void> {
isFetchingCurrencies.value = true
try {
const params: Record<string, string> = { driver, key }
const driverConfig: Record<string, string> = {}
if (currencyConverter.value.type) {
params.type = currencyConverter.value.type
driverConfig.type = currencyConverter.value.type
}
const res = await exchangeRateService.getSupportedCurrencies()
if (currencyConverter.value.url) {
driverConfig.url = currencyConverter.value.url
}
const res = await exchangeRateService.getSupportedCurrencies({
driver,
key,
driver_config: Object.keys(driverConfig).length ? driverConfig : undefined,
})
supportedCurrencies.value = res.supportedCurrencies ?? []
} finally {
isFetchingCurrencies.value = false