mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: wip matching bank transactions
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
// @ts-nocheck
|
||||
import { Menu, MenuItem, MenuDivider } from '@blueprintjs/core';
|
||||
import { safeCallback } from '@/utils';
|
||||
import { Icon } from '@/components';
|
||||
|
||||
export function ActionsMenu({ payload: { onRestore }, row: { original } }) {
|
||||
return (
|
||||
<Menu>
|
||||
<MenuItem text={'Restore'} onClick={safeCallback(onRestore, original)} />
|
||||
<MenuItem
|
||||
text={'Restore'}
|
||||
icon={<Icon icon="redo" iconSize={16} />}
|
||||
onClick={safeCallback(onRestore, original)}
|
||||
/>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export function ActionsMenu({
|
||||
<MenuItem
|
||||
text={'Exclude'}
|
||||
onClick={safeCallback(onExclude, original)}
|
||||
// icon={<Icon icon="trash-16" iconSize={16} />}
|
||||
icon={<Icon icon="disable" iconSize={16} />}
|
||||
/>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
// @ts-nocheck
|
||||
import { Formik, Form } from 'formik';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import styled from 'styled-components';
|
||||
import { CreateCategorizeTransactionSchema } from './CategorizeTransactionForm.schema';
|
||||
import { CategorizeTransactionFormContent } from './CategorizeTransactionFormContent';
|
||||
import { CategorizeTransactionFormFooter } from './CategorizeTransactionFormFooter';
|
||||
import { useCategorizeTransaction } from '@/hooks/query';
|
||||
import { useCategorizeTransactionBoot } from './CategorizeTransactionBoot';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import {
|
||||
transformToCategorizeForm,
|
||||
defaultInitialValues,
|
||||
tranformToRequest,
|
||||
} from './_utils';
|
||||
import { compose } from '@/utils';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withBankingActions } from '@/containers/CashFlow/withBankingActions';
|
||||
import { AppToaster } from '@/components';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { useCategorizeTransactionTabsBoot } from '@/containers/CashFlow/CategorizeTransactionAside/CategorizeTransactionTabsBoot';
|
||||
|
||||
/**
|
||||
* Categorize cashflow transaction form dialog content.
|
||||
*/
|
||||
function CategorizeTransactionFormRoot({
|
||||
// #withDrawerActions
|
||||
closeDrawer,
|
||||
// #withBankingActions
|
||||
closeMatchingTransactionAside,
|
||||
}) {
|
||||
const { uncategorizedTransactionId, uncategorizedTransaction } =
|
||||
useCategorizeTransactionTabsBoot();
|
||||
@@ -38,12 +37,12 @@ function CategorizeTransactionFormRoot({
|
||||
categorizeTransaction([uncategorizedTransactionId, transformedValues])
|
||||
.then(() => {
|
||||
setSubmitting(false);
|
||||
closeDrawer(DRAWERS.CATEGORIZE_TRANSACTION);
|
||||
|
||||
AppToaster.show({
|
||||
message: 'The uncategorized transaction has been categorized.',
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
closeMatchingTransactionAside();
|
||||
})
|
||||
.catch((err) => {
|
||||
setSubmitting(false);
|
||||
@@ -93,7 +92,7 @@ function CategorizeTransactionFormRoot({
|
||||
);
|
||||
}
|
||||
|
||||
export const CategorizeTransactionForm = compose(withDrawerActions)(
|
||||
export const CategorizeTransactionForm = compose(withBankingActions)(
|
||||
CategorizeTransactionFormRoot,
|
||||
);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export function MatchingBankTransaction() {
|
||||
});
|
||||
return;
|
||||
}
|
||||
matchTransaction({ id: uncategorizedTransactionId, values: _values })
|
||||
matchTransaction({ id: uncategorizedTransactionId, value: _values })
|
||||
.then(() => {
|
||||
AppToaster.show({
|
||||
intent: Intent.SUCCESS,
|
||||
|
||||
Reference in New Issue
Block a user