mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
fix(webapp): transaction number duplicated variable name
This commit is contained in:
@@ -22,7 +22,7 @@ function MoneyInDialogProvider({
|
|||||||
dialogName,
|
dialogName,
|
||||||
...props
|
...props
|
||||||
}) {
|
}) {
|
||||||
// Holds the selected account id.
|
// Holds the selected account id of the dialog.
|
||||||
const [accountId, setAccountId] = useState<number | null>(defaultAccountId);
|
const [accountId, setAccountId] = useState<number | null>(defaultAccountId);
|
||||||
|
|
||||||
// Detarmines whether the feature is enabled.
|
// Detarmines whether the feature is enabled.
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FastField, ErrorMessage, useFormikContext } from 'formik';
|
import { FastField, ErrorMessage } from 'formik';
|
||||||
import { FormGroup, Position, ControlGroup } from '@blueprintjs/core';
|
import { FormGroup, Position, ControlGroup } from '@blueprintjs/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { DateInput } from '@blueprintjs/datetime';
|
||||||
import {
|
import {
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
AccountsSuggestField,
|
AccountsSuggestField,
|
||||||
InputPrependText,
|
InputPrependText,
|
||||||
MoneyInputGroup,
|
|
||||||
FieldRequiredHint,
|
FieldRequiredHint,
|
||||||
Col,
|
Col,
|
||||||
Row,
|
Row,
|
||||||
If,
|
|
||||||
ExchangeRateMutedField,
|
|
||||||
BranchSelect,
|
BranchSelect,
|
||||||
BranchSelectButton,
|
BranchSelectButton,
|
||||||
FeatureCan,
|
FeatureCan,
|
||||||
@@ -22,7 +19,6 @@ import {
|
|||||||
FTextArea,
|
FTextArea,
|
||||||
FInputGroup,
|
FInputGroup,
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { DateInput } from '@blueprintjs/datetime';
|
|
||||||
import { ACCOUNT_TYPE, CLASSES, Features } from '@/constants';
|
import { ACCOUNT_TYPE, CLASSES, Features } from '@/constants';
|
||||||
import {
|
import {
|
||||||
inputIntent,
|
inputIntent,
|
||||||
@@ -33,11 +29,11 @@ import {
|
|||||||
import { useMoneyInDailogContext } from '../MoneyInDialogProvider';
|
import { useMoneyInDailogContext } from '../MoneyInDialogProvider';
|
||||||
import {
|
import {
|
||||||
useSetPrimaryBranchToForm,
|
useSetPrimaryBranchToForm,
|
||||||
useForeignAccount,
|
|
||||||
BranchRowDivider,
|
BranchRowDivider,
|
||||||
} from '../../MoneyInDialog/utils';
|
} from '../../MoneyInDialog/utils';
|
||||||
import { MoneyInOutTransactionNoField } from '../../_components';
|
import { MoneyInOutTransactionNoField } from '../../_components';
|
||||||
import { useMoneyInFieldsContext } from '../MoneyInFieldsProvider';
|
import { useMoneyInFieldsContext } from '../MoneyInFieldsProvider';
|
||||||
|
import { MoneyInExchangeRateField } from '../MoneyInExchangeRateField';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
/**
|
/**
|
||||||
@@ -48,10 +44,6 @@ export default function OwnerContributionFormFields() {
|
|||||||
const { accounts, branches } = useMoneyInDailogContext();
|
const { accounts, branches } = useMoneyInDailogContext();
|
||||||
const { account } = useMoneyInFieldsContext();
|
const { account } = useMoneyInFieldsContext();
|
||||||
|
|
||||||
const { values } = useFormikContext();
|
|
||||||
|
|
||||||
const isForeigAccount = useForeignAccount();
|
|
||||||
|
|
||||||
// Sets the primary branch to form.
|
// Sets the primary branch to form.
|
||||||
useSetPrimaryBranchToForm();
|
useSetPrimaryBranchToForm();
|
||||||
|
|
||||||
@@ -124,17 +116,9 @@ export default function OwnerContributionFormFields() {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<If condition={isForeigAccount}>
|
{/*------------ Exchange rate -----------*/}
|
||||||
{/*------------ exchange rate -----------*/}
|
<MoneyInExchangeRateField />
|
||||||
<ExchangeRateMutedField
|
|
||||||
name={'exchange_rate'}
|
|
||||||
fromCurrency={values.currency_code}
|
|
||||||
toCurrency={account.currency_code}
|
|
||||||
formGroupProps={{ label: '', inline: false }}
|
|
||||||
date={values.date}
|
|
||||||
exchangeRate={values.exchange_rate}
|
|
||||||
/>
|
|
||||||
</If>
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
{/*------------ equity account -----------*/}
|
{/*------------ equity account -----------*/}
|
||||||
@@ -171,7 +155,7 @@ export default function OwnerContributionFormFields() {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{/*------------ description -----------*/}
|
{/*------------ Description -----------*/}
|
||||||
<FFormGroup name={'description'} label={<T id={'description'} />}>
|
<FFormGroup name={'description'} label={<T id={'description'} />}>
|
||||||
<FTextArea
|
<FTextArea
|
||||||
name={'description'}
|
name={'description'}
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ export const MoneyInOutSyncIncrementSettingsToForm = R.compose(
|
|||||||
// Do not update if the invoice auto-increment is disabled.
|
// Do not update if the invoice auto-increment is disabled.
|
||||||
if (!transactionAutoIncrement) return null;
|
if (!transactionAutoIncrement) return null;
|
||||||
|
|
||||||
const transactionNumber = transactionNumber(
|
const newTransactionNumber = transactionNumber(
|
||||||
transactionNumberPrefix,
|
transactionNumberPrefix,
|
||||||
transactionNextNumber,
|
transactionNextNumber,
|
||||||
);
|
);
|
||||||
setFieldValue('transaction_number', transactionNumber);
|
setFieldValue('transaction_number', newTransactionNumber);
|
||||||
}, [setFieldValue, transactionNumberPrefix, transactionNextNumber]);
|
}, [setFieldValue, transactionNumberPrefix, transactionNextNumber]);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user