feat : Cash flow transaction type.

This commit is contained in:
elforjani13
2021-10-17 18:00:40 +02:00
parent 2078b6bc99
commit c148e2976a
33 changed files with 1273 additions and 63 deletions

View File

@@ -14,10 +14,14 @@ import {
AccountsSuggestField,
InputPrependText,
MoneyInputGroup,
FieldRequiredHint,
Col,
Row,
} from 'components';
import { DateInput } from '@blueprintjs/datetime';
import { useAutofocus } from 'hooks';
import { FieldRequiredHint, Col, Row } from 'components';
import { ACCOUNT_TYPE } from 'common/accountTypes';
import {
inputIntent,
momentFormatter,
@@ -28,7 +32,7 @@ import { CLASSES } from 'common/classes';
import { useMoneyInDailogContext } from '../MoneyInDialogProvider';
/**
* Other income form fiedls.
* Other income form fields.
*/
function OtherIncomeFormFields() {
// Money in dialog context.
@@ -120,20 +124,24 @@ function OtherIncomeFormFields() {
<Row>
<Col xs={5}>
{/*------------ other income account -----------*/}
<FastField name={'cashflow_account_id'}>
<FastField name={'credit_account_id'}>
{({ form, field, meta: { error, touched } }) => (
<FormGroup
label={<T id={'cash_flow_transaction.outher_income_account'} />}
label={<T id={'cash_flow_transaction.other_income_account'} />}
labelInfo={<FieldRequiredHint />}
intent={inputIntent({ error, touched })}
helperText={<ErrorMessage name="cashflow_account_id" />}
className={'form-group--cashflow_account_id'}
helperText={<ErrorMessage name="credit_account_id" />}
className={'form-group--credit_account_id'}
>
<AccountsSuggestField
accounts={accounts}
onAccountSelected={({ id }) =>
form.setFieldValue('cashflow_account_id', id)
form.setFieldValue('credit_account_id', id)
}
filterByTypes={[
ACCOUNT_TYPE.INCOME,
ACCOUNT_TYPE.OTHER_INCOME,
]}
inputProps={{
intent: inputIntent({ error, touched }),
}}