FSN#39567: Van MJOB naar MJOP/R.
svn path=/Website/trunk/; revision=34877
This commit is contained in:
@@ -571,6 +571,8 @@ ins = {checkAutLevel:
|
||||
var hasInspect = !oRs.eof;
|
||||
oRs.Close();
|
||||
|
||||
var mjb_freeze_year = S("mjb_freeze_year");
|
||||
var mjb_start_year = S("mjb_start_year");
|
||||
// Voor het bepalen van de autorisatie voor inspecties, moet gekeken worden naar de gegevens van de Active Situatie (AS).
|
||||
var sql = "SELECT insp.ins_deelsrtcontrole_key"
|
||||
+ " , insp.ins_deelsrtcontrole_status"
|
||||
@@ -609,8 +611,56 @@ ins = {checkAutLevel:
|
||||
+ " THEN 1"
|
||||
+ " ELSE 0"
|
||||
+ " END invoerAfterNext"
|
||||
// Bepaling in welk jaar er een inspectie is gepland.
|
||||
// 1) In het jaar van de plandatum.
|
||||
// 2) In het jaar van de startdatum.
|
||||
// 3) a) Laatste inspectie is NULL (eerste inspectie moet nog komen) en het is een Controle(1).
|
||||
// Volgende inspectie is in het freeze jaar.
|
||||
// b) Laatste inspectie is NULL (eerste inspectie moet nog komen) en het is een Vervanging(2) of Certificering(3).
|
||||
// Nextdate is na het freeze jaar?
|
||||
// Ja) Vorige inspectie ligt na het start jaar en ligt niet in het aanmaak jaar?
|
||||
// Ja) Volgende inspectie is in het freeze jaar.
|
||||
// Nee) Volgende inspectie is het jaar van de nextdate.
|
||||
// Nee) De laatst ingeplande inspectie (nextdate) is na of in het start jaar?
|
||||
// Ja) Volgende inspectie is in het freeze jaar.
|
||||
// Nee) Volgende inspectie is in het jaar "nextdatum + periode".
|
||||
// c) Laatste inspectie is niet NULL. Er is al 1 of meerdere keren geinspecteerd.
|
||||
// Ligt de laatst ingeplande inspectie (nextdate) na dit jaar?
|
||||
// Ja) Volgende inspectie is het jaar van de nextdate (in de toekomst).
|
||||
// Nee) Volgende inspectie is in het freeze jaar.
|
||||
+ " , CASE"
|
||||
+ " WHEN EXTRACT(YEAR FROM COALESCE(insp.plandatum, insp.inspectie_next)) <= " + S("mjb_start_year")
|
||||
+ " WHEN"
|
||||
+ " EXTRACT(YEAR FROM "
|
||||
+ " COALESCE(insp.plandatum"
|
||||
+ " , CASE WHEN insp.laatste IS NULL THEN insp.ins_srtcontroledl_xcp_startdat ELSE NULL END"
|
||||
+ " , CASE"
|
||||
+ " WHEN insp.laatste IS NULL AND insp.ctr_controle_type = 1" // 1: Controle.
|
||||
+ " THEN TO_DATE('" + mjb_freeze_year + "', 'YYYY')"
|
||||
+ " WHEN insp.laatste IS NULL AND insp.ctr_controle_type != 1" // 2: Vervanging, 3: Certificering.
|
||||
+ " THEN" // Er is nog geen inspectie geweest
|
||||
+ " CASE"
|
||||
+ " WHEN EXTRACT(YEAR FROM insp.inspectie_next0) > " + mjb_freeze_year
|
||||
+ " THEN" // Nextdate is na de freeze datum.
|
||||
+ " CASE"
|
||||
+ " WHEN EXTRACT(YEAR FROM ADD_MONTHS(insp.inspectie_next0, -1 * 12 * insp.ins_srtcontrole_periode)) >= " + mjb_start_year + " AND"
|
||||
+ " EXTRACT(YEAR FROM ADD_MONTHS(insp.inspectie_next0, -1 * 12 * insp.ins_srtcontrole_periode)) != EXTRACT(YEAR FROM insp.ins_deel_aanmaak)"
|
||||
+ " THEN TO_DATE('" + mjb_freeze_year + "', 'YYYY')" // Vorige inspectie ligt tussen start en freeze jaar (Nu ligt er ook tussen).
|
||||
+ " ELSE insp.inspectie_next0"
|
||||
+ " END"
|
||||
+ " ELSE" // Nextdate is voor of in het freeze jaar.
|
||||
+ " CASE"
|
||||
+ " WHEN EXTRACT(YEAR FROM insp.inspectie_next0) >= " + mjb_start_year
|
||||
+ " THEN TO_DATE('" + mjb_freeze_year + "', 'YYYY')" // Nextdate tussen start en freeze jaar.
|
||||
+ " ELSE ADD_MONTHS(insp.inspectie_next0, 12 * insp.ins_srtcontrole_periode)" // Nextdate voor het start jaar.
|
||||
+ " END"
|
||||
+ " END"
|
||||
+ " ELSE" // Laatste IS NOT NULL. Er is al een inspectie geweest.
|
||||
+ " CASE"
|
||||
+ " WHEN EXTRACT(YEAR FROM insp.inspectie_next0) > EXTRACT(YEAR FROM SYSDATE)"
|
||||
+ " THEN insp.inspectie_next0" // Volgende inspectie is in de toekomst.
|
||||
+ " ELSE TO_DATE('" + mjb_freeze_year + "', 'YYYY')" // Laatst ingeplande inspectie is nog niet uitgevoerd.
|
||||
+ " END"
|
||||
+ " END)) = " + mjb_freeze_year
|
||||
+ " THEN 1"
|
||||
+ " ELSE 0"
|
||||
+ " END isFreezeYear"
|
||||
@@ -630,7 +680,11 @@ ins = {checkAutLevel:
|
||||
+ " , xcp.ctr_discipline_key"
|
||||
+ " , xcp.ins_srtcontrole_options options"
|
||||
+ " , xcp.ins_srtcontrole_eenheid eenheid"
|
||||
+ " , xcp.ins_srtcontrole_periode"
|
||||
+ " , xcp.ins_deel_aanmaak"
|
||||
+ " , xcp.ctr_controle_type"
|
||||
+ " , idsc.ins_deelsrtcontrole_plandatum plandatum"
|
||||
+ " , ins_srtcontroledl_xcp_startdat"
|
||||
+ " , CASE"
|
||||
+ " WHEN 1 = " + (hasInspect? 0 : 1) // lastinspect IS NULL
|
||||
+ " THEN (SELECT d.ins_deel_aanmaak FROM ins_deel d WHERE d.ins_deel_key = " + pins_deel_key + ")"
|
||||
@@ -645,8 +699,15 @@ ins = {checkAutLevel:
|
||||
+ " , xcp.ins_srtcontrole_eenheid"
|
||||
+ " , xcp.ins_srtcontrole_periode"
|
||||
+ " , xcp.ins_srtcontrole_bits"
|
||||
+ " , 1)"
|
||||
+ " , 1"
|
||||
+ " , xcp.ctr_ismjob)"
|
||||
+ " END inspectie_next"
|
||||
+ " , ins.nextcyclusdate(xcp.ins_deel_key, xcp.ins_srtcontrole_key, 1, 0) inspectie_next0"
|
||||
+ " , (SELECT MAX(idsc2.ins_deelsrtcontrole_datum)"
|
||||
+ " FROM ins_deelsrtcontrole idsc2"
|
||||
+ " WHERE idsc2.ins_deel_key = " + pins_deel_key
|
||||
+ " AND idsc2.ins_srtcontrole_key = " + params.srtcont_key
|
||||
+ " AND idsc2.ins_scenario_key = 1) laatste"
|
||||
+ " FROM ins_deelsrtcontrole idsc"
|
||||
+ " , ins_v_defined_inspect_xcp xcp"
|
||||
+ " WHERE xcp.ins_srtcontrole_key = idsc.ins_srtcontrole_key(+)" // Er kan nog voor de eerste keer geinspecteerd moeten worden.
|
||||
@@ -722,9 +783,9 @@ ins = {checkAutLevel:
|
||||
actief && iresult.hasCTRWrite &&
|
||||
((isc_options & 2) == 2) &&
|
||||
!isScenario;
|
||||
// Bevriezen gebeurt altijd voor het kalenderjaar S("mjb_start_year").
|
||||
// De nextdate moet in dat jaar liggen. Dan is er voor het aankomende kalenderjaar ook een bedrag ingevuld.
|
||||
// Mocht het bedrag 0 zijn, dan moet er een lcl aan de opmerking worden toegevoegd tijdens heb bevriezen, dat de taak door een hogere prio taak wordt uitgevoerd.
|
||||
// Bevriezen gebeurt altijd voor het kalenderjaar S("mjb_freeze_year").
|
||||
// Dan is er voor het freeze kalenderjaar een bedrag ingevuld.
|
||||
// Mocht het bedrag 0 zijn, dan moet er tijdens heb bevriezen een lcl aan de opmerking worden toegevoegd, dat de taak door een hogere prio taak wordt uitgevoerd.
|
||||
iresult.canInspFreeze = iresult.canInspStart && isFreezeYear;
|
||||
// Bij eerste inspectie, geplande inspectie, gestarte inspectie of verwerkte inspectie kan er gereedgemeld/afgerond worden.
|
||||
iresult.canInspClose = iresult.readuse && invoerAfterNext &&
|
||||
@@ -1168,7 +1229,8 @@ ins = {checkAutLevel:
|
||||
+ " , di.ins_srtcontrole_eenheid"
|
||||
+ " , di.ins_srtcontrole_periode"
|
||||
+ " , di.ins_srtcontrole_bits"
|
||||
+ " , 1) inspectie_next"
|
||||
+ " , 1"
|
||||
+ " , di.ctr_ismjob) inspectie_next"
|
||||
+ " , di.ins_srtcontroledl_xcp_startdat"
|
||||
+ " , CASE WHEN " + lastinspect + " IS NULL THEN 1 ELSE 0 END nonext"
|
||||
+ " , di.ins_srtcontrole_eenheid inspectie_eenheid"
|
||||
@@ -1220,7 +1282,8 @@ ins = {checkAutLevel:
|
||||
+ " , di.ins_srtcontrole_eenheid"
|
||||
+ " , di.ins_srtcontrole_periode"
|
||||
+ " , di.ins_srtcontrole_bits"
|
||||
+ " , 1) "
|
||||
+ " , 1"
|
||||
+ " , di.ctr_ismjob) "
|
||||
+ " WHEN idsc.ins_deelsrtcontrole_status IN (0, 2)"
|
||||
+ " THEN ins_deelsrtcontrole_datum_org" // In status 0 en 2 wordt de volgende inspectie in ins_deelsrtcontrole_datum_org direct opgeslagen.
|
||||
+ " ELSE"
|
||||
@@ -1233,7 +1296,8 @@ ins = {checkAutLevel:
|
||||
+ " , di.ins_srtcontrole_eenheid"
|
||||
+ " , di.ins_srtcontrole_periode"
|
||||
+ " , di.ins_srtcontrole_bits"
|
||||
+ " , 1)"
|
||||
+ " , 1"
|
||||
+ " , di.ctr_ismjob)"
|
||||
+ " END inspectie_next"
|
||||
+ " , ins_srtcontroledl_xcp_startdat"
|
||||
+ " , CASE WHEN " + lastinspect + " IS NULL THEN 1 ELSE 0 END nonext"
|
||||
|
||||
@@ -78,8 +78,8 @@ for (var i = 0; i < ins_key_arr.length; i++)
|
||||
+ (deelsrtcont_arr[i] > 0
|
||||
? " AND idsc.ins_deelsrtcontrole_key = " + deelsrtcont_arr[i]
|
||||
: " AND idsc.ins_deelsrtcontrole_status(+) != 6")
|
||||
+ " AND idsc.ins_scenario_key(+) IS NULL"
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL"
|
||||
+ " AND idsc.ins_scenario_key(+) = 1"
|
||||
+ " AND xcp.ins_scenario_key(+) = 1"
|
||||
+ " ORDER BY ins_deelsrtcontrole_datum DESC";
|
||||
var oRs = Oracle.Execute(sql);
|
||||
ctrdisc_key = oRs("ctr_discipline_key").Value;
|
||||
@@ -191,7 +191,7 @@ if (ins_key_arr.length == 1)
|
||||
+ " FROM ins_v_defined_inspect_xcp xcp"
|
||||
+ " , ins_deelsrtcontrole idsc"
|
||||
+ " WHERE xcp.ins_srtcontrole_key = idsc.ins_srtcontrole_key(+)" // Er kan nog voor de eerste keer geinspecteerd moeten worden.
|
||||
+ " AND idsc.ins_scenario_key(+) IS NULL"
|
||||
+ " AND idsc.ins_scenario_key(+) = 1"
|
||||
+ " AND xcp.ins_scenario_key = 1"
|
||||
+ " AND xcp.ins_deel_key IN (" + ingesloten.join(",") + ")"
|
||||
+ " AND idsc.ins_deel_key(+) IN (" + ingesloten.join(",") + ")"
|
||||
@@ -253,7 +253,7 @@ if (ins_key_arr.length == 1)
|
||||
+ " AND COALESCE(xcp.ins_srtcontroledl_xcp_periode, isc.ins_srtcontrole_periode) > 0"
|
||||
+ " AND idsc.ins_srtcontrole_key = " + ingeslotensc[0]
|
||||
+ " AND idsc.ins_scenario_key = 1"
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL";
|
||||
+ " AND xcp.ins_scenario_key(+) = 1";
|
||||
var oRs = Oracle.Execute(sql);
|
||||
while (!oRs.eof)
|
||||
{ %>
|
||||
@@ -523,9 +523,6 @@ if (ins_key_arr.length == 1)
|
||||
BLOCK_START("insMultiEdit", blocktext);
|
||||
if (ins_key_arr.length == 1)
|
||||
{
|
||||
//ROFIELDTR("flddeel", L("lcl_obj_identification"), desc);
|
||||
//ROFIELDTR("fld", L("lcl_discipline"), disc);
|
||||
//ROFIELDTR("fld", L("lcl_obj_group"), group);
|
||||
ROFIELDTR("fld", L("lcl_obj_sort"), sort );
|
||||
}
|
||||
if (!multi)
|
||||
@@ -534,15 +531,11 @@ if (ins_key_arr.length == 1)
|
||||
+ " , " + lcl.xsqla('xcp.ins_srtcontrole_omschrijving', 'xcp.ins_srtcontrole_key')
|
||||
+ " , xcp.ins_srtcontrole_info info"
|
||||
+ " , COALESCE(xcp.ins_srtcontroledl_xcp_eenheid, xcp.ins_srtcontrole_eenheid) eenheid"
|
||||
// Alleen Active Situatie (AS) soort controle's kunnen gewijzigd worden dus voor scenario key moet "null" genomen worden.
|
||||
+ " , ins.nextcyclusdate(xcp.ins_deel_key, xcp.ins_srtcontrole_key, null, 1) nextcyclusdate"
|
||||
+ " , fac.getdatemillisec(ins.nextcyclusdate(xcp.ins_deel_key, xcp.ins_srtcontrole_key, null, 1)) nextcyclusdatems"
|
||||
+ " , fac.getdatemillisec(ins.nextcyclusdate(xcp.ins_deel_key, xcp.ins_srtcontrole_key, null)) nextcyclusdatems_n"
|
||||
+ " FROM ins_v_defined_inspect_xcp xcp"
|
||||
+ " WHERE xcp.ins_deel_key IN (" + ingesloten[0] + ")"
|
||||
+ " AND xcp.ins_srtcontrole_periode > 0"
|
||||
+ " AND xcp.ins_srtcontrole_key = " + ingeslotensc[0]
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL"
|
||||
+ " AND xcp.ins_scenario_key(+) = 1"
|
||||
+ " GROUP BY xcp.ins_srtcontrole_key"
|
||||
+ " , xcp.ins_srtcontrole_omschrijving"
|
||||
+ " , xcp.ins_srtcontrole_info"
|
||||
@@ -559,8 +552,8 @@ if (ins_key_arr.length == 1)
|
||||
emptyOption: L("lcl_select_srtcontrole"),
|
||||
readonly: true, // dan wordtie niet gesubmit
|
||||
required: true,
|
||||
extraParamValue: "eenheid, info, nextcyclusdatems, nextcyclusdatems_n",
|
||||
extraParamValueInit: "-1, , 0, 0"
|
||||
extraParamValue: "eenheid, info",
|
||||
extraParamValueInit: "-1, "
|
||||
});
|
||||
%>
|
||||
<input type="hidden" name="sel_srtcontrole" id="sel_srtcontrole" value="<%=ingeslotensc[0]%>">
|
||||
@@ -602,7 +595,7 @@ if (ins_key_arr.length == 1)
|
||||
+ " AND idsc.ins_deel_key IN (" + ingesloten.join(",") + ")"
|
||||
+ " AND idsc.ins_srtcontrole_key IN (" + ingeslotensc.join(",") + ")"
|
||||
+ " AND idsc.ins_scenario_key = 1"
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL"
|
||||
+ " AND xcp.ins_scenario_key(+) = 1"
|
||||
+ " GROUP BY isc.ins_srtcontrole_mode";
|
||||
var oRs = Oracle.Execute(sql);
|
||||
var lastinspectdatum;
|
||||
@@ -734,7 +727,7 @@ if (ins_key_arr.length == 1)
|
||||
+ " AND idsc.ins_srtcontrole_key IN (" + ingeslotensc[0] + ")"
|
||||
+ " AND ins_deelsrtcontrole_key < " + ingeslotendsc[0]
|
||||
+ " AND idsc.ins_scenario_key = 1"
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL"
|
||||
+ " AND xcp.ins_scenario_key(+) = 1"
|
||||
+ " GROUP BY isc.ins_srtcontrole_mode"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_eenheid"
|
||||
+ " , isc.ins_srtcontrole_eenheid";
|
||||
@@ -775,7 +768,7 @@ if (ins_key_arr.length == 1)
|
||||
+ " AND idsc.ins_srtcontrole_key IN (" + ingeslotensc[0] + ")"
|
||||
+ " AND ins_deelsrtcontrole_key > " + ingeslotendsc[0]
|
||||
+ " AND idsc.ins_scenario_key = 1"
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL"
|
||||
+ " AND xcp.ins_scenario_key(+) = 1"
|
||||
+ " GROUP BY isc.ins_srtcontrole_mode"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_eenheid"
|
||||
+ " , isc.ins_srtcontrole_eenheid";
|
||||
|
||||
@@ -67,7 +67,8 @@ insp = {
|
||||
+ " WHEN " + lastinspect + " IS NULL"
|
||||
+ " THEN 1" // Als Eerste inspectie, bepaal dan ook de volgende (1 step) datum.
|
||||
+ " ELSE 0" // Vindt de eerste datum vandaag of in de toekomst
|
||||
+ " END)"
|
||||
+ " END"
|
||||
+ " , di.ctr_ismjob)"
|
||||
+ " inspectie_next"
|
||||
+ " , di.ins_srtcontroledl_xcp_startdat"
|
||||
+ " , di.ins_srtcontrole_key"
|
||||
@@ -141,7 +142,8 @@ insp = {
|
||||
+ " WHEN " + lastinspect + " IS NULL"
|
||||
+ " THEN 1" // Als Eerste inspectie, bepaal dan ook de volgende (1 step) datum.
|
||||
+ " ELSE 0" // Vindt de eerste datum vandaag of in de toekomst
|
||||
+ " END)"
|
||||
+ " END"
|
||||
+ " , di.ctr_ismjob)"
|
||||
+ " ELSE ins_deelsrtcontrole_datum_org"
|
||||
+ " END) inspectie_org"
|
||||
+ " , CASE WHEN idsc.ins_deelsrtcontrole_plandatum > idsc.ins_deelsrtcontrole_datum_org THEN 1 ELSE 0 END isrespijt"
|
||||
|
||||
@@ -80,7 +80,7 @@ for (var i = 0; i < ins_key_arr.length; i++)
|
||||
+ " FROM ins_deelsrtcontrole idsc2"
|
||||
+ " WHERE idsc2.ins_deel_key = idsc.ins_deel_key"
|
||||
+ " AND idsc2.ins_srtcontrole_key = idsc.ins_srtcontrole_key"
|
||||
+ (scen_key_arr.length > 0 && scen_key_arr[i] > 0
|
||||
+ (scen_key_arr.length > 0 && scen_key_arr[i] > 1
|
||||
? " AND idsc2.ins_scenario_key = " + scen_key_arr[i]
|
||||
: " AND idsc2.ins_scenario_key = 1")
|
||||
+ " ) ins_deelsrtcontrole_datum"
|
||||
@@ -103,11 +103,11 @@ for (var i = 0; i < ins_key_arr.length; i++)
|
||||
+ (deelsrtcont_key > 0
|
||||
? " AND idsc.ins_deelsrtcontrole_key = " + deelsrtcont_key
|
||||
: "")
|
||||
+ (scen_key_arr.length > 0 && scen_key_arr[i] > 0
|
||||
+ (scen_key_arr.length > 0 && scen_key_arr[i] > 1
|
||||
? " AND xcp.ins_scenario_key(+) = " + scen_key_arr[i]
|
||||
+ " AND idsc.ins_scenario_key(+) = " + scen_key_arr[i]
|
||||
: " AND xcp.ins_scenario_key(+) IS NULL"
|
||||
+ " AND idsc.ins_scenario_key(+) IS NULL")
|
||||
: " AND xcp.ins_scenario_key(+) = 1"
|
||||
+ " AND idsc.ins_scenario_key(+) = 1")
|
||||
+ " )"
|
||||
+ " ORDER BY ins_deelsrtcontrole_key DESC";
|
||||
var oRs = Oracle.Execute(sql);
|
||||
@@ -126,7 +126,7 @@ for (var i = 0; i < ins_key_arr.length; i++)
|
||||
var this_ins = ins.func_enabled_deel(ins_key_arr[i],
|
||||
{srtcont_key: srtcont_key_arr[i],
|
||||
deelsrtcont_key: (ins_deelsrtcontrole_key != null? ins_deelsrtcontrole_key : -1),
|
||||
scen_key: (scen_key_arr.length > 0? scen_key_arr[i] : -1)
|
||||
scen_key: (scen_key_arr.length > 0? scen_key_arr[i] : 1)
|
||||
});
|
||||
canMsuEdit = savemode == "E" && this_ins.canMsuEdit;
|
||||
oRs.Close();
|
||||
@@ -212,7 +212,7 @@ for (var i = 0; i < ins_key_arr.length; i++)
|
||||
+ " AND idsc.ins_srtcontrole_key IN (" + srtcont_key_arr[i] + ")"
|
||||
+ " AND ins_deelsrtcontrole_key < " + dlsrtcont_key
|
||||
+ " AND idsc.ins_scenario_key = 1" // Status >= 0 dus kan geen scenario zijn.
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL" // Status >= 0 dus kan geen scenario zijn.
|
||||
+ " AND xcp.ins_scenario_key(+) = 1" // Status >= 0 dus kan geen scenario zijn.
|
||||
+ " GROUP BY isc.ins_srtcontrole_mode"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_eenheid"
|
||||
+ " , isc.ins_srtcontrole_eenheid";
|
||||
@@ -253,7 +253,7 @@ for (var i = 0; i < ins_key_arr.length; i++)
|
||||
+ " AND idsc.ins_srtcontrole_key IN (" + srtcont_key_arr[i] + ")"
|
||||
+ " AND ins_deelsrtcontrole_key > " + dlsrtcont_key
|
||||
+ " AND idsc.ins_scenario_key = 1" // Status >= 0 dus kan geen scenario zijn.
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL" // Status >= 0 dus kan geen scenario zijn.
|
||||
+ " AND xcp.ins_scenario_key(+) = 1" // Status >= 0 dus kan geen scenario zijn.
|
||||
+ " GROUP BY isc.ins_srtcontrole_mode"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_eenheid"
|
||||
+ " , isc.ins_srtcontrole_eenheid";
|
||||
@@ -282,7 +282,7 @@ for (var i = 0; i < ins_key_arr.length; i++)
|
||||
}
|
||||
}
|
||||
|
||||
ingesloten.push({ins_key: ins_key_arr[i], srtcont_key: srtcont_key_arr[i], dlsrtcont_key: dlsrtcont_key, scen_key: (scen_key_arr.length > 0? scen_key_arr[i] : -1),
|
||||
ingesloten.push({ins_key: ins_key_arr[i], srtcont_key: srtcont_key_arr[i], dlsrtcont_key: dlsrtcont_key, scen_key: (scen_key_arr.length > 0? scen_key_arr[i] : 1),
|
||||
inspectiemode: ins_srtcontrole_mode, inspectiestatus: ins_deelsrtcontrole_status, ins_deel_aanmaak: ins_deel_aanmaak,
|
||||
disc_oms: disc_oms});
|
||||
tobehandled++;
|
||||
@@ -345,9 +345,7 @@ if (savemode == "P")
|
||||
+ " FROM ins_deelsrtcontrole idsc"
|
||||
+ " WHERE idsc.ins_srtcontrole_key = " + ingesloten[i].srtcont_key
|
||||
+ " AND idsc.ins_deel_key = " + ingesloten[i].ins_key
|
||||
+ (mjob && ingesloten[i].scen_key > 0
|
||||
? " AND idsc.ins_scenario_key = " + ingesloten[i].scen_key
|
||||
: " AND idsc.ins_scenario_key = 1")
|
||||
+ " AND idsc.ins_scenario_key = " + ingesloten[i].scen_key
|
||||
+ " AND idsc.ins_deelsrtcontrole_datum IS NOT NULL";
|
||||
var oRs = Oracle.Execute(sql);
|
||||
var nextdate = null;
|
||||
@@ -355,7 +353,7 @@ if (savemode == "P")
|
||||
{ // Bereken de volgende inspectiedatum. Het object is minstens 1 keer geinspecteerd.
|
||||
sql = "SELECT ins.nextcyclusdate (" + ingesloten[i].ins_key
|
||||
+ ", " + ingesloten[i].srtcont_key
|
||||
+ ", " + (mjob && ingesloten[i].scen_key > 0? ingesloten[i].scen_key : "null")
|
||||
+ ", " + (mjob? ingesloten[i].scen_key : "1")
|
||||
+ ", 1) nextdate FROM DUAL"
|
||||
oRsN = Oracle.Execute(sql);
|
||||
nextdate = new Date(oRsN("nextdate").Value);
|
||||
@@ -375,7 +373,7 @@ if (savemode == "P")
|
||||
{dbs: "ins_deelsrtcontrole_datum_org", typ: "datetime", val: nextdate}
|
||||
];
|
||||
|
||||
if (mjob && ingesloten[i].scen_key > 0)
|
||||
if (mjob && ingesloten[i].scen_key > 1)
|
||||
fields.push({dbs: "ins_scenario_key", typ: "key", val: ingesloten[i].scen_key});
|
||||
|
||||
var insIns = buildInsert("ins_deelsrtcontrole", fields);
|
||||
@@ -456,7 +454,7 @@ else if (savemode == "C")
|
||||
else
|
||||
{ // Bereken de volgende inspectiedatum.
|
||||
// Alleen Active Situatie (AS) soort controle's kunnen afgemeld worden dus voor scenario key moet "null" genomen worden.
|
||||
sql = "SELECT ins.nextcyclusdate (" + ingesloten[i].ins_key + ", " + ingesloten[i].srtcont_key + ", null, 1) nextdate FROM DUAL"
|
||||
sql = "SELECT ins.nextcyclusdate (" + ingesloten[i].ins_key + ", " + ingesloten[i].srtcont_key + ", 1, 1) nextdate FROM DUAL"
|
||||
oRs = Oracle.Execute(sql);
|
||||
nextdate = new Date(oRs("nextdate").Value);
|
||||
oRs.Close();
|
||||
@@ -565,7 +563,7 @@ else if (savemode == "C")
|
||||
// Bereken de volgende inspectiedatum.
|
||||
// De functie ins.nextcyclusdate levert de volgende inspectie datum met tijd op onafhankelijk van de eenheid.
|
||||
// Alleen Active Situatie (AS) soort controle's kunnen afgemeld worden dus voor scenario key moet "null" genomen worden.
|
||||
sql = "SELECT ins.nextcyclusdate (" + ingesloten[i].ins_key + ", " + ingesloten[i].srtcont_key + ", null, 1) nextdate FROM DUAL"
|
||||
sql = "SELECT ins.nextcyclusdate (" + ingesloten[i].ins_key + ", " + ingesloten[i].srtcont_key + ", 1, 1) nextdate FROM DUAL"
|
||||
var oRs = Oracle.Execute(sql);
|
||||
nextdate = new Date(oRs("nextdate").Value);
|
||||
oRs.Close();
|
||||
@@ -660,7 +658,7 @@ else if (savemode == "C")
|
||||
else if (savemode == "E")
|
||||
{ // Wijzigen inspectie (Edit). Update van de gegevens (plandatum, opmerking en flexkenmerken).
|
||||
var result = { success: true, plandatum: plandatum, deelsrtcontrole_key: ingesloten[0].dlsrtcont_key, savemode: savemode, warning: "" };
|
||||
var isScenario = ingesloten[0].scen_key > 0;
|
||||
var isScenario = ingesloten[0].scen_key > 1;
|
||||
|
||||
var mjobdelete = false;
|
||||
// Kunnen we het plan record verwijderen?
|
||||
@@ -688,9 +686,7 @@ else if (savemode == "E")
|
||||
+ " FROM ins_deelsrtcontrole idsc"
|
||||
+ " WHERE idsc.ins_srtcontrole_key = " + ingesloten[0].srtcont_key
|
||||
+ " AND idsc.ins_deel_key = " + ingesloten[0].ins_key
|
||||
+ (ingesloten[0].scen_key > 0
|
||||
? " AND idsc.ins_scenario_key = " + ingesloten[0].scen_key
|
||||
: " AND idsc.ins_scenario_key = 1")
|
||||
+ " AND idsc.ins_scenario_key = " + ingesloten[0].scen_key
|
||||
+ " AND idsc.ins_deelsrtcontrole_datum IS NOT NULL"; // Er is geinspecteerd.
|
||||
var oRs = Oracle.Execute(sql);
|
||||
var nextdate = null;
|
||||
@@ -698,10 +694,10 @@ else if (savemode == "E")
|
||||
{ // Bereken de volgende orginele inspectiedatum (nextdate).
|
||||
sql = "SELECT ins.nextcyclusdate (" + ingesloten[0].ins_key
|
||||
+ ", " + ingesloten[0].srtcont_key
|
||||
+ ", " + (ingesloten[0].scen_key > 0? ingesloten[0].scen_key : "null")
|
||||
+ ", " + ingesloten[0].scen_key
|
||||
+ ", 1) nextdate FROM DUAL"
|
||||
var oRsN = Oracle.Execute(sql);
|
||||
nextdate = new Date(oRsN("nexdate").Value);
|
||||
nextdate = new Date(oRsN("nextdate").Value);
|
||||
oRsN.Close();
|
||||
|
||||
// Is jaar plandatum gelijk aan jaar orginele datum?
|
||||
@@ -743,10 +739,10 @@ else if (savemode == "E")
|
||||
mjobdelete = true;
|
||||
else if (srtcontrole_type == 2 || srtcontrole_type == 3) // Vervanging(2) of Certificering(3).
|
||||
{ // Bereken de volgende inspectiedatum.
|
||||
// Alleen Active Situatie (AS) soort controle's kunnen gewijzigd worden dus voor scenario key moet "null" genomen worden.
|
||||
// Alleen Active Situatie (AS) soort controle's kunnen gewijzigd worden dus voor scenario key moet 1 (of null) genomen worden.
|
||||
sql = "SELECT ins.nextcyclusdate (" + ingesloten[0].ins_key
|
||||
+ ", " + ingesloten[0].srtcont_key
|
||||
+ ", " + (ingesloten[0].scen_key > 0? ingesloten[0].scen_key : "null")
|
||||
+ ", " + ingesloten[0].scen_key
|
||||
+ ", 0) nextdate FROM DUAL" // 1-ste vandaag of in de toekomst(0).
|
||||
oRsN = Oracle.Execute(sql);
|
||||
var nextdate = new Date(oRsN("nextdate").Value);
|
||||
@@ -767,9 +763,7 @@ else if (savemode == "E")
|
||||
+ " WHERE ins_deel_key = " + ingesloten[0].ins_key
|
||||
+ " AND ins_srtcontrole_key = " + ingesloten[0].srtcont_key
|
||||
+ " AND ins_deelsrtcontrole_status = 0"
|
||||
+ (ingesloten[0].scen_key > 0
|
||||
? " AND ins_scenario_key = " + ingesloten[0].scen_key
|
||||
: " AND ins_scenario_key = 1");
|
||||
+ " AND ins_scenario_key = " + ingesloten[0].scen_key;
|
||||
var err = Oracle.Execute(sql, true);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -211,7 +211,7 @@ function insPlan(rowArray)
|
||||
{
|
||||
rowdata = eval('(' + rowArray[i].getAttribute("ROWDATA") + ')');
|
||||
// Scenario's kunnen niet gestart worden. Hier de scenario's er al uit filteren.
|
||||
if (!rowdata.insScenKey || rowdata.insScenKey < 0)
|
||||
if (!rowdata.insScenKey || rowdata.insScenKey == 1)
|
||||
{ // Het is geen scenario. De periodieke taak kan gestart worden. De periodieke taak aan het array toevoegen.
|
||||
srtcontrolekeyArray[i - deleted] = rowdata.insSrtControleKey;
|
||||
// Als je wilt inplannen is er nog geen inspectie record (ins_deelsrtcontrole_key). De insDeelSrtContrKey is dan -2.
|
||||
@@ -239,9 +239,16 @@ function insPlan(rowArray)
|
||||
FcltMgr.openDetail(url, L("lcl_ins_schedule"));
|
||||
}
|
||||
|
||||
function insStart(rowArray, isMulti)
|
||||
function insFreeze(rowArray, isMulti)
|
||||
{
|
||||
FcltMgr.confirm(rowArray.length == 1? L("lcl_ins_starting") : L("lcl_ins_starting_m"),
|
||||
insStart(rowArray, isMulti, true);
|
||||
}
|
||||
|
||||
function insStart(rowArray, isMulti, pfreeze)
|
||||
{
|
||||
var lcl_1 = pfreeze? L("lcl_mjb_freezing") : L("lcl_ins_starting");
|
||||
var lcl_m = pfreeze? L("lcl_mjb_freezing_m") : L("lcl_ins_starting_m");
|
||||
FcltMgr.confirm(rowArray.length == 1? lcl_1 : lcl_m,
|
||||
{ autoconfirm: isMulti },
|
||||
function()
|
||||
{
|
||||
@@ -253,7 +260,7 @@ function insStart(rowArray, isMulti)
|
||||
{
|
||||
rowdata = eval('(' + rowArray[i].getAttribute("ROWDATA") + ')');
|
||||
// Scenario's kunnen niet gestart worden. Hier de scenario's er al uit filteren.
|
||||
if (!rowdata.insScenKey || rowdata.insScenKey < 0)
|
||||
if (!rowdata.insScenKey || rowdata.insScenKey == 1)
|
||||
{ // Het is geen scenario. De periodieke taak kan gestart worden. De inspectie aan het array toevoegen.
|
||||
srtcontrolekeyArray[i - deleted] = rowdata.insSrtControleKey;
|
||||
}
|
||||
@@ -267,7 +274,8 @@ function insStart(rowArray, isMulti)
|
||||
}
|
||||
|
||||
var data = { ins_keys: insKeyString,
|
||||
srtcont_key_arr: srtcontrolekeyArray.join(",")
|
||||
srtcont_key_arr: srtcontrolekeyArray.join(","),
|
||||
freeze: (pfreeze? 1 : 0)
|
||||
};
|
||||
protectRequest.dataToken(data);
|
||||
$.post("../ins/ins_inspect_start.asp", data, FcltCallbackRefresh, "json");
|
||||
@@ -284,7 +292,7 @@ function insClose(rowArray, isMulti, fromfinish)
|
||||
{
|
||||
rowdata = eval('(' + rowArray[i].getAttribute("ROWDATA") + ')');
|
||||
// Scenario's kunnen niet gestart worden. Hier de scenario's er al uit filteren.
|
||||
if (!rowdata.insScenKey || rowdata.insScenKey < 0)
|
||||
if (!rowdata.insScenKey || rowdata.insScenKey == 1)
|
||||
{ // Het is geen scenario. De periodieke taak kan gestart worden. De inspectie aan het array toevoegen.
|
||||
srtcontrolekeyArray[i - deleted] = rowdata.insSrtControleKey;
|
||||
deelsrtcontrkeyArray[i - deleted] = rowdata.insDeelSrtContrKey;
|
||||
@@ -328,7 +336,7 @@ function insFinish(rowArray, isMulti)
|
||||
{
|
||||
rowdata = eval('(' + rowArray[i].getAttribute("ROWDATA") + ')');
|
||||
// Scenario's kunnen niet gestart worden. Hier de scenario's er al uit filteren.
|
||||
if (!rowdata.insScenKey || rowdata.insScenKey < 0)
|
||||
if (!rowdata.insScenKey || rowdata.insScenKey == 1)
|
||||
{ // Het is geen scenario. De periodieke taak kan gestart worden. De inspectie aan het array toevoegen.
|
||||
deelsrtcontrkeyArray[i - deleted] = rowdata.insDeelSrtContrKey;
|
||||
isc_status = rowdata.ins_status;
|
||||
|
||||
@@ -363,7 +363,7 @@ var authparams = user.checkAutorisation(autfunction);
|
||||
+ " , ins_srtcontroledl_xcp xcp"
|
||||
+ " WHERE isc.ins_srtcontrole_key = xcp.ins_srtcontrole_key(+)"
|
||||
+ " AND ctr_discipline_key " + ctr_disc_sql
|
||||
+ " AND xcp.ins_scenario_key(+) IS NULL"
|
||||
+ " AND xcp.ins_scenario_key(+) = 1"
|
||||
+ " AND COALESCE (xcp.ins_srtcontroledl_xcp_groep, isc.ins_srtcontrole_groep) IS NOT NULL"
|
||||
+ " ORDER BY UPPER (COALESCE(xcp.ins_srtcontroledl_xcp_groep, isc.ins_srtcontrole_groep))";
|
||||
FCLTselector("groep",
|
||||
|
||||
@@ -29,8 +29,7 @@ FCLTHeader.Requires({ plugins: ["jQuery", "suggest", "kenmerk"] });
|
||||
var ins_key = getQParamInt("ins_key");
|
||||
|
||||
var srtcont_key = getQParamInt("srtcont_key", -1); // voorgekozen inspectiesoort vanuit MJOB of Graphics thema.
|
||||
var scen_key = getQParamInt("scen_key", -1); // Scenario.
|
||||
var isScenario = scen_key > 0;
|
||||
var scen_key = getQParamInt("scen_key", 1); // Scenario.
|
||||
var deelsrtcont_key = getQParamInt("deelsrtcont_key", -1); // bestaande inspectie
|
||||
var transitParam = buildTransitParam(["srtcont_key", "deelsrtcont_key"]);
|
||||
var add = getQParamInt("add", 0) == 1; // Controle inspectie (ins_srtcontrole) waarvan de periode op 0 staat actief maken.
|
||||
@@ -75,9 +74,7 @@ if (srtcont_key > 0)
|
||||
+ " WHERE dix.ins_srtdeel_key = isd.ins_srtdeel_key"
|
||||
+ " AND dix.ins_deel_key = " + ins_key
|
||||
+ " AND dix.ins_srtcontrole_key = " + srtcont_key
|
||||
+ (isScenario
|
||||
? " AND dix.ins_scenario_key = " + scen_key
|
||||
: "");
|
||||
+ " AND dix.ins_scenario_key = " + scen_key;
|
||||
var oRs = Oracle.Execute(sql);
|
||||
isMJOB = oRs("ctr_ismjob").Value == 1;
|
||||
xcp_eenheid = oRs("ins_srtcontrole_eenheid").Value;
|
||||
@@ -125,9 +122,7 @@ if (srtcont_key > 0)
|
||||
+ " WHERE xcp.ins_deel_key = " + ins_key
|
||||
+ " AND xcp.ins_srtcontrole_key = " + srtcont_key
|
||||
+ " AND xcp.ins_srtcontrole_key = isc.ins_srtcontrole_key"
|
||||
+ (isScenario
|
||||
? " AND xcp.ins_scenario_key = " + scen_key
|
||||
: " AND xcp.ins_scenario_key = 1");
|
||||
+ " AND xcp.ins_scenario_key = " + scen_key;
|
||||
var oRs = Oracle.Execute(sql);
|
||||
if (!oRs.eof)
|
||||
{
|
||||
@@ -601,64 +596,67 @@ if (srtcont_key > 0)
|
||||
// Alle Active Situatie (AS) soort controle's die:
|
||||
// a) geen uitzondering (XCP) record hebben en geen scenario.
|
||||
// b) een uitzondering (XCP) record hebben.
|
||||
+ " SELECT xcp.ins_srtcontrole_key"
|
||||
+ " , " + lcl.xsqla('xcp.ins_srtcontrole_omschrijving', 'xcp.ins_srtcontrole_key')
|
||||
+ " , xcp.ins_srtcontrole_mode modus"
|
||||
+ " , xcp.ins_deel_aantal aantal_std"
|
||||
+ " SELECT di.ins_srtcontrole_key"
|
||||
+ " , " + lcl.xsqla('di.ins_srtcontrole_omschrijving', 'di.ins_srtcontrole_key')
|
||||
+ " , di.ins_srtcontrole_mode modus"
|
||||
+ " , di.ins_deel_aantal aantal_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_aantal aantal_xcp"
|
||||
+ " , xcp.ins_srtdeel_eenheid aanteh_std"
|
||||
+ " , di.ins_srtdeel_eenheid aanteh_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_aanteh aanteh_xcp"
|
||||
+ " , xcp.ins_srtcontrole_eenheid eenheid_std"
|
||||
+ " , di.ins_srtcontrole_eenheid eenheid_std"
|
||||
+ " , COALESCE(xcp.ins_srtcontroledl_xcp_eenheid, -1) eenheid_xcp"
|
||||
+ " , xcp.ins_srtcontrole_periode periode_std"
|
||||
+ " , di.ins_srtcontrole_periode periode_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_periode periode_xcp"
|
||||
+ " , xcp.ins_srtcontrole_bits bits_std"
|
||||
+ " , di.ins_srtcontrole_bits bits_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_bits bits_xcp"
|
||||
+ " , xcp.ins_srtcontrole_groep groep_std"
|
||||
+ " , di.ins_srtcontrole_groep groep_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_groep groep_xcp"
|
||||
+ " , xcp.ins_srtcontrole_kosten kosten_std1"
|
||||
+ " , di.ins_srtcontrole_kosten kosten_std1"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_kosten kosten_xcp1"
|
||||
+ " , xcp.ins_srtcontrole_kosten2 kosten_std2"
|
||||
+ " , di.ins_srtcontrole_kosten2 kosten_std2"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_kosten2 kosten_xcp2"
|
||||
+ " , xcp.ins_srtcontrole_kosten3 kosten_std3"
|
||||
+ " , di.ins_srtcontrole_kosten3 kosten_std3"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_kosten3 kosten_xcp3"
|
||||
+ " , xcp.ins_srtcontrole_uren uren_std"
|
||||
+ " , di.ins_srtcontrole_uren uren_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_uren uren_xcp"
|
||||
+ " , xcp.ins_srtcontrole_materiaal materiaal_std"
|
||||
+ " , di.ins_srtcontrole_materiaal materiaal_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_materia materiaal_xcp"
|
||||
+ " , xcp.ins_srtcontrole_percentage perc_std"
|
||||
+ " , di.ins_srtcontrole_percentage perc_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_perc perc_xcp"
|
||||
+ " , xcp.ins_srtcontrole_opmerking opmerk_std"
|
||||
+ " , di.ins_srtcontrole_opmerking opmerk_std"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_opmerk opmerk_xcp"
|
||||
+ " , COALESCE(xcp.ins_srtcontroledl_xcp_key, -1) xcp_key"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_startdat startdate_xcp"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontroledl_xcp_startdat, 'DD') start_xcp_dag"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontroledl_xcp_startdat, 'MM') start_xcp_maand"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontroledl_xcp_startdat, 'YYYY') start_xcp_jaar"
|
||||
+ " , xcp.ins_srtcontrole_eind eind_std"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontrole_eind, 'DD') eind_std_dag"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontrole_eind, 'MM') eind_std_maand"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontrole_eind, 'YYYY') eind_std_jaar"
|
||||
+ " , di.ins_srtcontrole_eind eind_std"
|
||||
+ " , TO_CHAR(di.ins_srtcontrole_eind, 'DD') eind_std_dag"
|
||||
+ " , TO_CHAR(di.ins_srtcontrole_eind, 'MM') eind_std_maand"
|
||||
+ " , TO_CHAR(di.ins_srtcontrole_eind, 'YYYY') eind_std_jaar"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_eind eind_xcp"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontroledl_xcp_eind, 'DD') eind_xcp_dag"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontroledl_xcp_eind, 'MM') eind_xcp_maand"
|
||||
+ " , TO_CHAR(xcp.ins_srtcontroledl_xcp_eind, 'YYYY') eind_xcp_jaar"
|
||||
+ " , TO_CHAR(ins.nextcyclusdate (xcp.ins_deel_key, xcp.ins_srtcontrole_key, " + (isScenario? scen_key : "null") + ", 1), 'DD') nextdate_dag"
|
||||
+ " , TO_CHAR(ins.nextcyclusdate (xcp.ins_deel_key, xcp.ins_srtcontrole_key, " + (isScenario? scen_key : "null") + ", 1), 'MM') nextdate_maand"
|
||||
+ " , TO_CHAR(ins.nextcyclusdate (xcp.ins_deel_key, xcp.ins_srtcontrole_key, " + (isScenario? scen_key : "null") + ", 1), 'YYYY') nextdate_jaar"
|
||||
+ " , TO_CHAR(ins.nextcyclusdate (di.ins_deel_key, di.ins_srtcontrole_key, " + scen_key + ", 1), 'DD') nextdate_dag"
|
||||
+ " , TO_CHAR(ins.nextcyclusdate (di.ins_deel_key, di.ins_srtcontrole_key, " + scen_key + ", 1), 'MM') nextdate_maand"
|
||||
+ " , TO_CHAR(ins.nextcyclusdate (di.ins_deel_key, di.ins_srtcontrole_key, " + scen_key + ", 1), 'YYYY') nextdate_jaar"
|
||||
+ " , xcp.ctr_ismjob ismjob"
|
||||
+ " , CASE"
|
||||
+ " WHEN (SELECT COUNT(sdc.ins_deelsrtcontrole_key)"
|
||||
+ " FROM ins_deelsrtcontrole sdc"
|
||||
+ " WHERE sdc.ins_deel_key = xcp.ins_deel_key"
|
||||
+ " AND sdc.ins_srtcontrole_key = xcp.ins_srtcontrole_key"
|
||||
+ " WHERE sdc.ins_deel_key = di.ins_deel_key"
|
||||
+ " AND sdc.ins_srtcontrole_key = di.ins_srtcontrole_key"
|
||||
+ " AND sdc.ins_deelsrtcontrole_status = 6"
|
||||
+ " AND sdc.ins_scenario_key = 1) > 0"
|
||||
+ " THEN 1"
|
||||
+ " ELSE 0"
|
||||
+ " END hascontroles"
|
||||
+ " FROM ins_v_defined_inspect_xcp xcp"
|
||||
+ " WHERE xcp.ins_deel_key = " + ins_key
|
||||
+ " , ins_v_defined_inspect di"
|
||||
+ " WHERE xcp.ins_srtcontrole_key = di.ins_srtcontrole_key"
|
||||
+ " AND xcp.ins_deel_key = di.ins_deel_key"
|
||||
+ " AND xcp.ins_deel_key = " + ins_key
|
||||
// De xcp_periode overruled de standaard periode. De xcp_periode kan/mag NULL zijn maar de standaard periode niet.
|
||||
// Mogelijke waarden van de standaard periode en xcp periode:
|
||||
// ins_srtcontrole_periode ins_srtcontroledl_xcp_periode uitleg
|
||||
@@ -667,14 +665,14 @@ if (srtcont_key > 0)
|
||||
// 0 1 een standaard niet actieve controle is voor het object actief gemaakt.
|
||||
// 1..n 0 een standaard actieve controle is voor het object inactief gemaakt.
|
||||
+ (add
|
||||
? " AND xcp.ins_srtcontrole_periode <= 0" // Inactieve soort controles tonen.
|
||||
? " AND COALESCE (xcp.ins_srtcontroledl_xcp_periode, di.ins_srtcontrole_periode) <= 0" // Inactieve soort controles tonen.
|
||||
+ " AND xcp.ins_srtcontroledl_xcp_periode IS NULL" // Soort controles die niet overruled zijn tonen.
|
||||
: " AND (xcp.ins_srtcontrole_periode > 0" // Actieve soort controles tonen.
|
||||
: " AND (COALESCE (xcp.ins_srtcontroledl_xcp_periode, di.ins_srtcontrole_periode) > 0" // Actieve soort controles tonen.
|
||||
+ " OR ins_srtcontroledl_xcp_periode = 0)") // Soort controles die inactief zijn gemaakt tonen.
|
||||
+ (srtcont_key > 0
|
||||
? " AND xcp.ins_srtcontrole_key = " + srtcont_key
|
||||
? " AND di.ins_srtcontrole_key = " + srtcont_key
|
||||
: "")
|
||||
+ " AND xcp.ctr_discipline_key IN (SELECT w.ins_discipline_key"
|
||||
+ " AND di.ctr_discipline_key IN (SELECT w.ins_discipline_key"
|
||||
+ " FROM fac_v_webgebruiker w"
|
||||
+ " , fac_functie f"
|
||||
+ " WHERE w.fac_functie_key = f.fac_functie_key "
|
||||
@@ -682,30 +680,28 @@ if (srtcont_key > 0)
|
||||
+ " AND w.fac_gebruiker_prs_level_write < 9"
|
||||
+ " AND w.fac_gebruiker_alg_level_write < 9"
|
||||
+ " AND w.prs_perslid_key = " + user_key + ")"
|
||||
+ (isScenario
|
||||
? " AND xcp.ins_scenario_key = " + scen_key
|
||||
: " AND xcp.ins_scenario_key = 1")
|
||||
+ " GROUP BY xcp.ins_srtcontrole_key"
|
||||
+ " , xcp.ins_srtcontrole_omschrijving"
|
||||
+ " , xcp.ins_srtcontrole_mode"
|
||||
+ " , xcp.ins_deel_aantal"
|
||||
+ " AND xcp.ins_scenario_key = " + scen_key
|
||||
+ " GROUP BY di.ins_srtcontrole_key"
|
||||
+ " , di.ins_srtcontrole_omschrijving"
|
||||
+ " , di.ins_srtcontrole_mode"
|
||||
+ " , di.ins_deel_aantal"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_aantal"
|
||||
+ " , xcp.ins_srtdeel_eenheid"
|
||||
+ " , di.ins_srtdeel_eenheid"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_aanteh"
|
||||
+ " , xcp.ins_srtcontrole_periode"
|
||||
+ " , xcp.ins_srtcontrole_eenheid"
|
||||
+ " , xcp.ins_srtcontrole_bits"
|
||||
+ " , xcp.ins_srtcontrole_groep"
|
||||
+ " , xcp.ins_srtcontrole_kosten"
|
||||
+ " , xcp.ins_srtcontrole_kosten2"
|
||||
+ " , xcp.ins_srtcontrole_kosten3"
|
||||
+ " , xcp.ins_srtcontrole_uren"
|
||||
+ " , xcp.ins_srtcontrole_materiaal"
|
||||
+ " , xcp.ins_srtcontrole_percentage"
|
||||
+ " , xcp.ins_srtcontrole_opmerking"
|
||||
+ " , xcp.ins_srtcontrole_eind"
|
||||
+ " , xcp.ins_deel_key"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_key"
|
||||
+ " , di.ins_srtcontrole_periode"
|
||||
+ " , di.ins_srtcontrole_eenheid"
|
||||
+ " , di.ins_srtcontrole_bits"
|
||||
+ " , di.ins_srtcontrole_groep"
|
||||
+ " , di.ins_srtcontrole_kosten"
|
||||
+ " , di.ins_srtcontrole_kosten2"
|
||||
+ " , di.ins_srtcontrole_kosten3"
|
||||
+ " , di.ins_srtcontrole_uren"
|
||||
+ " , di.ins_srtcontrole_materiaal"
|
||||
+ " , di.ins_srtcontrole_percentage"
|
||||
+ " , di.ins_srtcontrole_opmerking"
|
||||
+ " , di.ins_srtcontrole_eind"
|
||||
+ " , di.ins_deel_key"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_key"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_periode"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_eenheid"
|
||||
+ " , xcp.ins_srtcontroledl_xcp_bits"
|
||||
|
||||
@@ -22,8 +22,8 @@ var JSON_Result = true;
|
||||
<%
|
||||
var ins_key = getQParamInt("ins_key");
|
||||
var srtcontrole_key = getFParamInt("sel_srtcontrole"); // ins_srtcontrole_key.
|
||||
var scen_key = getFParamInt("scen_key", -1); // Scenario.
|
||||
var isScenario = scen_key > 0;
|
||||
var scen_key = getFParamInt("scen_key", 1); // Scenario.
|
||||
var isScenario = scen_key > 1;
|
||||
var this_ins = ins.func_enabled_deel(ins_key,
|
||||
{ srtcont_key: srtcontrole_key,
|
||||
scen_key: scen_key
|
||||
|
||||
Reference in New Issue
Block a user