fix: journal number increment.

This commit is contained in:
Ahmed Bouhuolia
2020-11-07 14:28:25 +02:00
parent cc1de9c897
commit acd74fd044
14 changed files with 146 additions and 72 deletions

View File

@@ -11,7 +11,7 @@ import { FormattedMessage as T } from 'react-intl';
import { Row, Col } from 'react-grid-system';
import moment from 'moment';
import classNames from 'classnames';
import { momentFormatter, tansformDateValue } from 'utils';
import { momentFormatter, tansformDateValue, saveInvoke } from 'utils';
import {
CurrenciesSelectList,
ErrorMessage,
@@ -27,7 +27,14 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import { compose } from 'utils';
function MakeJournalEntriesHeader({
formik: { errors, touched, values, setFieldValue, getFieldProps },
errors,
touched,
values,
setFieldValue,
getFieldProps,
// #ownProps
onJournalNumberChanged,
// #withDialog
openDialog,
@@ -43,6 +50,11 @@ function MakeJournalEntriesHeader({
openDialog('journal-number-form', {});
}, [openDialog]);
// Handle journal number field blur event.
const handleJournalNumberChanged = (event) => {
saveInvoke(onJournalNumberChanged, event.currentTarget.value);
};
return (
<div class="make-journal-entries__header">
<Row>
@@ -82,6 +94,7 @@ function MakeJournalEntriesHeader({
}}
/>}
{...getFieldProps('journal_number')}
onBlur={handleJournalNumberChanged}
/>
</FormGroup>
</Col>