mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-17 18:24:10 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user