DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_FAS410_XMLP_PKG

Source


1 PACKAGE BODY FA_FAS410_XMLP_PKG AS
2 /* $Header: FAS410B.pls 120.1 2009/07/19 12:42:18 glchen ship $ */
3 function BookFormula return VARCHAR2 is
4 begin
5 DECLARE
6   l_book       VARCHAR2(15);
7   l_book_class VARCHAR2(15);
8   l_accounting_flex_structure NUMBER(15);
9   l_currency_code VARCHAR2(15);
10   l_distribution_source_book VARCHAR2(15);
11   l_precision NUMBER(15);
12 BEGIN
13   SELECT bc.book_type_code,
14          bc.book_class,
15          bc.accounting_flex_structure,
16          bc.distribution_source_book,
17          sob.currency_code,
18          cur.precision
19   INTO   l_book,
20          l_book_class,
21          l_accounting_flex_Structure,
22          l_distribution_source_book,
23          l_currency_code,
24          l_precision
25   FROM   FA_BOOK_CONTROLS bc,
26          GL_SETS_OF_BOOKS sob,
27          FND_CURRENCIES cur
28   WHERE  bc.book_type_code = P_BOOK
29   AND    sob.set_of_books_id = bc.set_of_books_id
30   AND    sob.currency_code   = cur.currency_code;
31   Book_Class := l_book_class;
32   Accounting_Flex_Structure:=l_accounting_flex_structure;
33   Distribution_SOurce_Book :=l_distribution_source_book;
34   Currency_Code := l_currency_code;
35   return(l_book);
36 END;
37 RETURN NULL; end;
38 function Report_NameFormula return VARCHAR2 is
39 begin
40 DECLARE
41   l_report_name VARCHAR2(80);
42   l_conc_program_id NUMBER;
43 BEGIN
44 --Added during DT Fix
45 P_CONC_REQUEST_ID := fnd_global.CONC_REQUEST_ID;
46 --End of DT Fix
47   SELECT cr.concurrent_program_id
48   INTO l_conc_program_id
49   FROM FND_CONCURRENT_REQUESTS cr
50   WHERE cr.program_application_id = 140
51   AND   cr.request_id = P_CONC_REQUEST_ID;
52   SELECT cp.user_concurrent_program_name
53   INTO   l_report_name
54   FROM    FND_CONCURRENT_PROGRAMS_VL cp
55   WHERE
56       cp.concurrent_program_id= l_conc_program_id
57   and cp.application_id = 140;
58   l_report_name := substr(l_report_name,1,instr(l_report_name,' (XML)'));
59   RETURN(l_report_name);
60 EXCEPTION
61   WHEN OTHERS THEN
62     RETURN(':Asset Inventory Report:');
63 END;
64 RETURN NULL; end;
65 function BeforeReport return boolean is
66 begin
67 /*SRW.USER_EXIT('FND SRWINIT');*/null;
68   return (TRUE);
69 end;
70 function AfterReport return boolean is
71 begin
72 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
73   return (TRUE);
74 end;
75 function cur_periodformula(Book in varchar2) return varchar2 is
76 begin
77 DECLARE
78   l_period_name VARCHAR2(15);
79   l_period_PC   NUMBER(15);
80   l_flag 	NUMBER(15); BEGIN
81   l_flag := 0;
82   SELECT period_name,
83          period_counter
84   INTO   l_period_name,
85          l_period_PC
86   FROM   FA_DEPRN_PERIODS
87   WHERE  book_type_code = Book
88   AND    period_close_date IS NULL;
89  select count(*) into l_flag from fa_deprn_summary
90 		 where book_type_code = Book and
91 		 period_counter = l_period_PC;
92 if l_flag = 0 then
93   Cur_Period_PC := l_period_PC;
94 else
95   Cur_Period_PC := l_period_PC + 1;
96 end if;
97   RETURN(l_period_name);
98 EXCEPTION when no_data_found then null;  END;
99 RETURN NULL; end;
100 function as_nbvformula(as_cost in number, as_reserve in number) return number is
101 begin
102 return(as_cost - as_reserve);
103 end;
104 --Functions to refer Oracle report placeholders--
105  Function Accounting_Flex_Structure_p return number is
106 	Begin
107 	 return Accounting_Flex_Structure;
108 	 END;
109  Function Currency_Code_p return varchar2 is
110 	Begin
111 	 return Currency_Code;
112 	 END;
113  Function Book_Class_p return varchar2 is
114 	Begin
115 	 return Book_Class;
116 	 END;
117  Function Distribution_Source_Book_p return varchar2 is
118 	Begin
119 	 return Distribution_Source_Book;
120 	 END;
121  Function Cur_Period_PC_p return number is
122 	Begin
123 	 return Cur_Period_PC;
124 	 END;
125 END FA_FAS410_XMLP_PKG ;
126