Ver código fonte

fix expenditure graph

tags/Baseline_30082024_FRONTEND_UAT
MSI\User 1 ano atrás
pai
commit
1dfffa1524
3 arquivos alterados com 8 adições e 3 exclusões
  1. +1
    -0
      src/app/api/cashflow/index.ts
  2. +4
    -3
      src/components/ProjectCashFlow/ProjectCashFlow.tsx
  3. +3
    -0
      src/i18n/en/Invoice.json

+ 1
- 0
src/app/api/cashflow/index.ts Ver arquivo

@@ -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 Ver arquivo

@@ -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)


+ 3
- 0
src/i18n/en/Invoice.json Ver arquivo

@@ -0,0 +1,3 @@
{
}

Carregando…
Cancelar
Salvar