| @@ -1733,9 +1733,10 @@ open class ReportService( | |||||
| + " result.code, " | + " result.code, " | ||||
| + " result.name, " | + " result.name, " | ||||
| + " result.teamCode, " | + " result.teamCode, " | ||||
| + " result.custCode, " ) | |||||
| + " result.custCode, " | |||||
| + " result.subCode, " ) | |||||
| if (args.get("outstanding") as Boolean) { | if (args.get("outstanding") as Boolean) { | ||||
| sql.append(" result.projectFee - (result.totalBudget - COALESCE(i.issueAmount , 0) + COALESCE(i.issueAmount, 0) - COALESCE(i.paidAmount, 0)) as `Receivable Remained`, ") | |||||
| sql.append(" result.projectFee - COALESCE(i.paidAmount, 0) as `Receivable Remained`, ") | |||||
| } | } | ||||
| sql.append( | sql.append( | ||||
| " DATE_FORMAT(result.actualEnd, '%d/%m/%Y') as actualEnd " | " DATE_FORMAT(result.actualEnd, '%d/%m/%Y') as actualEnd " | ||||
| @@ -1746,6 +1747,7 @@ open class ReportService( | |||||
| + " min(p.name) as name, " | + " min(p.name) as name, " | ||||
| + " min(t.code) as teamCode, " | + " min(t.code) as teamCode, " | ||||
| + " min(c.code) as custCode, " | + " min(c.code) as custCode, " | ||||
| + " COALESCE(concat(min(ss.code),' - ',min(ss.name)), 'N/A') as subCode, " | |||||
| + " min(p.actualEnd) as actualEnd, " | + " min(p.actualEnd) as actualEnd, " | ||||
| + " min(p.expectedTotalFee) as projectFee, " | + " min(p.expectedTotalFee) as projectFee, " | ||||
| + " sum(COALESCE(tns.totalConsumed*sal.hourlyRate, 0)) as totalBudget " | + " sum(COALESCE(tns.totalConsumed*sal.hourlyRate, 0)) as totalBudget " | ||||
| @@ -1766,6 +1768,7 @@ open class ReportService( | |||||
| + " left join salary sal on s.salaryId = sal.salaryPoint " | + " left join salary sal on s.salaryId = sal.salaryPoint " | ||||
| + " left JOIN team t ON s.teamId = t.id " | + " left JOIN team t ON s.teamId = t.id " | ||||
| + " left join customer c on c.id = p.customerId " | + " left join customer c on c.id = p.customerId " | ||||
| + " LEFT JOIN subsidiary ss on p.customerSubsidiaryId = ss.id " | |||||
| + " where p.deleted = false " | + " where p.deleted = false " | ||||
| + " and p.status = 'Completed' " | + " and p.status = 'Completed' " | ||||
| + " and p.actualEnd BETWEEN :startDate and :endDate " | + " and p.actualEnd BETWEEN :startDate and :endDate " | ||||
| @@ -1806,7 +1809,7 @@ open class ReportService( | |||||
| + " p.name, " | + " p.name, " | ||||
| + " t.code as team, " | + " t.code as team, " | ||||
| + " c.code as client, " | + " c.code as client, " | ||||
| + " COALESCE(ss.name, 'N/A') as subsidiary, " | |||||
| + " COALESCE(ss.code, 'N/A') as subsidiary, " | |||||
| + " p.expectedTotalFee * 0.8 as plannedBudget, " | + " p.expectedTotalFee * 0.8 as plannedBudget, " | ||||
| + " COALESCE(tns.totalBudget, 0) as actualConsumedBudget, " | + " COALESCE(tns.totalBudget, 0) as actualConsumedBudget, " | ||||
| + " COALESCE(p.totalManhour, 0) as plannedManhour, " | + " COALESCE(p.totalManhour, 0) as plannedManhour, " | ||||