diff --git a/src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt b/src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt index 664d91b..18c5055 100644 --- a/src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt +++ b/src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt @@ -1733,9 +1733,10 @@ open class ReportService( + " result.code, " + " result.name, " + " result.teamCode, " - + " result.custCode, " ) + + " result.custCode, " + + " result.subCode, " ) 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( " DATE_FORMAT(result.actualEnd, '%d/%m/%Y') as actualEnd " @@ -1746,6 +1747,7 @@ open class ReportService( + " min(p.name) as name, " + " min(t.code) as teamCode, " + " min(c.code) as custCode, " + + " COALESCE(concat(min(ss.code),' - ',min(ss.name)), 'N/A') as subCode, " + " min(p.actualEnd) as actualEnd, " + " min(p.expectedTotalFee) as projectFee, " + " 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 team t ON s.teamId = t.id " + " left join customer c on c.id = p.customerId " + + " LEFT JOIN subsidiary ss on p.customerSubsidiaryId = ss.id " + " where p.deleted = false " + " and p.status = 'Completed' " + " and p.actualEnd BETWEEN :startDate and :endDate " @@ -1806,7 +1809,7 @@ open class ReportService( + " p.name, " + " t.code as team, " + " c.code as client, " - + " COALESCE(ss.name, 'N/A') as subsidiary, " + + " COALESCE(ss.code, 'N/A') as subsidiary, " + " p.expectedTotalFee * 0.8 as plannedBudget, " + " COALESCE(tns.totalBudget, 0) as actualConsumedBudget, " + " COALESCE(p.totalManhour, 0) as plannedManhour, " diff --git a/src/main/resources/templates/report/AR05_Project Completion Report.xlsx b/src/main/resources/templates/report/AR05_Project Completion Report.xlsx index d9187b6..2c07680 100644 Binary files a/src/main/resources/templates/report/AR05_Project Completion Report.xlsx and b/src/main/resources/templates/report/AR05_Project Completion Report.xlsx differ diff --git a/src/main/resources/templates/report/AR06_Project Completion Report with Outstanding Accounts Receivable v02.xlsx b/src/main/resources/templates/report/AR06_Project Completion Report with Outstanding Accounts Receivable v02.xlsx index 700dc59..ee9bcda 100644 Binary files a/src/main/resources/templates/report/AR06_Project Completion Report with Outstanding Accounts Receivable v02.xlsx and b/src/main/resources/templates/report/AR06_Project Completion Report with Outstanding Accounts Receivable v02.xlsx differ