FA Depreciation Projection - draft

Description
Categories: BI Publisher
Application: Assets
Source: Depreciation Projection Report (XML) - Not Supported: Reserved For Future Use
Short Name: FASPRJ_XML
DB package: FA_FASPRJ_XMLP_PKG
SELECT	--&ACCT_FLEX_BAL_SEG	comp_code,
		 fnd_flex_xml_publisher_apis.process_kff_combination_1('comp_code_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE') COMP_CODE_DSP1,
	--&ACCT_FLEX_ACCT_SEG	acct,
	fnd_flex_xml_publisher_apis.process_kff_combination_1('acct_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE') acct_DSP1,
	/*decode (:P_Display_CostCtr,
		'YES', &ACCT_FLEX_COST_SEG, null)	cost_center,*/
	decode (:P_Display_CostCtr,
		'YES', fnd_flex_xml_publisher_apis.process_kff_combination_1('cost_center_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE'), null)	COST_CENTER_DSP1,		
	decode (:P_Display_Asset_Number, 'YES', ad.asset_number, 0) Asset_Number,
	pi.period_name,
	pi.fiscal_year,
	sum (decode (pi.book_type_code,
		:P_BOOK1, depreciation, null))	depr1,
	sum (decode (pi.book_type_code,
		:P_BOOK2, depreciation, null))	depr2,
	sum (decode (pi.book_type_code,
		:P_BOOK3, depreciation, null))	depr3,
	sum (decode (pi.book_type_code,
		:P_BOOK4, depreciation, null))	depr4
FROM	fa_system_controls,
	&RP_PROJ_INTERIM_TABLE_noquotes	pi,
	fa_additions		ad,
	gl_code_combinations	cc
WHERE	pi.code_combination_id	= cc.code_combination_id
AND	pi.asset_id		= ad.asset_id
GROUP BY
	/*&ACCT_FLEX_BAL_SEG,
	&ACCT_FLEX_ACCT_SEG,
	decode (:P_Display_CostCtr,
		'YES', &ACCT_FLEX_COST_SEG, null),*/
    fnd_flex_xml_publisher_apis.process_kff_combination_1('comp_code_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE'),
	fnd_flex_xml_publisher_apis.process_kff_combination_1('acct_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE'),
	decode (:P_Display_CostCtr,'YES', fnd_flex_xml_publisher_apis.process_kff_combination_1('cost_center_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE'), null),
	decode (:P_Display_Asset_Number, 'YES', ad.asset_number, 0),
 	pi.fiscal_year,
        pi.period_index,
	pi.period_name
ORDER BY
	/*&ACCT_FLEX_BAL_SEG,
	&ACCT_FLEX_ACCT_SEG,
	decode (:P_Display_CostCtr,
		'YES', &ACCT_FLEX_COST_SEG, null),*/
	fnd_flex_xml_publisher_apis.process_kff_combination_1('comp_code_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE'),
	fnd_flex_xml_publisher_apis.process_kff_combination_1('acct_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE'),
	decode (:P_Display_CostCtr,'YES', fnd_flex_xml_publisher_apis.process_kff_combination_1('cost_center_dsp', 'SQLGL', 'GL#', cc.CHART_OF_ACCOUNTS_ID, NULL, cc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE'), null) ,
	decode (:P_Display_Asset_Number, 'YES', ad.asset_number, 0),
 	pi.fiscal_year,
        pi.period_index,
	pi.period_name