STPH#37556: Kan de ongewenste factuurafronding op centen eruit worden gehaald?

svn path=/Customer/trunk/; revision=33046
This commit is contained in:
Marcel Bourseau
2017-03-06 10:24:13 +00:00
parent 66fee7f975
commit 05c3c8921c

View File

@@ -1739,8 +1739,8 @@ AS
f.fin_factuur_totaal_btw,
CASE
WHEN ROUND(f.fin_factuur_totaal + f.fin_factuur_totaal_btw,2) > 0
THEN LPAD(TO_CHAR(100 * ROUND(f.fin_factuur_totaal + f.fin_factuur_totaal_btw,2)), 10, '0') || '-'
ELSE LPAD(TO_CHAR(100 * ROUND(ABS(f.fin_factuur_totaal + f.fin_factuur_totaal_btw),2)), 10, '0') || '+'
THEN LPAD(TO_CHAR(10000 * ROUND(f.fin_factuur_totaal + f.fin_factuur_totaal_btw,4)), 12, '0') || '-'
ELSE LPAD(TO_CHAR(10000 * ROUND(ABS(f.fin_factuur_totaal + f.fin_factuur_totaal_btw),4)), 12, '0') || '+'
END fin_factuur_totaal_dbs,
COALESCE (b_c.prs_bedrijf_key, b_o.prs_bedrijf_key) prs_bedrijf_key,
COALESCE (b_c.prs_leverancier_nr, b_o.prs_leverancier_nr) prs_leverancier_nr,
@@ -1748,8 +1748,8 @@ AS
fr.fin_factuurregel_btw,
CASE
WHEN ROUND(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw,2) > 0
THEN LPAD(TO_CHAR(100 * ROUND(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw,2)), 10, '0') || LPAD('0',10,'0')
ELSE LPAD('0',10,'0') || LPAD(TO_CHAR(100 * ROUND(ABS(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw),2)), 10, '0')
THEN LPAD(TO_CHAR(10000 * ROUND(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw,4)), 12, '0') || LPAD('0',12,'0')
ELSE LPAD('0',12,'0') || LPAD(TO_CHAR(10000 * ROUND(ABS(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw),4)), 12, '0')
END fin_factuurregel_totaal_dbs,
btw.fin_btwtabelwaarde_perc,
btw.fin_btwtabelwaarde_code,
@@ -1828,8 +1828,8 @@ AS
f.fin_factuur_totaal_btw,
CASE
WHEN ROUND(f.fin_factuur_totaal + f.fin_factuur_totaal_btw,2) > 0
THEN LPAD(TO_CHAR(100 * ROUND(f.fin_factuur_totaal + f.fin_factuur_totaal_btw,2)), 10, '0') || '-'
ELSE LPAD(TO_CHAR(100 * ROUND(ABS(f.fin_factuur_totaal + f.fin_factuur_totaal_btw),2)), 10, '0') || '+'
THEN LPAD(TO_CHAR(10000 * ROUND(f.fin_factuur_totaal + f.fin_factuur_totaal_btw,4)), 12, '0') || '-'
ELSE LPAD(TO_CHAR(10000 * ROUND(ABS(f.fin_factuur_totaal + f.fin_factuur_totaal_btw),4)), 12, '0') || '+'
END fin_factuur_totaal_dbs,
b.prs_bedrijf_key,
b.prs_leverancier_nr,
@@ -1837,8 +1837,8 @@ AS
fr.fin_factuurregel_btw,
CASE
WHEN ROUND(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw,2) > 0
THEN LPAD(TO_CHAR(100 * ROUND(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw,2)), 10, '0') || LPAD('0',10,'0')
ELSE LPAD('0',10,'0') || LPAD(TO_CHAR(100 * ROUND(ABS(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw),2)), 10, '0')
THEN LPAD(TO_CHAR(10000 * ROUND(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw,4)), 12, '0') || LPAD('0',12,'0')
ELSE LPAD('0',12,'0') || LPAD(TO_CHAR(10000 * ROUND(ABS(fr.fin_factuurregel_totaal + fr.fin_factuurregel_btw),4)), 12, '0')
END fin_factuurregel_totaal_dbs,
btw.fin_btwtabelwaarde_perc,
btw.fin_btwtabelwaarde_code,
@@ -1939,8 +1939,8 @@ SELECT SUBSTR(MAX(fin_factuur_boekmaand),1,4) || LPAD(MAX(fin_factuur_key), 5,
LPAD('0',5,'0') ||
LPAD('0',4,'0') ||
MAX(fin_factuur_totaal_dbs) ||
LPAD('0',10,'0') ||
LPAD('0',10,'0')
LPAD('0',12,'0') ||
LPAD('0',12,'0')
, SUBSTR(MAX(fin_factuur_boekmaand),1,4) || LPAD(MAX(fin_factuur_key), 5, '0') || LPAD('0',5,'0')
FROM stph_v_factuur_geg_akkoord fg
GROUP by fin_factuur_key
@@ -1954,7 +1954,7 @@ SELECT SUBSTR(fin_factuur_boekmaand,1,4) || LPAD(fin_factuur_key, 5, '0') ||
LPAD(COALESCE(fin_factuurregel_omschrijving, ' '),30,' ') ||
LPAD(prs_kostensoort_oms,5,'0') ||
LPAD(prs_kostenplaats_nr,4,'0') ||
LPAD('0',10,'0') || '0' ||
LPAD('0',12,'0') || '0' ||
fin_factuurregel_totaal_dbs
, SUBSTR(fin_factuur_boekmaand,1,4) || LPAD(fin_factuur_key, 5, '0') || LPAD(fin_factuurregel_nr,5,'0')
FROM stph_v_factuur_geg_akkoord fg;