Explorar el Código

update

tags/Baseline_30082024_BACKEND_UAT
MSI\derek hace 1 año
padre
commit
e34cc36087
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  1. +6
    -5
      src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt

+ 6
- 5
src/main/java/com/ffii/tsms/modules/report/service/ReportService.kt Ver fichero

@@ -1521,7 +1521,7 @@ open class ReportService(
+ " result.teamCode, "
+ " result.custCode, " )
if (args.get("outstanding") as Boolean) {
sql.append(" result.totalBudget - COALESCE(i.issueAmount , 0) + COALESCE(i.issueAmount, 0) - COALESCE(i.paidAmount, 0) as `Receivable Remained`, ")
sql.append(" result.projectFee - (result.totalBudget - COALESCE(i.issueAmount , 0) + COALESCE(i.issueAmount, 0) - COALESCE(i.paidAmount, 0)) as `Receivable Remained`, ")
}
sql.append(
" DATE_FORMAT(result.actualEnd, '%d/%m/%Y') as actualEnd "
@@ -1533,6 +1533,7 @@ open class ReportService(
+ " min(t.code) as teamCode, "
+ " min(c.code) as custCode, "
+ " min(p.actualEnd) as actualEnd, "
+ " min(p.expectedTotalFee) as projectFee, "
+ " sum(COALESCE(tns.totalConsumed*sal.hourlyRate, 0)) as totalBudget "
+ " FROM ( "
+ " SELECT "
@@ -1545,11 +1546,11 @@ open class ReportService(
+ " GROUP BY t.staffId, t.projectTaskId "
+ " order by t.staffId "
+ " ) AS tns "
+ " inner join project_task pt ON tns.taskId = pt.id "
+ " left JOIN staff s ON tns.staffId = s.id "
+ " right join project_task pt ON tns.taskId = pt.id "
+ " left join project p on p.id = pt.project_id "
+ " left JOIN staff s ON p.teamLead = s.id "
+ " left join salary sal on s.salaryId = sal.salaryPoint "
+ " left JOIN team t ON s.teamId = t.id "
+ " left join project p on p.id = pt.project_id "
+ " left join customer c on c.id = p.customerId "
+ " where p.deleted = false "
+ " and p.status = 'Completed' "
@@ -1591,7 +1592,7 @@ open class ReportService(
+ " p.name, "
+ " t.code as team, "
+ " c.code as client, "
+ " p.expectedTotalFee as plannedBudget, "
+ " p.expectedTotalFee * 0.8 as plannedBudget, "
+ " COALESCE(tns.totalBudget, 0) as actualConsumedBudget, "
+ " COALESCE(p.totalManhour, 0) as plannedManhour, "
+ " COALESCE(tns.totalConsumed, 0) as actualConsumedManhour, "


Cargando…
Cancelar
Guardar