|
@@ -3448,8 +3448,8 @@ open class DashboardService( |
|
|
+ " select " |
|
|
+ " select " |
|
|
+ " projectId, " |
|
|
+ " projectId, " |
|
|
+ " CASE WHEN tl.teamId = p.teamId " |
|
|
+ " CASE WHEN tl.teamId = p.teamId " |
|
|
+ " THEN (sum(coalesce(t.normalConsumed, 0)) + sum(coalesce(t.otConsumed, 0)))*max(sal.hourlyRate) " |
|
|
|
|
|
+ " ELSE ((sum(coalesce(t.normalConsumed, 0)) + sum(coalesce(t.otConsumed, 0)))*max(sal.hourlyRate)) * 1 " // cross team multiplier |
|
|
|
|
|
|
|
|
+ " THEN SUM((COALESCE(t.normalConsumed, 0) + COALESCE(t.otConsumed, 0)) * COALESCE(sal.hourlyRate, 0)) " |
|
|
|
|
|
+ " ELSE SUM((COALESCE(t.normalConsumed, 0) + COALESCE(t.otConsumed, 0)) * COALESCE(sal.hourlyRate, 0) * 1) " // cross team multiplier |
|
|
+ " END AS manhourExpense " |
|
|
+ " END AS manhourExpense " |
|
|
+ " from ( " |
|
|
+ " from ( " |
|
|
+ " SELECT * " |
|
|
+ " SELECT * " |
|
@@ -3462,7 +3462,7 @@ open class DashboardService( |
|
|
+ " ) t " |
|
|
+ " ) t " |
|
|
+ " left join p_cte p on p.id = t.projectId " |
|
|
+ " left join p_cte p on p.id = t.projectId " |
|
|
+ " left join team_log tl on tl.staffId = t.staffId and t.recordDate between tl.`from` AND tl.`to` " |
|
|
+ " left join team_log tl on tl.staffId = t.staffId and t.recordDate between tl.`from` AND tl.`to` " |
|
|
+ " inner JOIN salary_effective se ON se.staffId = t.staffId and t.recordDate between se.startDate AND se.endDate " |
|
|
|
|
|
|
|
|
+ " left JOIN salary_effective se ON se.staffId = t.staffId and t.recordDate between se.startDate AND se.endDate " |
|
|
+ " left join salary sal on sal.salaryPoint = se.salaryId " |
|
|
+ " left join salary sal on sal.salaryPoint = se.salaryId " |
|
|
+ " GROUP BY t.projectId, tl.teamId, p.teamId " |
|
|
+ " GROUP BY t.projectId, tl.teamId, p.teamId " |
|
|
+ " ) " |
|
|
+ " ) " |
|
|