fix: filtering accounts list.

This commit is contained in:
Ahmed Bouhuolia
2020-11-10 13:06:11 +02:00
parent 027c1af841
commit 18d9c53413
7 changed files with 57 additions and 37 deletions

View File

@@ -63,12 +63,6 @@ function ExpenseFormHeader({
[setFieldValue, selectedItems],
);
// Filter payment accounts.
const paymentAccounts = useMemo(
() => accountsList.filter((a) => a?.type?.key === 'current_asset'),
[accountsList],
);
// handle change customer
const onChangeCustomer = useCallback(
(filedName) => {
@@ -126,10 +120,11 @@ function ExpenseFormHeader({
}
>
<AccountsSelectList
accounts={paymentAccounts}
accounts={accountsList}
onAccountSelected={onChangeAccount}
defaultSelectText={<T id={'select_payment_account'} />}
selectedAccountId={values.payment_account_id}
filterByTypes={['current_asset']}
/>
</FormGroup>
</Col>