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,
|
||||
row: true,
|
||||
icon: InfoCircleIcon,
|
||||
url: (_id) => `/dashboard/management/taxrecords/info?taxRecordId=${_id}`
|
||||
url: (_id) => `/dashboard/finance/taxrecords/info?taxRecordId=${_id}`
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
@ -25,7 +25,7 @@ export const TaxRecord = {
|
||||
row: true,
|
||||
icon: EditIcon,
|
||||
url: (_id) =>
|
||||
`/dashboard/management/taxrecords/info?taxRecordId=${_id}&action=edit`,
|
||||
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=edit`,
|
||||
visible: (objectData) => {
|
||||
return !(objectData?._isEditing && objectData?._isEditing == true)
|
||||
}
|
||||
@ -35,7 +35,7 @@ export const TaxRecord = {
|
||||
label: 'Save Edits',
|
||||
icon: CheckIcon,
|
||||
url: (_id) =>
|
||||
`/dashboard/management/taxrecords/info?taxRecordId=${_id}&action=finishEdit`,
|
||||
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=finishEdit`,
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
@ -45,7 +45,7 @@ export const TaxRecord = {
|
||||
label: 'Cancel Edits',
|
||||
icon: XMarkIcon,
|
||||
url: (_id) =>
|
||||
`/dashboard/management/taxrecords/info?taxRecordId=${_id}&action=cancelEdit`,
|
||||
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=cancelEdit`,
|
||||
visible: (objectData) => {
|
||||
return objectData?._isEditing && objectData?._isEditing == true
|
||||
}
|
||||
@ -57,7 +57,7 @@ export const TaxRecord = {
|
||||
icon: BinIcon,
|
||||
danger: true,
|
||||
url: (_id) =>
|
||||
`/dashboard/management/taxrecords/info?taxRecordId=${_id}&action=delete`
|
||||
`/dashboard/finance/taxrecords/info?taxRecordId=${_id}&action=delete`
|
||||
}
|
||||
],
|
||||
columns: [
|
||||
|
||||
@ -17,6 +17,12 @@ const financeSidebarItems = [
|
||||
label: 'Payments',
|
||||
iconKey: 'payment',
|
||||
path: '/dashboard/finance/payments'
|
||||
},
|
||||
{
|
||||
key: 'taxRecords',
|
||||
iconKey: 'taxRecord',
|
||||
label: 'Tax Records',
|
||||
path: '/dashboard/finance/taxrecords'
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@ -73,12 +73,6 @@ const managementSidebarItems = [
|
||||
label: 'Tax Rates',
|
||||
path: '/dashboard/management/taxrates'
|
||||
},
|
||||
{
|
||||
key: 'taxRecords',
|
||||
iconKey: 'taxRecord',
|
||||
label: 'Tax Records',
|
||||
path: '/dashboard/management/taxrecords'
|
||||
},
|
||||
{ type: 'divider' },
|
||||
{
|
||||
key: 'noteTypes',
|
||||
|
||||
@ -1,5 +1,15 @@
|
||||
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(
|
||||
() => import('../components/Dashboard/Finance/Invoices.jsx')
|
||||
@ -16,6 +26,12 @@ const PaymentInfo = lazy(
|
||||
const FinanceOverview = lazy(
|
||||
() => 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 = [
|
||||
<Route
|
||||
@ -34,6 +50,22 @@ const FinanceRoutes = [
|
||||
key='payments-info'
|
||||
path='finance/payments/info'
|
||||
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(
|
||||
() => 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 ManagementRoutes = [
|
||||
@ -319,16 +312,6 @@ const ManagementRoutes = [
|
||||
key='taxrates-info'
|
||||
path='management/taxrates/info'
|
||||
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