| @@ -2975,10 +2975,11 @@ open class ReportService( | |||||
| } | } | ||||
| // if (timesheets.isNotEmpty()) { | // if (timesheets.isNotEmpty()) { | ||||
| val combinedTeamCodeColNumber = grades.size | |||||
| val combinedTeamCodeColNumber = grades.size * 2 | |||||
| val sortedGrades = grades.sortedBy { it.id } | val sortedGrades = grades.sortedBy { it.id } | ||||
| val sortedTeams = teams.sortedBy { it.id } | val sortedTeams = teams.sortedBy { it.id } | ||||
| logger.info(timesheets.filter { it.project?.teamLead?.team?.id != it.staff?.team?.id }.size) | |||||
| val groupedTimesheets = timesheets | val groupedTimesheets = timesheets | ||||
| .filter { it.project?.teamLead?.team?.id != it.staff?.team?.id } | .filter { it.project?.teamLead?.team?.id != it.staff?.team?.id } | ||||
| .groupBy { timesheetEntry -> | .groupBy { timesheetEntry -> | ||||
| @@ -3060,6 +3061,16 @@ open class ReportService( | |||||
| alignment = HorizontalAlignment.CENTER | alignment = HorizontalAlignment.CENTER | ||||
| } | } | ||||
| } | } | ||||
| createCell(columnIndex++).apply { | |||||
| val cellValue = grade.name.trim().substring(0,1) + grade.name.trim().substring(grade.name.length - 1) + " - Cost Adjusted by Salary Point" | |||||
| setCellValue(cellValue) | |||||
| val cloneStyle = workbook.createCellStyle() | |||||
| cloneStyle.cloneStyleFrom(boldFontWithBorderStyle) | |||||
| cellStyle = cloneStyle.apply { | |||||
| alignment = HorizontalAlignment.CENTER | |||||
| } | |||||
| } | |||||
| } | } | ||||
| createCell(columnIndex++).apply { | createCell(columnIndex++).apply { | ||||
| @@ -3106,8 +3117,26 @@ open class ReportService( | |||||
| grade.id | grade.id | ||||
| )]?.sumOf { it.getValue("salary") } ?: 0.0 | )]?.sumOf { it.getValue("salary") } ?: 0.0 | ||||
| cellStyle = normalFontWithBorderStyle | |||||
| cellStyle.dataFormat = accountingStyle | |||||
| val cloneStyle = workbook.createCellStyle() | |||||
| cloneStyle.cloneStyleFrom(normalFontWithBorderStyle) | |||||
| cellStyle = cloneStyle.apply { | |||||
| dataFormat = accountingStyle | |||||
| } | |||||
| } | |||||
| createCell(columnIndex++).apply { | |||||
| setCellValue( | |||||
| groupedTimesheets[Triple( | |||||
| team.id, | |||||
| chargedTeam.id, | |||||
| grade.id | |||||
| )]?.sumOf { it.getValue("manHour") * it.getValue("salary") } ?: 0.0) | |||||
| val cloneStyle = workbook.createCellStyle() | |||||
| cloneStyle.cloneStyleFrom(normalFontWithBorderStyle) | |||||
| cellStyle = cloneStyle.apply { | |||||
| dataFormat = accountingStyle | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -3149,6 +3178,13 @@ open class ReportService( | |||||
| cellStyle = normalFontWithBorderStyle | cellStyle = normalFontWithBorderStyle | ||||
| cellStyle.dataFormat = accountingStyle | cellStyle.dataFormat = accountingStyle | ||||
| } | } | ||||
| createCell(columnIndex++).apply { | |||||
| val currentCellLetter = CellReference.convertNumToColString(this.columnIndex) | |||||
| cellFormula = "sum(${currentCellLetter}${startRow}:${currentCellLetter}${endRow})" | |||||
| cellStyle = normalFontWithBorderStyle | |||||
| cellStyle.dataFormat = accountingStyle | |||||
| } | |||||
| } | } | ||||
| createCell(columnIndex++).apply { | createCell(columnIndex++).apply { | ||||