DBA Data[Home] [Help]

PACKAGE: APPS.RCV_ACCRUALACCOUNTING_GRP

Source


1 PACKAGE RCV_AccrualAccounting_GRP AS
2 /* $Header: RCVGCSTS.pls 120.1 2005/08/19 12:41:23 visrivas noship $ */
3 
4 TYPE number_tbl IS TABLE OF NUMBER
5 INDEX BY BINARY_INTEGER;
6 
7 -- Start of comments
8 --	API name 	: Create_AccountingEvents
9 --	Type		: Group
10 --	Function	: To seed accounting events for receiving transactions,
11 --			  retroactive price adjustments and global procurement.
12 --	Pre-reqs	:
13 --	Parameters	:
14 --	IN		:	p_api_version           IN NUMBER	Required
15 --				p_init_msg_list		IN VARCHAR2 	Optional
16 --					Default = FND_API.G_FALSE
17 --				p_commit	    	IN VARCHAR2	Optional
18 --					Default = FND_API.G_FALSE
19 --				p_validation_level	IN NUMBER	Optional
20 --					Default = FND_API.G_VALID_LEVEL_FULL
21 --
22 --				p_source_type		IN VARCHAR2	Required
23 --				Valid values : "RECEIVING", "RETROPRICE"
24 --
25 --				The following parameters are required for a source type
26 --				of "RECEIVING"
27 --                              p_rcv_transaction_id    IN NUMBER       Optional
28 --                              p_direct_delivery_flag  IN VARCHAR2     Optional
29 --
30 --                              The following parameters are required for a source type
31 --                              of "RETROPRICE"
32 --                              p_po_header_id    	IN NUMBER       Optional
33 --                              p_po_release_id    	IN NUMBER       Optional
34 --                              p_po_line_id    	IN NUMBER       Optional
35 --                              p_po_line_location_id   IN NUMBER       Optional
36 --                		p_old_po_price          IN NUMBER	Optional
37 --                		p_new_po_price          IN NUMBER	Optional
38 --
39 --                              The following parameters have been obsoleted. AP will call
40 --				the Create_InterCompanyEvents to seed IC events.
41 --				p_invoice_distribution_id 	IN 	NUMBER Optional
42 --
43 --	OUT		:	x_return_status		OUT	VARCHAR2(1)
44 --				x_msg_count		OUT	NUMBER
45 --				x_msg_data		OUT	VARCHAR2(2000)
46 --	Version	:
47 --			  Initial version 	1.0
48 --
49 --	Notes		: This API creates all Receiving related accounting events in
50 -- 			  RCV_ACCOUNTING_EVENTS. For online accruals, it also generates
51 --			  the accounting entries for the event.
52 --			  This API is called from :
53 --			  1. The Receiving Transaction Processor for each transaction in
54 --			     RCV_Transactions.
55 --			  2. The PO Approvals Process for retroactive price changes.
56 --			  Depending on the calling process, there are three valid source types:
57 --                              'RECEIVING' when called by Receiving
58 --                              'RETROPRICE' when called by PO for retroactive price changes
59 --
60 -- End of comments
61 -------------------------------------------------------------------------------
62 PROCEDURE Create_AccountingEvents(
63 	        p_api_version          	IN	NUMBER,
64 	        p_init_msg_list        	IN	VARCHAR2 := FND_API.G_FALSE,
65 	        p_commit               	IN	VARCHAR2 := FND_API.G_FALSE,
66 	        p_validation_level     	IN	NUMBER := FND_API.G_VALID_LEVEL_FULL,
67                 x_return_status         OUT NOCOPY      VARCHAR2,
68                 x_msg_count             OUT NOCOPY      NUMBER,
69                 x_msg_data              OUT NOCOPY      VARCHAR2,
70 
71 	        p_source_type       	IN	VARCHAR2, /*RECEIVING, RETROPRICE */
72 
73 	/* The following parameters are only required for source type of Receiving */
74 	        p_rcv_transaction_id 	IN NUMBER DEFAULT NULL,
75 		p_direct_delivery_flag  IN VARCHAR2 DEFAULT NULL,
76 
77 	/* The following parameters are only required for source type of RetroPrice*/
78 	        p_po_header_id		IN	NUMBER DEFAULT NULL,
79 	        p_po_release_id		IN	NUMBER DEFAULT NULL,
80 	        p_po_line_id		IN 	NUMBER DEFAULT NULL,
81 		p_po_line_location_id	IN	NUMBER DEFAULT NULL,
82 	        p_old_po_price    	IN 	NUMBER DEFAULT NULL,
83 	        p_new_po_price         	IN	NUMBER DEFAULT NULL,
84 
85         /* The following parameter has been obsoleted. AP will instead call the
86 	   Create_IntercompanyEvents to seed IC events. */
87 	        p_invoice_distribution_id	IN	NUMBER DEFAULT NULL
88 );
89 -----------------------------------------------------------------------------
90 -- This API is the same as the above except that it takes in an
91 -- additional p_gl_group_id parameter. The API would just call the above
92 -- API and is created in the interim for patching ease. It should be removed
93 -- before R12 release
94 ------------------------------------------------------------------------------
95 PROCEDURE Create_AccountingEvents(
96 	        p_api_version          	IN	NUMBER,
97 	        p_init_msg_list        	IN	VARCHAR2 := FND_API.G_FALSE,
98 	        p_commit               	IN	VARCHAR2 := FND_API.G_FALSE,
99 	        p_validation_level     	IN	NUMBER := FND_API.G_VALID_LEVEL_FULL,
100                 x_return_status         OUT NOCOPY      VARCHAR2,
101                 x_msg_count             OUT NOCOPY      NUMBER,
102                 x_msg_data              OUT NOCOPY      VARCHAR2,
103 
104 	        p_source_type       	IN	VARCHAR2,
105 
106 	        p_rcv_transaction_id 	IN NUMBER DEFAULT NULL,
107 		p_direct_delivery_flag  IN VARCHAR2 DEFAULT NULL,
108 		p_gl_group_id		IN NUMBER ,
109 
110 	        p_po_header_id		IN	NUMBER DEFAULT NULL,
111 	        p_po_release_id		IN	NUMBER DEFAULT NULL,
112 	        p_po_line_id		IN 	NUMBER DEFAULT NULL,
113 		p_po_line_location_id	IN	NUMBER DEFAULT NULL,
114 	        p_old_po_price    	IN 	NUMBER DEFAULT NULL,
115 	        p_new_po_price         	IN	NUMBER DEFAULT NULL,
116 
117 	        p_invoice_distribution_id	IN	NUMBER DEFAULT NULL
118 );
119 
120 -- Start of comments
121 --	API name 	: Create_InterCompanyEvents
122 --	Type		: Group
123 --	Function	: To seed accounting Intercompany events for period end accruals.
124 --			  When Invoice is matched to PO and validated, IC events will be
125 --			  seeded for Global Procurement scenarios.
126 --	Pre-reqs	:
127 --	Parameters	:
128 --	IN		:	p_api_version           IN NUMBER	Required
129 --				p_init_msg_list		IN VARCHAR2 	Optional
130 --					Default = FND_API.G_FALSE
131 --				p_commit	    	IN VARCHAR2	Optional
132 --					Default = FND_API.G_FALSE
133 --				p_validation_level	IN NUMBER	Optional
134 --					Default = FND_API.G_VALID_LEVEL_FULL
135 --
136 --				p_invoice_dist_id_tbl 	IN 	NUMBER_TBL Required
137 --
138 --	OUT		:	x_return_status		OUT	VARCHAR2(1)
139 --				x_msg_count		OUT	NUMBER
140 --				x_msg_data		OUT	VARCHAR2(2000)
141 --	Version	:
142 --			  Initial version 	1.0
143 --
144 --	Notes		: This API seeds Intercompany events for period end accruals.
145 --			  When Invoice is matched to PO and validated, AP will call this
146 --			  this API for period end accruals. If Invoice is for a global
147 --			  procurement scenario, this API will seed Intercompany events in
148 -- 			  RCV_ACCOUNTING_EVENTS. The intercompany invoicing program will
149 --			  later use these events to create intercompany invoices.
150 --
151 --			  This API is called from :
152 --			  1. Accounts Payables during Invoice Validation phase for period
153 --			     end accruals.
154 -- Start of comments
155 PROCEDURE Create_InterCompanyEvents(
156 	        p_api_version          	IN	NUMBER,
157 	        p_init_msg_list        	IN	VARCHAR2 := FND_API.G_FALSE,
158 	        p_commit               	IN	VARCHAR2 := FND_API.G_FALSE,
159 	        p_validation_level     	IN	NUMBER := FND_API.G_VALID_LEVEL_FULL,
160                 x_return_status         OUT NOCOPY      VARCHAR2,
161                 x_msg_count             OUT NOCOPY      NUMBER,
162                 x_msg_data              OUT NOCOPY      VARCHAR2,
163 
164 	        p_invoice_dist_id_tbl	IN	NUMBER_TBL
165 );
166 
167 
168 
169 
170 --	API name 	: Get_InvTransactionInfo
171 --	Type		: Private
172 --	Pre-reqs	:
173 --	Function	: To return the transfer price and distribution account in
174 --			  global procurement and drop shipment scenarios.
175 --	Parameters	:
176 --      IN              :       p_api_version           IN NUMBER       Required
177 --                              p_init_msg_list         IN VARCHAR2     Optional
178 --                                      Default = FND_API.G_FALSE
179 --                              p_commit                IN VARCHAR2     Optional
180 --                                      Default = FND_API.G_FALSE
181 --                              p_validation_level      IN NUMBER       Optional
182 --                                      Default = FND_API.G_VALID_LEVEL_FULL
183 --                              p_rcv_transaction_id    IN NUMBER       Required
184 --
185 --      OUT             :       x_return_status         OUT     VARCHAR2(1)
186 --                              x_msg_count             OUT     NUMBER
187 --                              x_msg_data              OUT     VARCHAR2(2000)
188 --				x_intercompany_pricing_option   OUT	VARCHAR2(1)
189 --				x_currency_code		OUT 	VARCHAR2(15)
190 --				x_currency_conversion_rate OUT  NUMBER
191 --				x_currency_conversion_date OUT  DATE
192 --                              x_currency_conversion_type OUT  VARCHAR2(30)
193 --				x_distribution_acct_id	OUT 	NUMBER
194 --	Version	:
195 --			  Initial version 	1.0
196 --
197 --      Notes           :
198 -- 	This API is called by the receiving transaction processor for Deliver, RTR
199 -- 	and Corrections to Deliver/RTR transactions, to determine if the price to be
200 -- 	stamped on MMTT is the PO price or the transfer price. This API returns a
201 -- 	flag to indicate if transfer price is to be used. If the intercompany_pricing_option
202 --	is set to 2, the transfer price and the corresponding currency code,
203 -- 	currency conversion rate, date and type are returned.
204 -- 	The transfer price is returned in the transaction UOM.
205 -- 	If the returned intercompany_pricing_option is 1, the Receiving transaction
206 -- 	Processor should stamp the PO price as usual.
207 --
208 -- 	This API also returns the distribution account for External Drop Shipments
209 -- 	when the new accounting flag is checked. If the returned distribution account
210 -- 	is -1, the Receiving transaction processor should stamp the MMTT transaction
211 -- 	with the Receiving Inspection account as usual.
212 -- 	Otherwise, it should stamp the returned Clearing Account.
213 --
214 -- End of comments
215 -------------------------------------------------------------------------------
216 PROCEDURE Get_InvTransactionInfo(
217           p_api_version               IN      NUMBER,
218           p_init_msg_list             IN      VARCHAR2 := FND_API.G_FALSE,
219           p_commit                    IN      VARCHAR2 := FND_API.G_FALSE,
220           p_validation_level          IN      VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
221           x_return_status             OUT NOCOPY     VARCHAR2,
222           x_msg_count                 OUT NOCOPY     NUMBER,
223           x_msg_data                  OUT NOCOPY     VARCHAR2,
224 
225           p_rcv_transaction_id        IN      	     NUMBER,
226 
227           x_intercompany_pricing_option       OUT NOCOPY     NUMBER,
228           x_transfer_price	      OUT NOCOPY     NUMBER,
229 	  x_currency_code	      OUT NOCOPY     VARCHAR2,
230 	  x_currency_conversion_rate  OUT NOCOPY     NUMBER,
231 	  x_currency_conversion_date  OUT NOCOPY     DATE,
232 	  x_currency_conversion_type  OUT NOCOPY     VARCHAR2,
233 	  x_distribution_acct_id      OUT NOCOPY     NUMBER
234 );
235 
236 
237 END RCV_AccrualAccounting_GRP;