PLAT#47027: Bulkactie Freeze (Accorderen) op hoger nivo.

svn path=/Website/branches/v2017.2/; revision=36071
This commit is contained in:
Maykel Geerdink
2017-11-21 15:18:23 +00:00
parent f866534a58
commit 3e48bfea71

View File

@@ -3090,14 +3090,15 @@ ins = {checkAutLevel:
+ " AND xcp.ins_deel_key = result.ins_deel_key"
+ " AND xcp.ins_srtcontrole_key = result.ins_srtcontrole_key"
// Inspectie mag niet op dezelfde dag plaatsvinden
+ " AND (SELECT TRUNC(idsc2.ins_deelsrtcontrole_datum)"
+ " FROM ins_deelsrtcontrole idsc2"
+ " WHERE ins_deelsrtcontrole_key = (SELECT MAX(idsc2.ins_deelsrtcontrole_key)"
+ " FROM ins_deelsrtcontrole idsc2"
+ " WHERE idsc2.ins_deel_key = xcp.ins_deel_key"
+ " AND idsc2.ins_srtcontrole_key = xcp.ins_srtcontrole_key"
+ " AND idsc2.ins_scenario_key = xcp.ins_scenario_key"
+ " AND idsc2.ins_deelsrtcontrole_status = 6)) != TRUNC(SYSDATE)"
// Als er nog geen inspectie is geweest neem dan gisteren (sysdate - 1).
+ " AND COALESCE((SELECT TRUNC(idsc2.ins_deelsrtcontrole_datum)"
+ " FROM ins_deelsrtcontrole idsc2"
+ " WHERE ins_deelsrtcontrole_key = (SELECT MAX(idsc2.ins_deelsrtcontrole_key)"
+ " FROM ins_deelsrtcontrole idsc2"
+ " WHERE idsc2.ins_deel_key = xcp.ins_deel_key"
+ " AND idsc2.ins_srtcontrole_key = xcp.ins_srtcontrole_key"
+ " AND idsc2.ins_scenario_key = xcp.ins_scenario_key"
+ " AND idsc2.ins_deelsrtcontrole_status = 6)), (TRUNC(SYSDATE-1))) != TRUNC(SYSDATE)"
// Autorisatie controleren i.p.v. canInspStartReq (Accorderen (Freeze)) en canInspFinishReq (Voltooien/Afronden (Finish)):
// 0) invoerAfterNext is voor mjob (interval modus) altijd waar.
// 1) Alleen voor Accorderen (Freeze): niet vervallen.