mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix: matching transactions bugs
This commit is contained in:
@@ -9,7 +9,6 @@ import {
|
||||
PopoverInteractionKind,
|
||||
Position,
|
||||
Tooltip,
|
||||
MenuDivider,
|
||||
} from '@blueprintjs/core';
|
||||
import { Box, FormatDateCell, Icon, MaterialProgressBar } from '@/components';
|
||||
import { useAccountTransactionsContext } from './AccountTransactionsProvider';
|
||||
@@ -213,9 +212,8 @@ export function useAccountUncategorizedTransactionsColumns() {
|
||||
{
|
||||
id: 'reference_number',
|
||||
Header: 'Ref.#',
|
||||
accessor: 'reference_number',
|
||||
accessor: 'reference_no',
|
||||
width: 50,
|
||||
className: 'reference_number',
|
||||
clickable: true,
|
||||
textOverview: true,
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
FFormGroup,
|
||||
FInputGroup,
|
||||
FTextArea,
|
||||
Icon,
|
||||
} from '@/components';
|
||||
import { useCategorizeTransactionBoot } from '../CategorizeTransactionBoot';
|
||||
import { CategorizeTransactionBranchField } from '../CategorizeTransactionBranchField';
|
||||
@@ -21,7 +22,7 @@ export default function CategorizeTransactionOtherIncome() {
|
||||
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
||||
formatDate={(date) => date.toLocaleDateString()}
|
||||
parseDate={(str) => new Date(str)}
|
||||
inputProps={{ fill: true }}
|
||||
inputProps={{ fill: true, leftElement: <Icon icon={'date-range'} /> }}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
FFormGroup,
|
||||
FInputGroup,
|
||||
FTextArea,
|
||||
Icon,
|
||||
} from '@/components';
|
||||
import { useCategorizeTransactionBoot } from '../CategorizeTransactionBoot';
|
||||
import { CategorizeTransactionBranchField } from '../CategorizeTransactionBranchField';
|
||||
@@ -21,7 +22,7 @@ export default function CategorizeTransactionOwnerContribution() {
|
||||
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
||||
formatDate={(date) => date.toLocaleDateString()}
|
||||
parseDate={(str) => new Date(str)}
|
||||
inputProps={{ fill: true }}
|
||||
inputProps={{ fill: true, leftElement: <Icon icon={'date-range'} /> }}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
FFormGroup,
|
||||
FInputGroup,
|
||||
FTextArea,
|
||||
Icon,
|
||||
} from '@/components';
|
||||
import { useCategorizeTransactionBoot } from '../CategorizeTransactionBoot';
|
||||
import { CategorizeTransactionBranchField } from '../CategorizeTransactionBranchField';
|
||||
@@ -21,7 +22,7 @@ export default function CategorizeTransactionTransferFrom() {
|
||||
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
||||
formatDate={(date) => date.toLocaleDateString()}
|
||||
parseDate={(str) => new Date(str)}
|
||||
inputProps={{ fill: true }}
|
||||
inputProps={{ fill: true, leftElement: <Icon icon={'date-range'} /> }}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
FFormGroup,
|
||||
FInputGroup,
|
||||
FTextArea,
|
||||
Icon,
|
||||
} from '@/components';
|
||||
import { useCategorizeTransactionBoot } from '../CategorizeTransactionBoot';
|
||||
import { CategorizeTransactionBranchField } from '../CategorizeTransactionBranchField';
|
||||
@@ -21,7 +22,7 @@ export default function CategorizeTransactionOtherExpense() {
|
||||
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
||||
formatDate={(date) => date.toLocaleDateString()}
|
||||
parseDate={(str) => new Date(str)}
|
||||
inputProps={{ fill: true }}
|
||||
inputProps={{ fill: true, leftElement: <Icon icon={'date-range'} /> }}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
FFormGroup,
|
||||
FInputGroup,
|
||||
FTextArea,
|
||||
Icon,
|
||||
} from '@/components';
|
||||
import { useCategorizeTransactionBoot } from '../CategorizeTransactionBoot';
|
||||
import { CategorizeTransactionBranchField } from '../CategorizeTransactionBranchField';
|
||||
@@ -21,7 +22,7 @@ export default function CategorizeTransactionOwnerDrawings() {
|
||||
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
||||
formatDate={(date) => date.toLocaleDateString()}
|
||||
parseDate={(str) => new Date(str)}
|
||||
inputProps={{ fill: true }}
|
||||
inputProps={{ fill: true, leftElement: <Icon icon={'date-range'} /> }}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
FFormGroup,
|
||||
FInputGroup,
|
||||
FTextArea,
|
||||
Icon,
|
||||
} from '@/components';
|
||||
import { useCategorizeTransactionBoot } from '../CategorizeTransactionBoot';
|
||||
import { CategorizeTransactionBranchField } from '../CategorizeTransactionBranchField';
|
||||
@@ -21,7 +22,7 @@ export default function CategorizeTransactionToAccount() {
|
||||
popoverProps={{ position: Position.BOTTOM, minimal: true }}
|
||||
formatDate={(date) => date.toLocaleDateString()}
|
||||
parseDate={(str) => new Date(str)}
|
||||
inputProps={{ fill: true }}
|
||||
inputProps={{ fill: true, leftElement: <Icon icon={'date-range'} /> }}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ export const MatchingReconcileFormSchema = Yup.object().shape({
|
||||
type: Yup.string().required().label('Type'),
|
||||
date: Yup.string().required().label('Date'),
|
||||
amount: Yup.string().required().label('Amount'),
|
||||
memo: Yup.string().required().label('Memo'),
|
||||
memo: Yup.string().required().min(3).label('Memo'),
|
||||
referenceNo: Yup.string().label('Refernece #'),
|
||||
category: Yup.string().required().label('Categogry'),
|
||||
});
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
// @ts-nocheck
|
||||
import * as R from 'ramda';
|
||||
import { Button, Intent, Position, Tag } from '@blueprintjs/core';
|
||||
import {
|
||||
Form,
|
||||
Formik,
|
||||
FormikHelpers,
|
||||
FormikValues,
|
||||
useFormikContext,
|
||||
} from 'formik';
|
||||
import { Form, Formik, FormikHelpers, useFormikContext } from 'formik';
|
||||
import moment from 'moment';
|
||||
import { round } from 'lodash';
|
||||
import {
|
||||
AccountsSelect,
|
||||
AppToaster,
|
||||
@@ -19,6 +14,7 @@ import {
|
||||
FInputGroup,
|
||||
FMoneyInputGroup,
|
||||
Group,
|
||||
Icon,
|
||||
} from '@/components';
|
||||
import { Aside } from '@/components/Aside/Aside';
|
||||
import { momentFormatter } from '@/utils';
|
||||
@@ -100,7 +96,7 @@ function MatchingReconcileTransactionFormRoot({
|
||||
|
||||
const _initialValues = {
|
||||
...initialValues,
|
||||
amount: Math.abs(reconcileMatchingTransactionPendingAmount) || 0,
|
||||
amount: round(Math.abs(reconcileMatchingTransactionPendingAmount), 2) || 0,
|
||||
date: moment().format('YYYY-MM-DD'),
|
||||
type:
|
||||
reconcileMatchingTransactionPendingAmount > 0 ? 'deposit' : 'withdrawal',
|
||||
@@ -179,7 +175,7 @@ function CreateReconcileTransactionContent() {
|
||||
},
|
||||
boundary: 'viewport',
|
||||
}}
|
||||
inputProps={{ fill: true }}
|
||||
inputProps={{ fill: true, leftElement: <Icon icon={'date-range'} /> }}
|
||||
fill
|
||||
fastField
|
||||
/>
|
||||
|
||||
@@ -235,6 +235,12 @@ export function useExcludeUncategorizedTransaction(
|
||||
queryClient.invalidateQueries(
|
||||
t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY,
|
||||
);
|
||||
// Invalidate accounts.
|
||||
queryClient.invalidateQueries(t.ACCOUNTS);
|
||||
queryClient.invalidateQueries(t.ACCOUNT);
|
||||
|
||||
// invalidate bank account summary.
|
||||
queryClient.invalidateQueries(QUERY_KEY.BANK_ACCOUNT_SUMMARY_META);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -282,6 +288,12 @@ export function useUnexcludeUncategorizedTransaction(
|
||||
queryClient.invalidateQueries(
|
||||
t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY,
|
||||
);
|
||||
// Invalidate accounts.
|
||||
queryClient.invalidateQueries(t.ACCOUNTS);
|
||||
queryClient.invalidateQueries(t.ACCOUNT);
|
||||
|
||||
// Invalidate bank account summary.
|
||||
queryClient.invalidateQueries(QUERY_KEY.BANK_ACCOUNT_SUMMARY_META);
|
||||
},
|
||||
...options,
|
||||
},
|
||||
@@ -323,6 +335,13 @@ export function useMatchUncategorizedTransaction(
|
||||
t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY,
|
||||
);
|
||||
queryClient.invalidateQueries(t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY);
|
||||
|
||||
// Invalidate accounts.
|
||||
queryClient.invalidateQueries(t.ACCOUNTS);
|
||||
queryClient.invalidateQueries(t.ACCOUNT);
|
||||
|
||||
// Invalidate bank account summary.
|
||||
queryClient.invalidateQueries(QUERY_KEY.BANK_ACCOUNT_SUMMARY_META);
|
||||
},
|
||||
...props,
|
||||
});
|
||||
@@ -362,6 +381,13 @@ export function useUnmatchMatchedUncategorizedTransaction(
|
||||
t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY,
|
||||
);
|
||||
queryClient.invalidateQueries(t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY);
|
||||
|
||||
// Invalidate accounts.
|
||||
queryClient.invalidateQueries(t.ACCOUNTS);
|
||||
queryClient.invalidateQueries(t.ACCOUNT);
|
||||
|
||||
// Invalidate bank account summary.
|
||||
queryClient.invalidateQueries(QUERY_KEY.BANK_ACCOUNT_SUMMARY_META);
|
||||
},
|
||||
...props,
|
||||
});
|
||||
|
||||
@@ -253,6 +253,9 @@ export function useCategorizeTransaction(props) {
|
||||
queryClient.invalidateQueries(
|
||||
t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY,
|
||||
);
|
||||
|
||||
// Invalidate bank account summary.
|
||||
queryClient.invalidateQueries('BANK_ACCOUNT_SUMMARY_META');
|
||||
},
|
||||
...props,
|
||||
},
|
||||
@@ -276,6 +279,9 @@ export function useUncategorizeTransaction(props) {
|
||||
queryClient.invalidateQueries(
|
||||
t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY,
|
||||
);
|
||||
|
||||
// Invalidate bank account summary.
|
||||
queryClient.invalidateQueries('BANK_ACCOUNT_SUMMARY_META');
|
||||
},
|
||||
...props,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user