PCHX#81768 Plaats informatie toevoegen aan contract overzicht

svn path=/Website/trunk/; revision=65282
This commit is contained in:
Erik Groener
2024-06-25 14:37:14 +00:00
parent 802261b02c
commit 0069b3f743
4 changed files with 116 additions and 28 deletions

View File

@@ -41,6 +41,8 @@ cnt = { setcontractstatus:
+ " , 'L' cnt_alg_plaats_code"
+ " , cp.cnt_alg_plaats_key alg_locatie_key"
+ " , g.alg_gebouw_key"
+ " , NULL alg_verdieping_key"
+ " , NULL alg_ruimte_key"
+ " FROM cnt_contract_plaats cp"
+ " , alg_gebouw g"
+ " WHERE cnt_alg_plaats_code = 'L'"
@@ -50,6 +52,8 @@ cnt = { setcontractstatus:
+ " , 'G'"
+ " , g.alg_locatie_key"
+ " , g.alg_gebouw_key"
+ " , NULL"
+ " , NULL"
+ " FROM cnt_contract_plaats cp"
+ " , alg_gebouw g"
+ " WHERE cnt_alg_plaats_code = 'G'"
@@ -59,6 +63,8 @@ cnt = { setcontractstatus:
+ " , 'V'"
+ " , g.alg_locatie_key"
+ " , g.alg_gebouw_key"
+ " , v.alg_verdieping_key"
+ " , NULL"
+ " FROM cnt_contract_plaats cp"
+ " , alg_gebouw g"
+ " , alg_verdieping v"
@@ -70,6 +76,8 @@ cnt = { setcontractstatus:
+ " , 'R'"
+ " , g.alg_locatie_key"
+ " , g.alg_gebouw_key"
+ " , v.alg_verdieping_key"
+ " , r.alg_ruimte_key"
+ " FROM cnt_contract_plaats cp"
+ " , alg_gebouw g"
+ " , alg_verdieping v"
@@ -83,6 +91,8 @@ cnt = { setcontractstatus:
+ " , 'T'"
+ " , t.alg_locatie_key"
+ " , t.alg_terreinsector_key" // alias alg_gebouw_key
+ " , NULL"
+ " , NULL"
+ " FROM cnt_contract_plaats cp"
+ " , alg_terreinsector t"
+ " WHERE cnt_alg_plaats_code = 'T'"
@@ -92,6 +102,8 @@ cnt = { setcontractstatus:
+ " , ''"
+ " , d.ins_alg_locatie_key"
+ " , g.alg_gebouw_key"
+ " , NULL"
+ " , NULL"
+ " FROM cnt_contract_object co"
+ " , ins_deel d"
+ " , alg_gebouw g"
@@ -334,11 +346,17 @@ cnt = { setcontractstatus:
+ " , c.prs_afdeling_key_eig eigenaar_key"
+ " , c.cnt_contract_nummer_intern"
+ " , dp.cnt_srtcontract_type"
+ " , alg_locatie_oms"
+ " , alg_locatie_omschrijving"
+ " , cloc.alg_locatie_oms"
+ " , cloc.alg_locatie_omschrijving"
+ " , alg_district_omschrijving"
+ " , alg_locatie_code"
+ " , alg_locatie_count"
+ " , cloc.alg_locatie_code"
+ " , cloc.alg_gebouw_code"
+ " , cloc.alg_verdieping_code"
+ " , cloc.alg_ruimte_nr"
+ " , cloc.alg_locatie_count"
+ " , cloc.alg_gebouw_count"
+ " , cloc.alg_verdieping_count"
+ " , cloc.alg_ruimte_count"
+ " , c.ins_discipline_key"
+ " , " + lcl.xsqla('cd.ins_discipline_omschrijving', 'cd.ins_discipline_key')
+ " , c.cnt_contract_kosten"
@@ -366,7 +384,6 @@ cnt = { setcontractstatus:
+ " , prs_v_afdeling d"
+ " , prs_v_afdeling afd"
+ " , prs_perslid p"
+ " , alg_district ad"
+ " , cnt_disc_params dp"
+ " , cnt_discipline cd";
@@ -378,17 +395,38 @@ cnt = { setcontractstatus:
// Voor de tweede is sql_cnt_loc_key die groeppeert en telt per locatie
// LET OP: - type 4 (algemeen / generiek) zit er niet in
var sql_cnt_loc_keyA = cnt.getCntLocationsSql(true);
var sql_cnt_loc_key = "SELECT MIN(alg_locatie_omschrijving || ' (' || alg_locatie_code || ')') alg_locatie_oms"
+ " , MIN(alg_locatie_omschrijving) alg_locatie_omschrijving"
+ " , MIN(alg_locatie_code) alg_locatie_code"
+ " , MIN(alg_district_key) alg_district_key"
var sql_cnt_loc_key = " WITH alg_onrgoed AS"
+ " ( SELECT o.*"
+ " , l.alg_district_key"
+ " , d.alg_district_omschrijving"
+ " , l.alg_locatie_code"
+ " , l.alg_locatie_omschrijving"
+ " , coalesce(o.alg_type, 'L') alg_level"
+ " FROM alg_district d"
+ " , alg_locatie l"
+ " , alg_v_onroerendgoed_gegevens o"
+ " WHERE l.alg_district_key = d.alg_district_key(+)"
+ " AND l.alg_locatie_key = o.alg_locatie_key(+)"
+ " )"
+ ""
+ "SELECT MIN(ll.alg_locatie_omschrijving || ' (' || ll.alg_locatie_code || ')') alg_locatie_oms"
+ " , MIN(ll.alg_district_omschrijving) alg_district_omschrijving"
+ " , MIN(ll.alg_locatie_omschrijving) alg_locatie_omschrijving"
+ " , MIN(ll.alg_locatie_code) alg_locatie_code"
+ " , MIN(ll.alg_gebouw_code) alg_gebouw_code"
+ " , MIN(ll.alg_verdieping_code) alg_verdieping_code"
+ " , MIN(ll.alg_ruimte_nr) alg_ruimte_nr"
+ " , MIN(ll.alg_district_key) alg_district_key"
+ " , cnt_contract_key"
+ " , MIN(ll.alg_locatie_key) alg_locatie_key"
+ " , COUNT(distinct alg_locatie_code) alg_locatie_count"
+ " FROM alg_locatie ll"
+ " , COUNT(DISTINCT ll.alg_locatie_code) alg_locatie_count"
+ " , COUNT(DISTINCT ll.alg_gebouw_code) alg_gebouw_count"
+ " , COUNT(DISTINCT ll.alg_verdieping_code) alg_verdieping_count"
+ " , COUNT(DISTINCT ll.alg_ruimte_nr) alg_ruimte_count"
+ " FROM alg_onrgoed ll"
+ " , (" + sql_cnt_loc_keyA + ") scloc"
+ " WHERE ll.alg_locatie_key = scloc.alg_locatie_key"
+ " GROUP BY cnt_contract_key";
+ " GROUP BY scloc.cnt_contract_key";
sql += ", (" + sql_cnt_loc_key + ") cloc";
@@ -400,8 +438,7 @@ cnt = { setcontractstatus:
+ " AND d.prs_afdeling_key = c.prs_afdeling_key_eig"
+ " AND c.ins_discipline_key = dp.cnt_ins_discipline_key"
+ " AND c.ins_discipline_key = cd.ins_discipline_key"
+ " AND cloc.cnt_contract_key(+) = c.cnt_contract_key"
+ " AND cloc.alg_district_key = ad.alg_district_key(+)";
+ " AND cloc.cnt_contract_key(+) = c.cnt_contract_key";
if (cntsrt_key_arr && cntsrt_key_arr.length)
sql += " AND c.ins_discipline_key IN (" + cntsrt_key_arr.join(",") + ")";

View File

@@ -47,10 +47,10 @@ sql = "SELECT cdp.cnt_srtcontract_type, cdp.cnt_ins_discipline_key"
oRs = Oracle.Execute(sql);
var cnt_srtcontract_type = oRs("cnt_srtcontract_type").value;
var disc_key = oRs("cnt_ins_discipline_key").value;
oRs.Close();
var authparams = user.checkAutorisation(autfunction, false, disc_key);
// TODO: Voor hetcnt_srtcontract_type == 1 moet de object scope nog toegevoegd worden!!!
%>
<html>
@@ -59,20 +59,29 @@ var authparams = user.checkAutorisation(autfunction, false, disc_key);
<script type="text/javascript">
PRSreadlevel = "<%=authparams.PRSreadlevel%>";
<% if (cnt_srtcontract_type == 3 || cnt_srtcontract_type == 5)
{ // Locatie/gebouw scope
<% switch (cnt_srtcontract_type)
{
case 1: // object scope
%> $(function ()
{
updateGroup("WEB_INSMAN");
});
<% break;
case 3: // object en/of plaats scope
%> $(function ()
{
updateBld(<%=authparams.ALGwritelevel%>); // hieruit volgt ook updateFlr() en updateRoo()
updateGroup("WEB_INSMAN");
});
<% break;
case 5: // plaats scope
%> $(function ()
{
updateBld(<%=authparams.ALGwritelevel%>); // hieruit volgt ook updateFlr() en updateRoo()
});
<% break;
}
%>
$(function ()
{
updateBld(<%=authparams.ALGwritelevel%>); // hieruit volgt ook updateFlr() en updateRoo()
<% if (cnt_srtcontract_type == 3)
{ // Objectensoort scope
%>
updateGroup("WEB_INSMAN");
<% } %>
});
<% } %>
</script>
</head>

View File

@@ -211,6 +211,42 @@ function cnt_list (pautfunction, params)
return safe.html(locatieCode);
}
function fncolPlaats(oRs)
{
var cnt_loc = oRs("alg_locatie_count").Value || 0;
var cnt_bld = oRs("alg_gebouw_count").Value || 0;
var cnt_flr = oRs("alg_verdieping_count").Value || 0;
var cnt_roo = oRs("alg_ruimte_count").Value || 0;
var oms = [];
if (cnt_loc == 1)
{
//oms.push(oRs("alg_locatie_code").Value);
if (cnt_bld == 1)
{
oms.push(oRs("alg_gebouw_code").Value);
if (cnt_flr == 1)
{
oms.push(oRs("alg_verdieping_code").Value);
if (cnt_roo == 1)
{
oms.push(oRs("alg_ruimte_nr").Value);
}
else if (cnt_roo > 1)
oms.push(L("lcl_cnt_ruimte_m") +"("+cnt_loc+")");
}
else if (cnt_flr > 1)
oms.push(L("lcl_cnt_verdieping_m") +"("+cnt_flr+")");
}
else if (cnt_bld > 1)
oms.push(L("lcl_cnt_gebouw_m") +"("+cnt_bld+")");
}
//else if (cnt_loc > 1)
// oms.push(L("lcl_cnt_locatie_m") +"("+cnt_loc+")");
var plaats = oms.join(" - ");
return safe.html(plaats);
}
function fncolStatus(oRs)
{
return safe.html(cnt.getcntstatustext(oRs("cnt_contract_status").Value));
@@ -273,12 +309,16 @@ function cnt_list (pautfunction, params)
rst.addColumn(new Column({caption: L("lcl_cnt_intern_nr"), content: fncolContractnr, colName: "fncolContractnr"}));
if (outputmode == 0)
{
rst.addColumn(new Column({caption: L("lcl_location"), content: fncolLoc, colName: "fncolLoc", hasActions: true}));
rst.addColumn(new Column({caption: L("lcl_place"), content: fncolPlaats, colName: "fncolPlaats"}));
}
else
{
rst.addColumn(new Column({caption: L("lcl_district"), content: "alg_district_omschrijving"}));
rst.addColumn(new Column({caption: L("lcl_location"), content: fncolLocOms, colName: "fncolLocOms"}));
rst.addColumn(new Column({caption: L("lcl_estate_locatie_man_code"), content: fncolLocCode, colName: "fncolLocCode"}));
rst.addColumn(new Column({caption: L("lcl_place"), content: fncolPlaats, colName: "fncolPlaats"}));
}
rst.addColumn(new Column({caption: L("lcl_cnt_contractnr"), content: "cnt_contract_nummer"}));
rst.addColumn(new Column({caption: L("lcl_cnt_srttype"), content: "ins_discipline_omschrijving"}));

View File

@@ -85,6 +85,7 @@ var outputmode = getQParamInt("outputmode", 0);
// Altijd resultaat
aantal = oRs("aantal").value;
totaal = oRs("totaal").value;
oRs.Close();
var kosten = 0;
sql = "SELECT cnt_contract_kosten FROM cnt_contract WHERE cnt_contract_key = " + cnt_key;
@@ -93,6 +94,7 @@ var outputmode = getQParamInt("outputmode", 0);
{
kosten = oRs("cnt_contract_kosten").value;
}
oRs.Close();
sql = "";
switch (cnt_typecontract)