select null TO_FLEXDATA,
decode(cc.summary_flag, 'Y', '*', '') SUMMARY,
null FROM_FLEXDATA,
(nvl(ca.entered_dr,0) - nvl(ca.entered_cr,0)) ACCOUNT_BAL,
ca.request_id REQUEST_ID,
--fnd_flex_xml_publisher_apis.process_kff_combination_1('to_flexfield', 'SQLGL', 'GL#', CA.CHART_OF_ACCOUNTS_ID, NULL, CA.CODE_COMBINATION_ID, 'ALL', 'Y', 'VALUE') TO_FLEXFIELD,
--fnd_flex_xml_publisher_apis.process_kff_combination_1('to_flexfield_pad', 'SQLGL', 'GL#', CA.CHART_OF_ACCOUNTS_ID, NULL, CA.CODE_COMBINATION_ID, 'ALL', 'Y', 'PADDED_VALUE') TO_FLEXFIELD_PAD,
fnd_flex_xml_publisher_apis.process_kff_combination_1('from_flexfield', 'SQLGL', 'GL#', CC.CHART_OF_ACCOUNTS_ID, NULL, CC.CODE_COMBINATION_ID, 'ALL', 'Y', 'VALUE') FROM_FLEXFIELD
from gl_code_combinations cc,
gl_consolidation_audit ca
where ca.consolidation_id = :P_CONSOLIDATION_ID
and &WHERE_BALANCE
and ca.to_period_name = :P_PERIOD_NAME
and ca.average_consolidation_flag = decode(:P_USAGE,'A','Y','N')
and cc.code_combination_id = ca.from_code_combination_id
and &WHERE_DR_CR_NOT_ZERO
ORDER BY 2 ASC , &ORDERBY_TO_FLEX , &ORDERBY_FROM_FLEX, ca.request_id , 4 |