DBA Data[Home] [Help]

PACKAGE: APPS.PO_REQS_CONTROL_SV

Source


1 PACKAGE po_reqs_control_sv AUTHID CURRENT_USER AS
2 /* $Header: POXRQCNS.pls 115.2 2002/11/23 01:58:31 sbull ship $*/
3 /*===========================================================================
4   PACKAGE NAME:		po_reqs_control_sv
5 
6   DESCRIPTION:          Contains the server side requisition control APIs
7 
8   CLIENT/SERVER:	Server
9 
10   LIBRARY NAME          NONE
11 
12   OWNER:                WLAU
13 
14   PROCEDURES/FUNCTIONS:	val_reqs_action()
15 			update_reqs_status()
16 
17 ===========================================================================*/
18 
19 
20 /*===========================================================================
21   FUNCTION NAME:	val_doc_security()
22 
23   DESCRIPTION:          This function checks for the document security check.
24                         It returns TRUE if the document security is passed
25                         otherwise it returns FALSE;
26 
27   PARAMETERS:           X_doc_agent_id            IN     NUMBER,
28                         X_agent_id                IN     NUMBER
29                         X_doc_type                IN     VARCHAR2,
30                         X_doc_subtype             IN     VARCHAR2
31 
32   RETURN:               TRUE/FALSE
33 
34   DESIGN REFERENCES:	../POXDOCON.dd
35 
36   ALGORITHM:
37 
38    1. Document security check is passed if the following is true:
39 
40      Security Level    Access level    Document Owner     Purchasing Agent
41     --------------    -------------   ---------------    -----------------
42       PUBLIC            Full
43       PRIVATE           all levels          YES
44       HIERARCHY         Full            in hierarchy
45       PURCHASING        Full                YES               YES
46 
47    2. Document security check is failed if the following is true:
48 
49     Security Level    Access level    Document Owner     Purchasing Agent
50     --------------    -------------   ---------------    -----------------
51       PUBLIC            View Only           NO
52       PRIVATE           all levels          NO
53       HIERARCHY         View Only     NO or Not in hierarchy
54       PURCHASING        View Only           NO                 NO
55 
56 
57   NOTES:
58 
59   OPEN ISSUES:
60 
61   CLOSED ISSUES:
62 
63   CHANGE HISTORY:       WLAU       6/5     Created
64 ===========================================================================*/
65   FUNCTION val_doc_security
66                        (X_doc_agent_id            IN     NUMBER,
67                         X_agent_id                IN     NUMBER,
68                         X_doc_type                IN     VARCHAR2,
69                         X_doc_subtype             IN     VARCHAR2) RETURN BOOLEAN;
70 
71 
72 /*===========================================================================
73   FUNCTION NAME:	val_reqs_action()
74 
75   DESCRIPTION:          Requisition control action validation driver.
76                         This driver validates the requisition document
77                         and ensures that the document is in proper
78                         state for 'CANCEL' or 'FINALLY CLOSE' before
79                         performing the update process.
80 
81                         If error condition is found, it retuns to the client
82                         side.  The form will display error message to
83                         the user.
84 
85                         If encumbrance flag is OFF, it is not needed
86                         to return to the client side to call the
87                         unencumbrance user exit.  This driver continue to
88                         perform the requisition status update process.
89 
90 
91 
92   PARAMETERS:           X_req_header_id           IN     NUMBER,
93                         X_req_line_id             IN     NUMBER,
94                         X_agent_id                IN     NUMBER,
95                         X_req_doc_type            IN     VARCHAR2,
96                         X_req_doc_subtype         IN     VARCHAR2,
97                         X_req_control_action      IN     VARCHAR2,
98                         X_req_control_reason      IN     VARCHAR2,
99                         X_req_action_date         IN     DATE,
100                         X_encumbrance_flag        IN     VARCHAR2,
101                         X_oe_installed_flag       IN     VARCHAR2
102 
103   RETURN:               TRUE/FALSE
104 
105   DESIGN REFERENCES:	../POXDOCON.dd
106 
107   ALGORITHM:            This driver invokes the following APIS:
108 
109                         - po_shipments_sv.val_reqs_po_shipment
110                         - po_sales_order_sv.val_reqs_oe_shipments
111                         - po_req_lines_sv.val_qty_delivered
112                         - po_req_lines_sv.update_reqs_lines_incomplete
113                         - po_reqs_control_sv.update_reqs_status
114 
115   NOTES:
116 
117   OPEN ISSUES:
118 
119   CLOSED ISSUES:
120 
121   CHANGE HISTORY:       WLAU       5/12     Created
122                         WLAU       3/20/96  bug 327628 added X_agent_id parm.
123 ===========================================================================*/
124   FUNCTION val_reqs_action
125                        (X_req_header_id           IN     NUMBER,
126                         X_req_line_id             IN     NUMBER,
127                         X_agent_id                IN     NUMBER,
128                         X_req_doc_type            IN     VARCHAR2,
129                         X_req_doc_subtype         IN     VARCHAR2,
130                         X_req_control_action      IN     VARCHAR2,
131                         X_req_control_reason      IN     VARCHAR2,
132                         X_req_action_date         IN     DATE,
133                         X_encumbrance_flag        IN     VARCHAR2,
134                         X_oe_installed_flag       IN     VARCHAR2) RETURN BOOLEAN;
135 
136 
137 /*===========================================================================
138   PROCEDURE NAME:	update_reqs_status()
139 
140   DESCRIPTION:          Requisition control action update driver.
141                         This driver performs the requisiton document
142                         status update functions after validation process
143                         is completed.
144 
145   PARAMETERS:           X_req_header_id           IN     NUMBER,
146 			X_req_line_id             IN     NUMBER,
147                         X_agent_id                IN     NUMBER,
148                         X_req_doc_type            IN     VARCHAR2,
149                         X_req_doc_subtype         IN     VARCHAR2,
150 			X_req_control_action      IN     VARCHAR2,
151 			X_req_control_reason      IN     VARCHAR2,
152                         X_req_action_date         IN     DATE,
153 			X_encumbrance_flag        IN     VARCHAR2,
154 			X_oe_installed_flag       IN     VARCHAR2,
155 			X_req_control_error_rc    IN OUT VARCHAR2
156 
157   DESIGN REFERENCES:	../POXDOCON.dd
158 
159   ALGORITHM:            This driver invokes the following APIs:
160                         - po_reqs_sv2.get_reqs_auth_status
161                         - po_req_distributions_sv.update_reqs_distributions
162                         - rcv_supply_sv.maintain_supply
163                         - po_reqs_sv.update_reqs_header_status
164                         - po_req_lines_sv.udpate_reqs_lines_status
165                         - po_notifications_sv.delete_notifications
166                         - po_approve_sv.update_po_action_history
167 
168   NOTES:
169 
170   OPEN ISSUES:
171 
172   CLOSED ISSUES:
173 
174   CHANGE HISTORY:       WLAU       5/12     Created
175                         WLAU       3/20/96  bug 327628 added X_agent_id parm.
176 ===========================================================================*/
177   PROCEDURE update_reqs_status
178                        (X_req_header_id           IN     NUMBER,
179                         X_req_line_id             IN     NUMBER,
180                         X_agent_id                IN     NUMBER,
181                         X_req_doc_type            IN     VARCHAR2,
182                         X_req_doc_subtype         IN     VARCHAR2,
183                         X_req_control_action      IN     VARCHAR2,
184                         X_req_control_reason      IN     VARCHAR2,
185  			X_req_action_date         IN     DATE,
186                         X_encumbrance_flag        IN     VARCHAR2,
187                         X_oe_installed_flag       IN     VARCHAR2,
188                         X_req_control_error_rc    IN OUT NOCOPY VARCHAR2);
189 
190 
191 /*===========================================================================
192   PROCEDURE NAME:	commit_changes;
193 
194   DESCRIPTION:          Perform a database commit.
195 
196   PARAMETERS:           None
197 
198   DESIGN REFERENCES:	../POXDOCON.dd
199 
200   ALGORITHM:            Database commit
201 
202   NOTES:
203 
204   OPEN ISSUES:
205 
206   CLOSED ISSUES:
207 
208   CHANGE HISTORY:       WLAU       8/1/95   Created
209 ===========================================================================*/
210   PROCEDURE commit_changes;
211 
212 
213 /*===========================================================================
214   PROCEDURE NAME:	rollback_changes
215 
216   DESCRIPTION:          Perform a database rollback
217 
218   PARAMETERS:           None
219 
220   DESIGN REFERENCES:	../POXDOCON.dd
221 
222   ALGORITHM:            Database rollback
223 
224   NOTES:
225 
226   OPEN ISSUES:
227 
228   CLOSED ISSUES:
229 
230   CHANGE HISTORY:       WLAU       8/1/95   Created
231 ===========================================================================*/
232   PROCEDURE rollback_changes;
233 
234 
235 /*===========================================================================
236   PROCEDURE NAME:	maintain_supply
237 
238   DESCRIPTION:          This procedure performs maintain_supply then function
239                         when cancelling/finally close a requisition.
240                         If the supply action is:
241 
242                         1. requistion header:
243                            Sets the req quantity in mtl_supply to 0
244                            for a given req header.
245                         2. requisition line:
246 			   Sets the req quantity in mtl_supply to 0
247                            for a given req line.
248 
249   PARAMETERS:           X_supply_action 	IN	VARCHAR2,
250 		        X_supply_id		IN	NUMBER,
251                         X_req_control_error_rc  IN OUT VARCHAR2
252 
253   DESIGN REFERENCES:	../POXDOCON.dd
254 
255   ALGORITHM:
256 
257   NOTES:
258 
259   OPEN ISSUES:
260 
261   CLOSED ISSUES:
262 
263   CHANGE HISTORY:       WLAU       9/28/95   Created
264 ===========================================================================*/
265   PROCEDURE maintain_supply
266 			(X_supply_action 	IN	VARCHAR2,
267 			 X_supply_id		IN	NUMBER,
268                          X_req_control_error_rc IN OUT NOCOPY  VARCHAR2);
269 
270 
271 
272 END po_reqs_control_sv;
273