Explorar el Código

update cross team report

add_swagger
cyril.tsui hace 8 meses
padre
commit
2f83abe6f1
Se han modificado 1 ficheros con 13 adiciones y 11 borrados
  1. +13
    -11
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt

+ 13
- 11
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt Ver fichero

@@ -3877,7 +3877,7 @@ open class ReportService(
}
println(_grade)
val gradeCode = _grade!!.grade.code
val otMultiplier = 1.15
// val otMultiplier = 1.15
val thisSE = salaryEffective.find {
it.staff.id == ts.staff!!.id
&& it.startDate <= ts.recordDate && (it.endDate >= ts.recordDate || it.endDate == null)
@@ -3886,18 +3886,19 @@ open class ReportService(
val normalHour = ts.normalConsumed ?: 0.0
val otHour = ts.otConsumed ?: 0.0
val normalCost = normalHour.times(hourlyRate)
val otCost = otHour.times(hourlyRate).times(otMultiplier)
// val otCost = otHour.times(hourlyRate).times(otMultiplier)
val otCost = otHour.times(hourlyRate)
//assigning data
val projectTeam = ts.project!!.teamLead!!.team.code
val staffTeam = ts.staff!!.team.code
// write in
var tsInData = teamsMap[projectTeam]!![gradeCode]!!.In
tsInData.manhour += normalHour + otHour
tsInData.cost += normalCost + otCost
tsInData.cost += (normalCost + otCost) * chargeFee
// write out
val tsOutData = teamsMap[staffTeam]!!.get(gradeCode)!!.Out
tsOutData.manhour += normalHour + otHour
tsOutData.cost += normalCost + otCost
tsOutData.cost += (normalCost + otCost) * chargeFee
}

return teamsMap
@@ -4410,7 +4411,7 @@ open class ReportService(
}
}
_timesheets.forEach { ts ->
val otMultiplier = 1.15
// val otMultiplier = 1.15
val thisSE = salaryEffective.filter {
it.staff.id == ts.staff!!.id
&&
@@ -4419,7 +4420,8 @@ open class ReportService(
val normalHour = ts.normalConsumed ?: 0.0
val otHour = ts.otConsumed ?: 0.0
val normalCost = normalHour.times(thisSE!!.salary.hourlyRate.toDouble())
val otCost = otHour.times(thisSE.salary.hourlyRate.toDouble()).times(otMultiplier)
// val otCost = otHour.times(thisSE.salary.hourlyRate.toDouble()).times(otMultiplier)
val otCost = otHour.times(thisSE.salary.hourlyRate.toDouble())
val staff = ts.staff!!
val project = ts.project!!
val projectNameCode = "${project.code}\n${project.name}"
@@ -4440,7 +4442,7 @@ open class ReportService(
tsInData[inOut_Key]!!.put(projectNameCode, TsData(0.0, 0.0))
}
tsInData[inOut_Key]!![projectNameCode]!!.manhour += normalHour + otHour
tsInData[inOut_Key]!![projectNameCode]!!.cost += normalCost + otCost
tsInData[inOut_Key]!![projectNameCode]!!.cost += (normalCost + otCost) * chargeFee
}

return teamsMap
@@ -4687,11 +4689,11 @@ open class ReportService(
grade.id
)]?.sumOf { it.getValue("manHour") } ?: 0.0)

totalSalary += groupedTimesheets[Triple(
totalSalary += (groupedTimesheets[Triple(
team.id,
chargedTeam.id,
grade.id
)]?.sumOf { it.getValue("salary") } ?: 0.0
)]?.sumOf { it.getValue("salary") } ?: 0.0) * chargeFee

val cloneStyle = workbook.createCellStyle()
cloneStyle.cloneStyleFrom(normalFontWithBorderStyle)
@@ -4702,11 +4704,11 @@ open class ReportService(

createCell(columnIndex++).apply {
setCellValue(
groupedTimesheets[Triple(
(groupedTimesheets[Triple(
team.id,
chargedTeam.id,
grade.id
)]?.sumOf { it.getValue("salary") } ?: 0.0)
)]?.sumOf { it.getValue("salary") } ?: 0.0) * chargeFee)

val cloneStyle = workbook.createCellStyle()
cloneStyle.cloneStyleFrom(normalFontWithBorderStyle)


Cargando…
Cancelar
Guardar