|
|
@@ -3672,9 +3672,12 @@ open class ReportService( |
|
|
|
val targetTeam = team.code |
|
|
|
_timesheets = timesheets.filter { ts -> |
|
|
|
// val staffTeam = ts.staff!!.team.code |
|
|
|
println(ts.staff!!.id!!) |
|
|
|
println(ts.id) |
|
|
|
println(ts.recordDate) |
|
|
|
val staffTeam = teamlog.find { |
|
|
|
it.staff.id == ts.staff!!.id |
|
|
|
&& it.from.isBefore(ts.recordDate) && (it.to == null || it.to.isAfter(ts.recordDate)) |
|
|
|
&& it.from <= ts.recordDate && (it.to == null || it.to >= ts.recordDate) |
|
|
|
&& it.deleted == false |
|
|
|
}!!.team.code |
|
|
|
val projectTeam = ts.project!!.teamLead!!.team.code |
|
|
@@ -3696,17 +3699,19 @@ open class ReportService( |
|
|
|
_timesheets.forEach {ts -> |
|
|
|
// this team charging others |
|
|
|
// get the grade and salary data of the record |
|
|
|
|
|
|
|
val _grade = gradeLog.find { |
|
|
|
it.staff.id == ts.staff!!.id |
|
|
|
&& it.from.isBefore(ts.recordDate) && (it.to == null || it.to.isAfter(ts.recordDate)) |
|
|
|
println("it staff: ${it.staff.id} ; ts staff: ${ts.staff!!.id}") |
|
|
|
println(it.staff.id == ts.staff!!.id) |
|
|
|
it.staff != null && it.staff.id == ts.staff!!.id |
|
|
|
&& it.from <= ts.recordDate && (it.to == null || it.to >=ts.recordDate) |
|
|
|
&& it.deleted == false |
|
|
|
} |
|
|
|
println(_grade) |
|
|
|
val gradeCode = _grade!!.grade.code |
|
|
|
val otMultiplier = 1.15 |
|
|
|
val thisSE = salaryEffective.find { |
|
|
|
it.staff.id == ts.staff!!.id |
|
|
|
&& it.startDate.isBefore(ts.recordDate) && (it.endDate.isAfter(ts.recordDate) || it.endDate == null) |
|
|
|
&& it.startDate <= ts.recordDate && (it.endDate >= ts.recordDate || it.endDate == null) |
|
|
|
} |
|
|
|
val normalHour = ts.normalConsumed ?: 0.0 |
|
|
|
val otHour = ts.otConsumed ?: 0.0 |
|
|
@@ -3716,12 +3721,10 @@ open class ReportService( |
|
|
|
val projectTeam = ts.project!!.teamLead!!.team.code |
|
|
|
val staffTeam = ts.staff!!.team.code |
|
|
|
// write in |
|
|
|
//println("putting in") |
|
|
|
var tsInData = teamsMap[projectTeam]!![gradeCode]!!.In |
|
|
|
tsInData.manhour += normalHour + otHour |
|
|
|
tsInData.cost += normalCost + otCost |
|
|
|
// write out |
|
|
|
//println("putting out") |
|
|
|
val tsOutData = teamsMap[staffTeam]!!.get(gradeCode)!!.Out |
|
|
|
tsOutData.manhour += normalHour + otHour |
|
|
|
tsOutData.cost += normalCost + otCost |
|
|
|