feat(cashflow): exchange rate muted.

This commit is contained in:
elforjani13
2022-03-07 16:38:14 +02:00
parent 51c7a0fcd8
commit d12e35f649
11 changed files with 136 additions and 89 deletions

View File

@@ -2,7 +2,7 @@ import React from 'react';
import styled from 'styled-components';
import { useFormikContext } from 'formik';
import { transactionNumber } from 'utils';
import { first } from 'lodash';
import { first, isEqual, isNull } from 'lodash';
import { useMoneyOutDialogContext } from './MoneyOutDialogProvider';
@@ -29,6 +29,16 @@ export const useSetPrimaryBranchToForm = () => {
}
}, [isBranchesSuccess, setFieldValue, branches]);
};
export const useForeignAccount = () => {
const { values } = useFormikContext();
const { account } = useMoneyOutDialogContext();
return (
!isEqual(account.currency_code, values.currency_code) &&
!isNull(account.currency_code)
);
};
export const BranchRowDivider = styled.div`
height: 1px;
background: #ebf1f6;