1 PACKAGE PO_HEADERS_SV1 AUTHID CURRENT_USER AS
2 /* $Header: POXPOH1S.pls 120.4 2011/06/24 07:55:56 vegajula ship $*/
3
4 g_pkg_name CONSTANT VARCHAR2(30) := 'PO_HEADERS_SV1';
5
6 /*===========================================================================
7 FUNCTION NAME: lock_row_for_status_update
8
9 DESCRIPTION: Locks the row in the po_headers table for update.
10
11 PARAMETERS: x_po_header_id IN NUMBER
12
13 DESIGN REFERENCES: POXDOAPP.dd, POXDOCON.dd
14
15 ALGORITHM:
16
17 NOTES:
18
19 OPEN ISSUES:
20
21 CLOSED ISSUES:
22
23 CHANGE HISTORY: cmok 7/26 created it
24 wlau 7/31 change api name
25 ===========================================================================*/
26
27 PROCEDURE lock_row_for_status_update (x_po_header_id IN NUMBER);
28
29 /*===========================================================================
30 FUNCTION NAME: val_po_encumbered()
31
32 DESCRIPTION:
33 - Can approve only if the following are true:
34 - If approving from entry form, either can_preparer_approve flag = 'Y'
35 or user is not preparer of document.
36 - Status of the doc is IN PROCESS, INCOMPLETE,
37 REQUIRES REAPPROVAL, REJECTED, or RETURNED.
38 - If status is pre-approved, either the
39 req-encumbrance flag is off or the req is fully
40 encumbered. (Call acceptance routine.)
41
42 - If a PO:
43 - Can approve only if the following are true:
44 - status of the doc is IN PROCESS, INCOMPLETE, REJECTED, or REQUIRES
45 REAPPROVAL. (Call the approve routine)
46 - if status is pre-approved, either PO_encumbrance flag is off or
47 the PO is fully encumbered. (Call acceptance routine)
48 - If approving from entry form, either can_preparer_approve_flag = 'Y'
49 or user is not preparer of document.
50 - Can always forward document.
51 - IF document has status INCOMPLETE, REQUIRES REAPPROVAL, REJECTED, RETURNED:
52 Call the submit routine
53 - IF document has status IN PROCESS, PRE APPROVED: Call the forward routine
54 - Can always reject document.
55 - Can reserve for PO and releases only if
56 - there are PO lines that are not cancelled and not finally closed
57 with encumbered_flag = 'N'and shipment type is not 'Price Break'.
58 PARAMETERS:
59
60 RETURN VALUE:
61
62 DESIGN REFERENCES: ../POXDOAPP.dd
63
64 ALGORITHM:
65
66 NOTES:
67
68 OPEN ISSUES:
69
70 CLOSED ISSUES:
71
72 CHANGE HISTORY:
73 ===========================================================================*/
74
75 --PROCEDURE val_po_encumbered();
76
77
78
79 /*===========================================================================
80 FUNCTION NAME: val_delete()
81
82 DESCRIPTION: Checks if the PO/PA is not encumbered.
83 If itis encumbered, cannot delete the document.
84
85
86
87 PARAMETERS:
88
89 DESIGN REFERENCES: ../POXPOMPO.doc
90
91 ALGORITHM:
92
93 NOTES:
94
95 OPEN ISSUES:
96
97 CLOSED ISSUES:
98
99 CHANGE HISTORY:
100 ===========================================================================*/
101
102 FUNCTION val_delete(X_po_header_id IN NUMBER , X_type_lookup_code IN VARCHAR2)
103 return boolean;
104
105 /*===========================================================================
106 PROCEDURE NAME: get_po_encumbered()
107
108 DESCRIPTION: Check if any distributions for a PO is encumbered.
109
110 PARAMETERS:
111
112 DESIGN REFERENCES: ../POXPOMPO.doc
113
114 ALGORITHM:
115
116 NOTES:
117
118 OPEN ISSUES:
119
120 CLOSED ISSUES:
121
122 CHANGE HISTORY:
123 ===========================================================================*/
124
125 FUNCTION get_po_encumbered(X_po_header_id IN number)
126 return boolean;
127
128 /*===========================================================================
129 PROCEDURE NAME: delete_children()
130
131 DESCRIPTION: Delete Lines, Shipments, Distributions for given PO/PA.
132 If it is a Planned PO/Blanket, delete the relevant
133 Notification Controls.
134
135 PARAMETERS:
136
137 DESIGN REFERENCES: ../POXPOMPO.doc
138
139 ALGORITHM:
140
141 NOTES:
142
143 OPEN ISSUES:
144
145 CLOSED ISSUES:
146
147 CHANGE HISTORY:
148 ===========================================================================*/
149
150 PROCEDURE delete_children(X_po_header_id IN NUMBER , X_type_lookup_code IN VARCHAR2);
151
152 /*===========================================================================
153 FUNCTION NAME: delete_po()
154
155 DESCRIPTION: Check if the PO can be deleted :
156 i) Cannot delete if there exist any encumbered distribution.
157 If the PO can be deleted,
158 delete the header,
159 remove the reqisistion link to the shipment,
160 delete the children ( lines, shipments, distibutions, notif. controls)
161 delete attachments
162 delete notifications
163
164 PARAMETERS:
165
166 DESIGN REFERENCES: ../POXPOMPO.doc
167
168 ALGORITHM:
169
170 NOTES:
171
172 OPEN ISSUES:
173
174 CLOSED ISSUES:
175
176 CHANGE HISTORY:
177 ===========================================================================*/
178
179 FUNCTION delete_po(X_po_header_id IN NUMBER,
180 X_type_lookup_code IN VARCHAR2,
181 p_skip_validation IN VARCHAR2 DEFAULT NULL) --<HTML Agreements R12>
182 return boolean;
183
184 --<HTML Agreements R12 Start>
185 PROCEDURE validate_delete_document(
186 p_doc_type IN VARCHAR2
187 ,p_doc_header_id IN NUMBER
188 ,p_doc_approved_date IN DATE
189 ,p_auth_status IN VARCHAR2
190 ,p_style_disp_name IN VARCHAR2
191 ,x_message_text OUT NOCOPY VARCHAR2);
192
193 PROCEDURE delete_document( p_doc_type IN VARCHAR2
194 ,p_doc_subtype IN VARCHAR2
195 ,p_doc_header_id IN NUMBER
196 ,p_ga_flag IN VARCHAR2
197 ,p_conterms_exist_flag IN VARCHAR2
198 ,x_return_status OUT NOCOPY VARCHAR2);
199
200 --<HTML Agreements R12 End>
201
202 /*===========================================================================
203 PROCEDURE NAME: delete_this_release()
204
205 DESCRIPTION: Delete the Releases against the PA that is
206 currently being deleted.
207
208 PARAMETERS:
209
210 DESIGN REFERENCES: ../POXPOMPO.doc
211
212 ALGORITHM:
213
214 NOTES:
215
216 OPEN ISSUES:
217
218 CLOSED ISSUES:
219
220 CHANGE HISTORY:
221 ===========================================================================*/
222
223 PROCEDURE delete_this_release(X_po_header_id IN NUMBER);
224
225 /*===========================================================================
226 * NOTE: MOVED to po_headers_sv11
227
228 PROCEDURE NAME: insert_po()
229
230 DESCRIPTION:
231 - call PO HEADERS table handler to insert the header
232 - call notification API to create a notification
233 [DEBUG;SEND_NOTIFICATION
234 PARAMETERS:
235
236 DESIGN REFERENCES: ../POXPOMPO.doc
237
238 ALGORITHM:
239
240 NOTES:
241
242 OPEN ISSUES:
243
244 CLOSED ISSUES:
245
246 CHANGE HISTORY: MOVED To po_headers_sv11
247 ===========================================================================*/
248
249 /*===========================================================================
250 PROCEDURE NAME: insert_children()
251
252 DESCRIPTION:
253 - call notification API to create a notification
254 [DEBUG;SEND_NOTIFICATION]
255 PARAMETERS:
256
257 DESIGN REFERENCES: ../POXPOMPO.doc
258
259 ALGORITHM:
260
261 NOTES:
262
263 OPEN ISSUES:
264
265 CLOSED ISSUES:
266
267 CHANGE HISTORY:
268 ===========================================================================*/
269
270 --PROCEDURE insert_children();
271
272 /*===========================================================================
273 Bug 12405805
274 PROCEDURE NAME: delete_events_entities()
275
276 DESCRIPTION:
277 Use XLA APIs to delete unnecessary events and entities
278 PARAMETERS: Doc type and Doc header id
279
280 ALGORITHM: Delete all the Unprocessed events associated with the document.
281 After that, if there are no Processed events associated with the document, we delete the entity associated with the document also.
282
283
284 NOTES:
285
286 OPEN ISSUES:
287
288 CLOSED ISSUES:
289
290 CHANGE HISTORY:
291 ===========================================================================*/
292
293
294 PROCEDURE Delete_events_entities(p_doc_entity IN VARCHAR2,
295 p_doc_id IN NUMBER);
296
297
298
299
300 END PO_HEADERS_SV1;