DBA Data[Home] [Help]

PACKAGE: APPS.PON_NEGOTIATION_COPY_GRP

Source


1 PACKAGE  PON_NEGOTIATION_COPY_GRP AS
2 --$Header: PONGCPYS.pls 120.1 2005/06/03 06:37:59 appldev  $
3 
4 
5 --
6 -- Different Copy types
7 --
8 
9 -- Copy type for New round Creation
10 g_new_rnd_copy       VARCHAR2(15) := 'NEW_ROUND';
11 
12 -- Copy type for Active and Published Negotiation
13 g_active_neg_copy    VARCHAR2(15) := 'COPY_ACTIVE';
14 
15 -- Copy type for Draft Negotiaiton Copy
16 g_draft_neg_copy     VARCHAR2(15) := 'COPY_DRAFT';
17 
18 -- Copy type for Amendment Creation
19 g_amend_copy         VARCHAR2(15) := 'AMENDMENT';
20 
21 -- Copy type for RFI to Auction/RFQ Creation
22 g_rfi_to_other_copy  VARCHAR2(15) := 'COPY_TO_DOC';
23 
24 
25 
26 
27 -- Start of comments
28 --      API name  : COPY_NEGOTIATION
29 --
30 --      Type      : Group
31 --
32 --      Pre-reqs  : Negotiation with the given auction_header_id
33 --                        (p_source_auction_header_id) must exists in the database
34 --
35 --      Function  : Creates a negotiation from copying the negotiation
36 --                        with given auction_header_id (p_source_auction_header_id)
37 --
38 --     Parameters:
39 --     IN   :      p_api_version       NUMBER   Required
40 --     IN   :      p_init_msg_list     VARCHAR2   DEFAULT   FND_API.G_TRUE Optional
41 --     IN   :      p_is_conc_call            VARCHAR2   Required This indicates if the
42 --                                      procedure is called online or via a concurrent program
43 --     IN   :      p_source_auction_header_id  NUMBER Required, auction_header_id
44 --                                                      of the source negotiation
45 --     IN   :      p_trading_partner_id    NUMBER Required,  trading_partner_id of user
46 --                                                      for which the reultant negotiation will be created
47 --     IN   :      p_trading_partner_contact_id     NUMBER Required,
48 --                                                      trading_partner_contact_id of user for which the
49 --                                                      reultant negotiation will be created
50 --     IN   :      p_language         VARCHAR2 Required, language of the resultant negotiation
51 --     IN   :      p_user_id          NUMBER Required, user_id (FND) of the calling user;
52 --                                                      It will used for WHO informations also
53 --     IN   :      p_doctype_id       NUMBER Required, doctype_id of the output negotiation
54 --     IN   :      p_copy_type        VARCHAR2 Required, Type of Copy action;
55 --                                                      It should be one of the following -
56 --                                                      g_new_rnd_copy (NEW_ROUND)
57 --                                                      g_active_neg_copy (COPY_ACTIVE)
58 --                                                      g_draft_neg_copy (COPY_DRAFT)
59 --                                                      g_amend_copy (AMENDMENT)
60 --                                                      g_rfi_to_other_copy (COPY_TO_DOC)
61 --     IN   :      p_is_award_approval_reqd     VARCHAR2 Required, flag to decide if
62 --                                                      award approval is required;
63 --                                                      Permissible values are Y or N
64 --
65 --     IN   :      p_user_name      VARCHAR2 Required, user name of the caller in
66 --                                                     the PON_NEG_TEAM_MEMBERS.USER_NAME format
67 --
68 --     IN   :      p_mgr_id       NUMBER Required, manager id of the caller in
69 --                                                     the PON_NEG_TEAM_MEMBERS.USER_ID format
70 --
71 --     IN   :      p_retain_clause  VARCHAR2 Required, flag to carry forward the
72 --                                                      Contracts related information;
73 --                                                      Permissible values are Y or N
74 --     IN   :      p_update_clause  VARCHAR2 Required, flag to ue/updatedate the Contracts
75 --                                                      related information from library;
76 --                                                      Permissible values are Y or N
77 --     IN   :      p_retain_attachments      VARCHAR2 Required, flag to carry forward the
78 --                                                      attachments related to negotiation;
79 --                                                      Permissible values are Y or N
80 --     IN   :      p_large_auction_header_id NUMBER Optional, In the case of the
81 --                                                      source auction being a super large one,
82 --                                                      non null value of this parameter
83 --                                                      corresponds to the header id of the new
84 --                                                      auction whose header has been created.
85 --                                                      Non null values of this parameter
86 --                                                      indicate that this procedure is called from
87 --                                                      a concurrent procedure
88 --     IN   :      p_style_id         NUMBER Optional    This parameter gives the
89 --                                                      style id of the
90 --                                                      destination auction
91 --     OUT  :      x_auction_header_id      NUMBER,     auction_header_id of the
92 --                                                      generated negotiation;
93 --
94 --     OUT  :      x_document_number        NUMBER,       document number of the
95 --                                                      generated negotiation;
96 --
97 --     OUT  :      x_request_id             NUMBER,       id of the  concurrent
98 --                                                      request generated;
99 --
100 --     OUT  :      x_return_status          VARCHAR2, flag to indicate if the copy procedure
101 --                                                       was successful or not; It can have
102 --                                                      following values -
103 --                                                         FND_API.G_RET_STS_SUCCESS (Success)
104 --                                                         FND_API.G_RET_STS_ERROR  (Success with warning)
105 --                                                         FND_API.G_RET_STS_UNEXP_ERROR (Failed due to error)
106 --
107 --     OUT  :      x_msg_count              NUMBER,   the number of warning of error messages due
108 --                                                       to this procedure call. It will have following
109 --                                                       values  -
110 --                                                       0 (for Success without warning)
111 --                                                       1 (for failure with error, check the
112 --                                                       x_return_status if it is error or waring)
113 --                                                       1 or more (for Success with warning, check the x_return_status)
114 --
115 --     OUT  :      x_msg_data               VARCHAR2,  the standard message data output parameter
116 --                                                       used to return the first message of the stack
117 --
118 --    Version    : Current version    1.0
119 --                 Previous version   1.0
120 --                 Initial version    1.0
121 --
122 -- End of comments
123 
124 
125 PROCEDURE COPY_NEGOTIATION(
126                     p_api_version                 IN          NUMBER,
127                     p_init_msg_list               IN          VARCHAR2,
128                     p_is_conc_call                IN          VARCHAR2,
129                     p_source_auction_header_id    IN          NUMBER,
130                     p_trading_partner_id          IN          NUMBER ,
131                     p_trading_partner_contact_id  IN          NUMBER ,
132                     p_language                    IN          VARCHAR2,
133                     p_user_id                     IN          NUMBER,
134                     p_doctype_id                  IN          NUMBER,
135                     p_copy_type                   IN          VARCHAR2,
136                     p_is_award_approval_reqd      IN          VARCHAR2,
137                     p_user_name                   IN          VARCHAR2,
138                     p_mgr_id                      IN          NUMBER,
139                     p_retain_clause               IN          VARCHAR2,
140                     p_update_clause               IN          VARCHAR2,
141                     p_retain_attachments          IN          VARCHAR2,
142                     p_large_auction_header_id     IN         NUMBER,
143                     p_style_id                    IN         NUMBER,
144                     x_auction_header_id           OUT NOCOPY  NUMBER,
145                     x_document_number             OUT NOCOPY VARCHAR2,
146                     x_request_id                  OUT NOCOPY  NUMBER,
147                     x_return_status               OUT NOCOPY  VARCHAR2,
148                     x_msg_count                   OUT NOCOPY  NUMBER,
149                     x_msg_data                    OUT NOCOPY  VARCHAR2
150                     );
151 
152 
153 --
154 -- This is a function required for the COPY_NEGOTIATION procedure
155 -- and shouldn't be used any where validates negotiation team members
156 --
157 -- CAUTION: This function may get removed. So, consult it before use.
158 
159 FUNCTION HAS_NEED_TO_COPY_MEMBER ( p_login_user_id           NUMBER,
160                                    p_login_manager_id        NUMBER,
161                                    p_copy_type               VARCHAR2,
162                                    p_memeber_id              NUMBER,
163                                    p_memeber_type            VARCHAR2,
164                                    p_busines_group_id        NUMBER,
165                                    p_member_busines_group_id NUMBER,
166                                    p_member_eff_start_date   DATE,
167                                    p_member_eff_end_date     DATE,
168                                    p_member_user_start_date  DATE,
169                                    p_member_user_end_date    DATE) RETURN VARCHAR2;
170 
171 
172 
173 --     Parameters:
174 --     IN   :      p_api_version               NUMBER   Required
175 --     IN   :      p_init_msg_list             VARCHAR2 DEFAULT   FND_API.G_TRUE Optional
176 --     IN   :      p_source_auction_header_id  NUMBER Required, auction_header_id of the source negotiation
177 --     IN   :      p_trading_partner_id        NUMBER Required,  trading_partner_id of user
178 --                                                      for which the reultant negotiation will be created
179 --     IN   :      p_trading_partner_contact_id NUMBER Required,  trading_partner_contact_id of
180 --                                                       user for which the reultant negotiation will be created
181 --     IN   :      p_language                  VARCHAR2 Required, language of the resultant negotiation
182 --     IN   :      p_user_id                   NUMBER Required, user_id (FND) of the calling user;
183 --                                                          It will used for WHO informations also
184 --     IN   :      p_doctype_id                NUMBER Required, doctype_id of the output negotiation
185 --     IN   :      p_copy_type                 VARCHAR2 Required, Type of Copy action;
186 --                                                   It should be one of the following -
187 --                                                        g_new_rnd_copy (NEW_ROUND)
188 --                                                        g_active_neg_copy (COPY_ACTIVE)
189 --                                                        g_draft_neg_copy (COPY_DRAFT)
190 --                                                        g_amend_copy (AMENDMENT)
191 --                                                        g_rfi_to_other_copy (COPY_TO_DOC)
192 --     IN   :      p_is_award_approval_reqd    VARCHAR2 Required, flag to decide if
193 --                                                         award approval is required;
197 --                                                     the PON_NEG_TEAM_MEMBERS.USER_NAME format
194 --                                                         Permissible values are Y or N
195 --
196 --     IN   :      p_user_name                 VARCHAR2 Required, user name of the caller in
198 --
199 --     IN   :      p_mgr_id                  NUMBER Required, manager id of the caller in
200 --                                                     the PON_NEG_TEAM_MEMBERS.USER_ID format
201 --
202 --     IN   :      p_retain_clause             VARCHAR2 Required, flag to carry forward the
203 --                                                       Contracts related information;
204 --                                                       Permissible values are Y or N
205 --     IN   :      p_update_clause             VARCHAR2 Required, flag to update the Contracts
206 --                                                       related information from library;
207 --                                                          Permissible values are Y or N
208 --     IN   :      p_retain_attachments        VARCHAR2 Required, flag to carry forward the
209 --                                                       attachments related to negotiation;
210 --                                                       Permissible values are Y or N
211 --     IN   :      p_large_auction_header_id NUMBER Optional, In the case of the
212 --                                                      source auction being a
213 --                                                      super large one,
214 --                                                      non null value of this
215 --                                                      parameter
216 --                                                      corresponds to the
217 --                                                      header id of the new
218 --                                                      auction whose header has
219 --                                                      been created.
220 --                                                      Non null values of this
221 --                                                      parameter
222 --                                                      indicate that this
223 --                                                      procedure is called from
224 --                                                      a concurrent procedure
225 --                                                      and null
226 --                                                      values of this parameter
227 --                                                      indicates the
228 --                                                      procedure being called
229 --                                                      online.
230 --     IN   :      p_style_id         NUMBER Optional    This parameter gives
231 --                                                       the
232 --                                                      style id of the
233 --                                                      destination auction
234 PROCEDURE PON_CONC_COPY_SUPER_LARGE_NEG (
235                     EFFBUF           OUT NOCOPY VARCHAR2,
236                     RETCODE          OUT NOCOPY VARCHAR2,
237                     p_api_version                IN         NUMBER,
238                     p_init_msg_list              IN         VARCHAR2 DEFAULT FND_API.G_TRUE,
239                     p_source_auction_header_id   IN         NUMBER,
240                     p_trading_partner_id         IN         NUMBER ,
241                     p_trading_partner_contact_id IN         NUMBER ,
242                     p_language                   IN         VARCHAR2,
243                     p_user_id                    IN         NUMBER,
244                     p_doctype_id                 IN         NUMBER,
245                     p_copy_type                  IN         VARCHAR2,
246                     p_is_award_approval_reqd     IN         VARCHAR2,
247                     p_user_name                  IN         VARCHAR2,
248                     p_mgr_id                     IN         NUMBER,
249                     p_retain_clause              IN         VARCHAR2,
250                     p_update_clause              IN         VARCHAR2,
251                     p_retain_attachments         IN         VARCHAR2,
252                     p_large_auction_header_id    IN         NUMBER,
253                     p_style_id                   IN         NUMBER);
254 
255 --PROCEDURE NAME: PON_LRG_DRAFT_TO_ORD_PF_COPY
256 --
257 --This procedure creates the relevant records for a large destination
258 --auction in the case of a copy from a large DRAFT to a normal auction.
259 --
260 --p_source_auction_hdr_id    IN
261 --DATATYPE: pon_large_neg_pf_values.AUCTION_HEADER_ID%type
262 --This parameter is the auction_header_id of the source auction
263 --
264 --p_destination_auction_hdr_id    IN
265 --DATATYPE: pon_large_neg_pf_values.AUCTION_HEADER_ID%type
266 --This parameter is the auction_header_id of the destination auction
267 --
268 --p_user_id    IN
269 --DATATYPE: NUMBER
270 --This parameter is the id of the user invoking the procedure
271 
272 PROCEDURE  PON_LRG_DRAFT_TO_ORD_PF_COPY (
273                 p_source_auction_hdr_id IN pon_large_neg_pf_values.AUCTION_HEADER_ID%type,
274                 p_destination_auction_hdr_id IN pon_large_neg_pf_values.AUCTION_HEADER_ID%type,
275                 p_user_id IN number,
276                 p_from_line_number         IN NUMBER,
277                 p_to_line_number           IN NUMBER);
278 
279 --
280 -- TEAM SCORING PROCEDURE TO COPY SCORING TEAMS, MEMBERS AND ASSIGNMENTS
281 --
282 
283 --------------------------------------------------------------------------
284 --
285 -- This procedure copies the details of the scoring teams
286 --
287 --  Tables handled here:
288 --
289 --  PON_SCORING_TEAMS   : Stores name of team, instructions
290 --  PON_SCORING_TEAM_MEMBERS  : Stores the members of the team
291 --  PON_SCORING_TEAM_SECTIONS : Stores the sections that the team has to score
292 --
293 -- Business rules:
294 --
295 --  1.  If the negotiation style of the target document does not allow
296 --      scoring teams, then do not copy any rows
297 --
298 --  2.  If the source auction does not have any scoring teams
299 -- 		do not attempt to copy teams or children over.
300 --
301 --  3.  If a collaboration team member is invalid at the time of copying
302 --      do not add him as a member
303 --
304 --------------------------------------------------------------------------
305 
306 PROCEDURE COPY_SCORING_TEAMS(
307     p_source_auction_header_id        	IN NUMBER,
308     p_auction_header_id               	IN NUMBER,
309     p_user_id                      		IN NUMBER
310     );
311 
312 --
313 -- END TEAM SCORING
314 --
315 
316 END PON_NEGOTIATION_COPY_GRP;