mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
fix: add base_currecny in manual journal.
This commit is contained in:
@@ -3,7 +3,7 @@ import { Formik, Form } from 'formik';
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { Intent } from '@blueprintjs/core';
|
import { Intent } from '@blueprintjs/core';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
import { pick } from 'lodash';
|
import { pick, defaultTo } from 'lodash';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ function MakeJournalEntriesForm({
|
|||||||
// #withSettings
|
// #withSettings
|
||||||
journalNextNumber,
|
journalNextNumber,
|
||||||
journalNumberPrefix,
|
journalNumberPrefix,
|
||||||
|
baseCurrency,
|
||||||
// #ownProps
|
// #ownProps
|
||||||
manualJournalId,
|
manualJournalId,
|
||||||
manualJournal,
|
manualJournal,
|
||||||
@@ -126,7 +126,8 @@ function MakeJournalEntriesForm({
|
|||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
...defaultInitialValues,
|
...defaultInitialValues,
|
||||||
journal_number: journalNumber,
|
journal_number: defaultTo(journalNumber, ''),
|
||||||
|
currency_code: defaultTo(baseCurrency, ''),
|
||||||
entries: orderingLinesIndexes(defaultInitialValues.entries),
|
entries: orderingLinesIndexes(defaultInitialValues.entries),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
@@ -239,7 +240,7 @@ function MakeJournalEntriesForm({
|
|||||||
validationSchema={isNewMode ? CreateJournalSchema : EditJournalSchema}
|
validationSchema={isNewMode ? CreateJournalSchema : EditJournalSchema}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
>
|
>
|
||||||
{({ isSubmitting}) => (
|
{({ isSubmitting }) => (
|
||||||
<Form>
|
<Form>
|
||||||
<MakeJournalEntriesHeader
|
<MakeJournalEntriesHeader
|
||||||
manualJournal={manualJournalId}
|
manualJournal={manualJournalId}
|
||||||
@@ -274,9 +275,10 @@ export default compose(
|
|||||||
withAccountsActions,
|
withAccountsActions,
|
||||||
withDashboardActions,
|
withDashboardActions,
|
||||||
withMediaActions,
|
withMediaActions,
|
||||||
withSettings(({ manualJournalsSettings }) => ({
|
withSettings(({ manualJournalsSettings, organizationSettings }) => ({
|
||||||
journalNextNumber: parseInt(manualJournalsSettings?.nextNumber, 10),
|
journalNextNumber: parseInt(manualJournalsSettings?.nextNumber, 10),
|
||||||
journalNumberPrefix: manualJournalsSettings?.numberPrefix,
|
journalNumberPrefix: manualJournalsSettings?.numberPrefix,
|
||||||
|
baseCurrency: organizationSettings?.baseCurrency,
|
||||||
})),
|
})),
|
||||||
withManualJournalsActions,
|
withManualJournalsActions,
|
||||||
)(MakeJournalEntriesForm);
|
)(MakeJournalEntriesForm);
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ function MakeJournalEntriesHeader({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_HEADER_FIELDS)}>
|
<div className={classNames(CLASSES.PAGE_FORM_HEADER_FIELDS)}>
|
||||||
|
{/*------------ Posting date -----------*/}
|
||||||
<FastField name={'date'}>
|
<FastField name={'date'}>
|
||||||
{({ form, field: { value }, meta: { error, touched } }) => (
|
{({ form, field: { value }, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
@@ -77,6 +78,7 @@ function MakeJournalEntriesHeader({
|
|||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|
||||||
|
{/*------------ Journal number -----------*/}
|
||||||
<FastField name={'journal_number'}>
|
<FastField name={'journal_number'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
@@ -115,6 +117,7 @@ function MakeJournalEntriesHeader({
|
|||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|
||||||
|
{/*------------ Reference -----------*/}
|
||||||
<FastField name={'reference'}>
|
<FastField name={'reference'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
@@ -136,14 +139,12 @@ function MakeJournalEntriesHeader({
|
|||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|
||||||
|
{/*------------ Journal type -----------*/}
|
||||||
<FastField name={'journal_type'}>
|
<FastField name={'journal_type'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'journal_type'} />}
|
label={<T id={'journal_type'} />}
|
||||||
className={classNames(
|
className={classNames('form-group--account-type', CLASSES.FILL)}
|
||||||
'form-group--account-type',
|
|
||||||
CLASSES.FILL,
|
|
||||||
)}
|
|
||||||
inline={true}
|
inline={true}
|
||||||
>
|
>
|
||||||
<InputGroup
|
<InputGroup
|
||||||
@@ -155,14 +156,12 @@ function MakeJournalEntriesHeader({
|
|||||||
)}
|
)}
|
||||||
</FastField>
|
</FastField>
|
||||||
|
|
||||||
<FastField name={'currency'}>
|
{/*------------ Currency -----------*/}
|
||||||
|
<FastField name={'currency_code'}>
|
||||||
{({ form, field: { value }, meta: { error, touched } }) => (
|
{({ form, field: { value }, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'currency'} />}
|
label={<T id={'currency'} />}
|
||||||
className={classNames(
|
className={classNames('form-group--currency', CLASSES.FILL)}
|
||||||
'form-group--currency',
|
|
||||||
CLASSES.FILL,
|
|
||||||
)}
|
|
||||||
inline={true}
|
inline={true}
|
||||||
>
|
>
|
||||||
<CurrencySelectList
|
<CurrencySelectList
|
||||||
|
|||||||
Reference in New Issue
Block a user