Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UISACQCOMP-237 Exclude unsupported currencies #844

Merged
merged 4 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Move reusable claiming code from `ui-receiving` to the shared library. Refs UISACQCOMP-236.
* Support `CLAIMS` export type in the `useIntegrationConfigs` hook. Refs UISACQCOMP-238.
* Claim locations from all members for locations filter when `crossTenant` equals `true`. Refs UISACQCOMP-239.
* Exclude unsupported currencies on `getInvoiceExportData`. Refs UISACQCOMP-237.

## [6.0.2](https://github.com/folio-org/stripes-acq-components/tree/v6.0.2) (2024-12-04)
[Full Changelog](https://github.com/folio-org/stripes-acq-components/compare/v6.0.1...v6.0.2)
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/invoiceExport/getInvoiceExportData.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ export const getInvoiceExportData = async ({ ky, intl, query, currency: to }) =>
});
const addresses = getAddresses(addressRecords);
const currencies = uniq(exportInvoices.map(({ currency }) => currency));
const exchangeRates = await Promise.all(
const allExchangeRates = await Promise.allSettled(
currencies.map(from => ky.get(EXCHANGE_RATE_API, { searchParams: { from, to } }).json()),
);
const exchangeRates = allExchangeRates.filter(({ status }) => status === 'fulfilled');
azizjonnurov marked this conversation as resolved.
Show resolved Hide resolved

return (createInvoiceExportReport({
acqUnitMap: keyBy(acqUnits, 'id'),
Expand Down
Loading