@@ -14,7 +14,7 @@ interface SubComponents { | |||||
const CostAndExpenseReportWrapper: React.FC & SubComponents = async () => { | const CostAndExpenseReportWrapper: React.FC & SubComponents = async () => { | ||||
const session: any = await getServerSession(authOptions) | const session: any = await getServerSession(authOptions) | ||||
const teamId = session.staff?.team.id | |||||
const teamId = session.staff?.teamId | |||||
const role = session.role | const role = session.role | ||||
let customers = await fetchAllCustomers() | let customers = await fetchAllCustomers() | ||||
let subsidiaries = await fetchAllSubsidiaries() | let subsidiaries = await fetchAllSubsidiaries() | ||||
@@ -12,7 +12,7 @@ interface SubComponents { | |||||
const GenerateMonthlyWorkHoursReportWrapper: React.FC & | const GenerateMonthlyWorkHoursReportWrapper: React.FC & | ||||
SubComponents = async () => { | SubComponents = async () => { | ||||
const session: any = await getServerSession(authOptions); | const session: any = await getServerSession(authOptions); | ||||
const teamId = session.staff?.team.id; | |||||
const teamId = session.staff?.teamId; | |||||
const role = session.role; | const role = session.role; | ||||
let staffs = await fetchStaff(); | let staffs = await fetchStaff(); | ||||
@@ -12,7 +12,7 @@ const GenerateProjectCashFlowReportWrapper: React.FC & SubComponents = async () | |||||
const projects = await fetchProjects(); | const projects = await fetchProjects(); | ||||
const staff = await getUserStaff() | const staff = await getUserStaff() | ||||
return <GenerateProjectCashFlowReport projects={projects.filter(project => project.teamId === staff.teamId)} />; | |||||
return <GenerateProjectCashFlowReport projects={staff?.teamId ? projects.filter(project => project.teamId === staff.teamId) : projects} />; | |||||
}; | }; | ||||
GenerateProjectCashFlowReportWrapper.Loading = GenerateProjectCashFlowReportLoading; | GenerateProjectCashFlowReportWrapper.Loading = GenerateProjectCashFlowReportLoading; | ||||
@@ -182,11 +182,11 @@ const NavigationContent: React.FC<Props> = ({ abilities }) => { | |||||
// label: "Completion Report with Outstanding Un-billed Hours Report", | // label: "Completion Report with Outstanding Un-billed Hours Report", | ||||
// path: "/analytics/ProjectCompletionReportWO", | // path: "/analytics/ProjectCompletionReportWO", | ||||
// }, | // }, | ||||
{ | |||||
icon: <Analytics />, | |||||
label: "Project Claims Report", | |||||
path: "/analytics/ProjectClaimsReport", | |||||
}, | |||||
// { | |||||
// icon: <Analytics />, | |||||
// label: "Project Claims Report", | |||||
// path: "/analytics/ProjectClaimsReport", | |||||
// }, | |||||
{ | { | ||||
icon: <Analytics />, | icon: <Analytics />, | ||||
label: "Project P&L Report", | label: "Project P&L Report", | ||||
@@ -13,7 +13,7 @@ interface SubComponents { | |||||
const ProjectCompletionReportWrapper: React.FC & SubComponents = async () => { | const ProjectCompletionReportWrapper: React.FC & SubComponents = async () => { | ||||
const session: any = await getServerSession(authOptions) | const session: any = await getServerSession(authOptions) | ||||
const teamId = session.staff?.team.id | |||||
const teamId = session.staff?.teamId | |||||
const role = session.role | const role = session.role | ||||
return <ProjectCompletionReport teamId={role === TEAM_LEAD && session.staff?.team ? teamId : null}/> | return <ProjectCompletionReport teamId={role === TEAM_LEAD && session.staff?.team ? teamId : null}/> | ||||
@@ -15,9 +15,9 @@ interface SubComponents { | |||||
const ResourceOvercomsumptionReportWrapper: React.FC & | const ResourceOvercomsumptionReportWrapper: React.FC & | ||||
SubComponents = async () => { | SubComponents = async () => { | ||||
const session: any = await getServerSession(authOptions); | const session: any = await getServerSession(authOptions); | ||||
const teamId = session.staff?.team.id; | |||||
const teamId = session.staff?.teamId; | |||||
const role = session.role; | const role = session.role; | ||||
let needAll = true; | |||||
let needAll = true; | |||||
let teams = await fetchTeam(); | let teams = await fetchTeam(); | ||||
const [customers, subsidiaries] = await Promise.all([ | const [customers, subsidiaries] = await Promise.all([ | ||||
fetchAllCustomers(), | fetchAllCustomers(), | ||||