BLCC#64393 Herziening facturatie/allocatiemodel
svn path=/Customer/trunk/; revision=48879
This commit is contained in:
@@ -7623,7 +7623,7 @@ AS
|
||||
TO_CHAR (LEAST (TRUNC (x.lt), LAST_DAY (TO_DATE (x.maand, 'yyyymm'))), 'dd-mm-yyyy') dageinde,
|
||||
LAST_DAY (TO_DATE (x.maand, 'yyyymm')) - TO_DATE (x.maand, 'yyyymm') + 1 mndbes, -- Beschikbaar
|
||||
LEAST (TRUNC (x.lt), LAST_DAY (TO_DATE (x.maand, 'yyyymm'))) - GREATEST (TRUNC (x.lv), TO_DATE (x.maand, 'yyyymm')) + 1 mndbez, -- Bezet
|
||||
DECODE (cpm.srtopp, 'X', -1, 'Y', -1, 'Z', 1, COALESCE (cpm.opp, 0)) aantal, -- Aantal m2
|
||||
DECODE (cpm.srtopp, 'X', -1, 'Y', 1, 'Z', 1, COALESCE (cpm.opp, 0)) aantal, -- Aantal m2
|
||||
DECODE (cpm.srtopp,
|
||||
'L', COALESCE (fac.safe_to_number (ltar.alg_onrgoedkenmerk_waarde), 0),
|
||||
'H', COALESCE (fac.safe_to_number (htar.alg_onrgoedkenmerk_waarde), 0),
|
||||
@@ -7640,7 +7640,7 @@ AS
|
||||
DECODE (factuur.cnt_kenmerkcontract_waarde, NULL, 0, 1) factuur,
|
||||
NULL alg_onroerendgoed_type, TO_NUMBER (NULL) alg_onroerendgoed_keys, cpm.srtopp alg_plaatsaanduiding,
|
||||
ROUND (((LEAST (TRUNC (x.lt), LAST_DAY (TO_DATE (x.maand, 'yyyymm'))) - GREATEST (TRUNC (x.lv), TO_DATE (x.maand, 'yyyymm')) + 1) / (LAST_DAY (TO_DATE (x.maand, 'yyyymm')) - TO_DATE (x.maand, 'yyyymm') + 1)) *
|
||||
DECODE (cpm.srtopp, 'X', -1, 'Y', -1, 'Z', 1, COALESCE (cpm.opp, 0)) *
|
||||
DECODE (cpm.srtopp, 'X', -1, 'Y', 1, 'Z', 1, COALESCE (cpm.opp, 0)) *
|
||||
DECODE (cpm.srtopp,
|
||||
'L', COALESCE (fac.safe_to_number (ltar.alg_onrgoedkenmerk_waarde), 0),
|
||||
'H', COALESCE (fac.safe_to_number (htar.alg_onrgoedkenmerk_waarde), 0),
|
||||
@@ -7655,7 +7655,7 @@ AS
|
||||
1/12, 2)
|
||||
mndnet, -- Netto maandbedrag
|
||||
ROUND (((LEAST (TRUNC (x.lt), LAST_DAY (TO_DATE (x.maand, 'yyyymm'))) - GREATEST (TRUNC (x.lv), TO_DATE (x.maand, 'yyyymm')) + 1) / (LAST_DAY (TO_DATE (x.maand, 'yyyymm')) - TO_DATE (x.maand, 'yyyymm') + 1)) *
|
||||
DECODE (cpm.srtopp, 'X', -1, 'Y', -1, 'Z', 1, COALESCE (cpm.opp, 0)) *
|
||||
DECODE (cpm.srtopp, 'X', -1, 'Y', 1, 'Z', 1, COALESCE (cpm.opp, 0)) *
|
||||
DECODE (cpm.srtopp,
|
||||
'L', COALESCE (fac.safe_to_number (ltar.alg_onrgoedkenmerk_waarde), 0),
|
||||
'H', COALESCE (fac.safe_to_number (htar.alg_onrgoedkenmerk_waarde), 0),
|
||||
@@ -13468,6 +13468,76 @@ AS -- Facturatie huur
|
||||
WHERE n.fac_srtnotificatie_key = 341 -- CUST02-noti
|
||||
AND n.fac_notificatie_refkey = vfk.fin_verkoopfactuurkop_key;
|
||||
|
||||
-- BLCC#64393: Rapportage waarmee Brightlands/Marie-Jose Douven eenvoudig de
|
||||
-- bedragen kan controleren die komende maand worden gefactureerd!
|
||||
CREATE OR REPLACE VIEW blcc_v_rap_fact_check
|
||||
(
|
||||
hide_f_sortering,
|
||||
prs_bedrijf_key,
|
||||
debiteur_naam,
|
||||
debiteur_nr,
|
||||
contractsoort,
|
||||
cnt_contract_key,
|
||||
contractnr,
|
||||
--po_nr, -- Yourref
|
||||
--ourref, -- Ourref
|
||||
--omschrijving, -- Contract scope
|
||||
--sortering,
|
||||
regel,
|
||||
btw,
|
||||
maand,
|
||||
dagbegin,
|
||||
dageinde,
|
||||
crf, -- CCCV=0 en CRF=1
|
||||
factuur,
|
||||
mndnet,
|
||||
mndbtw,
|
||||
totaal
|
||||
)
|
||||
AS
|
||||
SELECT SUBSTR ('00000' || x.debiteur_nr, -6) || SUBSTR ('00000' || x.cnt_contract_nummer_intern, -6) || x.sortering || x.fin_btwtabelwaarde_code,
|
||||
x.prs_bedrijf_key,
|
||||
x.prs_debiteur_naam,
|
||||
x.debiteur_nr,
|
||||
td.ins_discipline_omschrijving,
|
||||
x.cnt_contract_key,
|
||||
x.cnt_contract_nummer_intern || '.' || COALESCE (x.cnt_contract_versie, '0') contractnr,
|
||||
--x.po_nr, -- Yourref
|
||||
--x.ourref, -- Ourref
|
||||
--x.omschrijving, -- Contract scope
|
||||
--x.sortering,
|
||||
x.regel,
|
||||
x.fin_btwtabelwaarde_perc,
|
||||
x.maand,
|
||||
x.dagbegin,
|
||||
x.dageinde,
|
||||
x.crf, -- CCCV=0 en CRF=1
|
||||
x.factuur,
|
||||
SUM (x.mndnet), -- Netto maandbedrag
|
||||
SUM ((x.mndnet / 100) * x.fin_btwtabelwaarde_perc), -- BTW maandbedrag
|
||||
SUM ((x.mndnet / 100) * (x.fin_btwtabelwaarde_perc + 100)) -- Totaal
|
||||
FROM blcc_v_factv2_actual x, cnt_contract c, ins_tab_discipline td
|
||||
WHERE x.cnt_contract_key = c.cnt_contract_key
|
||||
AND c.ins_discipline_key = td.ins_discipline_key
|
||||
GROUP BY SUBSTR ('00000' || x.debiteur_nr, -6) || SUBSTR ('00000' || x.cnt_contract_nummer_intern, -6) || x.sortering || x.fin_btwtabelwaarde_code,
|
||||
x.prs_bedrijf_key,
|
||||
x.prs_debiteur_naam,
|
||||
x.debiteur_nr,
|
||||
td.ins_discipline_omschrijving,
|
||||
x.cnt_contract_key,
|
||||
x.cnt_contract_nummer_intern || '.' || COALESCE (x.cnt_contract_versie, '0'),
|
||||
--x.po_nr, -- Yourref
|
||||
--x.ourref, -- Ourref
|
||||
--x.omschrijving, -- Contract scope
|
||||
--x.sortering,
|
||||
x.regel,
|
||||
x.fin_btwtabelwaarde_perc,
|
||||
x.maand,
|
||||
x.dagbegin,
|
||||
x.dageinde,
|
||||
x.crf, -- CCCV=0 en CRF=1
|
||||
x.factuur;
|
||||
|
||||
CREATE OR REPLACE VIEW blcc_v_rap_fact_controle
|
||||
(
|
||||
fclt_x_stroom,
|
||||
|
||||
Reference in New Issue
Block a user