| @@ -3963,6 +3963,7 @@ open class DashboardService( | |||||
| else "") | else "") | ||||
| + " group by pe.projectId " | + " group by pe.projectId " | ||||
| + " ) " | + " ) " | ||||
| // project_fee | |||||
| + " , projectFee as ( " | + " , projectFee as ( " | ||||
| + " select " | + " select " | ||||
| + " m.projectId, " | + " m.projectId, " | ||||
| @@ -3991,7 +3992,7 @@ open class DashboardService( | |||||
| + " (coalesce(pf.projectFee, 0) - ifnull(p.subContractFee, 0)) * 0.8 as totalBudget, " | + " (coalesce(pf.projectFee, 0) - ifnull(p.subContractFee, 0)) * 0.8 as totalBudget, " | ||||
| + " coalesce(me.manhourExpense, 0) as manhourExpense, " | + " coalesce(me.manhourExpense, 0) as manhourExpense, " | ||||
| + " coalesce(id.invoicedAmount, 0) as invoicedAmount, " | + " coalesce(id.invoicedAmount, 0) as invoicedAmount, " | ||||
| + " coalesce(id.uninvoicedAmount, 0) as uninvoicedAmount, " | |||||
| // + " coalesce(id.uninvoicedAmount, 0) as uninvoicedAmount, " | |||||
| + " coalesce(id.paidAmount, 0) as paidAmount, " | + " coalesce(id.paidAmount, 0) as paidAmount, " | ||||
| + " coalesce(pe.projectExpense, 0) as projectExpense " | + " coalesce(pe.projectExpense, 0) as projectExpense " | ||||
| + " from project p " | + " from project p " | ||||
| @@ -4006,8 +4007,10 @@ open class DashboardService( | |||||
| + " where p.status = 'On-going' " | + " where p.status = 'On-going' " | ||||
| + " and p.deleted = false " | + " and p.deleted = false " | ||||
| + (if (args.containsKey("teamId")) "and s.teamId = :teamId" else "") | + (if (args.containsKey("teamId")) "and s.teamId = :teamId" else "") | ||||
| + (if (args.containsKey("endDate")) " and coalesce(p.planStart, p.actualStart) <= :endDate" else "") | |||||
| + " order by p.code " | + " order by p.code " | ||||
| + " ) result ") | + " ) result ") | ||||
| println(sql) | |||||
| return jdbcDao.queryForList(sql.toString(), args) | return jdbcDao.queryForList(sql.toString(), args) | ||||
| } | } | ||||