// @ts-nocheck import React from 'react'; import { FastField, ErrorMessage } from 'formik'; import { Classes, FormGroup, TextArea, Position, ControlGroup, } from '@blueprintjs/core'; import classNames from 'classnames'; import { FormattedMessage as T, AccountsSuggestField, InputPrependText, MoneyInputGroup, FieldRequiredHint, Col, Row, FeatureCan, BranchSelect, BranchSelectButton, FInputGroup, FFormGroup, FTextArea, FMoneyInputGroup, } from '@/components'; import { DateInput } from '@blueprintjs/datetime'; import { CLASSES, ACCOUNT_TYPE, Features } from '@/constants'; import { inputIntent, momentFormatter, tansformDateValue, handleDateChange, } from '@/utils'; import { useMoneyInDailogContext } from '../MoneyInDialogProvider'; import { useSetPrimaryBranchToForm, BranchRowDivider } from '../utils'; import { MoneyInOutTransactionNoField } from '../../_components'; import { useMoneyInFieldsContext } from '../MoneyInFieldsProvider'; import { MoneyInExchangeRateField } from '../MoneyInExchangeRateField'; /** * Other income form fields. */ export default function OtherIncomeFormFields() { // Money in dialog context. const { accounts, branches } = useMoneyInDailogContext(); const { account } = useMoneyInFieldsContext(); // Sets the primary branch to form. useSetPrimaryBranchToForm(); return ( }> {/*------------ Date -----------*/} {({ form, field: { value }, meta: { error, touched } }) => ( } labelInfo={} intent={inputIntent({ error, touched })} helperText={} minimal={true} className={classNames(CLASSES.FILL, 'form-group--date')} > { form.setFieldValue('date', formattedDate); })} value={tansformDateValue(value)} popoverProps={{ position: Position.BOTTOM, minimal: true, }} intent={inputIntent({ error, touched })} /> )} {/*------------ Transaction number -----------*/} {/*------------ Amount -----------*/} } labelInfo={} > {/*------------ Exchange rate -----------*/} {/*------------ other income account -----------*/} {({ form, field, meta: { error, touched } }) => ( } labelInfo={} intent={inputIntent({ error, touched })} helperText={} className={'form-group--credit_account_id'} > form.setFieldValue('credit_account_id', id) } filterByTypes={[ ACCOUNT_TYPE.INCOME, ACCOUNT_TYPE.OTHER_INCOME, ]} inputProps={{ intent: inputIntent({ error, touched }), }} /> )} {/*------------ Reference -----------*/} } name={'reference_no'}> {/*------------ Description -----------*/} }> ); }