VNOG#90924: Discrepantie bij filteren objectenbeheer in Facilitor.

svn path=/Website/trunk/; revision=70571
This commit is contained in:
Maykel Geerdink
2025-10-08 12:16:45 +00:00
parent e169b4ac94
commit d0d4fd471b
2 changed files with 21 additions and 7 deletions

View File

@@ -2825,7 +2825,11 @@ ins = {checkAutLevel:
//sqlPosition += " AND (dl.ins_alg_ruimte_key IN (" + terr_key_arr.join(",") + ") OR o.alg_gebouw_key IN (" + bld_key_arr.join(",") + "))";
}
else if (loc_key_arr.length)
sqlPosition += " AND dl.ins_alg_locatie_key IN (" + loc_key_arr.join(",") + ")";
sqlPosition += " AND COALESCE(dl.ins_alg_locatie_key, (SELECT d2.ins_alg_locatie_key"
+ " FROM ins_deel d2"
+ " WHERE d2.ins_deel_key = (SELECT d3.ins_deel_parent_key"
+ " FROM ins_deel d3"
+ " WHERE d3.ins_deel_key = dl.ins_deel_key))) IN (" + loc_key_arr.join(",") + ")";
else if (dist_key_arr.length)
sqlPosition += " AND alg.alg_district_key IN (" + dist_key_arr.join(",") + ")";
else if (reg_key_arr.length)

View File

@@ -40,6 +40,8 @@ var sql = "SELECT d.ins_deel_parent_key"
+ " , g.ins_discipline_key"
+ " , COALESCE(d.ins_alg_ruimte_type, d_parent.ins_alg_ruimte_type) bind"
+ " , COALESCE(d.ins_alg_ruimte_key, d_parent.ins_alg_ruimte_key) bind_key"
+ " , d_parent.ins_alg_ruimte_type pbind"
+ " , d_parent.ins_alg_ruimte_key pbind_key"
+ " , d.ins_alg_ruimte_key_org"
+ " , d_parent.ins_deel_omschrijving"
+ " FROM ins_deel d"
@@ -56,6 +58,8 @@ var srtdeel_binding = oRs("ins_srtdeel_binding").Value;
var disc_key = oRs("ins_discipline_key").Value;
var bind = oRs("bind").Value;
var bind_key = oRs("bind_key").Value;
var pbind = oRs("pbind").Value;
var pbind_key = oRs("pbind_key").Value;
var isLendOut = (oRs("ins_alg_ruimte_key_org").Value != null);
var parent_oms = oRs("ins_deel_omschrijving").Value;
oRs.Close();
@@ -135,10 +139,14 @@ lcl.set_dialect(disc_key, "INS_DISCIPLINE_KEY");
protectRequest.validateToken();
var success = false;
var asparent = getFParamInt("asparent", 0) == 1; // Plaats/eigenaar gelijk aan de parent maken.
var ins_alg_ruimte_key;
var ins_alg_ruimte_type;
var empty_loc = false;
if (asparent)
{ // Er is op de button "gelijk aan de {parent}" geklikt.
var ins_alg_ruimte_key = "NULL";
var ins_alg_ruimte_type = "NULL";
ins_alg_ruimte_key = "NULL";
ins_alg_ruimte_type = "NULL";
empty_loc = true;
}
else
{
@@ -148,8 +156,6 @@ lcl.set_dialect(disc_key, "INS_DISCIPLINE_KEY");
var room_key = getFParamInt("ruimtekey", -1); // Ruimte.
var workpl_key = getFParamInt("werkplekkey", -1); // Werkplek.
var ins_alg_ruimte_key;
var ins_alg_ruimte_type;
if (dept_key > 0)
{
ins_alg_ruimte_key = dept_key;
@@ -176,11 +182,12 @@ lcl.set_dialect(disc_key, "INS_DISCIPLINE_KEY");
ins_alg_ruimte_type = "T";
}
// ALs de ingevulde plaats/eigenaar hetzelfde is als die van de parent, dan NULL opslaan.
if (parent_key && ins_alg_ruimte_key && ins_alg_ruimte_type && bind_key == ins_alg_ruimte_key && bind == ins_alg_ruimte_type)
// Als de ingevulde plaats/eigenaar hetzelfde is als die van de parent, dan NULL opslaan.
if (parent_key && ins_alg_ruimte_key && ins_alg_ruimte_type && pbind_key == ins_alg_ruimte_key && pbind == ins_alg_ruimte_type)
{
ins_alg_ruimte_key = "NULL";
ins_alg_ruimte_type = "NULL";
empty_loc = true;
}
else {
ins_alg_ruimte_type = "'" + ins_alg_ruimte_type + "'";
@@ -190,6 +197,9 @@ lcl.set_dialect(disc_key, "INS_DISCIPLINE_KEY");
var sql = "UPDATE ins_deel"
+ " SET ins_alg_ruimte_key = " + ins_alg_ruimte_key
+ " , ins_alg_ruimte_type = " + ins_alg_ruimte_type
+ (empty_loc
? " , ins_alg_locatie_key = NULL"
: "")
+ " WHERE ins_deel_key = " + ins_key;
Oracle.Execute(sql);
%>