KFNS#33610 KFNS - Contractselectie bij opdracht onder melding niet gekoppeld aan plaats
svn path=/Website/trunk/; revision=40969
This commit is contained in:
@@ -536,12 +536,19 @@ oRs.Close();
|
||||
+ " FROM cnt_v_aanwezigcontract cnt, "
|
||||
+ " cnt_contract_plaats cp, "
|
||||
+ " mld_melding me, "
|
||||
+ " cnt_disc_params cpa "
|
||||
+ " mld_stdmelding sm, "
|
||||
+ " cnt_disc_params cpa, "
|
||||
+ " ins_tab_discipline td, "
|
||||
+ " ins_srtdiscipline sd "
|
||||
+ " WHERE cnt.cnt_contract_key = cp.cnt_contract_key "
|
||||
+ " AND cnt.ins_discipline_key = cpa.cnt_ins_discipline_key "
|
||||
+ " AND sm.mld_stdmelding_key = me.mld_stdmelding_key "
|
||||
+ " AND td.ins_discipline_key = sm.mld_ins_discipline_key "
|
||||
+ " AND sd.ins_srtdiscipline_key = td.ins_srtdiscipline_key "
|
||||
+ " AND (cnt_contract_status = 0 OR cnt.cnt_contract_key = {0})".format(mld_opdr.contract_key||-1) // actief
|
||||
+ " AND ( (cp.cnt_alg_plaats_key = me.mld_alg_locatie_key "
|
||||
+ " AND cp.cnt_alg_plaats_code = 'L') "
|
||||
+ " OR (me.mld_alg_locatie_key IS NULL AND sd.ins_srtdiscipline_alg = 0) "
|
||||
+ " OR (cp.cnt_alg_plaats_key = "
|
||||
+ " (SELECT CASE cp.cnt_alg_plaats_code "
|
||||
+ " WHEN 'G' THEN alg_gebouw_key "
|
||||
|
||||
@@ -55,15 +55,22 @@ if (authparamsORDBOF || authparamsMLDBOF || authparamsMLDBO3)
|
||||
+ ", 2"
|
||||
+ ", cnt.cnt_contract_nummer_intern"
|
||||
+ ", cnt.cnt_contract_versie"
|
||||
+ " FROM cnt_v_aanwezigcontract cnt"
|
||||
+ ", cnt_contract_plaats cp"
|
||||
+ ", mld_melding me"
|
||||
+ ", cnt_disc_params cpa "
|
||||
+ " WHERE cnt.cnt_contract_key = cp.cnt_contract_key"
|
||||
+ " AND cnt.ins_discipline_key = cpa.cnt_ins_discipline_key"
|
||||
+ " AND cnt.cnt_contract_status = 0" // actief
|
||||
+ " FROM cnt_v_aanwezigcontract cnt "
|
||||
+ " , cnt_contract_plaats cp "
|
||||
+ " , mld_melding me "
|
||||
+ " , mld_stdmelding sm "
|
||||
+ " , cnt_disc_params cpa "
|
||||
+ " , ins_tab_discipline td "
|
||||
+ " , ins_srtdiscipline sd "
|
||||
+ " WHERE cnt.cnt_contract_key = cp.cnt_contract_key "
|
||||
+ " AND cnt.ins_discipline_key = cpa.cnt_ins_discipline_key "
|
||||
+ " AND sm.mld_stdmelding_key = me.mld_stdmelding_key "
|
||||
+ " AND td.ins_discipline_key = sm.mld_ins_discipline_key "
|
||||
+ " AND sd.ins_srtdiscipline_key = td.ins_srtdiscipline_key "
|
||||
+ " AND cnt.cnt_contract_status = 0" // actief
|
||||
+ " AND ( (cp.cnt_alg_plaats_key = me.mld_alg_locatie_key "
|
||||
+ " AND cp.cnt_alg_plaats_code = 'L') "
|
||||
+ " OR (me.mld_alg_locatie_key IS NULL AND sd.ins_srtdiscipline_alg = 0) "
|
||||
+ " OR (cp.cnt_alg_plaats_key = "
|
||||
+ " (SELECT CASE cp.cnt_alg_plaats_code "
|
||||
+ " WHEN 'G' THEN alg_gebouw_key "
|
||||
|
||||
Reference in New Issue
Block a user