diff --git a/src/containers/Accounting/MakeJournal/MakeJournalEntriesHeaderFields.js b/src/containers/Accounting/MakeJournal/MakeJournalEntriesHeaderFields.js index 448ef9b67..9e5e3a783 100644 --- a/src/containers/Accounting/MakeJournal/MakeJournalEntriesHeaderFields.js +++ b/src/containers/Accounting/MakeJournal/MakeJournalEntriesHeaderFields.js @@ -9,7 +9,6 @@ import { FastField, ErrorMessage } from 'formik'; import { DateInput } from '@blueprintjs/datetime'; import { FormattedMessage as T } from 'components'; import classNames from 'classnames'; -import { Features } from 'common'; import { CLASSES } from 'common/classes'; import { @@ -24,14 +23,12 @@ import { FieldHint, FieldRequiredHint, Icon, - If, - FeatureCan, InputPrependButton, CurrencySelectList, - ExchangeRateInputGroup, } from 'components'; import withSettings from 'containers/Settings/withSettings'; import { useMakeJournalFormContext } from './MakeJournalProvider'; +import { JournalExchangeRateInputField } from './components'; import withDialogActions from 'containers/Dialog/withDialogActions'; import { currenciesFieldShouldUpdate, @@ -52,13 +49,7 @@ function MakeJournalEntriesHeader({ journalNextNumber, journalNumberPrefix, }) { - const { - currencies, - isForeignJournal, - baseCurrency, - selectJournalCurrency, - setSelactJournalCurrency, - } = useMakeJournalFormContext(); + const { currencies } = useMakeJournalFormContext(); // Handle journal number change. const handleJournalNumberChange = () => { @@ -195,45 +186,35 @@ function MakeJournalEntriesHeader({ {/*------------ 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', ''); - setSelactJournalCurrency(currencyItem); - }} - defaultSelectText={value} - /> - - )} - - + + {({ 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 ----------- */} - - - + ); } diff --git a/src/containers/Accounting/MakeJournal/MakeJournalFormFooter.js b/src/containers/Accounting/MakeJournal/MakeJournalFormFooter.js index fd1315e05..26c11aa29 100644 --- a/src/containers/Accounting/MakeJournal/MakeJournalFormFooter.js +++ b/src/containers/Accounting/MakeJournal/MakeJournalFormFooter.js @@ -1,44 +1,29 @@ import React from 'react'; -import { FastField } from 'formik'; import classNames from 'classnames'; +import styled from 'styled-components'; + import { CLASSES } from 'common/classes'; -import { FormGroup, TextArea } from '@blueprintjs/core'; -import { FormattedMessage as T } from 'components'; -import { Postbox, ErrorMessage, Row, Col } from 'components'; -import Dragzone from 'components/Dragzone'; -import { inputIntent } from 'utils'; +import { Row, Col, Paper } from 'components'; +import { MakeJournalFormFooterLeft } from './MakeJournalFormFooterLeft'; +import { MakeJournalFormFooterRight } from './MakeJournalFormFooterRight'; export default function MakeJournalFormFooter() { return (
- } defaultOpen={false}> + - - {({ field, meta: { error, touched } }) => ( - } - className={'form-group--description'} - intent={inputIntent({ error, touched })} - helperText={} - fill={true} - > -