Sfoglia il codice sorgente

Merge branch 'main' of https://git.2fi-solutions.com/wayne.lee/tsms

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi 1 anno fa
parent
commit
58e439a6dd
2 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. +1
    -0
      src/app/api/cashflow/index.ts
  2. +4
    -3
      src/components/ProjectCashFlow/ProjectCashFlow.tsx

+ 1
- 0
src/app/api/cashflow/index.ts Vedi File

@@ -28,6 +28,7 @@ export interface CashFlowByMonthChartResult {
cumulativeExpenditure:number;
incomeList: any[];
expenditureList: any[];
beforeCurrentYearExpenditure: any[];
}

export interface CashFlowReceivableAndExpenditure {


+ 4
- 3
src/components/ProjectCashFlow/ProjectCashFlow.tsx Vedi File

@@ -89,6 +89,7 @@ const ProjectCashFlow: React.FC = () => {
}
const fetchChartData = async () => {
const cashFlowMonthlyChartData = await fetchProjectsCashFlowMonthlyChart(selectedProjectIdList,cashFlowYear);
console.log(cashFlowMonthlyChartData)
const monthlyIncome = []
const cumulativeIncome = []
const monthlyExpenditure = []
@@ -104,11 +105,11 @@ const ProjectCashFlow: React.FC = () => {
cumulativeIncome.push(cashFlowMonthlyChartData[0].incomeList[i].cumulativeIncome)
}
for (var i = 0; i < cashFlowMonthlyChartData[0].expenditureList.length; i++) {
if (rightMax < cashFlowMonthlyChartData[0].incomeList[i].cumulativeIncome || rightMax < cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure){
rightMax = Math.max(cashFlowMonthlyChartData[0].incomeList[i].cumulativeIncome,cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure)
if (rightMax < cashFlowMonthlyChartData[0].incomeList[i].cumulativeIncome || rightMax < cashFlowMonthlyChartData[0].beforeCurrentYearExpenditure[0].beforeCurrentYearCumulativeExpenditure +cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure){
rightMax = Math.max(cashFlowMonthlyChartData[0].incomeList[i].cumulativeIncome,cashFlowMonthlyChartData[0].beforeCurrentYearExpenditure[0].beforeCurrentYearCumulativeExpenditure + cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure)
}
monthlyExpenditure.push(cashFlowMonthlyChartData[0].expenditureList[i].expenditure)
cumulativeExpenditure.push(cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure)
cumulativeExpenditure.push(cashFlowMonthlyChartData[0].beforeCurrentYearExpenditure[0].beforeCurrentYearCumulativeExpenditure + cashFlowMonthlyChartData[0].expenditureList[i].cumulativeExpenditure)
}
setMonthlyIncomeList(monthlyIncome)
setMonthlyCumulativeIncomeList(cumulativeIncome)


Caricamento…
Annulla
Salva