DBA Data[Home] [Help]

PACKAGE BODY: APPS.ARP_ARXCUDCI_PKG

Source


1 PACKAGE BODY arp_arxcudci_pkg AS
2 /* $Header: AROSTDB.pls 120.2 2005/08/01 12:18:21 mantani ship $ */
3 --
4 -- PROCEDURE
5 --     initialize
6 --
7 -- DESCRIPTION
8 --		This procedure returns all the defaults ans system options the form
9 --		requires.
10 -- SCOPE -
11 --
12 -- EXETERNAL PROCEDURES/FUNCTIONS ACCESSED
13 --
14 -- ARGUMENTS  : IN:
15 --
16 --              OUT:
17 --                    None
18 --
19 -- RETURNS    : NONE
20 --
21 -- NOTES
22 --
23 -- MODIFICATION HISTORY - Created by Kevin Hudson
24 --
25 --	Sisir 	07-JUL-02	:Bug:2420993,Handled exception for set_of_books.
26 --
27 procedure initialize ( 	customer_type 		in out nocopy varchar2,
28 			tax_printing_option 	in out nocopy varchar2,
29 			grouping_rule		in out nocopy varchar2,
30 			create_reciprocal	in out nocopy varchar2,
31 			auto_cust_numbering 	in out nocopy varchar2,
32 			auto_site_numbering 	in out nocopy varchar2,
33 			profile_class 		in out nocopy varchar2,
34 			change_cust_name 	in out nocopy varchar2,
35 			use_customer_keys_flag 	in out nocopy varchar2,
36 			so_organization_id 	in out nocopy number,
37 			address_validation 	in out nocopy varchar2,
38 			location_structure_id 	in out nocopy number,
39 			from_postal_code 	in out nocopy varchar2,
40 			to_postal_code 		in out nocopy varchar2,
41 			home_country_code 	in out nocopy varchar2,
42 			default_country_code 	in out nocopy varchar2,
43 			default_country_disp 	in out nocopy varchar2,
44 			address_style		in out nocopy varchar2,
45 			functional_currency	in out nocopy varchar2
46 	   	     ) is
47 
48 begin
49 	customer_type := arp_standard.ar_lookup('CUSTOMER_TYPE','R');
50 
51 	tax_printing_option := arp_standard.sysparm.tax_invoice_print;
52 
53         begin
54 	  select gr.name
55 	  into    grouping_rule
56 	  from    ra_grouping_rules gr
57 	  where   gr.grouping_rule_id = arp_standard.sysparm.default_grouping_rule_id
58 	  and     trunc(sysdate) BETWEEN gr.start_date AND nvl(gr.end_date, trunc(sysdate));
59           exception
60             when NO_DATA_FOUND then
61             null;
62         end;
63 
64 	--l_sob_id	  := arp_standard.sysparm.set_of_books_id;
65 	--
66 	--
67 	---Bug:2420993,Handled the following exception.
68 	--
69 	begin
70 	  SELECT 	currency_code
71 	  INTO	functional_currency
72 	  FROM	gl_sets_of_books
73 	  WHERE	set_of_books_id = arp_standard.sysparm.set_of_books_id;
74 	exception
75 	  when NO_DATA_FOUND then
76             arp_standard.fnd_message( 'ARTA_SET_OF_BOOKS_ID_NOT_FOUND' );
77         end;
78 
79 	--
80 	create_reciprocal := arp_standard.sysparm.create_reciprocal_flag;
81 	auto_cust_numbering := arp_standard.sysparm.generate_customer_number;
82 	auto_site_numbering := arp_standard.sysparm.auto_site_numbering;
83 	address_validation :=  arp_standard.sysparm.address_validation;
84 	location_structure_id := arp_standard.sysparm.location_structure_id;
85 	from_postal_code := arp_standard.sysparm.from_postal_code;
86 	to_postal_code := arp_standard.sysparm.to_postal_code;
87 	home_country_code := arp_standard.sysparm.default_country;
88 	fnd_profile.get('DEFAULT_COUNTRY',default_country_code);
89 	--
90 	if  ( default_country_code is null ) then
91 		default_country_code := home_country_code;
92 	end if;
93 	--
94 	-- To avoid exception NO_DATA_FOUND "if" clause is used
95         --
96         if default_country_code is not null then
97 	  select territory_short_name,address_style
98 	  into 	 default_country_disp,address_style
99 	  from 	 fnd_territories_vl
100 	  where  territory_code = default_country_code;
101         end if;
102 	--
103 	--
104 	fnd_profile.get('AR_CHANGE_CUST_NAME',change_cust_name);
105 	fnd_profile.get('AS_USE_CUSTOMER_KEYS_FLAG',use_customer_keys_flag);
106 
107         -- OE/OM Change
108         --
109 	-- fnd_profile.get('SO_ORGANIZATION_ID',so_organization_id);
110         --
111 	oe_profile.get('SO_ORGANIZATION_ID',so_organization_id);
112 
113         /*4512781 ar_customer_profile_classes to hz_cust_profile_classes*/
114         begin
115 	  select 	cpc.name
116   	  into 	profile_class
117   	  from 	HZ_CUST_PROFILE_CLASSES cpc
118  	  WHERE cpc.status 		      = 'A'
119    	  AND 	cpc.profile_class_id = 0;
120           exception
121             when NO_DATA_FOUND then
122             null;
123         end;
124 
125 end initialize;
126 
127 end arp_arxcudci_pkg;