FA Cost Summary - draft

Description
Categories: BI Publisher
Application: Assets
Source: Cost Summary Report (XML) - Not Supported: Reserved For Future Use
Short Name: FASCOSTS_XML
DB package: FA_FASCOSTS_XMLP_PKG
SELECT
	&ACCT_FLEX_BAL_SEG					COMP_CODE,
	NVL(&ACCT_FLEX_ACCT_SEG, BAL.Category_Books_Account)	ACCOUNT,
	BAL.Category_Books_Account	Category_Books_Account,
	&ACCT_FLEX_COST_SEG					COST_CTR,
	NVL(SUM (DECODE (BAL.Source_Type_Code, 
		'BEGIN', NVL(BAL.Amount,0), NULL)), 0)			BEGIN,
	SUM (DECODE (BAL.Source_Type_Code,  DECODE(:P_REPORT_TYPE, 'COST', 'ADDITION', 
		'CIP ADDITION'), NVL(BAL.Amount,0), NULL)) 			ADDITION,
	SUM (DECODE (BAL.Source_Type_Code,  DECODE(:P_REPORT_TYPE, 'CIP COST', 'ADDITION'),
		-NVL(BAL.Amount,0), NULL)) 				CAPITALIZATION,
	SUM (DECODE (BAL.Source_Type_Code, DECODE(:P_REPORT_TYPE, 'COST', 'ADJUSTMENT',
		'CIP ADJUSTMENT'), NVL(BAL.Amount,0), NULL)) 		ADJUSTMENT,
	SUM (DECODE (BAL.Source_Type_Code, 
		'RECLASS', NVL(BAL.Amount,0), NULL)) 			RECLASS,
	SUM (DECODE (BAL.Source_Type_Code, DECODE(:P_REPORT_TYPE, 'COST', 'RETIREMENT',
		'CIP RETIREMENT'), -NVL(BAL.Amount,0), NULL))		RETIREMENT,
	SUM (DECODE (BAL.Source_Type_Code, 
		'REVALUATION', NVL(BAL.Amount,0), NULL)) 			REVALUATION,
	SUM (DECODE (BAL.Source_Type_Code, 
		'TRANSFER', NVL(BAL.Amount,0), NULL)) 			TRANSFER,
	NVL(SUM (DECODE (BAL.Source_Type_Code, 
		'END', NVL(BAL.Amount,0), NULL)), 0)				END, 
	fnd_flex_xml_publisher_apis.process_kff_combination_1('d_comp_code', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE') d_comp_code, 
	FA_FASCOSTS_XMLP_PKG.bal_out_of_balanceformula(:BAL_BEGIN, :BAL_ADD, :BAL_REVAL, :BAL_RECLASS, :BAL_RETIRE, :BAL_ADJUST, :BAL_TRANS, :BAL_CAPITAL, :BAL_END) BAL_OUT_OF_BALANCE,
	--fnd_flex_xml_publisher_apis.process_kff_combination_1('d_account', 'SQLGL', 'GL#', ajcc.CHART_OF_ACCOUNTS_ID, NULL, ajcc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE') d_account, 
	NVL(fnd_flex_xml_publisher_apis.process_kff_combination_1('d_account', 'SQLGL', 'GL#', ajcc.CHART_OF_ACCOUNTS_ID, NULL, ajcc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE'), BAL.Category_Books_Account) d_account1, 
	FA_FASCOSTS_XMLP_PKG.acct_out_of_balanceformula(:ACCT_BEGIN, :ACCT_ADD, :ACCT_REVAL, :ACCT_RECLASS, :ACCT_RETIRE, :ACCT_ADJUST, :ACCT_TRANS, :ACCT_CAPITAL, :ACCT_END) ACCT_OUT_OF_BALANCE, 
	fnd_flex_xml_publisher_apis.process_kff_combination_1('d_cost_ctr', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE') d_cost_ctr, 
	FA_FASCOSTS_XMLP_PKG.caprevalformula(SUM ( DECODE ( BAL.Source_Type_Code , 'REVALUATION' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , DECODE ( :P_REPORT_TYPE , 'CIP COST' , 'ADDITION' ) , - NVL ( BAL.Amount , 0 ) , NULL ) )) CAPREVAL, 
	FA_FASCOSTS_XMLP_PKG.out_of_balanceformula(NVL ( SUM ( DECODE ( BAL.Source_Type_Code , 'BEGIN' , NVL ( BAL.Amount , 0 ) , NULL ) ) , 0 ), SUM ( DECODE ( BAL.Source_Type_Code , DECODE ( :P_REPORT_TYPE , 'COST' , 'ADDITION' , 'CIP ADDITION' ) , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'REVALUATION' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'RECLASS' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , DECODE ( :P_REPORT_TYPE , 'COST' , 'RETIREMENT' , 'CIP RETIREMENT' ) , - NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , DECODE ( :P_REPORT_TYPE , 'COST' , 'ADJUSTMENT' , 'CIP ADJUSTMENT' ) , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'TRANSFER' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , DECODE ( :P_REPORT_TYPE , 'CIP COST' , 'ADDITION' ) , - NVL ( BAL.Amount , 0 ) , NULL ) ), NVL ( SUM ( DECODE ( BAL.Source_Type_Code , 'END' , NVL ( BAL.Amount , 0 ) , NULL ) ) , 0 )) OUT_OF_BALANCE
FROM
	FA_BALANCES_REPORT_GT BAL,
	GL_CODE_COMBINATIONS DHCC,
	GL_CODE_COMBINATIONS AJCC
WHERE
	DHCC.Code_Combination_ID	= BAL.Distribution_CCID
AND
	AJCC.Code_Combination_ID (+) = BAL.Adjustment_CCID
AND
	:DO_INSERT = 1
GROUP BY
	&ACCT_FLEX_BAL_SEG,
	NVL(&ACCT_FLEX_ACCT_SEG, BAL.Category_Books_Account),
	&ACCT_FLEX_COST_SEG,
	--added
	NVL(fnd_flex_xml_publisher_apis.process_kff_combination_1('d_account', 'SQLGL', 'GL#', ajcc.CHART_OF_ACCOUNTS_ID, NULL, ajcc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE'), BAL.Category_Books_Account),
	fnd_flex_xml_publisher_apis.process_kff_combination_1('d_comp_code', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE'),fnd_flex_xml_publisher_apis.process_kff_combination_1('d_cost_ctr', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE'), BAL.Category_Books_Account
/*ORDER BY
D_COMP_CODE,d_account,D_COST_CTR,BEGIN,ADDITION,RECLASS,CAPITALIZATION,RETIREMENT,
REVALUATION,ADJUSTMENT,TRANSFER,END
--	1, 2, 3*/
ORDER by 1,2,fnd_flex_xml_publisher_apis.process_kff_combination_1('d_cost_ctr', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE'),4,5,6
Parameter NameSQL textValidation
Report Type
 
To Period
 
LOV Oracle
From Period
 
LOV Oracle
Set of Books Currency
 
LOV Oracle
Book
 
LOV Oracle