From d68c8fa7c2673f656059f474f33f00329a17d451 Mon Sep 17 00:00:00 2001 From: "MSI\\2Fi" Date: Fri, 9 Aug 2024 17:29:01 +0800 Subject: [PATCH] Add function to calculate cumulative expediture Modify PNL Report, Financial Status Report and Cost and Expense Report --- .../modules/report/web/ReportController.kt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/com/ffii/tsms/modules/report/web/ReportController.kt b/src/main/java/com/ffii/tsms/modules/report/web/ReportController.kt index 8f858ba..7fa7aed 100644 --- a/src/main/java/com/ffii/tsms/modules/report/web/ReportController.kt +++ b/src/main/java/com/ffii/tsms/modules/report/web/ReportController.kt @@ -38,6 +38,7 @@ import org.apache.commons.logging.Log import org.apache.commons.logging.LogFactory import org.springframework.data.domain.Example import org.springframework.data.domain.ExampleMatcher +import java.math.BigDecimal import java.time.YearMonth import java.util.* @@ -346,4 +347,28 @@ class ReportController( // return ResponseEntity.noContent().build() // } } + +// API for testing data of total cumulative expenditure +// @GetMapping("/test") +// fun testApi(@RequestParam teamLeadId: Long): Map{ +// val manhoursSpent = excelReportService.getManHoursSpentByTeam(teamLeadId) +// val salaryEffectiveMap = excelReportService.getSalaryEffectiveByTeamLead(teamLeadId) +// val updatedTimesheetData = excelReportService.updateTimesheetDataWithEffectiveSalary(manhoursSpent, salaryEffectiveMap) +// val projectStaffExpenditures = excelReportService.sumTimesheetDataByMonth(updatedTimesheetData) +// val projectExpenditure = excelReportService.calculateProjectExpenditures(updatedTimesheetData) +// +// return projectExpenditure +// } +// @GetMapping("/test2") +// +// fun testApi2(@RequestParam teamLeadId: Long): Map{ +// val manhoursSpent = excelReportService.getManHoursSpentByTeam(teamLeadId) +// val salaryEffectiveMap = excelReportService.getSalaryEffectiveByTeamLead(teamLeadId) +// val updatedTimesheetData = excelReportService.updateTimesheetDataWithEffectiveSalary(manhoursSpent, salaryEffectiveMap) +// val projectStaffExpenditures = excelReportService.sumTimesheetDataByMonth(updatedTimesheetData) +// val projectExpenditure = excelReportService.calculateProjectExpenditures(updatedTimesheetData) +// +// return projectStaffExpenditures +// } + } \ No newline at end of file