mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 23:30:32 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e437a041c | ||
|
|
5dde7f5584 | ||
|
|
8e0911ec85 |
@@ -50,8 +50,8 @@ export class JournalSheetTable extends R.compose(
|
|||||||
{ key: 'description', accessor: 'entry.note' },
|
{ key: 'description', accessor: 'entry.note' },
|
||||||
{ key: 'account_code', accessor: 'entry.accountCode' },
|
{ key: 'account_code', accessor: 'entry.accountCode' },
|
||||||
{ key: 'account_name', accessor: 'entry.accountName' },
|
{ key: 'account_name', accessor: 'entry.accountName' },
|
||||||
{ key: 'credit', accessor: 'entry.formattedCredit' },
|
|
||||||
{ key: 'debit', accessor: 'entry.formattedDebit' },
|
{ key: 'debit', accessor: 'entry.formattedDebit' },
|
||||||
|
{ key: 'credit', accessor: 'entry.formattedCredit' },
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -67,8 +67,8 @@ export class JournalSheetTable extends R.compose(
|
|||||||
{ key: 'description', accessor: 'note' },
|
{ key: 'description', accessor: 'note' },
|
||||||
{ key: 'account_code', accessor: 'accountCode' },
|
{ key: 'account_code', accessor: 'accountCode' },
|
||||||
{ key: 'account_name', accessor: 'accountName' },
|
{ key: 'account_name', accessor: 'accountName' },
|
||||||
{ key: 'credit', accessor: 'formattedCredit' },
|
|
||||||
{ key: 'debit', accessor: 'formattedDebit' },
|
{ key: 'debit', accessor: 'formattedDebit' },
|
||||||
|
{ key: 'credit', accessor: 'formattedCredit' },
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -84,8 +84,8 @@ export class JournalSheetTable extends R.compose(
|
|||||||
{ key: 'description', accessor: '_empty_' },
|
{ key: 'description', accessor: '_empty_' },
|
||||||
{ key: 'account_code', accessor: '_empty_' },
|
{ key: 'account_code', accessor: '_empty_' },
|
||||||
{ key: 'account_name', accessor: '_empty_' },
|
{ key: 'account_name', accessor: '_empty_' },
|
||||||
{ key: 'credit', accessor: 'formattedCredit' },
|
|
||||||
{ key: 'debit', accessor: 'formattedDebit' },
|
{ key: 'debit', accessor: 'formattedDebit' },
|
||||||
|
{ key: 'credit', accessor: 'formattedCredit' },
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -101,8 +101,8 @@ export class JournalSheetTable extends R.compose(
|
|||||||
{ key: 'description', value: '' },
|
{ key: 'description', value: '' },
|
||||||
{ key: 'account_code', value: '' },
|
{ key: 'account_code', value: '' },
|
||||||
{ key: 'account_name', value: '' },
|
{ key: 'account_name', value: '' },
|
||||||
{ key: 'credit', value: '' },
|
|
||||||
{ key: 'debit', value: '' },
|
{ key: 'debit', value: '' },
|
||||||
|
{ key: 'credit', value: '' },
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -118,8 +118,8 @@ export class JournalSheetTable extends R.compose(
|
|||||||
{ key: 'description', label: 'Description' },
|
{ key: 'description', label: 'Description' },
|
||||||
{ key: 'account_code', label: 'Acc. Code' },
|
{ key: 'account_code', label: 'Acc. Code' },
|
||||||
{ key: 'account_name', label: 'Account' },
|
{ key: 'account_name', label: 'Account' },
|
||||||
{ key: 'credit', label: 'Credit' },
|
|
||||||
{ key: 'debit', label: 'Debit' },
|
{ key: 'debit', label: 'Debit' },
|
||||||
|
{ key: 'credit', label: 'Credit' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,7 @@ import React from 'react';
|
|||||||
import clsx from 'classnames';
|
import clsx from 'classnames';
|
||||||
import { Navbar } from '@blueprintjs/core';
|
import { Navbar } from '@blueprintjs/core';
|
||||||
|
|
||||||
interface DashboardActionsBarProps {
|
export function DashboardActionsBar({ className, children, name }) {
|
||||||
children?: React.ReactNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function DashboardActionsBar({
|
|
||||||
className,
|
|
||||||
children,
|
|
||||||
name,
|
|
||||||
}: DashboardActionsBarProps) {
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
|||||||
@@ -20,9 +20,8 @@ export const AbilitySubject = {
|
|||||||
SubscriptionBilling: 'SubscriptionBilling',
|
SubscriptionBilling: 'SubscriptionBilling',
|
||||||
CreditNote: 'CreditNote',
|
CreditNote: 'CreditNote',
|
||||||
VendorCredit: 'VendorCredit',
|
VendorCredit: 'VendorCredit',
|
||||||
Project: 'Project',
|
Project:'Project',
|
||||||
TaxRate: 'TaxRate',
|
TaxRate: 'TaxRate',
|
||||||
BankRule: 'BankRule',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ItemAction = {
|
export const ItemAction = {
|
||||||
@@ -189,16 +188,10 @@ export const SubscriptionBillingAbility = {
|
|||||||
Payment: 'payment',
|
Payment: 'payment',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const TaxRateAction = {
|
export const TaxRateAction = {
|
||||||
View: 'View',
|
View: 'View',
|
||||||
Create: 'Create',
|
Create: 'Create',
|
||||||
Edit: 'Edit',
|
Edit: 'Edit',
|
||||||
Delete: 'Delete',
|
Delete: 'Delete',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const BankRuleAction = {
|
|
||||||
View: 'View',
|
|
||||||
Create: 'Create',
|
|
||||||
Edit: 'Edit',
|
|
||||||
Delete: 'Delete',
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -458,11 +458,6 @@ export const SidebarMenu = [
|
|||||||
ability: CashflowAction.View,
|
ability: CashflowAction.View,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
text: 'Rules',
|
|
||||||
href: '/bank-rules',
|
|
||||||
type: ISidebarMenuItemType.Link,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -111,16 +111,16 @@ export const useJournalTableEntriesColumns = () => {
|
|||||||
fieldProps: { allowCreate: true },
|
fieldProps: { allowCreate: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: CreditHeaderCell,
|
Header: DebitHeaderCell,
|
||||||
accessor: 'credit',
|
accessor: 'debit',
|
||||||
Cell: MoneyFieldCell,
|
Cell: MoneyFieldCell,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
width: 100,
|
width: 100,
|
||||||
align: Align.Right,
|
align: Align.Right,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: DebitHeaderCell,
|
Header: CreditHeaderCell,
|
||||||
accessor: 'debit',
|
accessor: 'credit',
|
||||||
Cell: MoneyFieldCell,
|
Cell: MoneyFieldCell,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
width: 100,
|
width: 100,
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
import React, { createContext } from 'react';
|
|
||||||
import { DialogContent } from '@/components';
|
|
||||||
|
|
||||||
interface RuleFormBootValues {
|
|
||||||
bankRule?: null;
|
|
||||||
bankRuleId?: null;
|
|
||||||
isBankRuleLoading: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const RuleFormBootContext = createContext<RuleFormBootValues>(
|
|
||||||
{} as RuleFormBootValues,
|
|
||||||
);
|
|
||||||
|
|
||||||
interface RuleFormBootProps {
|
|
||||||
bankRuleId?: number;
|
|
||||||
children: React.ReactNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
function RuleFormBoot({ bankRuleId, ...props }: RuleFormBootProps) {
|
|
||||||
const provider = {} as RuleFormBootValues;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DialogContent isLoading={false}>
|
|
||||||
<RuleFormBootContext.Provider value={provider} {...props} />
|
|
||||||
</DialogContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const useRuleFormDialogBoot = () =>
|
|
||||||
React.useContext<RuleFormBootValues>(RuleFormBootContext);
|
|
||||||
|
|
||||||
export { RuleFormBoot, useRuleFormDialogBoot };
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { RuleFormBoot } from "./RuleFormBoot";
|
|
||||||
|
|
||||||
|
|
||||||
interface RuleFormContentProps {
|
|
||||||
dialogName: string;
|
|
||||||
bankRuleId?: number;
|
|
||||||
}
|
|
||||||
export function RuleFormContent({
|
|
||||||
dialogName,
|
|
||||||
bankRuleId,
|
|
||||||
}: RuleFormContentProps) {
|
|
||||||
return (
|
|
||||||
<RuleFormBoot
|
|
||||||
bankRuleId={bankRuleId}
|
|
||||||
>
|
|
||||||
|
|
||||||
</RuleFormBoot>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import * as Yup from 'yup';
|
|
||||||
|
|
||||||
const Schema = Yup.object().shape({
|
|
||||||
name: Yup.string().required().label('Rule name'),
|
|
||||||
applyIfAccountId: Yup.number().required().label(''),
|
|
||||||
applyIfTransactionType: Yup.string().required().label(''),
|
|
||||||
conditionsType: Yup.string().required(),
|
|
||||||
assignCategory: Yup.string().required(),
|
|
||||||
assignAccountId: Yup.string().required(),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const CreateRuleFormSchema = Schema;
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
import { Form, Formik, useFormikContext } from 'formik';
|
|
||||||
import { Button, Radio } from '@blueprintjs/core';
|
|
||||||
import { CreateRuleFormSchema } from './RuleFormContentForm.schema';
|
|
||||||
import {
|
|
||||||
Box,
|
|
||||||
FFormGroup,
|
|
||||||
FInputGroup,
|
|
||||||
FRadioGroup,
|
|
||||||
FSelect,
|
|
||||||
Group,
|
|
||||||
} from '@/components';
|
|
||||||
|
|
||||||
const initialValues = {
|
|
||||||
name: '',
|
|
||||||
order: 0,
|
|
||||||
applyIfAccountId: '',
|
|
||||||
applyIfTransactionType: '',
|
|
||||||
conditionsType: '',
|
|
||||||
conditions: [
|
|
||||||
{
|
|
||||||
field: 'description',
|
|
||||||
comparator: 'contains',
|
|
||||||
value: 'payment',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
assignCategory: '',
|
|
||||||
assignAccountId: '',
|
|
||||||
};
|
|
||||||
|
|
||||||
interface RuleFormValues {
|
|
||||||
name: string;
|
|
||||||
order: number;
|
|
||||||
applyIfAccountId: string;
|
|
||||||
applyIfTransactionType: string;
|
|
||||||
conditionsType: string;
|
|
||||||
conditions: Array<{
|
|
||||||
field: string;
|
|
||||||
comparator: string;
|
|
||||||
value: string;
|
|
||||||
}>;
|
|
||||||
assignCategory: string;
|
|
||||||
assignAccountId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function RuleFormContentForm() {
|
|
||||||
const validationSchema = CreateRuleFormSchema;
|
|
||||||
const handleSubmit = () => {};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Formik<RuleFormValues>
|
|
||||||
initialValues={initialValues}
|
|
||||||
validationSchema={validationSchema}
|
|
||||||
onSubmit={handleSubmit}
|
|
||||||
>
|
|
||||||
<Form>
|
|
||||||
<FFormGroup name={'name'} label={'Rule Name'}>
|
|
||||||
<FInputGroup name={'name'} />
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
<FFormGroup name={'conditionsType'} label={'Apply to transactions are'}>
|
|
||||||
<FSelect name={'conditionsType'} items={[]} />
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
<FFormGroup name={''} label={'Categorize the transactions when'}>
|
|
||||||
<FRadioGroup name={'conditionsType'}>
|
|
||||||
<Radio value={'and'} label={'All the following criteria matches'} />
|
|
||||||
<Radio
|
|
||||||
value={'or'}
|
|
||||||
label={'Any one of the following criteria matches'}
|
|
||||||
/>
|
|
||||||
</FRadioGroup>
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
<RuleFormConditions />
|
|
||||||
|
|
||||||
<h3>Then Assign</h3>
|
|
||||||
|
|
||||||
<FFormGroup name={'assignCategory'} label={'Transaction type'}>
|
|
||||||
<FSelect name={'assignCategory'} items={[]} />
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
<FFormGroup name={'assignAccountId'} label={'Account category'}>
|
|
||||||
<FSelect name={'assignAccountId'} items={[]} />
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
<FFormGroup name={'assignRef'} label={'Reference'}>
|
|
||||||
<FInputGroup name={'assignRef'} />
|
|
||||||
</FFormGroup>
|
|
||||||
</Form>
|
|
||||||
</Formik>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function RuleFormConditions() {
|
|
||||||
const { values } = useFormikContext<RuleFormValues>();
|
|
||||||
|
|
||||||
const handleAddConditionBtnClick = () => {
|
|
||||||
values.conditions.push({
|
|
||||||
field: '',
|
|
||||||
comparator: '',
|
|
||||||
value: '',
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box>
|
|
||||||
{values?.conditions?.map((condition, index) => (
|
|
||||||
<Group>
|
|
||||||
<FFormGroup name={`conditions[${index}].field`} label={'Field'}>
|
|
||||||
<FSelect name={`conditions[${index}].field`} items={[]} />
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
<FFormGroup
|
|
||||||
name={`conditions[${index}].comparator`}
|
|
||||||
label={'Condition'}
|
|
||||||
>
|
|
||||||
<FSelect name={`conditions[${index}].comparator`} items={[]} />
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
<FFormGroup
|
|
||||||
name={`conditions[${index}].condition`}
|
|
||||||
label={'Condition'}
|
|
||||||
>
|
|
||||||
<FInputGroup name={`conditions[${index}].value`} />
|
|
||||||
</FFormGroup>
|
|
||||||
</Group>
|
|
||||||
))}
|
|
||||||
|
|
||||||
<Button type={'button'} onClick={handleAddConditionBtnClick}>
|
|
||||||
Add Condition
|
|
||||||
</Button>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import React from 'react';
|
|
||||||
import { Dialog, DialogSuspense } from '@/components';
|
|
||||||
import withDialogRedux from '@/components/DialogReduxConnect';
|
|
||||||
import { compose } from '@/utils';
|
|
||||||
|
|
||||||
const RuleFormContent = React.lazy(() => import('./RuleFormContent'));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Payment mail dialog.
|
|
||||||
*/
|
|
||||||
function RuleFormDialog({
|
|
||||||
dialogName,
|
|
||||||
payload: { bankRuleId = null },
|
|
||||||
isOpen,
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<Dialog
|
|
||||||
name={dialogName}
|
|
||||||
title={'New Bank Rule'}
|
|
||||||
isOpen={isOpen}
|
|
||||||
canEscapeJeyClose={true}
|
|
||||||
autoFocus={true}
|
|
||||||
style={{ width: 600 }}
|
|
||||||
>
|
|
||||||
<DialogSuspense>
|
|
||||||
<RuleFormContent dialogName={dialogName} bankRuleId={bankRuleId} />
|
|
||||||
</DialogSuspense>
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default compose(withDialogRedux())(RuleFormDialog);
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import * as R from 'ramda';
|
|
||||||
import { Button, Intent } from '@blueprintjs/core';
|
|
||||||
import { EmptyStatus, Can, FormattedMessage as T } from '@/components';
|
|
||||||
import { AbilitySubject, BankRuleAction } from '@/constants/abilityOption';
|
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
|
||||||
|
|
||||||
function BankRulesLandingEmptyStateRoot({
|
|
||||||
// #withDialogAction
|
|
||||||
openDialog,
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<EmptyStatus
|
|
||||||
title={"The organization doesn't have taxes, yet!"}
|
|
||||||
description={
|
|
||||||
<p>
|
|
||||||
Setup the organization taxes to start tracking taxes on sales
|
|
||||||
transactions.
|
|
||||||
</p>
|
|
||||||
}
|
|
||||||
action={
|
|
||||||
<>
|
|
||||||
<Can I={BankRuleAction.Create} a={AbilitySubject.BankRule}>
|
|
||||||
<Button intent={Intent.PRIMARY} large={true} onClick={() => {}}>
|
|
||||||
New tax rate
|
|
||||||
</Button>
|
|
||||||
<Button intent={Intent.NONE} large={true}>
|
|
||||||
<T id={'learn_more'} />
|
|
||||||
</Button>
|
|
||||||
</Can>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export const BankRulesLandingEmptyState = R.compose(withDialogActions)(
|
|
||||||
BankRulesLandingEmptyStateRoot,
|
|
||||||
);
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import { DashboardPageContent } from '@/components';
|
|
||||||
import { RulesListBoot } from './RulesListBoot';
|
|
||||||
import { RulesListActionsBar } from './RulesListActionsBar';
|
|
||||||
import { BankRulesTable } from './RulesTable';
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function RulesList() {
|
|
||||||
return (
|
|
||||||
<RulesListBoot>
|
|
||||||
<RulesListActionsBar />
|
|
||||||
|
|
||||||
<DashboardPageContent>
|
|
||||||
<BankRulesTable />
|
|
||||||
</DashboardPageContent>
|
|
||||||
</RulesListBoot>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { DashboardActionsBar } from '@/components';
|
|
||||||
import { NavbarGroup } from '@blueprintjs/core';
|
|
||||||
|
|
||||||
export function RulesListActionsBar() {
|
|
||||||
return (
|
|
||||||
<DashboardActionsBar>
|
|
||||||
<NavbarGroup></NavbarGroup>
|
|
||||||
</DashboardActionsBar>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import React, { createContext } from 'react';
|
|
||||||
import { DialogContent } from '@/components';
|
|
||||||
|
|
||||||
interface RulesListBootValues {
|
|
||||||
rules: any;
|
|
||||||
isRulesLoading: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const RulesListBootContext = createContext<RulesListBootValues>(
|
|
||||||
{} as RulesListBootValues,
|
|
||||||
);
|
|
||||||
|
|
||||||
interface RulesListBootProps {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
function RulesListBoot({ ...props }: RulesListBootProps) {
|
|
||||||
const provider = {} as RulesListBootValues;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DialogContent isLoading={false}>
|
|
||||||
<RulesListBootContext.Provider value={provider} {...props} />
|
|
||||||
</DialogContent>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const useRulesListBoot = () =>
|
|
||||||
React.useContext<RulesListBootValues>(RulesListBootContext);
|
|
||||||
|
|
||||||
export { RulesListBoot, useRulesListBoot };
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import * as R from 'ramda';
|
|
||||||
import {
|
|
||||||
DataTable,
|
|
||||||
DashboardContentTable,
|
|
||||||
TableSkeletonHeader,
|
|
||||||
TableSkeletonRows,
|
|
||||||
} from '@/components';
|
|
||||||
|
|
||||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
|
||||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
|
||||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
|
||||||
import withDashboardActions from '@/containers/Dashboard/withDashboardActions';
|
|
||||||
|
|
||||||
import { useBankRulesTableColumns } from './hooks';
|
|
||||||
import { BankRulesTableActionsMenu } from './_components';
|
|
||||||
import { BankRulesLandingEmptyState } from './BankRulesLandingEmptyState';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Invoices datatable.
|
|
||||||
*/
|
|
||||||
function RulesTable({
|
|
||||||
// #withAlertsActions
|
|
||||||
openAlert,
|
|
||||||
|
|
||||||
// #withDrawerActions
|
|
||||||
openDrawer,
|
|
||||||
|
|
||||||
// #withDialogAction
|
|
||||||
openDialog,
|
|
||||||
}) {
|
|
||||||
// Invoices table columns.
|
|
||||||
const columns = useBankRulesTableColumns();
|
|
||||||
|
|
||||||
// Handle edit bank rule.
|
|
||||||
const handleDeleteBankRule = ({ id }) => {};
|
|
||||||
|
|
||||||
// Handle delete bank rule.
|
|
||||||
const handleEditBankRule = () => {};
|
|
||||||
|
|
||||||
// Display invoice empty status instead of the table.
|
|
||||||
if (isEmptyStatus) {
|
|
||||||
return <BankRulesLandingEmptyState />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DashboardContentTable>
|
|
||||||
<DataTable
|
|
||||||
columns={columns}
|
|
||||||
data={[]}
|
|
||||||
loading={false}
|
|
||||||
headerLoading={false}
|
|
||||||
progressBarLoading={false}
|
|
||||||
manualSortBy={false}
|
|
||||||
selectionColumn={false}
|
|
||||||
noInitialFetch={true}
|
|
||||||
sticky={true}
|
|
||||||
pagination={false}
|
|
||||||
manualPagination={false}
|
|
||||||
autoResetSortBy={false}
|
|
||||||
autoResetPage={false}
|
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
|
||||||
ContextMenu={BankRulesTableActionsMenu}
|
|
||||||
onCellClick={handleCellClick}
|
|
||||||
size={'medium'}
|
|
||||||
payload={{
|
|
||||||
onDelete: handleDeleteTaxRate,
|
|
||||||
onEdit: handleEditTaxRate,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</DashboardContentTable>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export const BankRulesTable = R.compose(
|
|
||||||
withDashboardActions,
|
|
||||||
withAlertsActions,
|
|
||||||
withDrawerActions,
|
|
||||||
withDialogActions,
|
|
||||||
)(RulesTable);
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import React from 'react';
|
|
||||||
import { Intent, Menu, MenuDivider, MenuItem } from '@blueprintjs/core';
|
|
||||||
import { Can, Icon } from '@/components';
|
|
||||||
import { AbilitySubject, BankRuleAction } from '@/constants/abilityOption';
|
|
||||||
import { safeCallback } from '@/utils';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tax rates table actions menu.
|
|
||||||
* @returns {JSX.Element}
|
|
||||||
*/
|
|
||||||
export function BankRulesTableActionsMenu({
|
|
||||||
payload: { onEdit, onDelete },
|
|
||||||
row: { original },
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<Menu>
|
|
||||||
<Can I={BankRuleAction.Edit} a={AbilitySubject.BankRule}>
|
|
||||||
<MenuDivider />
|
|
||||||
<MenuItem
|
|
||||||
icon={<Icon icon="pen-18" />}
|
|
||||||
text={'Edit Rule'}
|
|
||||||
onClick={safeCallback(onEdit, original)}
|
|
||||||
/>
|
|
||||||
</Can>
|
|
||||||
<MenuDivider />
|
|
||||||
<Can I={BankRuleAction.Delete} a={AbilitySubject.BankRule}>
|
|
||||||
<MenuDivider />
|
|
||||||
<MenuItem
|
|
||||||
text={'Delete Rule'}
|
|
||||||
intent={Intent.DANGER}
|
|
||||||
onClick={safeCallback(onDelete, original)}
|
|
||||||
icon={<Icon icon="trash-16" iconSize={16} />}
|
|
||||||
/>
|
|
||||||
</Can>
|
|
||||||
</Menu>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
export const useBankRulesTableColumns = () => {
|
|
||||||
return [];
|
|
||||||
};
|
|
||||||
@@ -26,6 +26,14 @@ export const useAccountReadEntriesColumns = () => {
|
|||||||
width: 100,
|
width: 100,
|
||||||
textOverview: true,
|
textOverview: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Header: intl.get('debit'),
|
||||||
|
accessor: isFCYCurrencyType ? 'formatted_fc_debit' : 'formatted_debit',
|
||||||
|
width: 80,
|
||||||
|
className: 'debit',
|
||||||
|
align: 'right',
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Header: intl.get('credit'),
|
Header: intl.get('credit'),
|
||||||
accessor: isFCYCurrencyType
|
accessor: isFCYCurrencyType
|
||||||
@@ -36,14 +44,6 @@ export const useAccountReadEntriesColumns = () => {
|
|||||||
align: 'right',
|
align: 'right',
|
||||||
textOverview: true,
|
textOverview: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Header: intl.get('debit'),
|
|
||||||
accessor: isFCYCurrencyType ? 'formatted_fc_debit' : 'formatted_debit',
|
|
||||||
width: 80,
|
|
||||||
className: 'debit',
|
|
||||||
align: 'right',
|
|
||||||
textOverview: true,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
[isFCYCurrencyType],
|
[isFCYCurrencyType],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -82,20 +82,6 @@ export const useManualJournalEntriesColumns = () => {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
{
|
|
||||||
Header: intl.get('credit'),
|
|
||||||
accessor: 'credit',
|
|
||||||
Cell: FormatNumberCell,
|
|
||||||
width: getColumnWidth(entries, 'credit', {
|
|
||||||
minWidth: 60,
|
|
||||||
magicSpacing: 5,
|
|
||||||
}),
|
|
||||||
disableResizable: true,
|
|
||||||
disableSortBy: true,
|
|
||||||
textOverview: true,
|
|
||||||
formatNumber: { noZero: true },
|
|
||||||
align: 'right',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Header: intl.get('debit'),
|
Header: intl.get('debit'),
|
||||||
accessor: 'debit',
|
accessor: 'debit',
|
||||||
@@ -110,6 +96,20 @@ export const useManualJournalEntriesColumns = () => {
|
|||||||
formatNumber: { noZero: true },
|
formatNumber: { noZero: true },
|
||||||
align: 'right',
|
align: 'right',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Header: intl.get('credit'),
|
||||||
|
accessor: 'credit',
|
||||||
|
Cell: FormatNumberCell,
|
||||||
|
width: getColumnWidth(entries, 'credit', {
|
||||||
|
minWidth: 60,
|
||||||
|
magicSpacing: 5,
|
||||||
|
}),
|
||||||
|
disableResizable: true,
|
||||||
|
disableSortBy: true,
|
||||||
|
textOverview: true,
|
||||||
|
formatNumber: { noZero: true },
|
||||||
|
align: 'right',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,14 +25,6 @@ export const useGLEntriesTableColumns = () => {
|
|||||||
width: 140,
|
width: 140,
|
||||||
textOverview: true,
|
textOverview: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Header: intl.get('credit'),
|
|
||||||
accessor: ({ credit }) => credit.formatted_amount,
|
|
||||||
width: 100,
|
|
||||||
className: 'credit',
|
|
||||||
align: 'right',
|
|
||||||
textOverview: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
Header: intl.get('debit'),
|
Header: intl.get('debit'),
|
||||||
accessor: ({ debit }) => debit.formatted_amount,
|
accessor: ({ debit }) => debit.formatted_amount,
|
||||||
@@ -41,6 +33,14 @@ export const useGLEntriesTableColumns = () => {
|
|||||||
textOverview: true,
|
textOverview: true,
|
||||||
align: 'right',
|
align: 'right',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Header: intl.get('credit'),
|
||||||
|
accessor: ({ credit }) => credit.formatted_amount,
|
||||||
|
width: 100,
|
||||||
|
className: 'credit',
|
||||||
|
align: 'right',
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1221,14 +1221,6 @@ export const getDashboardRoutes = () => [
|
|||||||
pageTitle: 'Tax Rates',
|
pageTitle: 'Tax Rates',
|
||||||
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
|
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
|
||||||
},
|
},
|
||||||
// Bank Rules
|
|
||||||
{
|
|
||||||
path: '/bank-rules',
|
|
||||||
component: lazy(
|
|
||||||
() => import('@/containers/Banking/Rules/RulesList/RulesList'),
|
|
||||||
),
|
|
||||||
pageTitle: 'Bank Rules',
|
|
||||||
},
|
|
||||||
// Homepage
|
// Homepage
|
||||||
{
|
{
|
||||||
path: `/`,
|
path: `/`,
|
||||||
|
|||||||
Reference in New Issue
Block a user