diff --git a/APPL/CNT/cnt.inc b/APPL/CNT/cnt.inc index 607b2c3028..b7753e5f01 100644 --- a/APPL/CNT/cnt.inc +++ b/APPL/CNT/cnt.inc @@ -61,24 +61,6 @@ cnt = { setcontractstatus: + " , ins_deel d" + " WHERE co.cnt_ins_deel_key = d.ins_deel_key" + " AND d.ins_alg_locatie_key IS NOT NULL"; - -// + " UNION ALL" -// + " SELECT co.cnt_contract_key" -// + " , g.alg_locatie_key" -// + " FROM cnt_contract_onrgoed co" -// + " , alg_gebouw g" -// + " , alg_verdieping v" -// + " , alg_ruimte r" -// + " WHERE co.alg_onrgoed_niveau = 'R'" -// + " AND co.alg_onrgoed_key = r.alg_ruimte_key" -// + " AND r.alg_verdieping_key = v.alg_verdieping_key" -// + " AND v.alg_gebouw_key = g.alg_gebouw_key" -// + " UNION ALL" -// + " SELECT co.cnt_contract_key" -// + " , t.alg_locatie_key" -// + " FROM cnt_contract_onrgoed co, alg_terreinsector t" -// + " WHERE co.alg_onrgoed_niveau = 'T'" -// + " AND co.alg_onrgoed_key = t.alg_terreinsector_key"; }, getCntApprovers: @@ -342,24 +324,7 @@ cnt = { setcontractstatus: + " , d.ins_alg_locatie_key" + " FROM cnt_contract_object co" + " , ins_deel d" - + " WHERE co.cnt_ins_deel_key = d.ins_deel_key" - + " UNION ALL" - + " SELECT co.cnt_contract_key" - + " , g.alg_locatie_key" - + " FROM cnt_contract_onrgoed co" - + " , alg_gebouw g" - + " , alg_verdieping v" - + " , alg_ruimte r" - + " WHERE co.alg_onrgoed_niveau = 'R'" - + " AND co.alg_onrgoed_key = r.alg_ruimte_key" - + " AND r.alg_verdieping_key = v.alg_verdieping_key" - + " AND v.alg_gebouw_key = g.alg_gebouw_key" - + " UNION ALL" - + " SELECT co.cnt_contract_key" - + " , t.alg_locatie_key" - + " FROM cnt_contract_onrgoed co, alg_terreinsector t" - + " WHERE co.alg_onrgoed_niveau = 'T'" - + " AND co.alg_onrgoed_key = t.alg_terreinsector_key"; + + " WHERE co.cnt_ins_deel_key = d.ins_deel_key"; sql_cnt_loc_key = "SELECT MIN(alg_locatie_omschrijving || ' (' || alg_locatie_code || ')') alg_locatie_oms" + " , MIN(alg_locatie_omschrijving) alg_locatie_omschrijving" @@ -641,9 +606,6 @@ cnt = { setcontractstatus: + " WHERE NOT EXISTS (SELECT cnt_contract_key" + " FROM cnt_contract_plaats cp" + " WHERE cp.cnt_contract_key = c.cnt_contract_key)" - + " AND NOT EXISTS (SELECT cnt_contract_key" - + " FROM cnt_contract_onrgoed co" - + " WHERE co.cnt_contract_key = c.cnt_contract_key)" + " AND NOT EXISTS (SELECT cnt_contract_key" + " FROM cnt_contract_object co" + " WHERE co.cnt_contract_key = c.cnt_contract_key"