diff --git a/db/routines/vn/procedures/route_calcCommission.sql b/db/routines/vn/procedures/route_calcCommission.sql index afca4564d..ab47e8281 100644 --- a/db/routines/vn/procedures/route_calcCommission.sql +++ b/db/routines/vn/procedures/route_calcCommission.sql @@ -68,7 +68,7 @@ BEGIN FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc - LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.workCenterFk + LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.commissionWorkCenterFk WHERE r.id = vSelf AND r.workerFk AND r.commissionWorkCenterFk; @@ -100,7 +100,7 @@ BEGIN FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc - LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.workCenterFk + LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.commissionWorkCenterFk WHERE r.id = vSelf AND r.kmStart AND r.kmEnd