Add Tax Records feature to Finance dashboard, including NewTaxRecord component for creating records and TaxRecordInfo for detailed views. Update routing and sidebar navigation to reflect new structure, ensuring a seamless user experience in managing tax records.
This commit is contained in:
parent
6d1c7cf6ca
commit
0406c0d0e0
@ -17,7 +17,7 @@ export const TaxRecord = {
|
|||||||
default: true,
|
default: true,
|
||||||
row: true,
|
row: true,
|
||||||
icon: InfoCircleIcon,
|
icon: InfoCircleIcon,
|
||||||
url: (_id) => `/dashboard/management/taxrecords/info?taxRecordId=${_id}`
|
url: (_id) => `/dashboard/finance/taxrecords/info?taxRecordId=${_id}`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
@ -25,7 +25,7 @@ export const TaxRecord = {
|
|||||||
row: true,
|
row: true,
|
||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
url: (_id) =>
|
||||||
`/dashboard/management/taxrecords/info?taxRecordId=${_id}&action=edit`,
|
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=edit`,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||||
}
|
}
|
||||||
@ -35,7 +35,7 @@ export const TaxRecord = {
|
|||||||
label: 'Save Edits',
|
label: 'Save Edits',
|
||||||
icon: CheckIcon,
|
icon: CheckIcon,
|
||||||
url: (_id) =>
|
url: (_id) =>
|
||||||
`/dashboard/management/taxrecords/info?taxRecordId=${_id}&action=finishEdit`,
|
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=finishEdit`,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const TaxRecord = {
|
|||||||
label: 'Cancel Edits',
|
label: 'Cancel Edits',
|
||||||
icon: XMarkIcon,
|
icon: XMarkIcon,
|
||||||
url: (_id) =>
|
url: (_id) =>
|
||||||
`/dashboard/management/taxrecords/info?taxRecordId=${_id}&action=cancelEdit`,
|
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=cancelEdit`,
|
||||||
visible: (objectData) => {
|
visible: (objectData) => {
|
||||||
return objectData?._isEditing && objectData?._isEditing == true
|
return objectData?._isEditing && objectData?._isEditing == true
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ export const TaxRecord = {
|
|||||||
icon: BinIcon,
|
icon: BinIcon,
|
||||||
danger: true,
|
danger: true,
|
||||||
url: (_id) =>
|
url: (_id) =>
|
||||||
`/dashboard/management/taxrecords/info?taxRecordId=${_id}&action=delete`
|
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=delete`
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: [
|
columns: [
|
||||||
|
|||||||
@ -17,6 +17,12 @@ const financeSidebarItems = [
|
|||||||
label: 'Payments',
|
label: 'Payments',
|
||||||
iconKey: 'payment',
|
iconKey: 'payment',
|
||||||
path: '/dashboard/finance/payments'
|
path: '/dashboard/finance/payments'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'taxRecords',
|
||||||
|
iconKey: 'taxRecord',
|
||||||
|
label: 'Tax Records',
|
||||||
|
path: '/dashboard/finance/taxrecords'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -73,12 +73,6 @@ const managementSidebarItems = [
|
|||||||
label: 'Tax Rates',
|
label: 'Tax Rates',
|
||||||
path: '/dashboard/management/taxrates'
|
path: '/dashboard/management/taxrates'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
key: 'taxRecords',
|
|
||||||
iconKey: 'taxRecord',
|
|
||||||
label: 'Tax Records',
|
|
||||||
path: '/dashboard/management/taxrecords'
|
|
||||||
},
|
|
||||||
{ type: 'divider' },
|
{ type: 'divider' },
|
||||||
{
|
{
|
||||||
key: 'noteTypes',
|
key: 'noteTypes',
|
||||||
|
|||||||
@ -1,5 +1,15 @@
|
|||||||
import { lazy } from 'react'
|
import { lazy } from 'react'
|
||||||
import { Route } from 'react-router-dom'
|
import { Navigate, Route, useLocation } from 'react-router-dom'
|
||||||
|
|
||||||
|
const TaxRecordsInfoRedirect = () => {
|
||||||
|
const location = useLocation()
|
||||||
|
return (
|
||||||
|
<Navigate
|
||||||
|
to={`/dashboard/finance/taxrecords/info${location.search}`}
|
||||||
|
replace
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const Invoices = lazy(
|
const Invoices = lazy(
|
||||||
() => import('../components/Dashboard/Finance/Invoices.jsx')
|
() => import('../components/Dashboard/Finance/Invoices.jsx')
|
||||||
@ -16,6 +26,12 @@ const PaymentInfo = lazy(
|
|||||||
const FinanceOverview = lazy(
|
const FinanceOverview = lazy(
|
||||||
() => import('../components/Dashboard/Finance/FinanceOverview.jsx')
|
() => import('../components/Dashboard/Finance/FinanceOverview.jsx')
|
||||||
)
|
)
|
||||||
|
const TaxRecords = lazy(
|
||||||
|
() => import('../components/Dashboard/Finance/TaxRecords.jsx')
|
||||||
|
)
|
||||||
|
const TaxRecordInfo = lazy(
|
||||||
|
() => import('../components/Dashboard/Finance/TaxRecords/TaxRecordInfo.jsx')
|
||||||
|
)
|
||||||
|
|
||||||
const FinanceRoutes = [
|
const FinanceRoutes = [
|
||||||
<Route
|
<Route
|
||||||
@ -34,6 +50,22 @@ const FinanceRoutes = [
|
|||||||
key='payments-info'
|
key='payments-info'
|
||||||
path='finance/payments/info'
|
path='finance/payments/info'
|
||||||
element={<PaymentInfo />}
|
element={<PaymentInfo />}
|
||||||
|
/>,
|
||||||
|
<Route key='taxrecords' path='finance/taxrecords' element={<TaxRecords />} />,
|
||||||
|
<Route
|
||||||
|
key='taxrecords-info'
|
||||||
|
path='finance/taxrecords/info'
|
||||||
|
element={<TaxRecordInfo />}
|
||||||
|
/>,
|
||||||
|
<Route
|
||||||
|
key='taxrecords-redirect'
|
||||||
|
path='management/taxrecords'
|
||||||
|
element={<Navigate to='/dashboard/finance/taxrecords' replace />}
|
||||||
|
/>,
|
||||||
|
<Route
|
||||||
|
key='taxrecords-info-redirect'
|
||||||
|
path='management/taxrecords/info'
|
||||||
|
element={<TaxRecordsInfoRedirect />}
|
||||||
/>
|
/>
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -139,13 +139,6 @@ const TaxRates = lazy(
|
|||||||
const TaxRateInfo = lazy(
|
const TaxRateInfo = lazy(
|
||||||
() => import('../components/Dashboard/Management/TaxRates/TaxRateInfo.jsx')
|
() => import('../components/Dashboard/Management/TaxRates/TaxRateInfo.jsx')
|
||||||
)
|
)
|
||||||
const TaxRecords = lazy(
|
|
||||||
() => import('../components/Dashboard/Management/TaxRecords.jsx')
|
|
||||||
)
|
|
||||||
const TaxRecordInfo = lazy(
|
|
||||||
() =>
|
|
||||||
import('../components/Dashboard/Management/TaxRecords/TaxRecordInfo.jsx')
|
|
||||||
)
|
|
||||||
const About = lazy(() => import('../components/Dashboard/Management/About.jsx'))
|
const About = lazy(() => import('../components/Dashboard/Management/About.jsx'))
|
||||||
|
|
||||||
const ManagementRoutes = [
|
const ManagementRoutes = [
|
||||||
@ -319,16 +312,6 @@ const ManagementRoutes = [
|
|||||||
key='taxrates-info'
|
key='taxrates-info'
|
||||||
path='management/taxrates/info'
|
path='management/taxrates/info'
|
||||||
element={<TaxRateInfo />}
|
element={<TaxRateInfo />}
|
||||||
/>,
|
|
||||||
<Route
|
|
||||||
key='taxrecords'
|
|
||||||
path='management/taxrecords'
|
|
||||||
element={<TaxRecords />}
|
|
||||||
/>,
|
|
||||||
<Route
|
|
||||||
key='taxrecords-info'
|
|
||||||
path='management/taxrecords/info'
|
|
||||||
element={<TaxRecordInfo />}
|
|
||||||
/>
|
/>
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user