TWYN#53458 conversie project EPO
svn path=/Customer/trunk/; revision=38073
This commit is contained in:
@@ -82,6 +82,7 @@ CREATE OR REPLACE VIEW twyn_v_bgt_budgetsrtmutatie
|
||||
AS
|
||||
SELECT bm_1.bgt_budget_key_van bgt_budget_key
|
||||
, bm_1.bgt_budgetmutatie_datum
|
||||
, BGT.GETSOORTMUTATIE(bm_1.bgt_budgetmutatie_key) soortmutatie
|
||||
, CASE WHEN INSTR('AR', BGT.GETSOORTMUTATIE(bm_1.bgt_budgetmutatie_key)) > 0
|
||||
THEN COALESCE(bm_1.bgt_budget_bedrag_van, 0)
|
||||
ELSE 0
|
||||
@@ -99,9 +100,10 @@ AS
|
||||
ELSE 0
|
||||
END mut_bedrag_btw
|
||||
FROM bgt_budgetmutatie bm_1
|
||||
UNION
|
||||
UNION ALL
|
||||
SELECT bm_2.bgt_budget_key_naar bgt_budget_key
|
||||
, bm_2.bgt_budgetmutatie_datum
|
||||
, BGT.GETSOORTMUTATIE(bm_2.bgt_budgetmutatie_key) soortmutatie
|
||||
, CASE WHEN INSTR('AR', BGT.GETSOORTMUTATIE(bm_2.bgt_budgetmutatie_key)) > 0
|
||||
THEN COALESCE(bm_2.bgt_budget_bedrag_naar, 0)
|
||||
ELSE 0
|
||||
@@ -593,21 +595,22 @@ AS
|
||||
, kostengroep
|
||||
, scode
|
||||
, kostensoort
|
||||
, financieel."BGT_KOSTENRUBRIEK_KEY"
|
||||
, financieel."SOORT"
|
||||
, financieel."BGT_BEDRAG_EXC"
|
||||
, financieel."BGT_BEDRAG_BTW"
|
||||
, financieel."RES_BEDRAG_EXC"
|
||||
, financieel."RES_BEDRAG_BTW"
|
||||
, financieel."MUT_BEDRAG_EXC"
|
||||
, financieel."MUT_BEDRAG_BTW"
|
||||
, financieel."BGT_DATUM"
|
||||
, financieel."CNT_BEDRAG_EXC"
|
||||
, financieel."CNT_BEDRAG_BTW"
|
||||
, financieel."CNT_DATUM"
|
||||
, financieel."FIN_BEDRAG_EXC"
|
||||
, financieel."FIN_BEDRAG_BTW"
|
||||
, financieel."FIN_DATUM"
|
||||
, financieel.bgt_kostenrubriek_key
|
||||
, financieel.soort
|
||||
, financieel.soortmutatie
|
||||
, financieel.bgt_bedrag_exc
|
||||
, financieel.bgt_bedrag_btw
|
||||
, financieel.res_bedrag_exc
|
||||
, financieel.res_bedrag_btw
|
||||
, financieel.mut_bedrag_exc
|
||||
, financieel.mut_bedrag_btw
|
||||
, financieel.bgt_datum
|
||||
, financieel.cnt_bedrag_exc
|
||||
, financieel.cnt_bedrag_btw
|
||||
, financieel.cnt_datum
|
||||
, financieel.fin_bedrag_exc
|
||||
, financieel.fin_bedrag_btw
|
||||
, financieel.fin_datum
|
||||
, CASE
|
||||
WHEN financieel.soort = 'F' THEN financieel.fin_datum
|
||||
WHEN financieel.soort = 'C' THEN financieel.cnt_datum
|
||||
@@ -619,6 +622,7 @@ AS
|
||||
, bu.prs_kostensoortgrp_key
|
||||
, bu.prs_kostensoort_key
|
||||
, 'B' soort
|
||||
, NULL soortmutatie
|
||||
, bu.bgt_budget_bedrag bgt_bedrag_exc
|
||||
, bu.bgt_budget_btwbedrag bgt_bedrag_btw
|
||||
, 0 res_bedrag_exc
|
||||
@@ -638,6 +642,7 @@ AS
|
||||
, bu.prs_kostensoortgrp_key
|
||||
, bu.prs_kostensoort_key
|
||||
, 'M' soort
|
||||
, bm.soortmutatie soortmutatie
|
||||
, 0 bgt_bedrag_exc
|
||||
, 0 bgt_bedrag_btw
|
||||
, COALESCE (bm.res_bedrag_exc, 0) res_bedrag_exc
|
||||
@@ -659,6 +664,7 @@ AS
|
||||
, bu.prs_kostensoortgrp_key
|
||||
, bu.prs_kostensoort_key
|
||||
, 'C' soort
|
||||
, NULL soortmutatie
|
||||
, 0 bgt_bedrag_exc
|
||||
, 0 bgt_bedrag_btw
|
||||
, 0 res_bedrag_exc
|
||||
@@ -680,6 +686,7 @@ AS
|
||||
, bu.prs_kostensoortgrp_key
|
||||
, bu.prs_kostensoort_key
|
||||
, 'F' soort
|
||||
, NULL soortmutatie
|
||||
, 0 bgt_bedrag_exc
|
||||
, 0 bgt_bedrag_btw
|
||||
, 0 res_bedrag_exc
|
||||
@@ -826,6 +833,7 @@ AS
|
||||
, (
|
||||
SELECT kr.bgt_kostenrubriek_key
|
||||
, 'B' soort
|
||||
, NULL soortmutatie
|
||||
, SUM(bu.bgt_budget_bedrag) bgt_bedrag_exc
|
||||
, SUM(bu.bgt_budget_btwbedrag) bgt_bedrag_btw
|
||||
, 0 res_bedrag_exc
|
||||
@@ -846,6 +854,7 @@ AS
|
||||
UNION ALL
|
||||
SELECT bu.bgt_kostenrubriek_key
|
||||
, 'M' soort
|
||||
, bm.soortmutatie soortmutatie
|
||||
, 0 bgt_bedrag_exc
|
||||
, 0 bgt_bedrag_btw
|
||||
, COALESCE(bm.res_bedrag_exc, 0) res_bedrag_exc
|
||||
@@ -865,6 +874,7 @@ AS
|
||||
UNION ALL
|
||||
SELECT bu.bgt_kostenrubriek_key
|
||||
, 'C' soort
|
||||
, NULL soortmutatie
|
||||
, 0 bgt_bedrag_exc
|
||||
, 0 bgt_bedrag_btw
|
||||
, 0 res_bedrag_exc
|
||||
@@ -884,6 +894,7 @@ AS
|
||||
UNION ALL
|
||||
SELECT bu.bgt_kostenrubriek_key
|
||||
, 'F' soort
|
||||
, NULL soortmutatie
|
||||
, 0 bgt_bedrag_exc
|
||||
, 0 bgt_bedrag_btw
|
||||
, 0 res_bedrag_exc
|
||||
|
||||
Reference in New Issue
Block a user