feat: implement auto entries rates re-calculation after change the exchange rate

This commit is contained in:
Ahmed Bouhuolia
2024-01-14 14:44:48 +02:00
parent 2cb8c2932f
commit 2b03ac7f16
24 changed files with 522 additions and 241 deletions

View File

@@ -28,7 +28,7 @@ interface ExchangeRateInputGroupProps {
inputGroupProps?: any;
formGroupProps?: any;
popoverRecalcConfirm?: boolean;
withPopoverRecalcConfirm?: boolean;
onRecalcConfirm: (bag: ExchangeRateValuesBag) => void;
onCancel: (bag: ExchangeRateValuesBag) => void;
@@ -47,7 +47,7 @@ export function ExchangeRateInputGroup({
inputGroupProps,
formGroupProps,
popoverRecalcConfirm = false,
withPopoverRecalcConfirm = false,
onRecalcConfirm,
onCancel,
@@ -97,6 +97,7 @@ export function ExchangeRateInputGroup({
onChange={() => null}
onBlur={handleExchangeRateFieldBlur}
rightElement={isLoading && <Spinner size={16} />}
decimalsLimit={5}
{...inputGroupProps}
name={name}
/>
@@ -142,7 +143,7 @@ export function ExchangeRateInputGroup({
<ExchangeFlagIcon currencyCode={fromCurrency} /> 1 {fromCurrency} =
</ExchangeRatePrepend>
{popoverRecalcConfirm ? (
{withPopoverRecalcConfirm ? (
<Popover isOpen={isOpen} content={popoverConfirmContent}>
{exchangeRateField}
</Popover>