diff --git a/src/app/(main)/dashboard/CompanyTeamCashFlow/page.tsx b/src/app/(main)/dashboard/CompanyTeamCashFlow/page.tsx index 268f098..90c9d9a 100644 --- a/src/app/(main)/dashboard/CompanyTeamCashFlow/page.tsx +++ b/src/app/(main)/dashboard/CompanyTeamCashFlow/page.tsx @@ -18,9 +18,6 @@ const CompanyTeamCashFlow: React.FC = () => { preloadClientProjects(); return ( - - Company / Team Cash Flow - ); diff --git a/src/app/(main)/dashboard/ProjectCashFlow/page.tsx b/src/app/(main)/dashboard/ProjectCashFlow/page.tsx index 3a08236..c81acc0 100644 --- a/src/app/(main)/dashboard/ProjectCashFlow/page.tsx +++ b/src/app/(main)/dashboard/ProjectCashFlow/page.tsx @@ -17,10 +17,7 @@ export const metadata: Metadata = { const ProjectCashFlow: React.FC = () => { preloadClientProjects(); return ( - - - Project Cash Flow - + {/* }> */} diff --git a/src/app/(main)/dashboard/ProjectFinancialSummary/page.tsx b/src/app/(main)/dashboard/ProjectFinancialSummary/page.tsx index feec24e..bd64276 100644 --- a/src/app/(main)/dashboard/ProjectFinancialSummary/page.tsx +++ b/src/app/(main)/dashboard/ProjectFinancialSummary/page.tsx @@ -9,6 +9,7 @@ import Tab from "@mui/material/Tab"; import Typography from "@mui/material/Typography"; import ProjectFinancialSummaryComponents from "@/components/ProjectFinancialSummary"; import { preloadClientProjects } from "@/app/api/clientprojects"; +import { useTranslation } from "react-i18next"; export const metadata: Metadata = { title: "Project Status by Client", @@ -17,10 +18,7 @@ export const metadata: Metadata = { const ProjectFinancialSummary: React.FC = () => { preloadClientProjects(); return ( - - - Financial Summary - + ); diff --git a/src/app/(main)/dashboard/ProjectResourceConsumptionRanking/page.tsx b/src/app/(main)/dashboard/ProjectResourceConsumptionRanking/page.tsx index 052b861..2d6eadb 100644 --- a/src/app/(main)/dashboard/ProjectResourceConsumptionRanking/page.tsx +++ b/src/app/(main)/dashboard/ProjectResourceConsumptionRanking/page.tsx @@ -17,10 +17,7 @@ export const metadata: Metadata = { const ProjectResourceConsumptionRanking: React.FC = () => { preloadClientProjects(); return ( - - - Project Resource Consumption Ranking - + ); diff --git a/src/app/(main)/dashboard/ProjectResourceSummary/page.tsx b/src/app/(main)/dashboard/ProjectResourceSummary/page.tsx index c6a8c98..9631fa8 100644 --- a/src/app/(main)/dashboard/ProjectResourceSummary/page.tsx +++ b/src/app/(main)/dashboard/ProjectResourceSummary/page.tsx @@ -5,11 +5,11 @@ import DashboardPageButton from "@/components/DashboardPage/DashboardTabButton"; import { Suspense } from "react"; import Tabs, { TabsProps } from "@mui/material/Tabs"; import Tab from "@mui/material/Tab"; -import Typography from "@mui/material/Typography"; import StaffUtilizationComponent from "@/components/StaffUtilization"; import ProjectResourceSummarySearch from "@/components/ProjectResourceSummarySearch"; import { ResourceSummaryResult } from "@/app/api/resourcesummary"; import { preloadClientProjects } from "@/app/api/clientprojects"; +import ProjectResourceSummaryComponent from "@/components/ProjectResourceSummary"; export const metadata: Metadata = { title: "Project Resource Summary", @@ -18,13 +18,11 @@ export const metadata: Metadata = { const ProjectResourceSummary: React.FC = () => { preloadClientProjects(); return ( - - - Project Resource Summary - + }> + {/* */} ); }; diff --git a/src/app/(main)/dashboard/ProjectStatusByClient/page.tsx b/src/app/(main)/dashboard/ProjectStatusByClient/page.tsx index 1b51537..b2971d0 100644 --- a/src/app/(main)/dashboard/ProjectStatusByClient/page.tsx +++ b/src/app/(main)/dashboard/ProjectStatusByClient/page.tsx @@ -20,10 +20,7 @@ export const metadata: Metadata = { const ProjectStatusByClient: React.FC = () => { preloadClientProjects(); return ( - - - Project Status by Client - + }> diff --git a/src/app/(main)/dashboard/ProjectStatusByTeam/page.tsx b/src/app/(main)/dashboard/ProjectStatusByTeam/page.tsx index c76327b..e7c2d19 100644 --- a/src/app/(main)/dashboard/ProjectStatusByTeam/page.tsx +++ b/src/app/(main)/dashboard/ProjectStatusByTeam/page.tsx @@ -17,10 +17,7 @@ export const metadata: Metadata = { const ProjectStatusByTeam: React.FC = () => { preloadClientProjects(); return ( - - - Project Status by Team - + }> diff --git a/src/app/(main)/dashboard/StaffUtilization/page.tsx b/src/app/(main)/dashboard/StaffUtilization/page.tsx index c7fdb95..7ab698d 100644 --- a/src/app/(main)/dashboard/StaffUtilization/page.tsx +++ b/src/app/(main)/dashboard/StaffUtilization/page.tsx @@ -18,9 +18,6 @@ const StaffUtilization: React.FC = () => { preloadClientProjects(); return ( - - Staff Utilization - ); diff --git a/src/components/Breadcrumb/Breadcrumb.tsx b/src/components/Breadcrumb/Breadcrumb.tsx index dcb9b9c..2ad36bc 100644 --- a/src/components/Breadcrumb/Breadcrumb.tsx +++ b/src/components/Breadcrumb/Breadcrumb.tsx @@ -15,9 +15,9 @@ const pathToLabelMap: { [path: string]: string } = { "/home": "User Workspace", "/changepassword": "Change Password", "/dashboard": "Dashboard", - "/dashboard/CompanyTeamCashFlow": "Company Team Cash Flow", + "/dashboard/CompanyTeamCashFlow": "Company / Team Cash Flow", "/dashboard/ProjectCashFlow": "Project Cash Flow", - "/dashboard/ProjectFinancialSummary": "Project Finanical Summary", + "/dashboard/ProjectFinancialSummary": "Financial Summary", "/dashboard/ProjectResourceSummary": "Project Resource Summary", "/dashboard/ProjectStatusByClient": "Project Status by Client", "/dashboard/ProjectStatusByTeam": "Project Status by Team", @@ -82,7 +82,8 @@ const Breadcrumb = () => { const pathname = usePathname(); const segments = pathname.split("/"); - // const { t } = useTranslation("customer"); + //const { t } = useTranslation("customer"); + const { t } = useTranslation("common"); return ( { {segments.map((segment, index) => { const href = segments.slice(0, index + 1).join("/"); - const label = pathToLabelMap[href] || segment; + // const label = pathToLabelMap[href] || segment; + const originalLabel = pathToLabelMap[href] || segment; + const label = t(originalLabel, originalLabel); if (index === segments.length - 1) { return ( diff --git a/src/components/CompanyTeamCashFlow/CompanyTeamCashFlow.tsx b/src/components/CompanyTeamCashFlow/CompanyTeamCashFlow.tsx index dcf2ab2..dd8f397 100644 --- a/src/components/CompanyTeamCashFlow/CompanyTeamCashFlow.tsx +++ b/src/components/CompanyTeamCashFlow/CompanyTeamCashFlow.tsx @@ -24,6 +24,7 @@ import Select, { components } from "react-select"; import { fetchTeamCombo, fetchTeamCashFlowChartData } from "@/app/api/teamCashflow"; import { VIEW_DASHBOARD_ALL } from "@/middleware"; import { SessionStaff } from "@/config/authConfig"; +import Typography from "@mui/material/Typography"; interface Props { abilities: string[], @@ -31,6 +32,7 @@ interface Props { } const CompanyTeamCashFlow: React.FC = ({ abilities, staff }) => { + const { t } = useTranslation("dashboard"); const todayDate = new Date(); const [selectionModel, setSelectionModel]: any[] = React.useState([]); const [teamOptions, setTeamOptions]: any[] = React.useState([]); @@ -220,24 +222,27 @@ const CompanyTeamCashFlow: React.FC = ({ abilities, staff }) => { }, xaxis: { categories: [ - "JAN", - "FEB", - "MAR", - "APR", - "MAY", - "JUN", - "JUL", - "AUG", - "SEP", - "OCT", - "NOV", - "DEC", + t("JAN"), + t("FEB"), + t("MAR"), + t("APR"), + t("MAY"), + t("JUN"), + t("JUL"), + t("AUG"), + t("SEP"), + t("OCT"), + t("NOV"), + t("DEC"), ], }, yaxis: [ { title: { - text: "Monthly Income and Expenditure(HKD)", + text:t("Monthly Income and Expenditure (HKD)"), + style: { + fontSize: '15px' + } }, min: 0, max: monthlyChartLeftMax, @@ -252,7 +257,7 @@ const CompanyTeamCashFlow: React.FC = ({ abilities, staff }) => { show: false, seriesName: "Monthly Expenditure", title: { - text: "Monthly Expenditure (HKD)", + text: t("Monthly Expenditure (HKD)"), }, min: 0, max: monthlyChartLeftMax, @@ -262,7 +267,10 @@ const CompanyTeamCashFlow: React.FC = ({ abilities, staff }) => { seriesName: "Cumulative Income", opposite: true, title: { - text: "Cumulative Income and Expenditure(HKD)", + text: t("Cumulative Income and Expenditure (HKD)"), + style: { + fontSize: '15px' + } }, min: 0, max: monthlyChartRightMax, @@ -278,7 +286,7 @@ const CompanyTeamCashFlow: React.FC = ({ abilities, staff }) => { seriesName: "Cumulative Expenditure", opposite: true, title: { - text: "Cumulative Expenditure (HKD)", + text: t("Cumulative Expenditure (HKD)"), }, min: 0, max: monthlyChartRightMax, @@ -291,25 +299,25 @@ const CompanyTeamCashFlow: React.FC = ({ abilities, staff }) => { annotations: {}, series: [ { - name: "Monthly Income", + name: t("Monthly Income"), type: "column", color: "#ffde91", data: monthlyIncomeList, }, { - name: "Monthly Expenditure", + name: t("Monthly Expenditure"), type: "column", color: "#82b59a", data: monthlyExpenditureList, }, { - name: "Cumulative Income", + name: t("Cumulative Income"), type: "line", color: "#EE6D7A", data: monthlyCumulativeIncomeList, }, { - name: "Cumulative Expenditure", + name: t("Cumulative Expenditure"), type: "line", color: "#7cd3f2", data: monthlyCumulativeExpenditureList, @@ -320,17 +328,20 @@ const CompanyTeamCashFlow: React.FC = ({ abilities, staff }) => { return ( <> -
+ + {t("Company / Team Cash Flow")} + +
= ({ abilities, staff }) => { {abilities.includes(VIEW_DASHBOARD_ALL) &&
{
{ className="text-sm font-medium ml-5 mt-2" style={{ color: "#898d8d" }} > - Total Project Fee + {t("Total Project Fee")}
{ className="text-sm font-medium ml-5 mt-2" style={{ color: "#898d8d" }} > - Total Invoiced Amount + {t("Total Invoiced Amount")}
{ className="text-sm font-medium ml-5" style={{ color: "#898d8d" }} > - Total Received Amount + {t("Total Received Amount")}
{ className="text-sm font-medium ml-5" style={{ color: "#898d8d" }} > - Accounts Receivable + {t("Accounts Receivable")}
{ { className="text-sm font-medium ml-5 mt-2" style={{ color: "#898d8d" }} > - Total Budget + {t("Total Budget")}
{ className="text-sm font-medium ml-5" style={{ color: "#898d8d" }} > - Total Cumulative Expenditure + {t("Total Cumulative Expenditure")}
{ className="text-sm font-medium ml-5" style={{ color: "#898d8d" }} > - Remaining Budget + {t("Remaining Budget")}
{
{
= ({

- Total Active Project + {t("Total Active Project")}
{TotalActiveProjectNumber.toLocaleString()}

- Total Fees + {t("Total Fees")}
{TotalFees.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}

- Total Budget + {t("Total Budget")}
{TotalBudget.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}

- Total Cumulative Expenditure + {t("Total Cumulative Expenditure")}
{TotalCumulative.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}

- Total Invoiced Amount + {t("Total Invoiced Amount")}
{TotalInvoicedAmount.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}

- Total Un-Invoiced Amount + {t("Total Un-Invoiced Amount")}
{TotalUnInvoicedAmount.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}

- Total Received Amount + {t("Total Received Amount")}
{TotalReceivedAmount.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}

- Cash Flow Status + {t("Cash Flow Status")}
{CashFlowStatus === "Negative" && ( <> @@ -135,7 +135,7 @@ const ProjectFinancialCard: React.FC = ({ className="text-lg font-medium ml-5" style={{ color: "#f896aa" }} > - {CashFlowStatus} + {t(CashFlowStatus)}

@@ -146,7 +146,7 @@ const ProjectFinancialCard: React.FC = ({ className="text-lg font-medium ml-5" style={{ color: "#71d19e" }} > - {CashFlowStatus} + {t(CashFlowStatus)}

@@ -155,7 +155,7 @@ const ProjectFinancialCard: React.FC = ({ className="text-sm mt-2 font-medium ml-5" style={{ color: "#898d8d" }} > - Cost Performance Index (CPI) + {t("Cost Performance Index") + " (CPI)"}
{Number(CostPerformanceIndex) < 1 && ( <> @@ -180,7 +180,7 @@ const ProjectFinancialCard: React.FC = ({ )}
- Projected Cash Flow Status + {t("Projected Cash Flow Status")}
{ProjectedCashFlowStatus === "Negative" && ( <> @@ -188,7 +188,7 @@ const ProjectFinancialCard: React.FC = ({ className="text-lg font-medium ml-5" style={{ color: "#f896aa" }} > - {ProjectedCashFlowStatus} + {t(ProjectedCashFlowStatus)}

@@ -199,7 +199,7 @@ const ProjectFinancialCard: React.FC = ({ className="text-lg font-medium ml-5" style={{ color: "#71d19e" }} > - {ProjectedCashFlowStatus} + {t(ProjectedCashFlowStatus)}

@@ -208,7 +208,7 @@ const ProjectFinancialCard: React.FC = ({ className="text-sm mt-2 font-medium ml-5" style={{ color: "#898d8d" }} > - Projected Cost Performance Index (CPI) + {t("Projected Cost Performance Index") + " (CPI)"}
{Number(ProjectedCPI) < 1 && ( <> diff --git a/src/components/ProjectFinancialSummary/ProjectFinancialSummary.tsx b/src/components/ProjectFinancialSummary/ProjectFinancialSummary.tsx index 80a4d81..e55aaf8 100644 --- a/src/components/ProjectFinancialSummary/ProjectFinancialSummary.tsx +++ b/src/components/ProjectFinancialSummary/ProjectFinancialSummary.tsx @@ -23,6 +23,7 @@ import { exportFinancialSummaryByClientExcel, exportFinancialSummaryByProjectExc import ProjectFinancialCard from "./ProjectFinancialCard"; import VisibilityIcon from '@mui/icons-material/Visibility'; import { downloadFile } from "@/app/utils/commonUtil"; +import Typography from "@mui/material/Typography"; type SearchProjectQuery = Partial>; type SearchClientQuery = Partial>; @@ -41,15 +42,15 @@ const ProjectFinancialSummary: React.FC = () => { const projectSearchCriteria: Criterion[] = useMemo( () => [ - { label: "Project Code", paramName: "projectCode", type: "text" }, - { label: "Project Name", paramName: "projectName", type: "text" }, + { label: t("Project Code"), paramName: "projectCode", type: "text" }, + { label: t("Project Name"), paramName: "projectName", type: "text" }, ], [t], ); const clientSearchCriteria: Criterion[] = useMemo( () => [ - { label: "Client Code", paramName: "customerCode", type: "text" }, - { label: "Client Name", paramName: "customerName", type: "text" }, + { label: t("Client Code"), paramName: "customerCode", type: "text" }, + { label: t("Client Name"), paramName: "customerName", type: "text" }, ], [t], ); @@ -109,35 +110,35 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'customerCode', field: 'customerCode', - headerName: "Client Code", + headerName: t("Client Code"), minWidth:50 }, { id: 'customerName', field: 'customerName', - headerName: "Client Name", + headerName: t("Client Name"), minWidth:80 }, { id: 'projectNo', field: 'projectNo', - headerName: "Total Project Involved", + headerName: t("Total Project Involved"), minWidth:80 }, { id: 'cashFlowStatus', field: 'cashFlowStatus', - headerName: "Cash Flow Status", + headerName: t("Cash Flow Status"), minWidth:100, renderCell: (params:any) => { console.log(params.row) if (params.row.cashFlowStatus === "Positive") { return ( - {params.row.cashFlowStatus} + {t(params.row.cashFlowStatus)} ) } else if (params.row.cashFlowStatus === "Negative") { return ( - {params.row.cashFlowStatus} + {t(params.row.cashFlowStatus)} ) } }, @@ -145,7 +146,7 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'cpi', field: 'cpi', - headerName: "CPI", + headerName: t("CPI"), minWidth:50, renderCell: (params:any) => { if (params.row.cpi >= 1) { @@ -162,16 +163,16 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'projectedCashFlowStatus', field: 'projectedCashFlowStatus', - headerName: "Projected Cash Flow Status", + headerName: t("Projected Cash Flow Status"), minWidth:100, renderCell: (params:any) => { if (params.row.projectedCashFlowStatus === "Positive") { return ( - {params.row.projectedCashFlowStatus} + {t(params.row.projectedCashFlowStatus)} ) } else if (params.row.projectedCashFlowStatus === "Negative") { return ( - {params.row.projectedCashFlowStatus} + {t(params.row.projectedCashFlowStatus)} ) } }, @@ -179,7 +180,7 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'projectedCpi', field: 'projectedCpi', - headerName: "Projected CPI", + headerName: t("Projected CPI"), minWidth:50, renderCell: (params:any) => { if (params.row.projectedCpi >= 1) { @@ -196,7 +197,7 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'totalFee', field: 'totalFee', - headerName: "Total Fees (HKD)", + headerName: t("Total Fees")+t("HKD"), minWidth:50, renderCell: (params:any) => { return ( @@ -207,7 +208,7 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'totalBudget', field: 'totalBudget', - headerName: "Total Budget (HKD)", + headerName: t("Total Budget")+t("HKD"), minWidth:50, renderCell: (params:any) => { return ( @@ -218,7 +219,7 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'cumulativeExpenditure', field: 'cumulativeExpenditure', - headerName: "Total Cumulative Expenditure (HKD)", + headerName: t("Total Cumulative Expenditure")+t("HKD"), minWidth:280, renderCell: (params:any) => { return ( @@ -229,7 +230,7 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'totalInvoiced', field: 'totalInvoiced', - headerName: "Total Invoiced Amount (HKD)", + headerName: t("Total Invoiced Amount")+t("HKD"), minWidth:250, renderCell: (params:any) => { return ( @@ -240,7 +241,7 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'totalUnInvoiced', field: 'totalUnInvoiced', - headerName: "Total Un-invoiced Amount (HKD)", + headerName: t("Total Un-Invoiced Amount")+t("HKD"), minWidth:250, renderCell: (params:any) => { return ( @@ -251,7 +252,7 @@ const ProjectFinancialSummary: React.FC = () => { { id: 'totalReceived', field: 'totalReceived', - headerName: "Total Received Amount (HKD)", + headerName: t("Total Received Amount")+t("HKD"), minWidth:250, renderCell: (params:any) => { return ( @@ -314,40 +315,40 @@ const columns2 = [ { id: 'projectCode', field: 'projectCode', - headerName: "Project Code", + headerName: t("Project Code"), minWidth:50, }, { id: 'projectName', field: 'projectName', - headerName: "Project Name", + headerName: t("Project Name"), minWidth:50, }, { id: 'customerName', field: 'customerName', - headerName: "Client Name", + headerName: t("Client Name"), minWidth:50, }, { id: 'subsidiaryName', field: 'subsidiaryName', - headerName: "Subsidiary", + headerName: t("Subsidiary"), minWidth:50, }, { id: 'cashFlowStatus', field: 'cashFlowStatus', - headerName: "Cash Flow Status", + headerName: t("Cash Flow Status"), minWidth:80, renderCell: (params:any) => { if (params.row.cashFlowStatus === "Positive") { return ( - {params.row.cashFlowStatus} + {t(params.row.cashFlowStatus)} ) } else if (params.row.cashFlowStatus === "Negative") { return ( - {params.row.cashFlowStatus} + {t(params.row.cashFlowStatus)} ) } }, @@ -368,16 +369,16 @@ const columns2 = [ { id: 'projectedCashFlowStatus', field: 'projectedCashFlowStatus', - headerName: "Projected Cash Flow Status", + headerName: t("Projected Cash Flow Status"), minWidth:100, renderCell: (params:any) => { if (params.row.projectedCashFlowStatus === "Positive") { return ( - {params.row.projectedCashFlowStatus} + {t(params.row.projectedCashFlowStatus)} ) } else if (params.row.projectedCashFlowStatus === "Negative") { return ( - {params.row.projectedCashFlowStatus} + {t(params.row.projectedCashFlowStatus)} ) } }, @@ -385,7 +386,7 @@ const columns2 = [ { id: 'projectedCpi', field: 'projectedCpi', - headerName: "Projected CPI", + headerName: t("Projected CPI"), minWidth:50, renderCell: (params:any) => { if (params.row.projectedCpi >= 1) { @@ -402,7 +403,7 @@ const columns2 = [ { id: 'totalFees', field: 'totalFees', - headerName: "Total Fees (HKD)", + headerName: t("Total Fees")+t("HKD"), minWidth:50, renderCell: (params:any) => { return ( @@ -413,7 +414,7 @@ const columns2 = [ { id: 'totalBudget', field: 'totalBudget', - headerName: "Total Budget (HKD)", + headerName: t("Total Budget")+t("HKD"), minWidth:50, renderCell: (params:any) => { return ( @@ -424,7 +425,7 @@ const columns2 = [ { id: 'totalCumulativeExpenditure', field: 'totalCumulativeExpenditure', - headerName: "Total Cumulative Expenditure (HKD)", + headerName: t("Total Cumulative Expenditure")+t("HKD"), minWidth:250, renderCell: (params:any) => { return ( @@ -435,7 +436,7 @@ const columns2 = [ { id: 'totalInvoicedAmount', field: 'totalInvoicedAmount', - headerName: "Total Invoiced Amount (HKD)", + headerName: t("Total Invoiced Amount")+t("HKD"), minWidth:250, renderCell: (params:any) => { return ( @@ -446,7 +447,7 @@ const columns2 = [ { id: 'totalUnInvoicedAmount', field: 'totalUnInvoicedAmount', - headerName: "Total Un-invoiced Amount (HKD)", + headerName: t("Total Un-Invoiced Amount")+t("HKD"), minWidth:250, renderCell: (params:any) => { return ( @@ -457,7 +458,7 @@ const columns2 = [ { id: 'totalReceivedAmount', field: 'totalReceivedAmount', - headerName: "Total Received Amount (HKD)", + headerName: t("Total Received Amount") +t("HKD"), minWidth:250, renderCell: (params:any) => { return ( @@ -503,30 +504,33 @@ const columns2 = [ return ( - - + + {t("Financial Summary")} + + +
{projectFinancialData.map((record:any, index:any) => (
handleCardClick(record,index)}> - +
))}

-
-Formula-
-
CPI: Invoiced Amount / Cumulative Expenditure
-
Cash Flow Status: {`Positive when CPI >= 1`}
-
Projected CPI: Project Fee / Cumulative Expenditure
-
Cash Flow Status: {`Positive when Projected CPI >= 1`}
+
-{t("Formula")}-
+
CPI: {t("Invoiced Amount")} / {t("Cumulative Expenditure")}
+
{t("Cash Flow Status")}: {`${t("Positive when CPI")}`}
+
{t("Projected CPI")}: {t("Project Fee")} / {t("Cumulative Expenditure")}
+
{t("Cash Flow Status")}: {t("Positive when Projected CPI")}
- +
{projectFinancialRows.length > 0 && ( )}
@@ -556,12 +560,12 @@ const columns2 = [
- +
{clientFinancialRows.length > 0 && ( )}
diff --git a/src/components/ProjectResourceConsumptionRanking/ProjectResourceConsumptionRanking.tsx b/src/components/ProjectResourceConsumptionRanking/ProjectResourceConsumptionRanking.tsx index 926db84..34c40f1 100644 --- a/src/components/ProjectResourceConsumptionRanking/ProjectResourceConsumptionRanking.tsx +++ b/src/components/ProjectResourceConsumptionRanking/ProjectResourceConsumptionRanking.tsx @@ -20,6 +20,7 @@ import ProgressByTeamSearch from "@/components/ProgressByTeamSearch"; import { Suspense } from "react"; import { useSearchParams } from 'next/navigation'; import { fetchAllTeamProjects, TeamProjectResult, fetchTeamProjects, fetchAllTeamConsumption, fetchAllTeamConsumptionColorOrder} from "@/app/api/teamprojects/actions"; +import Typography from "@mui/material/Typography"; // const ReactApexChart = dynamic(() => import('react-apexcharts'), { ssr: false }); interface Props { @@ -125,8 +126,8 @@ const ProjectResourceConsumptionRanking: React.FC = () => { const searchCriteria: Criterion[] = useMemo( () => [ - { label: "Team Code", paramName: "teamCode", type: "text" }, - { label: "Team Name", paramName: "teamName", type: "text" }, + { label: t("Team Code"), paramName: "teamCode", type: "text" }, + { label: t("Team Name"), paramName: "teamName", type: "text" }, ], [t], ); @@ -292,19 +293,19 @@ const ProjectResourceConsumptionRanking: React.FC = () => { { id: "teamCode", field: "teamCode", - headerName: "Team Code", + headerName: t("Team Code"), flex: 1, }, { id: "teamName", field: "teamName", - headerName: "Team Name", + headerName: t("Team Name"), flex: 1, }, { id: "projectNo", field: "projectNo", - headerName: "No. of Projects", + headerName: t("No. of Projects"), flex: 1, }, ]; @@ -360,31 +361,31 @@ const ProjectResourceConsumptionRanking: React.FC = () => { { id: "projectCode", field: "projectCode", - headerName: "Project No", + headerName: t("Project Code"), minWidth:100 }, { id: "projectName", field: "projectName", - headerName: "Project", + headerName: t("Project Name"), minWidth:300 }, { id: "team", field: "team", - headerName: "Team", + headerName: t("Team"), minWidth:50 }, { id: "teamLead", field: "teamLead", - headerName: "Team Leader", + headerName: t("Team Leader"), minWidth: 70 }, { id: "expectedStage", field: "expectedStage", - headerName: "Expected Stage", + headerName: t("Expected Stage"), minWidth: 300, renderCell: (params: any) => { if (params.row.expectedStage != null){ @@ -405,7 +406,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { { id: "budgetedManhour", field: "budgetedManhour", - headerName: "Budgeted Manhour", + headerName: t("Budgeted Manhours"), minWidth: 70, renderCell: (params: any) => { return {params.row.budgetedManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}; @@ -414,7 +415,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { { id: "spentManhour", field: "spentManhour", - headerName: "Spent Manhour", + headerName: t("Spent Manhours"), renderCell: (params: any) => { if (params.row.budgetedManhour - params.row.spentManhour <= 0) { return ( @@ -429,7 +430,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { { id: "remainedManhour", field: "remainedManhour", - headerName: "Remained Manhour", + headerName: t("Remained Manhours"), renderCell: (params: any) => { if (params.row.budgetedManhour - params.row.spentManhour <= 0) { return ( @@ -444,13 +445,13 @@ const ProjectResourceConsumptionRanking: React.FC = () => { { id: "comingPaymentMilestone", field: "comingPaymentMilestone", - headerName: "Coming Payment Milestone", + headerName: t("Coming Payment Milestones"), minWidth: 100 }, { id: "alert", field: "alert", - headerName: "Alert", + headerName: t("Alert"), renderCell: (params: any) => { if (params.row.alert === 1) { return ( @@ -532,7 +533,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { total: { show: true, showAlways: true, - label: "Spent", + label: t("Spent"), fontFamily: "sans-serif", formatter: function (val) { return totalSpentPercentage + "%"; @@ -580,9 +581,9 @@ const ProjectResourceConsumptionRanking: React.FC = () => {
${projectCode} - ${projectName}
- Budget Manhours: ${budgetManhours} hours + ${t("Budget Manhours")}: ${budgetManhours} ${t("hours")}
- Spent Manhours: ${spentManhours} hours + ${t("Spent Manhours")}: ${spentManhours} ${t("hours")}
Percentage: ${value}%
@@ -615,7 +616,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { }, yaxis: { title: { - text: "Projects", + text: t("Projects"), }, labels: { maxWidth: 200, @@ -625,7 +626,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { }, }, title: { - text: "Project Resource Consumption Percentage", + text: t("Project Resource Consumption Percentage"), align: "center", }, grid: { @@ -671,7 +672,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { const percentageArray = []; for (let i = 0; i <= selectedRowsData.length; i++) { if (i === selectedRowsData.length && i > 0) { - projectArray.push("Remained"); + projectArray.push(t("Remained")); } else if (selectedRowsData.length > 0) { projectArray.push(selectedRowsData[i].projectName); totalBudgetManhour += Number(selectedRowsData[i].budgetedManhour); @@ -705,7 +706,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { setTotalSpentPercentage( ((totalSpent / totalBudgetManhour) * 100).toFixed(1), ); - if (projectArray.length > 0 && projectArray.includes("Remained")) { + if (projectArray.length > 0 && projectArray.includes(t("Remained"))) { const nonLastRecordColors = pieChartColorArray; setColorArray([ ...nonLastRecordColors.slice(0, projectArray.length - 1), @@ -754,6 +755,9 @@ const ProjectResourceConsumptionRanking: React.FC = () => { }; return ( <> + + {t("Project Resource Consumption Ranking")} + { @@ -779,30 +783,30 @@ const ProjectResourceConsumptionRanking: React.FC = () => {
- +
- Sorting: + {t("Sorting")}:
{
{currentPage === 1 && ( )} {currentPage !== 1 && ( - )} {endIndex >= chartManhourConsumptionPercentage.length && ( )} {endIndex < chartManhourConsumptionPercentage.length && ( )} - Page  + {t("Page")}  {chartManhourConsumptionPercentage.length === 0 && ( 0 )} @@ -848,7 +852,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => {
{ {percentageArray.length === 0 && (
- Please select the project you want to check. + {t("Please select the project you want to check.")}
)} {percentageArray.length > 0 && ( @@ -905,7 +909,7 @@ const ProjectResourceConsumptionRanking: React.FC = () => { className="mt-5 text-lg font-medium" style={{ color: "#898d8d" }} > - Project Budget Manhour + {t("Project Budget Manhours")}
{ className="mt-2 text-lg font-medium" style={{ color: "#898d8d" }} > - Actual Manhour Spent + {t("Actual Manhours Spent")}
{ className="mt-2 text-lg font-medium" style={{ color: "#898d8d" }} > - Remained Manhour + {t("Remained Manhours")}
{ className="mt-2 text-lg font-medium" style={{ color: "#898d8d" }} > - Last Update + {t("Last Update")}
{ {row.stage} {row.taskCount} - {row.g1Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g1Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g2Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g2Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g3Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g3Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g4Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g4Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g5Planned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.g5Actual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.totalPlanned.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} - {row.totalActual.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {row.g1Planned.toFixed(2)} + {row.g1Actual.toFixed(2)} + {row.g2Planned.toFixed(2)} + {row.g2Actual.toFixed(2)} + {row.g3Planned.toFixed(2)} + {row.g3Actual.toFixed(2)} + {row.g4Planned.toFixed(2)} + {row.g4Actual.toFixed(2)} + {row.g5Planned.toFixed(2)} + {row.g5Actual.toFixed(2)} + {row.totalPlanned.toFixed(2)} + {row.totalActual.toFixed(2)} {row.task.map((taskRow:any) => ( @@ -314,7 +314,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[4].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[4] === 'number' ? taskRow[4].toFixed(2) : (taskRow[4] || '-')}
@@ -327,7 +327,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[5].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[5] === 'number' ? taskRow[5].toFixed(2) : (taskRow[5] || '-')}
@@ -340,7 +340,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[6].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[6] === 'number' ? taskRow[6].toFixed(2) : (taskRow[6] || '-')}
@@ -353,7 +353,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[7].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[7] === 'number' ? taskRow[7].toFixed(2) : (taskRow[7] || '-')}
@@ -366,7 +366,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[8].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[8] === 'number' ? taskRow[8].toFixed(2) : (taskRow[8] || '-')}
@@ -379,7 +379,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[9].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[9] === 'number' ? taskRow[9].toFixed(2) : (taskRow[9] || '-')}
@@ -392,7 +392,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[10].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[10] === 'number' ? taskRow[10].toFixed(2) : (taskRow[10] || '-')}
@@ -405,7 +405,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[11].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[11] === 'number' ? taskRow[11].toFixed(2) : (taskRow[11] || '-')}
@@ -418,7 +418,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[12].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[12] === 'number' ? taskRow[12].toFixed(2) : (taskRow[12] || '-')}
@@ -431,7 +431,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[13].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[13] === 'number' ? taskRow[13].toFixed(2) : (taskRow[13] || '-')}
@@ -444,7 +444,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[2].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[2] === 'number' ? taskRow[2].toFixed(2) : (taskRow[2] || '-')}
@@ -457,7 +457,7 @@ const ProjectResourceSummary: React.FC = () => { - {taskRow[3].toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + {typeof taskRow[3] === 'number' ? taskRow[3].toFixed(2) : (taskRow[3] || '-')}
@@ -619,12 +619,12 @@ const columns2 = [ }, }}> - +
- Project + {t("Project")}
@@ -634,81 +634,81 @@ const columns2 = [
- Project Fee + {t("Project Fee")}
- HKD ${projectFee.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + HKD ${projectFee.toFixed(2)}
- Total Budget + {t("Total Budget")}
- HKD ${projectBudget.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + HKD ${projectBudget.toFixed(2)}
- Cumculative Expenditure + {t("Cumulative Expenditure")}
- HKD ${expenditure.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + HKD ${expenditure.toFixed(2)}
- Remaining Budget + {t("Remaining Budget")}
- HKD ${remainingBudget.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} + HKD ${remainingBudget.toFixed(2)}
- Status + {t("Status")}
- {status} + {t(status)}
- Planned Resources + {t("Planned Resources")}
- {plannedResources.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} Manhours + {plannedResources.toFixed(2)} {t("Manhours")}
- Actual Resources Spent + {t("Actual Resources Spent")}
- {(actualResourcesSpent ?? 0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} Manhours ({(actualResourcesSpent/plannedResources*100).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}%) + {(actualResourcesSpent ?? 0).toFixed(2)} {t("Manhours")} ({(actualResourcesSpent/plannedResources*100).toFixed(2)}%)
- Remaining Resources + {t("Remaining Resources")}
-
- {(remainingResources ?? 0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })} Manhours ({(remainingResources/plannedResources*100).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}%) +
+ {(remainingResources ?? 0).toFixed(2)} {t("Manhours")} ({(remainingResources/plannedResources*100).toFixed(2)}%)
@@ -742,25 +742,25 @@ const columns2 = [ G5 - Total + {t("Total")} - Stage - Task Count - Planned - Actual - Planned - Actual - Planned - Actual - Planned - Actual - Planned - Actual - Planned - Actual + {t("Stage")} + {t("Task Count")} + {t("Planned")} + {t("Actual")} + {t("Planned")} + {t("Actual")} + {t("Planned")} + {t("Actual")} + {t("Planned")} + {t("Actual")} + {t("Planned")} + {t("Actual")} + {t("Planned")} + {t("Actual")} diff --git a/src/components/ProjectResourceSummarySearch/ProjectResourceSummarySearch.tsx b/src/components/ProjectResourceSummarySearch/ProjectResourceSummarySearch.tsx index eeae876..0cc989a 100644 --- a/src/components/ProjectResourceSummarySearch/ProjectResourceSummarySearch.tsx +++ b/src/components/ProjectResourceSummarySearch/ProjectResourceSummarySearch.tsx @@ -10,6 +10,7 @@ import EditNote from "@mui/icons-material/EditNote"; import { useRouter, useSearchParams } from "next/navigation"; import ProjectResourceSummary from "@/components/ProjectResourceSummary"; import ArticleIcon from '@mui/icons-material/Article'; +import Typography from "@mui/material/Typography"; interface Props { projects: ResourceSummaryResult[]; @@ -19,7 +20,7 @@ type SearchParamNames = keyof SearchQuery; const ProjectResourceSummarySearch: React.FC = ({ projects }) => { - const { t } = useTranslation("projects"); + const { t } = useTranslation("dashboard"); const router = useRouter(); const searchParams = useSearchParams() // If project searching is done on the server-side, then no need for this. @@ -27,10 +28,10 @@ const ProjectResourceSummarySearch: React.FC = ({ projects }) => { const searchCriteria: Criterion[] = useMemo( () => [ - { label: "Project Code", paramName: "projectCode", type: "text" }, - { label: "Project Name", paramName: "projectName", type: "text" }, - { label: "Client Code", paramName: "customerCode", type: "text" }, - { label: "Client Name", paramName: "customerName", type: "text" }, + { label: t("Project Code"), paramName: "projectCode", type: "text" }, + { label: t("Project Name"), paramName: "projectName", type: "text" }, + { label: t("Client Code"), paramName: "customerCode", type: "text" }, + { label: t("Client Name"), paramName: "customerName", type: "text" }, ], [t], ); @@ -51,7 +52,7 @@ const ProjectResourceSummarySearch: React.FC = ({ projects }) => { () => [ { name: "id", - label: t("View"), + label: t("Details"), onClick: onTaskClick, buttonIcon: , }, @@ -66,6 +67,9 @@ const ProjectResourceSummarySearch: React.FC = ({ projects }) => { return ( <> + + {t("Project Resource Summary")} + { diff --git a/src/components/StaffUtilization/StaffUtilization.tsx b/src/components/StaffUtilization/StaffUtilization.tsx index 9bd1487..9c585c4 100644 --- a/src/components/StaffUtilization/StaffUtilization.tsx +++ b/src/components/StaffUtilization/StaffUtilization.tsx @@ -35,6 +35,7 @@ import { fetchTeamCombo, fetchweeklyTeamTotalManhours, fetchmonthlyTeamTotalManh import { SessionStaff } from "@/config/authConfig"; import { VIEW_DASHBOARD_ALL } from "@/middleware"; import { QrCode } from "@mui/icons-material"; +import Typography from "@mui/material/Typography"; dayjs.extend(isBetweenPlugin); interface CustomPickerDayProps extends PickersDayProps { @@ -104,6 +105,7 @@ interface Props { } const StaffUtilization: React.FC = ({ abilities, staff }) => { + const { t } = useTranslation("dashboard"); const abilityViewDashboardAll = abilities.includes(VIEW_DASHBOARD_ALL) const todayDate = new Date(); @@ -275,8 +277,8 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { const [totalLeaveHours, setTotalLeaveHours]: any = React.useState('NA'); const [currentPage, setCurrentPage] = useState(1); const recordsPerPage = 10; - const [datePickerToLabel, setDatePickerToLabel] = React.useState("To"); - const [datePickerToLabel2, setDatePickerToLabel2] = React.useState("To"); + const [datePickerToLabel, setDatePickerToLabel] = React.useState(t("To")); + const [datePickerToLabel2, setDatePickerToLabel2] = React.useState(t("To")); const fetchComboData = async () => { const staffComboList = [] @@ -812,7 +814,10 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { yaxis: [ { title: { - text: "Team Total Manhours Spent (Hour)", + text: t("Team Total Manhours Spent (Hours)"), + style: { + fontSize: "14px" + } }, min: 0, max: totalManHoursMaxValue, @@ -830,13 +835,13 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { annotations: {}, series: [ { - name: "Planned", + name: t("Planned"), type: "line", color: "#efbe7d", data: teamTotalManhoursSpentPlanData, }, { - name: "Actual", + name: t("Actual"), type: "line", color: "#7cd3f2", data: teamTotalManhoursSpentActualData, @@ -867,7 +872,10 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { yaxis: [ { title: { - text: "Staff Grade", + text: t("Staff Grade"), + style: { + fontSize: "14px" + } }, min: 0, max: totalManHoursByGradeMaxValue, @@ -880,13 +888,13 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { annotations: {}, series: [ { - name: "Planned", + name: t("Planned"), type: "bar", color: "#efbe7d", data: totalManhourByGradePlannedManhours, }, { - name: "Actual", + name: t("Actual"), type: "bar", color: "#00acb1", data: totalManhourByGradeActualManhours, @@ -917,7 +925,10 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { yaxis: [ { title: { - text: "Project", + text: t("Project"), + style: { + fontSize: "14px" + } }, min: 0, max: individualManhoursMaxValue, @@ -937,7 +948,7 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { }, series: [ { - name: "Manhours(Hour)", + name: t("Manhours (Hour)"), type: "bar", color: "#00acb1", data: individualStaffManhours, @@ -968,7 +979,10 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { yaxis: [ { title: { - text: "Staff", + text: t("Staff"), + style: { + fontSize: "14px" + } }, min: 0, max: unsubmittedMaxValue, @@ -981,7 +995,7 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { annotations: {}, series: [ { - name: "Unsubmitted Time Sheet", + name: t("Unsubmitted Time Sheet"), type: "bar", color: "#00acb1", data: currentPageunsubmitCount, @@ -1325,20 +1339,23 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { return ( <> -
+ + {t("Staff Utilization")} + +
{teamTotalManhoursSpentSelect === "Weekly" && ( <> )} @@ -1372,10 +1389,10 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { } className="hover:cursor-pointer hover:bg-lime-50 text-lg bg-transparent border-lime-600 text-lime-600 border-solid rounded-l-md w-32" > - Weekly + {t("Weekly")} )} @@ -1385,12 +1402,12 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => {
{ @@ -1553,7 +1572,7 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { setDatePickerToLabel2("") }} onMenuClose={() => { - setDatePickerToLabel2("To") + setDatePickerToLabel2(t("To")) }} />
@@ -1563,7 +1582,7 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { @@ -1596,8 +1615,9 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { defaultValue={ totalManHoursByStaffGradeMonthlyFromValue } - label={"From"} + label={t("From")} views={["month", "year"]} + format="MM-YYYY" /> = ({ abilities, staff }) => { } label={datePickerToLabel2} views={["month", "year"]} + format="MM-YYYY" /> )} @@ -1642,19 +1663,20 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { verticalAlign: "top", marginLeft: 10, }} + className="mt-5" >
{unsubmittedTimeSheetSelect === "Weekly" && ( <> )} @@ -1688,10 +1710,10 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { } className="hover:cursor-pointer hover:bg-lime-50 text-lg bg-transparent border-lime-600 text-lime-600 border-solid w-32" > - Weekly + {t("Weekly")} )} @@ -1700,12 +1722,12 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { {abilityViewDashboardAll &&
{ @@ -1954,7 +1977,7 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { defaultValue={ totalManHoursByIndividualStaffDailyFromValue } - label={"On"} + label={t("On")} views={["day"]} /> {/* = ({ abilities, staff }) => { @@ -2009,8 +2032,9 @@ const StaffUtilization: React.FC = ({ abilities, staff }) => { defaultValue={ indivdualManHoursMonthlyFromValue } - label={"On"} + label={t("Month") + ":"} views={["month", "year"]} + format="MM-YYYY" /> {/* = ({ abilities, staff }) => { >
- Total Normal Hours Spent + {t("Total Normal Hours Spent")}
= ({ abilities, staff }) => {
- Total Leave Hours + {t("Total Leave Hours")}
= ({ abilities, staff }) => { >
- Total Other Hours Spent + {t("Total Other Hours Spent")}
= ({ abilities, staff }) => {
- + = 1", + "Projected CPI": "Projected CPI", + "Project Fee": "Project Fee", + "Positive when Projected CPI": "Positive when Projected CPI >= 1", + "Financial Status (by Project)": "Financial Status (by Project)", + "Financial Status (by Client)": "Financial Status (by Client)", + "Project Code": "Project Code", + "Project Name": "Project Name", + "Client Code": "Client Code", + "Client Name": "Client Name", + "Subsidiary": "Subsidiary", + "Total Project Involved": "Total Project Involved", + "HKD": "(HKD)", + "Negative": "Negative", + "Positive": "Positive", + "Export Excel": "Export Excel", + + "Company / Team Cash Flow": "Company / Team Cash Flow", + "Company and Team Cash Flow By Month": "Company and Team Cash Flow By Month", + "Year": "Year", + "Team": "Team", + "Monthly Income and Expenditure (HKD)": "Monthly Income and Expenditure (HKD)", + "Cumulative Income and Expenditure (HKD)": "Cumulative Income and Expenditure (HKD)", + "Monthly Income": "Monthly Income", + "Monthly Expenditure": "Monthly Expenditure", + "Cumulative Income": "Cumulative Income", + "JAN": "JAN", + "FEB": "FEB", + "MAR": "MAR", + "APR": "APR", + "MAY": "MAY", + "JUN": "JUN", + "JUL": "JUL", + "AUG": "AUG", + "SEP": "SEP", + "OCT": "OCT", + "NOV": "NOV", + "DEC": "DEC", + + "Project Cash Flow": "Project Cash Flow", + "Start Date From": "Start Date From", + "Start Date To": "Start Date To", + "Team Leader": "Team Leader", + "Start Date": "Start Date", + "Target End Date": "Target End Date", + "Client": "Client", + "Project Cash Flow by Month": "Project Cash Flow by Month", + "Accounts Receivable (HKD)": "Accounts Receivable (HKD)", + "Accounts Receivable": "Accounts Receivable", + "Receivable (HKD)": "Receivable (HKD)", + "Receivable": "Receivable", + "Invoiced": "Invoiced", + "Total Project Fee": "Total Project Fee", + "Expenditure": "Expenditure", + "Remaining Budget": "Remaining Budget", + "Anticipate Cash Flow by Month": "Anticipate Cash Flow by Month", + "Anticipate Monthly Income and Expenditure": "Anticipate Monthly Income and Expenditure", + "Cash Flow Ledger by Month": "Cash Flow Ledger by Month", + "Date": "Date", + "Expenditure (HKD)": "Expenditure (HKD)", + "Income (HKD)": "Income (HKD)", + "Cash Flow Balance (HKD)": "Cash Flow Balance (HKD)", + "Remarks": "Remarks", + + "Project Status by Client": "Project Status by Client", + "Details": "Details", + "Subsidiary Code": "Subsidiary Code", + "No. of Projects": "No. of Projects", + "Project Resource Consumption": "Project Resource Consumption", + "Sorting": "Sorting", + "Percentage (Ascending Order)": "Percentage (Ascending Order)", + "Percentage (Descending Order)": "Percentage (Descending Order)", + "Project Resource Consumption Percentage": "Project Resource Consumption Percentage", + "Project Resource Consumption Percentage (%)": "Project Resource Consumption Percentage (%)", + "Projects": "Projects", + "Overall Progress per Project": "Overall Progress per Project", + "Please select the project you want to check.": "Please select the project you want to check.", + "Spent": "Spent", + "Resource Consumption and Coming Milestones": "Resource Consumption and Coming Milestones", + "Expected Stage": "Expected Stage", + "Budgeted Manhours": "Budgeted Manhours", + "Spent Manhours": "Spent Manhours", + "Remained Manhours": "Remained Manhours", + "Coming Payment Milestones": "Coming Payment Milestones", + "Alert": "Alert", + "Project Budget Manhours": "Project Budget Manhours", + "Actual Manhours Spent": "Actual Manhours Spent", + "Last Update": "Last Update", + "Previous": "Previous", + "Next": "Next", + "Page": "Page", + + "Project Status by Team": "Project Status by Team", + "Team Code": "Team Code", + "Team Name": "Team Name", + + "Project Resource Consumption Ranking": "Project Resource Consumption Ranking", + + "Staff Utilization": "Staff Utilization", + "Team Total Manhours Spent": "Team Total Manhours Spent", + "Weekly": "Weekly", + "Monthly": "Monthly", + "Please select a team": "Please select a team", + "From": "From", + "To": "To", + "Team Total Manhours Spent (Hours)": "Team Total Manhours Spent (Hours)", + "Planned": "Planned", + "Actual": "Actual", + "Unsubmitted Time Sheet by Staff": "Unsubmitted Time Sheet by Staff", + "Unsubmitted Time Sheet": "Unsubmitted Time Sheet", + "On": "On", + "Staff": "Staff", + "Total Manhours Spent by Staff Grade": "Total Manhours Spent by Staff Grade", + "Staff Grade": "Staff Grade", + "Manhours Spent by Individual Staff": "Manhours Spent by Individual Staff", + "Staff Code and Name": "Staff Code and Name", + "Please select a staff": "Please select a staff", + "Total Normal Hours Spent": "Total Normal Hours Spent", + "Total Other Hours Spent": "Total Other Hours Spent", + "Total Leave Hours": "Total Leave Hours", + "Effort Proportion for individual Staff": "Effort Proportion for individual Staff", + "Week": "Week", + "Month": "Month", + "Project": "Project", + "Manhours (Hour)": "Manhours (Hour)", + + "Project Resource Summary": "Project Resource Summary", + "Client Code And Name": "Client Code And Name", + "Subsidiary Code And Name": "Subsidiary Code And Name", + "Project Information": "Project Information", + "Remaining Resources": "Remaining Resources", + "Planned Resources": "Planned Resources", + "Actual Resources Spent": "Actual Resources Spent", + "Manhours": "Manhours", + "Within Budget": "Within Budget", + "Overconsumption": "Overconsumption", + "Stage": "Stage", + "Task Count": "Task Count", + "Total": "Total", + "Status": "Status" +} \ No newline at end of file diff --git a/src/i18n/zh/common.json b/src/i18n/zh/common.json index 6f5e25c..e6afc1f 100644 --- a/src/i18n/zh/common.json +++ b/src/i18n/zh/common.json @@ -28,5 +28,16 @@ "Submit": "提交", "Save": "儲存", "Save And Submit": "儲存及提交", - "Reset": "重置" + "Reset": "重置", + + "Overview": "總覽", + "Dashboard": "儀表板", + "Financial Summary": "財務摘要", + "Company / Team Cash Flow": "公司/團隊現金流", + "Project Cash Flow": "項目現金流", + "Project Status by Client": "按客戶查看項目狀態", + "Project Status by Team": "按團隊查看項目狀態", + "Project Resource Consumption Ranking": "項目資源消耗排名", + "Staff Utilization": "員工利用率", + "Project Resource Summary": "項目資源摘要" } \ No newline at end of file diff --git a/src/i18n/zh/dashboard.json b/src/i18n/zh/dashboard.json index d80cb57..406f84d 100644 --- a/src/i18n/zh/dashboard.json +++ b/src/i18n/zh/dashboard.json @@ -1,3 +1,160 @@ { - "Dashboard": "儀表板" + "Financial Summary": "財務摘要", + "Active Project Financial Status": "活躍項目財務狀況", + "All Team": "所有團隊", + "Total Active Project": "總活躍項目", + "Total Fees": "總費用", + "Total Budget": "總預算", + "Total Cumulative Expenditure": "累計支出總額", + "Total Invoiced Amount": "已開發票總額", + "Total Un-Invoiced Amount": "未開發票總額", + "Total Received Amount": "已收款總額", + "Cash Flow Status": "現金流狀況", + "Cost Performance Index": "成本績效指數", + "Projected Cash Flow Status": "預計現金流狀況", + "Projected Cost Performance Index": "預計成本績效指數", + "Formula": "公式", + "Invoiced Amount": "已開發票金額", + "Cumulative Expenditure": "累計支出", + "Positive when CPI": "當 CPI 大於1時為正數", + "Projected CPI": "預計 CPI", + "Project Fee": "項目費用", + "Positive when Projected CPI": "當預計 CPI 大於1時為正數", + "Financial Status (by Project)": "財務狀況(按項目)", + "Financial Status (by Client)": "財務狀況(按客戶)", + "Project Code": "項目代碼", + "Project Name": "項目名稱", + "Client Code": "客戶代碼", + "Client Name": "客戶名稱", + "Subsidiary": "子公司", + "Total Project Involved": "總項目數", + "HKD": "(港幣)", + "Negative": "負數", + "Positive": "正數", + "Export Excel": "導出 Excel", + + "Company / Team Cash Flow": "公司/團隊現金流", + "Company and Team Cash Flow By Month": "公司及團隊按月現金流", + "Year": "年份", + "Team": "團隊", + "Monthly Income and Expenditure (HKD)": "月收入與支出(港幣)", + "Cumulative Income and Expenditure (HKD)": "累計收入與支出(港幣)", + "Monthly Income": "月收入", + "Monthly Expenditure": "月支出", + "Cumulative Income": "累計收入", + "JAN": "一月", + "FEB": "二月", + "MAR": "三月", + "APR": "四月", + "MAY": "五月", + "JUN": "六月", + "JUL": "七月", + "AUG": "八月", + "SEP": "九月", + "OCT": "十月", + "NOV": "十一月", + "DEC": "十二月", + + "Project Cash Flow": "項目現金流", + "Start Date From": "開始日期從", + "Start Date To": "開始日期至", + "Team Leader": "團隊領導", + "Start Date": "開始日期", + "Target End Date": "目標結束日期", + "Client": "客戶", + "Project Cash Flow by Month": "按月項目現金流", + "Accounts Receivable (HKD)": "應收賬款(港幣)", + "Accounts Receivable": "應收賬款", + "Receivable (HKD)": "應收款(港幣)", + "Receivable": "應收款", + "Invoiced": "已開發票", + "Total Project Fee": "項目總費用", + "Expenditure": "支出", + "Remaining Budget": "剩餘預算", + "Anticipate Cash Flow by Month": "按月預計現金流", + "Anticipate Monthly Income and Expenditure": "預計月收入與支出", + "Cash Flow Ledger by Month": "按月現金流賬本", + "Date": "日期", + "Expenditure (HKD)": "支出(港幣)", + "Income (HKD)": "收入(港幣)", + "Cash Flow Balance (HKD)": "現金流餘額(港幣)", + "Remarks": "備註", + + "Project Status by Client": "按客戶查看項目狀態", + "Details": "詳情", + "Subsidiary Code": "子公司代碼", + "No. of Projects": "項目數量", + "Project Resource Consumption": "項目資源消耗", + "Sorting": "排序", + "Percentage (Ascending Order)": "百分比(升序)", + "Percentage (Descending Order)": "百分比(降序)", + "Project Resource Consumption Percentage": "項目資源消耗百分比", + "Project Resource Consumption Percentage (%)": "項目資源消耗百分比 (%)", + "Projects": "項目", + "Overall Progress per Project": "每個項目的整體進度", + "Please select the project you want to check.": "請選擇您要查看的項目。", + "Spent": "已用", + "Resource Consumption and Coming Milestones": "資源消耗與即將到來的里程碑", + "Expected Stage": "預計階段", + "Budgeted Manhours": "預算工時", + "Spent Manhours": "已用工時", + "Remained Manhours": "剩餘工時", + "Remained": "剩餘", + "Coming Payment Milestones": "即將到來的付款里程碑", + "Alert": "警告", + "Project Budget Manhours": "項目預算工時", + "Actual Manhours Spent": "實際已用工時", + "Last Update": "最後更新", + "Previous": "上一頁", + "Next": "下一頁", + "Page": "頁", + + "Project Status by Team": "按團隊查看項目狀態", + "Team Code": "團隊代碼", + "Team Name": "團隊名稱", + + "Project Resource Consumption Ranking": "項目資源消耗排名", + + "Staff Utilization": "員工利用率", + "Team Total Manhours Spent": "團隊總工時花費", + "Weekly": "每週", + "Monthly": "每月", + "Please select a team": "請選擇一個團隊", + "From": "從", + "To": "到", + "Team Total Manhours Spent (Hours)": "團隊總工時花費(小時)", + "Planned": "計劃", + "Actual": "實際", + "Unsubmitted Time Sheet by Staff": "員工未提交的時間表", + "Unsubmitted Time Sheet": "未提交的時間表", + "On": "於", + "Staff": "員工", + "Total Manhours Spent by Staff Grade": "按員工級別統計的總工時花費", + "Staff Grade": "員工級別", + "Manhours Spent by Individual Staff": "個別員工的工時花費", + "Staff Code and Name": "員工代碼與姓名", + "Please select a staff": "請選擇一名員工", + "Total Normal Hours Spent": "總正常工時花費", + "Total Other Hours Spent": "總其他工時花費", + "Total Leave Hours": "總請假時數", + "Effort Proportion for individual Staff": "個別員工的工作比例", + "Week": "週", + "Month": "月份", + "Project": "項目", + "Manhours (Hour)": "工時(小時)", + + "Project Resource Summary": "項目資源摘要", + "Client Code And Name": "客戶代碼與名稱", + "Subsidiary Code And Name": "子公司代碼與名稱", + "Project Information": "項目信息", + "Remaining Resources": "剩餘資源", + "Planned Resources": "計劃資源", + "Actual Resources Spent": "實際資源花費", + "Manhours": "工時(小時)", + "Within Budget": "在預算內", + "Overconsumption": "超量消耗", + "Stage": "階段", + "Task Count": "工作數量", + "Total": "總計", + "Status": "狀態" } \ No newline at end of file