mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: configuring import services on more resources
This commit is contained in:
@@ -75,6 +75,11 @@ function VendorsCreditNoteActionsBar({
|
||||
addSetting('vendorCredit', 'tableSize', size);
|
||||
};
|
||||
|
||||
// Handle import button click.
|
||||
const handleImportBtnClick = () => {
|
||||
history.push('/vendor-credits/import')
|
||||
}
|
||||
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
@@ -117,6 +122,7 @@ function VendorsCreditNoteActionsBar({
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'file-import-16'} />}
|
||||
text={<T id={'import'} />}
|
||||
onClick={handleImportBtnClick}
|
||||
/>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// @ts-nocheck
|
||||
import { DashboardInsider } from '@/components';
|
||||
import { ImportView } from '@/containers/Import';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
export default function VendorCreditsImport() {
|
||||
const history = useHistory();
|
||||
|
||||
const handleCancelBtnClick = () => {
|
||||
history.push('/vendor-credits');
|
||||
};
|
||||
const handleImportSuccess = () => {
|
||||
history.push('/vendor-credits');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardInsider name={'import-vendor-credit'}>
|
||||
<ImportView
|
||||
resource={'vendor_credit'}
|
||||
onCancelClick={handleCancelBtnClick}
|
||||
onImportSuccess={handleImportSuccess}
|
||||
/>
|
||||
</DashboardInsider>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// @ts-nocheck
|
||||
import { DashboardInsider } from '@/components';
|
||||
import { ImportView } from '@/containers/Import';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
export default function CreditNotesImport() {
|
||||
const history = useHistory();
|
||||
|
||||
const handleCancelBtnClick = () => {
|
||||
history.push('/credit-notes');
|
||||
};
|
||||
const handleImportSuccess = () => {
|
||||
history.push('/credit-notes');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardInsider name={'import-credit-notes'}>
|
||||
<ImportView
|
||||
resource={'credit_note'}
|
||||
onCancelClick={handleCancelBtnClick}
|
||||
onImportSuccess={handleImportSuccess}
|
||||
/>
|
||||
</DashboardInsider>
|
||||
);
|
||||
}
|
||||
@@ -69,6 +69,11 @@ function CreditNotesActionsBar({
|
||||
addSetting('creditNote', 'tableSize', size);
|
||||
};
|
||||
|
||||
// Handle import button click.
|
||||
const handleImportBtnClick = () => {
|
||||
history.push('/credit-notes/import');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
@@ -111,6 +116,7 @@ function CreditNotesActionsBar({
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'file-import-16'} />}
|
||||
text={<T id={'import'} />}
|
||||
onClick={handleImportBtnClick}
|
||||
/>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// @ts-nocheck
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { DashboardInsider } from '@/components';
|
||||
import { ImportView } from '@/containers/Import';
|
||||
|
||||
export default function PaymentsReceiveImport() {
|
||||
const history = useHistory();
|
||||
|
||||
const handleCancelBtnClick = () => {
|
||||
history.push('/');
|
||||
};
|
||||
const handleImportSuccess = () => {
|
||||
history.push('/accounts');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardInsider name={'import-accounts'}>
|
||||
<ImportView
|
||||
resource={'payment_receive'}
|
||||
onCancelClick={handleCancelBtnClick}
|
||||
onImportSuccess={handleImportSuccess}
|
||||
/>
|
||||
</DashboardInsider>
|
||||
);
|
||||
}
|
||||
@@ -26,7 +26,10 @@ import withPaymentReceives from './withPaymentReceives';
|
||||
import withPaymentReceivesActions from './withPaymentReceivesActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import { PaymentReceiveAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
import {
|
||||
PaymentReceiveAction,
|
||||
AbilitySubject,
|
||||
} from '@/constants/abilityOption';
|
||||
import { usePaymentReceivesListContext } from './PaymentReceiptsListProvider';
|
||||
import { useRefreshPaymentReceive } from '@/hooks/query/paymentReceives';
|
||||
import { compose } from '@/utils';
|
||||
@@ -75,6 +78,10 @@ function PaymentReceiveActionsBar({
|
||||
const handleTableRowSizeChange = (size) => {
|
||||
addSetting('paymentReceives', 'tableSize', size);
|
||||
};
|
||||
// Handle the import button click.
|
||||
const handleImportBtnClick = () => {
|
||||
history.push('/payment-receives/import');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
@@ -126,6 +133,7 @@ function PaymentReceiveActionsBar({
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'file-import-16'} />}
|
||||
text={<T id={'import'} />}
|
||||
onClick={handleImportBtnClick}
|
||||
/>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
@@ -81,6 +81,11 @@ function ReceiptActionsBar({
|
||||
addSetting('salesReceipts', 'tableSize', size);
|
||||
};
|
||||
|
||||
// Handle the import button click.
|
||||
const handleImportBtnClick = () => {
|
||||
history.push('/receipts/import');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
@@ -134,6 +139,7 @@ function ReceiptActionsBar({
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon={'file-import-16'} />}
|
||||
text={<T id={'import'} />}
|
||||
onClick={handleImportBtnClick}
|
||||
/>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// @ts-nocheck
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { ImportView } from '@/containers/Import';
|
||||
import { DashboardInsider } from '@/components';
|
||||
|
||||
export default function ReceiptsImport() {
|
||||
const history = useHistory();
|
||||
|
||||
const handleCancelBtnClick = () => {
|
||||
history.push('/accounts');
|
||||
};
|
||||
const handleImportSuccess = () => {
|
||||
history.push('/accounts');
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardInsider name={'import-accounts'}>
|
||||
<ImportView
|
||||
resource={'sale_receipt'}
|
||||
onCancelClick={handleCancelBtnClick}
|
||||
onImportSuccess={handleImportSuccess}
|
||||
/>
|
||||
</DashboardInsider>
|
||||
);
|
||||
}
|
||||
@@ -789,6 +789,19 @@ export const getDashboardRoutes = () => [
|
||||
},
|
||||
|
||||
// Sales Receipts.
|
||||
{
|
||||
path: `/receipts/import`,
|
||||
component: lazy(
|
||||
() => import('@/containers/Sales/Receipts/SaleReceiptsImport'),
|
||||
),
|
||||
name: 'receipt-import',
|
||||
breadcrumb: 'Receipts Import',
|
||||
pageTitle: 'Receipts Import',
|
||||
backLink: true,
|
||||
sidebarExpand: false,
|
||||
defaultSearchResource: RESOURCES_TYPES.RECEIPT,
|
||||
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
|
||||
},
|
||||
{
|
||||
path: `/receipts/:id/edit`,
|
||||
component: lazy(
|
||||
@@ -829,6 +842,19 @@ export const getDashboardRoutes = () => [
|
||||
},
|
||||
|
||||
// Sales Credit notes.
|
||||
{
|
||||
path: `/credit-notes/import`,
|
||||
component: lazy(
|
||||
() => import('@/containers/Sales/CreditNotes/CreditNotesImport'),
|
||||
),
|
||||
name: 'credit-note-import',
|
||||
breadcrumb: 'Credit Notes Import',
|
||||
pageTitle: 'Credit Notes Import',
|
||||
backLink: true,
|
||||
sidebarExpand: false,
|
||||
defaultSearchResource: RESOURCES_TYPES.CREDIT_NOTE,
|
||||
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
|
||||
},
|
||||
{
|
||||
path: `/credit-notes/:id/edit`,
|
||||
component: lazy(
|
||||
@@ -890,8 +916,20 @@ export const getDashboardRoutes = () => [
|
||||
defaultSearchResource: RESOURCES_TYPES.CREDIT_NOTE,
|
||||
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
|
||||
},
|
||||
|
||||
// Payment receives
|
||||
{
|
||||
path: `/payment-receives/import`,
|
||||
component: lazy(
|
||||
() => import('@/containers/Sales/PaymentReceives/PaymentReceivesImport'),
|
||||
),
|
||||
name: 'payment-receive-import',
|
||||
breadcrumb: 'Payments Receive Import',
|
||||
pageTitle: 'Payments Receive Import',
|
||||
backLink: true,
|
||||
sidebarExpand: false,
|
||||
defaultSearchResource: RESOURCES_TYPES.PAYMENT_RECEIVE,
|
||||
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
|
||||
},
|
||||
{
|
||||
path: `/payment-receives/:id/edit`,
|
||||
component: lazy(
|
||||
@@ -989,6 +1027,19 @@ export const getDashboardRoutes = () => [
|
||||
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
|
||||
},
|
||||
// Purchases Credit note.
|
||||
{
|
||||
path: `/vendor-credits/import`,
|
||||
component: lazy(
|
||||
() => import('@/containers/Purchases/CreditNotes/VendorCreditsImport'),
|
||||
),
|
||||
name: 'vendor-credits-edit',
|
||||
breadcrumb: 'Vendor Credits Import',
|
||||
pageTitle: 'Vendor Credits Import',
|
||||
backLink: true,
|
||||
sidebarExpand: false,
|
||||
defaultSearchResource: RESOURCES_TYPES.VENDOR_CREDIT,
|
||||
subscriptionActive: [SUBSCRIPTION_TYPE.MAIN],
|
||||
},
|
||||
{
|
||||
path: `/vendor-credits/:id/edit`,
|
||||
component: lazy(
|
||||
|
||||
Reference in New Issue
Block a user