BLCC#39847 contracten ook met ruimte/verdiepingscope

FSN#31475 Huurcontracten zijn obsolete geraakt

svn path=/Website/trunk/; revision=33144
This commit is contained in:
Peter Feij
2017-03-14 17:33:50 +00:00
parent ffee659a3b
commit ec22035242

View File

@@ -7,14 +7,13 @@
Description: Afhankelijk van het type contract wordt hier gepresenteerd de bijbehorende scope
cnt_srtcontract_type Scope
[1] Onderhoud/Maintenance Objecten
[2] Huur/Rental Onroerend goed (ruimten/terreinen)
[3] Ondersteuning/Support Plaats (locatie, gebouw, verdieping, ruimte, terrein) en/of objecten
[4] Algemeen/Generic Geen
[5] Leverancier/Supplier Plaats (locatie, gebouw, verdieping, ruimte, terrein)
[6] Mantel/Master Geen
Parameters: cnt_key Contract key
Context:
Note: Weet niet of status=2 wel afgehandeld moet worden als scope; dat was eerder niet zo.
Note:
*/
%>
@@ -53,6 +52,7 @@ var outputmode = getQParamInt("outputmode", 0);
case 'V' : url = "appl/alg/alg_verdieping.asp?key="+rowKey ; break;
case 'R' : url = "appl/alg/alg_ruimte.asp?key="+rowKey ; break;
case 'L' : url = "appl/alg/alg_locatie.asp?key="+rowKey ; break;
case 'T' : url = "appl/alg/alg_terreinsector.asp?ter_key="+rowKey ; break;
case 'D' : url= "appl/ins/ins_deel.asp?urole=bo&ins_key="+rowKey; break;
case 'S' : url = "appl/ins/ins_srtdeel.asp?urole=bo&srtdeel_key="+rowKey ; break;
}
@@ -96,7 +96,6 @@ var outputmode = getQParamInt("outputmode", 0);
}
sql = "";
var scopetext = "";
switch (cnt_typecontract)
{
// resultaatkolommen code, scope, gewicht, type, key
@@ -137,78 +136,8 @@ var outputmode = getQParamInt("outputmode", 0);
+ " AND cnt_contract_object_verwijder IS NULL"
+ " AND cnt_contract_key = " + cnt_key
+ " ORDER BY 3";
scopetext = L("lcl_cnt_objects");
break;
case 2: // Huur van ruimte of terreinsector: deze werden eigenlijk niet direct als scope getoond geloof ik
sql = " SELECT NULL code"
+ ", plaatsaanduiding scope"
+ ", NULL gewicht"
+ ", type type"
+ ", totaal_opp"
+ ", contract_opp"
+ ", tariefsrt"
+ ", locatie"
+ ", (contract_opp * prijs) totaalprijs"
+ ", alg_onrgoed_key key"
+ " FROM"
+ " (SELECT co.alg_onrgoed_key"
+ ", rm.alg_ruimte_aanduiding plaatsaanduiding"
+ ", (SELECT fac.safe_to_number(alg_onrgoedkenmerk_waarde)"
+ " FROM alg_onrgoedkenmerk"
+ " WHERE alg_onrgoed_key = co.alg_onrgoed_key"
+ " AND alg_kenmerk_key = " + S("alg_ruimte_comm_opp_key") + ") totaal_opp"
+ ", co.cnt_contract_onrgoed_opp contract_opp"
+ ", alg_srtruimte_code tariefsrt"
+ ", rm.alg_locatie_omschrijving locatie"
+ ", sr.alg_srtruimte_prijs prijs"
+ ", 'R' type"
+ " FROM alg_v_ruimte_gegevens rm"
+ ", cnt_contract_onrgoed co"
+ ", alg_srtruimte sr"
+ " WHERE co.alg_onrgoed_niveau = 'R'"
+ " AND co.alg_onrgoed_key = rm.ALG_RUIMTE_KEY"
+ " AND sr.alg_srtruimte_key = co.alg_srtonrgoed_key"
+ " AND co.cnt_mld_melding_key IS NULL"
+ " AND co.cnt_contract_key = " + cnt_key + ""
+ " UNION"
+ " SELECT co.alg_onrgoed_key"
+ ", lc.alg_locatie_code || ' - ' || alg_terreinsector_omschrijving plaatsaanduiding"
+ ", (SELECT fac.safe_to_number(alg_onrgoedkenmerk_waarde) from alg_onrgoedkenmerk"
+ " WHERE alg_onrgoed_key = co.alg_onrgoed_key"
+ " AND alg_kenmerk_key = " + S("alg_terrein_comm_opp_key") + ") totaal_opp"
+ ", co.cnt_contract_onrgoed_opp contract_opp"
+ ", sr.alg_srtterreinsector_code tariefsrt"
+ ", lc.alg_locatie_omschrijving locatie"
+ ", sr.alg_srtterreinsector_prijs prijs"
+ ", 'T' type"
+ " FROM alg_terreinsector tr"
+ ", cnt_contract_onrgoed co"
+ ", alg_srtterreinsector sr"
+ ", alg_locatie lc"
+ " WHERE co.alg_onrgoed_niveau = 'T'"
+ " AND co.alg_onrgoed_key = tr.alg_terreinsector_key"
+ " AND sr.alg_srtterreinsector_key = co.alg_srtonrgoed_key"
+ " AND lc.alg_locatie_key = tr.alg_locatie_key"
+ " AND co.cnt_mld_melding_key IS NULL"
+ " AND co.cnt_contract_key = " + cnt_key + ""
+ " UNION"
+ " SELECT co.alg_onrgoed_key"
+ ", " + safe.quoted_sql(L("lcl_location")) + " plaatsaanduiding"
+ ", null totaal_opp"
+ ", co.cnt_contract_onrgoed_opp contract_opp"
+ ", sr.alg_srtruimte_code tariefsrt"
+ ", lc.alg_locatie_omschrijving locatie"
+ ", COALESCE(co.cnt_srtruimte_prijs,0) prijs"
+ ", 'L' type"
+ " FROM alg_locatie lc"
+ ", cnt_contract_onrgoed co"
+ ", alg_srtruimte sr"
+ " WHERE co.alg_onrgoed_niveau = 'L'"
+ " AND co.alg_onrgoed_key = lc.alg_locatie_key"
+ " AND sr.alg_srtruimte_key = co.alg_srtonrgoed_key"
+ " AND co.cnt_mld_melding_key IS NULL"
+ " AND co.cnt_contract_key = " + cnt_key
+ ")";
case 2: // DEPRECATED
break;
case 3: // onderhoud op objectsoorten en/of plaats
case 5: // onderhoud op plaats
@@ -227,8 +156,9 @@ var outputmode = getQParamInt("outputmode", 0);
+ " AND cnt_contract_key = " + cnt_key
+ " UNION ALL ";
}
// Checken of deze presentatie consistent is met de overige plaatsaanduidingen bv bij ins
sql += "SELECT cnt_alg_plaats_code"
+ " , l.alg_locatie_omschrijving || ' (' || l.alg_locatie_code || ')' scope"
+ " , l.alg_locatie_code || ' (' || l.alg_locatie_omschrijving || ')' scope"
+ " , cnt_contract_plaats_gewicht gewicht"
+ " , cnt_alg_plaats_code type"
+ " , cnt_alg_plaats_key key"
@@ -240,34 +170,58 @@ var outputmode = getQParamInt("outputmode", 0);
+ " AND cnt_contract_key = " + cnt_key
+ " UNION "
+ "SELECT cnt_alg_plaats_code"
+ " , l.alg_locatie_omschrijving || ' (' || l.alg_locatie_code || '): "
+ L("lcl_building") + " ' || g.alg_gebouw_omschrijving scope"
+ " , l.alg_locatie_code ||'-'||v.alg_plaatsaanduiding || DECODE(v.alg_plaatsomschrijving, '','' , ' (' || v.alg_plaatsomschrijving || ')')"
+ " , cnt_contract_plaats_gewicht gewicht, cnt_alg_plaats_code type"
+ " , cnt_alg_plaats_key key"
+ " FROM cnt_contract_plaats, alg_locatie l"
+ " , alg_gebouw g "
+ " , alg_v_allonrgoed_gegevens v"
+ " WHERE cnt_alg_plaats_code = 'G'"
+ " AND cnt_alg_plaats_key=g.alg_gebouw_key"
+ " AND g.alg_locatie_key=l.alg_locatie_key"
+ " AND v.alg_type = 'G'"
+ " AND cnt_alg_plaats_key=v.alg_gebouw_key"
+ " AND v.alg_locatie_key=l.alg_locatie_key"
+ " AND cnt_contract_plaats_verwijder IS NULL"
+ " AND cnt_contract_key = " + cnt_key
+ " UNION "
+ "SELECT cnt_alg_plaats_code"
+ " , l.alg_locatie_omschrijving || ' (' || l.alg_locatie_code || '): "
+ L("lcl_terra") + " ' || t.alg_terreinsector_omschrijving scope"
+ " , l.alg_locatie_code ||'-'||v.alg_plaatsaanduiding || DECODE(v.alg_plaatsomschrijving, '','' , ' (' || v.alg_plaatsomschrijving || ')')"
+ " , cnt_contract_plaats_gewicht gewicht, cnt_alg_plaats_code type"
+ " , cnt_alg_plaats_key key"
+ " FROM cnt_contract_plaats, alg_locatie l"
+ " , alg_v_allonrgoed_gegevens v"
+ " WHERE cnt_alg_plaats_code = 'V'"
+ " AND v.alg_type = 'V'"
+ " AND cnt_alg_plaats_key=v.alg_verdieping_key"
+ " AND v.alg_locatie_key=l.alg_locatie_key"
+ " AND cnt_contract_plaats_verwijder IS NULL"
+ " AND cnt_contract_key = " + cnt_key
+ " UNION "
+ "SELECT cnt_alg_plaats_code"
+ " , l.alg_locatie_code ||'-'||v.alg_plaatsaanduiding || DECODE(v.alg_plaatsomschrijving, '','' , ' (' || v.alg_plaatsomschrijving || ')')"
+ " , cnt_contract_plaats_gewicht gewicht, cnt_alg_plaats_code type"
+ " , cnt_alg_plaats_key key"
+ " FROM cnt_contract_plaats, alg_locatie l"
+ " , alg_v_allonrgoed_gegevens v"
+ " WHERE cnt_alg_plaats_code = 'R'"
+ " AND v.alg_type = 'R'"
+ " AND cnt_alg_plaats_key=v.alg_ruimte_key"
+ " AND v.alg_locatie_key=l.alg_locatie_key"
+ " AND cnt_contract_plaats_verwijder IS NULL"
+ " AND cnt_contract_key = " + cnt_key
+ " UNION "
+ "SELECT cnt_alg_plaats_code"
+ " , l.alg_locatie_code ||'-'||v.alg_plaatsaanduiding || DECODE(v.alg_plaatsomschrijving, '','' , ' (' || v.alg_plaatsomschrijving || ')')"
+ " , cnt_contract_plaats_gewicht gewicht"
+ " , cnt_alg_plaats_code type"
+ " , cnt_alg_plaats_key key"
+ " FROM cnt_contract_plaats"
+ " , alg_locatie l"
+ " , alg_terreinsector t"
+ " FROM cnt_contract_plaats, alg_locatie l"
+ " , alg_v_allonrgoed_gegevens v"
+ " WHERE cnt_alg_plaats_code = 'T'"
+ " AND cnt_alg_plaats_key=t.alg_terreinsector_key"
+ " AND t.alg_locatie_key=l.alg_locatie_key"
+ " AND v.alg_type = 'T'"
+ " AND cnt_alg_plaats_key=v.alg_terreinsector_key"
+ " AND v.alg_locatie_key=l.alg_locatie_key"
+ " AND cnt_contract_plaats_verwijder IS NULL"
+ " AND cnt_contract_key = " + cnt_key
+ " ORDER BY 4,2";
scopetext = L("lcl_cnt_locations");
+ " ORDER BY 2,4";
break;
case 4: // scopeloos
case 6: // mantelcontract
@@ -287,12 +241,13 @@ var outputmode = getQParamInt("outputmode", 0);
var result = "";
switch (oRs("type").value)
{
case 'G' : result = L("lcl_building"); break;
case 'V' : result = L("lcl_floor"); break;
case 'R' : result = L("lcl_room"); break;
case 'L' : result = L("lcl_location"); break;
case 'D' : result = L("lcl_obj_inf_name"); break;
case 'S' : result = L("lcl_obj_sort"); break;
case "G" : result = L("lcl_building"); break;
case "V" : result = L("lcl_floor"); break;
case "R" : result = L("lcl_room"); break;
case "L" : result = L("lcl_location"); break;
case "T" : result = L("lcl_terra"); break;
case "D" : result = L("lcl_obj_inf_name"); break;
case "S" : result = L("lcl_obj_sort"); break;
}
return result;
}
@@ -313,7 +268,7 @@ var outputmode = getQParamInt("outputmode", 0);
}
var buttons = [];
if (cnt_typecontract != 2 && this_cnt.canChange)
if (this_cnt.canChange)
{
buttons.push({title: L("lcl_change"), icon: "wijzigen.png", action: "cnt_scopechange()" });
}
@@ -328,18 +283,10 @@ var outputmode = getQParamInt("outputmode", 0);
buttons: buttons
});
if (cnt_typecontract == 2)
rst.addColumn(new Column({ caption: L("lcl_location"), content: "locatie" }));
rst.addColumn(new Column({ caption: L("lcl_cnt_scope_title"), content: "scope", hasActions: true, tooltip: fnScopetype }));
if (cnt_typecontract != 1 && cnt_typecontract != 2)
rst.addColumn(new Column({ caption: L("lcl_cnt_scope_title"), content: fnScopetype }));
rst.addColumn(new Column({ caption: L("lcl_plaatsgegevens"), content: "scope", hasActions: true }));
if (cnt_typecontract != 1)
rst.addColumn(new Column({ caption: L("lcl_cnt_verdeling"), content: fnGewicht, datatype: "currency" }));
if (cnt_typecontract == 2)
{
rst.addColumn(new Column({ caption: L("lcl_cnt_ruimte_opp"), content: fnTotaal_opp, datatype: "float" }));
rst.addColumn(new Column({ caption: L("lcl_cnt_ruimte_occ"), content: "contract_opp", datatype: "float", total: true }));
rst.addColumn(new Column({ caption: L("lcl_cnt_ruimte_tarief"), content: "tariefsrt" }));
rst.addColumn(new Column({ caption: L("lcl_total_cost"), content: "totaalprijs", datatype: "currency", total: true }));
}
rst.addAction({ action: "gotoScope", caption: L("lcl_details"), isDefault: true });
var cnt = rst.processResultset();