|
@@ -80,7 +80,11 @@ open class DashboardService( |
|
|
+ " sum(t.normalConsumed) + sum(t.otConsumed) as spentManhour," |
|
|
+ " sum(t.normalConsumed) + sum(t.otConsumed) as spentManhour," |
|
|
+ " p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed) as remainedManhour," |
|
|
+ " p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed) as remainedManhour," |
|
|
+ " coalesce (round(((sum(t.normalConsumed) + sum(t.otConsumed))/p.totalManhour)*100,2),0) as manhourConsumptionPercentage," |
|
|
+ " coalesce (round(((sum(t.normalConsumed) + sum(t.otConsumed))/p.totalManhour)*100,2),0) as manhourConsumptionPercentage," |
|
|
+ " COALESCE (DATE_FORMAT(milestonePayment.comingPaymentMilestone, '%Y-%m-%d'),'NA') as comingPaymentMilestone" |
|
|
|
|
|
|
|
|
+ " COALESCE (DATE_FORMAT(milestonePayment.comingPaymentMilestone, '%Y-%m-%d'),'NA') as comingPaymentMilestone," |
|
|
|
|
|
+ " case" |
|
|
|
|
|
+ " when COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) > 0 then 0" |
|
|
|
|
|
+ " when COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) <= 0 then 1" |
|
|
|
|
|
+ " end as alert" |
|
|
+ " from project p" |
|
|
+ " from project p" |
|
|
+ " left join project_task pt on p.id = pt.project_id" |
|
|
+ " left join project_task pt on p.id = pt.project_id" |
|
|
+ " left join timesheet t on pt.id = t.projectTaskId" |
|
|
+ " left join timesheet t on pt.id = t.projectTaskId" |
|
@@ -143,7 +147,11 @@ open class DashboardService( |
|
|
+ " COALESCE (sum(t.normalConsumed) + sum(t.otConsumed),0) as spentManhour," |
|
|
+ " COALESCE (sum(t.normalConsumed) + sum(t.otConsumed),0) as spentManhour," |
|
|
+ " COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) as remainedManhour," |
|
|
+ " COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) as remainedManhour," |
|
|
+ " coalesce (round(((sum(t.normalConsumed) + sum(t.otConsumed))/p.totalManhour)*100,2),0) as manhourConsumptionPercentage," |
|
|
+ " coalesce (round(((sum(t.normalConsumed) + sum(t.otConsumed))/p.totalManhour)*100,2),0) as manhourConsumptionPercentage," |
|
|
+ " COALESCE (DATE_FORMAT(milestonePayment.comingPaymentMilestone, '%Y-%m-%d'),'NA') as comingPaymentMilestone" |
|
|
|
|
|
|
|
|
+ " COALESCE (DATE_FORMAT(milestonePayment.comingPaymentMilestone, '%Y-%m-%d'),'NA') as comingPaymentMilestone," |
|
|
|
|
|
+ " case" |
|
|
|
|
|
+ " when COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) > 0 then 0" |
|
|
|
|
|
+ " when COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) <= 0 then 1" |
|
|
|
|
|
+ " end as alert" |
|
|
+ " from project p" |
|
|
+ " from project p" |
|
|
+ " left join project_task pt on p.id = pt.project_id" |
|
|
+ " left join project_task pt on p.id = pt.project_id" |
|
|
+ " left join timesheet t on pt.id = t.projectTaskId" |
|
|
+ " left join timesheet t on pt.id = t.projectTaskId" |
|
@@ -303,7 +311,11 @@ open class DashboardService( |
|
|
+ " COALESCE (sum(t.normalConsumed) + sum(t.otConsumed),0) as spentManhour," |
|
|
+ " COALESCE (sum(t.normalConsumed) + sum(t.otConsumed),0) as spentManhour," |
|
|
+ " COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) as remainedManhour," |
|
|
+ " COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) as remainedManhour," |
|
|
+ " coalesce (round(((sum(t.normalConsumed) + sum(t.otConsumed))/p.totalManhour)*100,2),0) as manhourConsumptionPercentage," |
|
|
+ " coalesce (round(((sum(t.normalConsumed) + sum(t.otConsumed))/p.totalManhour)*100,2),0) as manhourConsumptionPercentage," |
|
|
+ " COALESCE (DATE_FORMAT(milestonePayment.comingPaymentMilestone, '%Y-%m-%d'),'NA') as comingPaymentMilestone" |
|
|
|
|
|
|
|
|
+ " COALESCE (DATE_FORMAT(milestonePayment.comingPaymentMilestone, '%Y-%m-%d'),'NA') as comingPaymentMilestone," |
|
|
|
|
|
+ " case" |
|
|
|
|
|
+ " when COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) > 0 then 0" |
|
|
|
|
|
+ " when COALESCE (p.totalManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) <= 0 then 1" |
|
|
|
|
|
+ " end as alert" |
|
|
+ " from project p" |
|
|
+ " from project p" |
|
|
+ " left join project_task pt on p.id = pt.project_id" |
|
|
+ " left join project_task pt on p.id = pt.project_id" |
|
|
+ " left join timesheet t on pt.id = t.projectTaskId" |
|
|
+ " left join timesheet t on pt.id = t.projectTaskId" |
|
@@ -351,7 +363,11 @@ open class DashboardService( |
|
|
+ " project.budgetedManhour as budgetedManhour," |
|
|
+ " project.budgetedManhour as budgetedManhour," |
|
|
+ " COALESCE (sum(t.normalConsumed) + sum(t.otConsumed),0) as spentManhour," |
|
|
+ " COALESCE (sum(t.normalConsumed) + sum(t.otConsumed),0) as spentManhour," |
|
|
+ " COALESCE (project.budgetedManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) as remainedManhour," |
|
|
+ " COALESCE (project.budgetedManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) as remainedManhour," |
|
|
+ " coalesce (round(((sum(t.normalConsumed) + sum(t.otConsumed))/project.budgetedManhour)*100,2),0) as manhourConsumptionPercentage" |
|
|
|
|
|
|
|
|
+ " coalesce (round(((sum(t.normalConsumed) + sum(t.otConsumed))/project.budgetedManhour)*100,2),0) as manhourConsumptionPercentage," |
|
|
|
|
|
+ " case" |
|
|
|
|
|
+ " when COALESCE (project.budgetedManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) > 0 then 0" |
|
|
|
|
|
+ " when COALESCE (project.budgetedManhour - sum(t.normalConsumed) - sum(t.otConsumed),0) <= 0 then 1" |
|
|
|
|
|
+ " end as alert" |
|
|
+ " from team te" |
|
|
+ " from team te" |
|
|
+ " left join project p on p.teamLead = te.teamLead" |
|
|
+ " left join project p on p.teamLead = te.teamLead" |
|
|
+ " left join project_task pt on p.id = pt.project_id" |
|
|
+ " left join project_task pt on p.id = pt.project_id" |
|
|