PCHD#41384 In lijst ook ALG-scope van ORDBOF betrekken om te bepalen welke offertjes je mag fiatteren

svn path=/Website/branches/v2017.1/; revision=34772
This commit is contained in:
Jos Groot Lipman
2017-07-31 09:55:58 +00:00
parent e7c24adf20
commit fe37fda505

View File

@@ -548,6 +548,8 @@ function getSqlGoedkeurMld(fiatstatus, prsKeys, params)
+ " AND sd.ins_srtdiscipline_key = td.ins_srtdiscipline_key"
+ " AND mdp.mld_ins_discipline_key = sm.mld_ins_discipline_key"
+ " AND EXISTS("
// JGL: 31-7-2017 Deze prs-scoping werkt volgens mij niet voor bedrijf-niveau
// Bovendien heeft geen van de WEB_ORDGO? uberhaupt PRS-scoping?
+ " SELECT g.prs_perslid_key"
+ " FROM fac_v_webgebruiker g"
+ " , fac_functie f"
@@ -701,6 +703,24 @@ function getSqlAccAfwOff(params)
+ " AND m.mld_alg_onroerendgoed_keys = onrg.alg_onroerendgoed_keys(+)"
+ " AND onrg.alg_gebouw_key = g.alg_gebouw_key(+)"
+ " AND onrg.alg_terreinsector_key = t.alg_terreinsector_key(+)"
+ " AND EXISTS("
+ " SELECT g.prs_perslid_key"
+ " FROM fac_v_webgebruiker g"
+ " , fac_functie f"
+ " , prs_perslid pzelf"
+ " WHERE g.fac_functie_key = f.fac_functie_key"
+ " AND f.fac_functie_code = 'WEB_ORDBOF'"
+ " AND g.ins_discipline_key = sm.mld_ins_discipline_key"
+ " AND pzelf.prs_perslid_key IN (" + prsKeys + ")"
+ " AND g.prs_perslid_key = pzelf.prs_perslid_key"
+ " AND (g.fac_gebruiker_alg_level_write = -1"
+ " OR (g.fac_gebruiker_alg_level_write < 9"
+ " AND m.mld_alg_locatie_key IN" // alleen locatie en lager ondersteund
+ " (SELECT alg_locatie_key"
+ " FROM fac_v_my_locations"
+ " WHERE prs_perslid_key = pzelf.prs_perslid_key"
+ " AND niveau = fac_gebruiker_alg_level_write)))"
+ " )"
+ (params.bld_key // sortering op gebouw, locatie of district
? " AND g.alg_gebouw_key = " + params.bld_key
: (params.loc_key_arr