mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
feat: fix setting cash.
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
|||||||
useCreateCashflowTransaction,
|
useCreateCashflowTransaction,
|
||||||
useAccounts,
|
useAccounts,
|
||||||
useCashflowAccounts,
|
useCashflowAccounts,
|
||||||
|
useSettingCashFlow,
|
||||||
} from 'hooks/query';
|
} from 'hooks/query';
|
||||||
|
|
||||||
const MoneyInDialogContent = React.createContext();
|
const MoneyInDialogContent = React.createContext();
|
||||||
@@ -27,6 +28,9 @@ function MoneyInDialogProvider({
|
|||||||
const { mutateAsync: createCashflowTransactionMutate } =
|
const { mutateAsync: createCashflowTransactionMutate } =
|
||||||
useCreateCashflowTransaction();
|
useCreateCashflowTransaction();
|
||||||
|
|
||||||
|
// Handle fetching settings.
|
||||||
|
const { isLoading: isSettingsLoading } = useSettingCashFlow();
|
||||||
|
|
||||||
// Submit payload.
|
// Submit payload.
|
||||||
const [submitPayload, setSubmitPayload] = React.useState({});
|
const [submitPayload, setSubmitPayload] = React.useState({});
|
||||||
|
|
||||||
@@ -47,7 +51,11 @@ function MoneyInDialogProvider({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DialogContent isLoading={isAccountsLoading || isCashFlowAccountsLoading}>
|
<DialogContent
|
||||||
|
isLoading={
|
||||||
|
isAccountsLoading || isCashFlowAccountsLoading || isSettingsLoading
|
||||||
|
}
|
||||||
|
>
|
||||||
<MoneyInDialogContent.Provider value={provider} {...props} />
|
<MoneyInDialogContent.Provider value={provider} {...props} />
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FastField, ErrorMessage } from 'formik';
|
import { FastField, Field, ErrorMessage } from 'formik';
|
||||||
import {
|
import {
|
||||||
Classes,
|
Classes,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
@@ -112,7 +112,7 @@ function OtherIncomeFormFields({
|
|||||||
</Col>
|
</Col>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
{/*------------ Transaction number -----------*/}
|
{/*------------ Transaction number -----------*/}
|
||||||
<FastField name={'transaction_number'}>
|
<Field name={'transaction_number'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'transaction_number'} />}
|
label={<T id={'transaction_number'} />}
|
||||||
@@ -147,7 +147,7 @@ function OtherIncomeFormFields({
|
|||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</Field>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
{/*------------ amount -----------*/}
|
{/*------------ amount -----------*/}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FastField, ErrorMessage } from 'formik';
|
import { FastField, Field, ErrorMessage } from 'formik';
|
||||||
import {
|
import {
|
||||||
Classes,
|
Classes,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
momentFormatter,
|
momentFormatter,
|
||||||
tansformDateValue,
|
tansformDateValue,
|
||||||
handleDateChange,
|
handleDateChange,
|
||||||
compose
|
compose,
|
||||||
} from 'utils';
|
} from 'utils';
|
||||||
import { CLASSES } from 'common/classes';
|
import { CLASSES } from 'common/classes';
|
||||||
import { useMoneyInDailogContext } from '../MoneyInDialogProvider';
|
import { useMoneyInDailogContext } from '../MoneyInDialogProvider';
|
||||||
@@ -112,7 +112,7 @@ function OwnerContributionFormFields({
|
|||||||
</Col>
|
</Col>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
{/*------------ Transaction number -----------*/}
|
{/*------------ Transaction number -----------*/}
|
||||||
<FastField name={'transaction_number'}>
|
<Field name={'transaction_number'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'transaction_number'} />}
|
label={<T id={'transaction_number'} />}
|
||||||
@@ -147,7 +147,7 @@ function OwnerContributionFormFields({
|
|||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</Field>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
{/*------------ amount -----------*/}
|
{/*------------ amount -----------*/}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FastField, ErrorMessage } from 'formik';
|
import { FastField, Field, ErrorMessage } from 'formik';
|
||||||
import {
|
import {
|
||||||
Classes,
|
Classes,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
@@ -111,7 +111,7 @@ function TransferFromAccountFormFields({
|
|||||||
</Col>
|
</Col>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
{/*------------ Transaction number -----------*/}
|
{/*------------ Transaction number -----------*/}
|
||||||
<FastField name={'transaction_number'}>
|
<Field name={'transaction_number'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'transaction_number'} />}
|
label={<T id={'transaction_number'} />}
|
||||||
@@ -146,7 +146,7 @@ function TransferFromAccountFormFields({
|
|||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</Field>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
{/*------------ amount -----------*/}
|
{/*------------ amount -----------*/}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
useAccounts,
|
useAccounts,
|
||||||
useCreateCashflowTransaction,
|
useCreateCashflowTransaction,
|
||||||
useCashflowAccounts,
|
useCashflowAccounts,
|
||||||
|
useSettingCashFlow,
|
||||||
} from 'hooks/query';
|
} from 'hooks/query';
|
||||||
|
|
||||||
const MoneyInDialogContent = React.createContext();
|
const MoneyInDialogContent = React.createContext();
|
||||||
@@ -22,6 +23,9 @@ function MoneyOutProvider({ accountId, accountType, dialogName, ...props }) {
|
|||||||
const { mutateAsync: createCashflowTransactionMutate } =
|
const { mutateAsync: createCashflowTransactionMutate } =
|
||||||
useCreateCashflowTransaction();
|
useCreateCashflowTransaction();
|
||||||
|
|
||||||
|
// Handle fetching settings.
|
||||||
|
const { isLoading: isSettingsLoading } = useSettingCashFlow();
|
||||||
|
|
||||||
// Submit payload.
|
// Submit payload.
|
||||||
const [submitPayload, setSubmitPayload] = React.useState({});
|
const [submitPayload, setSubmitPayload] = React.useState({});
|
||||||
|
|
||||||
@@ -42,7 +46,11 @@ function MoneyOutProvider({ accountId, accountType, dialogName, ...props }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DialogContent isLoading={isAccountsLoading || isCashFlowAccountsLoading}>
|
<DialogContent
|
||||||
|
isLoading={
|
||||||
|
isAccountsLoading || isCashFlowAccountsLoading || isSettingsLoading
|
||||||
|
}
|
||||||
|
>
|
||||||
<MoneyInDialogContent.Provider value={provider} {...props} />
|
<MoneyInDialogContent.Provider value={provider} {...props} />
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FastField, ErrorMessage } from 'formik';
|
import { FastField, Field, ErrorMessage } from 'formik';
|
||||||
import {
|
import {
|
||||||
Classes,
|
Classes,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
@@ -112,7 +112,7 @@ function OtherExpnseFormFields({
|
|||||||
</Col>
|
</Col>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
{/*------------ Transaction number -----------*/}
|
{/*------------ Transaction number -----------*/}
|
||||||
<FastField name={'transaction_number'}>
|
<Field name={'transaction_number'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'transaction_number'} />}
|
label={<T id={'transaction_number'} />}
|
||||||
@@ -147,7 +147,7 @@ function OtherExpnseFormFields({
|
|||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</Field>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
{/*------------ amount -----------*/}
|
{/*------------ amount -----------*/}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ function OwnerDrawingsFormFields({
|
|||||||
</Col>
|
</Col>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
{/*------------ Transaction number -----------*/}
|
{/*------------ Transaction number -----------*/}
|
||||||
<FastField name={'transaction_number'}>
|
<Field name={'transaction_number'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'transaction_number'} />}
|
label={<T id={'transaction_number'} />}
|
||||||
@@ -146,7 +146,7 @@ function OwnerDrawingsFormFields({
|
|||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</Field>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
{/*------------ amount -----------*/}
|
{/*------------ amount -----------*/}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FastField, ErrorMessage } from 'formik';
|
import { FastField, Field, ErrorMessage } from 'formik';
|
||||||
import {
|
import {
|
||||||
Classes,
|
Classes,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
@@ -112,7 +112,7 @@ function TransferToAccountFormFields({
|
|||||||
</Col>
|
</Col>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
{/*------------ Transaction number -----------*/}
|
{/*------------ Transaction number -----------*/}
|
||||||
<FastField name={'transaction_number'}>
|
<Field name={'transaction_number'}>
|
||||||
{({ form, field, meta: { error, touched } }) => (
|
{({ form, field, meta: { error, touched } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'transaction_number'} />}
|
label={<T id={'transaction_number'} />}
|
||||||
@@ -147,7 +147,7 @@ function TransferToAccountFormFields({
|
|||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
</FastField>
|
</Field>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
{/*------------ amount -----------*/}
|
{/*------------ amount -----------*/}
|
||||||
|
|||||||
Reference in New Issue
Block a user