select decode(sum(iperc1), 0, '',rpad(max(iname1), 32, ' ')|| to_char(round(sum(iperc1) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc2), 0, '',chr(13)||chr(10)||rpad(max(iname2), 32, ' ')|| to_char(round(sum(iperc2) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc3), 0, '',chr(13)||chr(10)||rpad(max(iname3), 32, ' ')|| to_char(round(sum(iperc3) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc4), 0, '',chr(13)||chr(10)||rpad(max(iname4), 32, ' ')|| to_char(round(sum(iperc4) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc5), 0, '',chr(13)||chr(10)||rpad(max(iname5), 32, ' ')|| to_char(round(sum(iperc5) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc6), 0, '',chr(13)||chr(10)||rpad(max(iname6), 32, ' ')|| to_char(round(sum(iperc6) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc7), 0, '',chr(13)||chr(10)||rpad(max(iname7), 32, ' ')|| to_char(round(sum(iperc7) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc8), 0, '',chr(13)||chr(10)||rpad(max(iname8), 32, ' ')|| to_char(round(sum(iperc8) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc9), 0, '',chr(13)||chr(10)||rpad(max(iname9), 32, ' ')|| to_char(round(sum(iperc9) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc0), 0, '',chr(13)||chr(10)||rpad(max(iname0), 32, ' ')|| to_char(round(sum(iperc0) * tax_paid,2), '$999,999,990.00'))
from (select decode(rownum, 1, iname, '') iname1, decode(rownum, 1, iperc, 0.00) iperc1,
decode(rownum, 2, iname, '') iname2, decode(rownum, 2, iperc, 0.00) iperc2,
decode(rownum, 3, iname, '') iname3, decode(rownum, 3, iperc, 0.00) iperc3,
decode(rownum, 4, iname, '') iname4, decode(rownum, 4, iperc, 0.00) iperc4,
decode(rownum, 5, iname, '') iname5, decode(rownum, 5, iperc, 0.00) iperc5,
decode(rownum, 6, iname, '') iname6, decode(rownum, 6, iperc, 0.00) iperc6,
decode(rownum, 7, iname, '') iname7, decode(rownum, 7, iperc, 0.00) iperc7,
decode(rownum, 8, iname, '') iname8, decode(rownum, 8, iperc, 0.00) iperc8,
decode(rownum, 9, iname, '') iname9, decode(rownum, 9, iperc, 0.00) iperc9,
decode(rownum,10, iname, '') iname0, decode(rownum,10, iperc, 0.00) iperc0
from ( select nvl(bed.descr, rtrim(aet.name)) iname,
sum(nvl(acp.percentage, 0.00)) iperc
from tax.app_code_percentages acp,
tax.app_tax_district_code atd,
tax.app_entity_types aet,
tax.billing_entity_descr bed,
tax.taxes t,
tax.accounts a
where aet.recno(+) = acp.entity_receiving
and bed.entity(+) = rtrim(aet.name)
and acp.coderecno(+) = atd.recno
and atd.year(+) = t.tax_year
and atd.code(+) = t.tax_dist
and t.tax_type = a.tax_type
and t.tax_year = a.tax_year
and t.tax_dist = decode(:v_tax_class, 'A', a.tax_dist, 'F', a.fire_dist, 'x')
and a.acct_id = :v_acct_id
group by nvl(bed.descr, rtrim(aet.name))
order by 1 asc)) list,
(select tax.acct_info.tax_payments(:v_acct_id, :v_tax_class) - tax.acct_info.tax_refunds(:v_acct_id, :v_tax_class) tax_paid
from dual);
I get to join in from work!
chuck
decode(sum(iperc2), 0, '',chr(13)||chr(10)||rpad(max(iname2), 32, ' ')|| to_char(round(sum(iperc2) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc3), 0, '',chr(13)||chr(10)||rpad(max(iname3), 32, ' ')|| to_char(round(sum(iperc3) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc4), 0, '',chr(13)||chr(10)||rpad(max(iname4), 32, ' ')|| to_char(round(sum(iperc4) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc5), 0, '',chr(13)||chr(10)||rpad(max(iname5), 32, ' ')|| to_char(round(sum(iperc5) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc6), 0, '',chr(13)||chr(10)||rpad(max(iname6), 32, ' ')|| to_char(round(sum(iperc6) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc7), 0, '',chr(13)||chr(10)||rpad(max(iname7), 32, ' ')|| to_char(round(sum(iperc7) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc8), 0, '',chr(13)||chr(10)||rpad(max(iname8), 32, ' ')|| to_char(round(sum(iperc8) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc9), 0, '',chr(13)||chr(10)||rpad(max(iname9), 32, ' ')|| to_char(round(sum(iperc9) * tax_paid,2), '$999,999,990.00'))||
decode(sum(iperc0), 0, '',chr(13)||chr(10)||rpad(max(iname0), 32, ' ')|| to_char(round(sum(iperc0) * tax_paid,2), '$999,999,990.00'))
from (select decode(rownum, 1, iname, '') iname1, decode(rownum, 1, iperc, 0.00) iperc1,
decode(rownum, 2, iname, '') iname2, decode(rownum, 2, iperc, 0.00) iperc2,
decode(rownum, 3, iname, '') iname3, decode(rownum, 3, iperc, 0.00) iperc3,
decode(rownum, 4, iname, '') iname4, decode(rownum, 4, iperc, 0.00) iperc4,
decode(rownum, 5, iname, '') iname5, decode(rownum, 5, iperc, 0.00) iperc5,
decode(rownum, 6, iname, '') iname6, decode(rownum, 6, iperc, 0.00) iperc6,
decode(rownum, 7, iname, '') iname7, decode(rownum, 7, iperc, 0.00) iperc7,
decode(rownum, 8, iname, '') iname8, decode(rownum, 8, iperc, 0.00) iperc8,
decode(rownum, 9, iname, '') iname9, decode(rownum, 9, iperc, 0.00) iperc9,
decode(rownum,10, iname, '') iname0, decode(rownum,10, iperc, 0.00) iperc0
from ( select nvl(bed.descr, rtrim(aet.name)) iname,
sum(nvl(acp.percentage, 0.00)) iperc
from tax.app_code_percentages acp,
tax.app_tax_district_code atd,
tax.app_entity_types aet,
tax.billing_entity_descr bed,
tax.taxes t,
tax.accounts a
where aet.recno(+) = acp.entity_receiving
and bed.entity(+) = rtrim(aet.name)
and acp.coderecno(+) = atd.recno
and atd.year(+) = t.tax_year
and atd.code(+) = t.tax_dist
and t.tax_type = a.tax_type
and t.tax_year = a.tax_year
and t.tax_dist = decode(:v_tax_class, 'A', a.tax_dist, 'F', a.fire_dist, 'x')
and a.acct_id = :v_acct_id
group by nvl(bed.descr, rtrim(aet.name))
order by 1 asc)) list,
(select tax.acct_info.tax_payments(:v_acct_id, :v_tax_class) - tax.acct_info.tax_refunds(:v_acct_id, :v_tax_class) tax_paid
from dual);
I get to join in from work!
chuck
Comment