KFSG#78420 -- Catering op verkeerde contract
svn path=/Customer/trunk/; revision=60574
This commit is contained in:
@@ -986,6 +986,7 @@ AS -- Vaste contractkosten over de ACTUAL termijn
|
||||
AND b.prs_bedrijf_key = c.cnt_prs_bedrijf_key
|
||||
AND c.ins_discipline_key = 523 -- Variabele contracten
|
||||
--AND c.cnt_contract_status = 0 -- NIET Gesloten
|
||||
AND c.cnt_contract_omschrijving NOT LIKE '%BPS%' -- BPS contracten worden gebruikt om mld_opdrachten te koppelen
|
||||
AND TRUNC (c.cnt_contract_looptijd_van) < TRUNC (LAST_DAY (SYSDATE))
|
||||
AND c.cnt_contract_looptijd_tot >= TRUNC (LAST_DAY (SYSDATE))
|
||||
AND c.cnt_contract_mantel_key = mc.cnt_contract_key(+)
|
||||
@@ -993,13 +994,14 @@ AS -- Vaste contractkosten over de ACTUAL termijn
|
||||
AND cp.prs_perslid_key = pcp.prs_perslid_key(+)
|
||||
AND NOT EXISTS
|
||||
(SELECT 1
|
||||
FROM cnt_v_aanwezigcontract
|
||||
WHERE ins_discipline_key = 523 -- Variabele contracten
|
||||
FROM cnt_v_aanwezigcontract c2
|
||||
WHERE c2.ins_discipline_key = 523 -- Variabele contracten
|
||||
--AND cnt_contract_status = 0 -- NIET Gesloten
|
||||
AND TRUNC (cnt_contract_looptijd_van) < TRUNC (SYSDATE, 'mm') - 1
|
||||
AND cnt_contract_looptijd_tot >= TRUNC (SYSDATE, 'mm') - 1
|
||||
AND cnt_prs_bedrijf_key = c.cnt_prs_bedrijf_key
|
||||
AND cnt_contract_nummer_intern > c.cnt_contract_nummer_intern)) x
|
||||
AND TRUNC (c2.cnt_contract_looptijd_van) < TRUNC (SYSDATE, 'mm') - 1
|
||||
AND c2.cnt_contract_looptijd_tot >= TRUNC (SYSDATE, 'mm') - 1
|
||||
AND c2.cnt_prs_bedrijf_key = c.cnt_prs_bedrijf_key
|
||||
AND c2.cnt_contract_omschrijving NOT LIKE '%BPS%' -- BPS contracten worden gebruikt om mld_opdrachten te koppelen
|
||||
AND c2.cnt_contract_nummer_intern > c.cnt_contract_nummer_intern)) x
|
||||
GROUP BY x.prs_afdeling_key,
|
||||
TO_CHAR (SYSDATE, 'yyyy-mm'),
|
||||
'R',
|
||||
@@ -1509,20 +1511,21 @@ AS
|
||||
AND b.prs_bedrijf_key = c.cnt_prs_bedrijf_key
|
||||
AND c.ins_discipline_key = 523 -- Variabele contracten
|
||||
--AND c.cnt_contract_status = 0 -- NIET Gesloten
|
||||
AND c.cnt_contract_omschrijving NOT LIKE '%BPS%' -- BPS contracten worden gebruikt om mld_opdrachten te koppelen
|
||||
AND TRUNC (c.cnt_contract_looptijd_van) < TRUNC (SYSDATE, 'mm') - 1
|
||||
AND c.cnt_contract_looptijd_tot >= TRUNC (SYSDATE, 'mm') - 1
|
||||
AND c.cnt_contract_mantel_key = mc.cnt_contract_key(+)
|
||||
AND mc.prs_contactpersoon_key = cp.prs_contactpersoon_key(+)
|
||||
AND cp.prs_perslid_key = pcp.prs_perslid_key(+)
|
||||
AND c.prs_perslid_key_beh = pcm.prs_perslid_key
|
||||
AND NOT EXISTS
|
||||
(SELECT 1
|
||||
FROM cnt_v_aanwezigcontract
|
||||
WHERE ins_discipline_key = 523 -- Variabele contracten
|
||||
--AND cnt_contract_status = 0 -- NIET Gesloten
|
||||
AND TRUNC (cnt_contract_looptijd_van) < TRUNC (SYSDATE, 'mm') - 1
|
||||
AND cnt_contract_looptijd_tot >= TRUNC (SYSDATE, 'mm') - 1
|
||||
AND cnt_prs_bedrijf_key = c.cnt_prs_bedrijf_key
|
||||
FROM cnt_v_aanwezigcontract c2
|
||||
WHERE c2.ins_discipline_key = 523 -- Variabele contracten
|
||||
--AND cnt_contract_status = 0 -- NIET Gesloten
|
||||
AND TRUNC (c2.cnt_contract_looptijd_van) < TRUNC (SYSDATE, 'mm') - 1
|
||||
AND c2.cnt_contract_looptijd_tot >= TRUNC (SYSDATE, 'mm') - 1
|
||||
AND c2.cnt_prs_bedrijf_key = c.cnt_prs_bedrijf_key
|
||||
AND c2.cnt_contract_omschrijving NOT LIKE '%BPS%' -- BPS contracten worden gebruikt om mld_opdrachten te koppelen
|
||||
AND cnt_contract_nummer_intern > c.cnt_contract_nummer_intern)) x
|
||||
GROUP BY x.prs_afdeling_key,
|
||||
TO_CHAR (TRUNC (SYSDATE, 'mm') - 1, 'yyyy-mm'),
|
||||
|
||||
Reference in New Issue
Block a user