// @ts-nocheck import React, { useRef } from 'react'; import intl from 'react-intl-universal'; import { Button } from '@blueprintjs/core'; import { useFormikContext } from 'formik'; import * as R from 'ramda'; import { ExchangeRateInputGroup } from '@/components'; import { useCurrentOrganization } from '@/hooks/state'; import { useReceiptIsForeignCustomer, useReceiptTotals } from './utils'; import { useUpdateEffect } from '@/hooks'; import { transactionNumber } from '@/utils'; import withSettings from '@/containers/Settings/withSettings'; import { useSyncExRateToForm, withExchangeRateFetchingLoading, withExchangeRateItemEntriesPriceRecalc, } from '@/containers/Entries/withExRateItemEntriesPriceRecalc'; import withDialogActions from '@/containers/Dialog/withDialogActions'; import { DialogsName } from '@/constants/dialogs'; /** * Receipt exchange rate input field. * @returns {JSX.Element} */ function ReceiptExchangeRateInputFieldRoot({ ...props }) { const currentOrganization = useCurrentOrganization(); const isForeignCustomer = useReceiptIsForeignCustomer(); const { values } = useFormikContext(); // Can't continue if the customer is not foreign. if (!isForeignCustomer) { return null; } return ( ); } export const ReceiptExchangeRateInputField = R.compose( withExchangeRateFetchingLoading, withExchangeRateItemEntriesPriceRecalc, )(ReceiptExchangeRateInputFieldRoot); /** * Receipt project select. * @returns {JSX.Element} */ export function ReceiptProjectSelectButton({ label }) { return