Skip to content

Commit

Permalink
UINV-530 Include the currency in an invoice upon creation derived fro…
Browse files Browse the repository at this point in the history
…m a purchase order
  • Loading branch information
usavkov-epam committed Feb 5, 2024
1 parent cfffaa0 commit 9ff4ad2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Display all external account numbers associated with an invoice in the export report. Refs UINV-515.
* Uninformative error in invoice payment due to user not linked to the Purchase Order's acquisition unit. Refs UINV-518.
* *BREAKING:* Bump up okapi interfaces for `pieces` (3.0). Refs UINV-529.
* Include the currency in an invoice upon creation derived from a purchase order. Refs UINV-530

## [5.0.1](https://github.com/folio-org/ui-invoice/tree/v5.0.1) (2023-10-31)
[Full Changelog](https://github.com/folio-org/ui-invoice/compare/v5.0.0...v5.0.1)
Expand Down
6 changes: 4 additions & 2 deletions src/invoices/InvoiceForm/InvoiceFormContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,16 @@ export function InvoiceFormContainerComponent({

const allAdjustments = useMemo(() => getSettingsAdjustmentsList(configAdjustments), [configAdjustments]);
const alwaysShowAdjustments = useMemo(() => getAlwaysShownAdjustmentsList(allAdjustments), [allAdjustments]);
const batchGroupId = isCreate && (batchGroups?.length === 1) ? batchGroups[0]?.id : undefined;
const batchGroupId = isCreate && (batchGroups?.length === 1) ? batchGroups?.[0]?.id : undefined;
const exportToAccounting = alwaysShowAdjustments.some(adj => adj.exportToAccounting);

const initialInvoice = useMemo(() => {
return !isCreate
? invoice
: {
chkSubscriptionOverlap: true,
currency: stripes.currency,
currency: orderLines?.[0]?.cost?.currency || stripes.currency,
exchangeRate: orderLines?.[0]?.cost?.exchangeRate,
source: sourceValues.user,
adjustments: alwaysShowAdjustments,
batchGroupId,
Expand All @@ -209,6 +210,7 @@ export function InvoiceFormContainerComponent({
exportToAccounting,
invoice,
isCreate,
orderLines,
orders,
stripes.currency,
]);
Expand Down

0 comments on commit 9ff4ad2

Please sign in to comment.