@@ -178,6 +178,13 @@ const CompanyTeamCashFlow: React.FC = () => { | |||||
]; | ]; | ||||
const options: ApexOptions = { | const options: ApexOptions = { | ||||
tooltip: { | |||||
y: { | |||||
formatter: function(val) { | |||||
return val.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); | |||||
} | |||||
} | |||||
}, | |||||
chart: { | chart: { | ||||
height: 350, | height: 350, | ||||
type: "line", | type: "line", | ||||
@@ -246,7 +246,10 @@ const ProgressByClient: React.FC<Props> = () => { | |||||
id: "budgetedManhour", | id: "budgetedManhour", | ||||
field: "budgetedManhour", | field: "budgetedManhour", | ||||
headerName: "Budgeted Manhour", | headerName: "Budgeted Manhour", | ||||
minWidth: 70 | |||||
minWidth: 70, | |||||
renderCell: (params: any) => { | |||||
return <span>{params.row.budgetedManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</span>; | |||||
} | |||||
}, | }, | ||||
{ | { | ||||
id: "spentManhour", | id: "spentManhour", | ||||
@@ -255,11 +258,11 @@ const ProgressByClient: React.FC<Props> = () => { | |||||
renderCell: (params: any) => { | renderCell: (params: any) => { | ||||
if (params.row.budgetedManhour - params.row.spentManhour <= 0) { | if (params.row.budgetedManhour - params.row.spentManhour <= 0) { | ||||
return ( | return ( | ||||
<span className="text-red-300">{params.row.spentManhour}</span> | |||||
<span className="text-red-300">{params.row.spentManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</span> | |||||
); | ); | ||||
} else { | } else { | ||||
console.log(params) | console.log(params) | ||||
return <span>{params.row.spentManhour}</span>; | |||||
return <span>{params.row.spentManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</span>; | |||||
} | } | ||||
}, | }, | ||||
minWidth: 70 | minWidth: 70 | ||||
@@ -271,10 +274,10 @@ const ProgressByClient: React.FC<Props> = () => { | |||||
renderCell: (params: any) => { | renderCell: (params: any) => { | ||||
if (params.row.budgetedManhour - params.row.spentManhour <= 0) { | if (params.row.budgetedManhour - params.row.spentManhour <= 0) { | ||||
return ( | return ( | ||||
<span className="text-red-300">({params.row.remainedManhour})</span> | |||||
<span className="text-red-300">({params.row.remainedManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })})</span> | |||||
); | ); | ||||
} else { | } else { | ||||
return <span>{params.row.remainedManhour}</span>; | |||||
return <span>{params.row.remainedManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</span>; | |||||
} | } | ||||
}, | }, | ||||
minWidth: 70 | minWidth: 70 | ||||
@@ -277,7 +277,10 @@ const ProgressByTeam: React.FC = () => { | |||||
id: "budgetedManhour", | id: "budgetedManhour", | ||||
field: "budgetedManhour", | field: "budgetedManhour", | ||||
headerName: "Budgeted Manhour", | headerName: "Budgeted Manhour", | ||||
minWidth: 70 | |||||
minWidth: 70, | |||||
renderCell: (params: any) => { | |||||
return <span>{params.row.budgetedManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</span>; | |||||
} | |||||
}, | }, | ||||
{ | { | ||||
id: "spentManhour", | id: "spentManhour", | ||||
@@ -286,10 +289,10 @@ const ProgressByTeam: React.FC = () => { | |||||
renderCell: (params: any) => { | renderCell: (params: any) => { | ||||
if (params.row.budgetedManhour - params.row.spentManhour <= 0) { | if (params.row.budgetedManhour - params.row.spentManhour <= 0) { | ||||
return ( | return ( | ||||
<span className="text-red-300">{params.row.spentManhour}</span> | |||||
<span className="text-red-300">{params.row.spentManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</span> | |||||
); | ); | ||||
} else { | } else { | ||||
return <span>{params.row.spentManhour}</span>; | |||||
return <span>{params.row.spentManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</span>; | |||||
} | } | ||||
}, | }, | ||||
minWidth: 70 | minWidth: 70 | ||||
@@ -301,10 +304,10 @@ const ProgressByTeam: React.FC = () => { | |||||
renderCell: (params: any) => { | renderCell: (params: any) => { | ||||
if (params.row.budgetedManhour - params.row.spentManhour <= 0) { | if (params.row.budgetedManhour - params.row.spentManhour <= 0) { | ||||
return ( | return ( | ||||
<span className="text-red-300">({params.row.remainedManhour})</span> | |||||
<span className="text-red-300">({params.row.remainedManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })})</span> | |||||
); | ); | ||||
} else { | } else { | ||||
return <span>{params.row.remainedManhour}</span>; | |||||
return <span>{params.row.remainedManhour.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}</span>; | |||||
} | } | ||||
}, | }, | ||||
minWidth: 70 | minWidth: 70 | ||||
@@ -146,6 +146,7 @@ const ProjectCashFlow: React.FC = () => { | |||||
setMonthlyAnticipateExpenditureList([0,0,0,0,0,0,0,0,0,0,0,0]) | setMonthlyAnticipateExpenditureList([0,0,0,0,0,0,0,0,0,0,0,0]) | ||||
} | } | ||||
setMonthlyAnticipateIncomeList(monthlyAnticipateIncome) | setMonthlyAnticipateIncomeList(monthlyAnticipateIncome) | ||||
console.log(cashFlowAnticipateData) | |||||
if(cashFlowAnticipateData.length !== 0){ | if(cashFlowAnticipateData.length !== 0){ | ||||
if (cashFlowAnticipateData[0].anticipateExpenditureList.length !== 0) { | if (cashFlowAnticipateData[0].anticipateExpenditureList.length !== 0) { | ||||
const anticipateExpenditureList = [] | const anticipateExpenditureList = [] | ||||
@@ -157,6 +158,7 @@ const ProjectCashFlow: React.FC = () => { | |||||
for (var j = 1; j < 13; j++){ | for (var j = 1; j < 13; j++){ | ||||
if (month === j && duration > 0) { | if (month === j && duration > 0) { | ||||
subAnticipateExpenditure.push(anticipateExpenditure) | subAnticipateExpenditure.push(anticipateExpenditure) | ||||
month = month + 1 | |||||
duration = duration - 1 | duration = duration - 1 | ||||
} else { | } else { | ||||
subAnticipateExpenditure.push(0) | subAnticipateExpenditure.push(0) | ||||
@@ -164,6 +166,7 @@ const ProjectCashFlow: React.FC = () => { | |||||
} | } | ||||
anticipateExpenditureList.push(subAnticipateExpenditure) | anticipateExpenditureList.push(subAnticipateExpenditure) | ||||
} | } | ||||
console.log(anticipateExpenditureList) | |||||
const result = new Array(anticipateExpenditureList[0].length).fill(0); | const result = new Array(anticipateExpenditureList[0].length).fill(0); | ||||
for (const arr of anticipateExpenditureList) { | for (const arr of anticipateExpenditureList) { | ||||
for (let i = 0; i < arr.length; i++) { | for (let i = 0; i < arr.length; i++) { | ||||
@@ -306,6 +309,13 @@ const ProjectCashFlow: React.FC = () => { | |||||
]; | ]; | ||||
const options: ApexOptions = { | const options: ApexOptions = { | ||||
tooltip: { | |||||
y: { | |||||
formatter: function(val) { | |||||
return val.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); | |||||
} | |||||
} | |||||
}, | |||||
chart: { | chart: { | ||||
height: 350, | height: 350, | ||||
type: "line", | type: "line", | ||||