// @ts-nocheck
import React from 'react';
import { InputGroup, FormGroup, Position } from '@blueprintjs/core';
import { FastField, ErrorMessage } from 'formik';
import { DateInput } from '@blueprintjs/datetime';
import classNames from 'classnames';
import { CLASSES } from '@/constants/classes';
import {
momentFormatter,
inputIntent,
handleDateChange,
tansformDateValue,
} from '@/utils';
import {
Hint,
FieldRequiredHint,
Icon,
CurrencySelectList,
FormattedMessage as T,
} from '@/components';
import { useMakeJournalFormContext } from './MakeJournalProvider';
import { JournalExchangeRateInputField } from './components';
import { currenciesFieldShouldUpdate } from './utils';
import { MakeJournalTransactionNoField } from './MakeJournalTransactionNoField';
/**
* Make journal entries header.
*/
export default function MakeJournalEntriesHeader({}) {
const { currencies } = useMakeJournalFormContext();
return (
{/*------------ Posting date -----------*/}
{({ form, field: { value }, meta: { error, touched } }) => (
}
labelInfo={}
intent={inputIntent({ error, touched })}
helperText={}
minimal={true}
inline={true}
className={classNames(CLASSES.FILL)}
>
{
form.setFieldValue('date', formattedDate);
})}
value={tansformDateValue(value)}
popoverProps={{
position: Position.BOTTOM,
minimal: true,
}}
inputProps={{
leftIcon: ,
}}
/>
)}
{/*------------ Journal number -----------*/}
{/*------------ Reference -----------*/}
{({ form, field, meta: { error, touched } }) => (
}
labelInfo={
}
position={Position.RIGHT}
/>
}
className={'form-group--reference'}
intent={inputIntent({ error, touched })}
helperText={}
fill={true}
inline={true}
>
)}
{/*------------ Journal type -----------*/}
{({ form, field, meta: { error, touched } }) => (
}
className={classNames('form-group--account-type', CLASSES.FILL)}
inline={true}
>
)}
{/*------------ Currency -----------*/}
{({ form, field: { value }, meta: { error, touched } }) => (
}
className={classNames('form-group--currency', CLASSES.FILL)}
inline={true}
>
{
form.setFieldValue('currency_code', currencyItem.currency_code);
form.setFieldValue('exchange_rate', '');
}}
defaultSelectText={value}
/>
)}
{/* ----------- Exchange rate ----------- */}
);
}