1 PACKAGE PO_ASL_SV AUTHID CURRENT_USER as
2 /* $Header: POXA1LSS.pls 115.7 2003/11/06 03:46:13 bao ship $ */
3
4 TYPE orgTab IS TABLE OF NUMBER
5 INDEX BY BINARY_INTEGER;
6
7 x_ship_to_org_list orgTab;
8
9 -- <ASL ERECORD FPJ START>
10
11 G_EVENT_INSERT CONSTANT VARCHAR2(10) := 'INSERT';
12 G_EVENT_UPDATE CONSTANT VARCHAR2(10) := 'UPDATE';
13
14 -- <ASL ERECORD FPJ END>
15
16
17 /*===========================================================================
18 PACKAGE NAME: po_asl_sv
19
20 DESCRIPTION: General server-side utilities for Approved Supplier List.
21
22 CLIENT/SERVER: Server
23
24 LIBRARY NAME
25
26 OWNER: Liza Broadbent
27
28 PROCEDURE NAMES: get_startup_values()
29 check_asl_action()
30
31 ===========================================================================*/
32 /*===========================================================================
33 FUNCTION NAME: check_asl_action
34
35 RETURN VALUE: number
36
37
38 DESCRIPTION: Checks to see whether a given action (e.g. PO
39 Approval) is valid based on the ASL status for
40 the supplier-item combination.
41
42 If the supplier-item combination does not exist
43 in the ASL, then this routine returns TRUE.
44
45 PARAMETERS: action varchar2 -- Actions are lookup_codes
46 -- in po_lookup_codes where
47 -- lookup_type =
48 -- 'ASL_STATUS_BUSINESS_RULES'
49 vendor_id number -- Required
50 vendor_site_id number -- Optional
51 item_id number -- Either an item or category_id
52 -- is required.
53 category_id number -- Note: this is associated with
54 -- the PO Category Set.
55 ship_to_org_list orgTable -- This is a PL/SQL table that can
56 -- take a list of ship-to orgs
57 -- for cases where it makes sense
58 -- to return a single results for
59 -- multiple organizations. An
60 -- example of this is the test for
61 -- PO Approval where a single PO
62 -- header can have multiple ship-to
63 -- locations. This also accepts
64 -- a single organization_id for the
65 -- simple case.
66
67 CHANGE HISTORY: 21-May-96 lbroadbe Created
68
69 ===============================================================================*/
70
71 function check_asl_action(x_action varchar2,
72 x_vendor_id number,
73 x_vendor_site_id number,
74 x_item_id number,
75 x_category_id number,
76 x_ship_to_org number) return number;
77
78 --pragma restrict_references (check_asl_action,WNDS,RNPS,WNPS);
79
80 /*===========================================================================
81 PROCEDURE NAME: update_vendor_status
82
83
84 DESCRIPTION: Updates the vendor status to that what is passed in.
85
86 PARAMETERS:
87
88 x_organiazation_id input required
89 x_vendor_id input required
90 x_status input required
91 x_vendor_site_id input optional
92 x_item_id input optional
93 x_global_asl_update input optional
94 x_org_id input optional
95 x_return_code in out 'S' for success 'F' for failure
96
97 CHANGE HISTORY: 30-JUL-97 vpawar Created
98
99 24-MAY-02 davidng Fix for 2386912
100 Change x_vendor_site_id to number default null from number
101 Change x_item_id to number default null from number
102 Change x_org_id to number default null from number
103
104 ===============================================================================*/
105
106 procedure update_vendor_status(x_organization_id in number,
107 x_vendor_id in number,
108 x_status in varchar2,
109 x_vendor_site_id in number default null,
110 x_item_id in number default null,
111 x_global_asl_update in varchar2 := 'N',
112 x_org_id in number default null,
113 x_return_code in out NOCOPY varchar2);
114
115 /*===========================================================================
116 PROCEDURE NAME: get_startup_values
117
118
119 DESCRIPTION: Gets all startup values for the Approved Supplier List.
120
121
122 CHANGE HISTORY: 21-May-96 lbroadbe Created
123
124 ===============================================================================*/
125
126 procedure get_startup_values(x_current_form_org in number,
127 x_po_item_master_org_id in out NOCOPY number,
128 x_po_category_set_id in out NOCOPY number,
129 x_po_structure_id in out NOCOPY number,
130 x_default_status_id in out NOCOPY number,
131 x_default_status in out NOCOPY varchar2,
132 x_default_business_code in out NOCOPY varchar2,
133 x_default_business in out NOCOPY varchar2,
134 x_chv_install in out NOCOPY varchar2,
135 x_chv_cum_flag in out NOCOPY varchar2);
136
137 /*===========================================================================
138 PROCEDURE NAME: check_record_unique
139
140
141 DESCRIPTION: Determines whether record contains unique combination
142 of using_organization_id, vendor, and item/commodity.
143
144
145 CHANGE HISTORY: 28-Jun-96 cmok Created
146
147 ===============================================================================*/
148
149 function check_record_unique(x_manufacturer_id number,
150 x_vendor_id number,
151 x_vendor_site_id number,
152 x_item_id number,
153 x_category_id number,
154 x_using_organization_id number) return boolean;
155
156
157 -- <ASL ERECORD FPJ START>
158 /*===========================================================================
159 PROCEDURE NAME: raise_asl_eres_event
160
161
162 DESCRIPTION: Call QA api to raise an event for eRecord creation. This
163 procedure will also acknowledge the eRecord.
164
165
166 CHANGE HISTORY: 01-Oct-2003 bao Created
167
168 =============================================================================*/
169 PROCEDURE raise_asl_eres_event
170 ( x_return_status OUT NOCOPY VARCHAR2,
171 p_asl_id IN NUMBER,
172 p_action IN VARCHAR2,
173 p_calling_from IN VARCHAR2,
174 p_ackn_note IN VARCHAR2,
175 p_autonomous_commit IN VARCHAR2
176 );
177
178
179 /*===========================================================================
180 PROCEDURE NAME: init_asl_activity_tbl
181
182
183 DESCRIPTION: Initialize the table that captures ASL changes (insert
184 or update).
185
186
187 CHANGE HISTORY: 05-Nov-2003 bao Created
188
189 =============================================================================*/
190
191 PROCEDURE init_asl_activity_tbl;
192
193
194 /*===========================================================================
195 PROCEDURE NAME: add_asl_activity
196
197
198 DESCRIPTION: Populate ASL changes (insert or update) to the table
199
200
201 CHANGE HISTORY: 05-Nov-2003 bao Created
202
203 =============================================================================*/
204
205 PROCEDURE add_asl_activity
206 ( p_asl_id IN NUMBER,
207 p_action IN VARCHAR2
208 );
209
210
211 /*===========================================================================
212 PROCEDURE NAME: process_asl_activity_tbl
213
214
215 DESCRIPTION: Raise ERES event for each ASL change logged in the
216 table
217
218
219 CHANGE HISTORY: 05-Nov-2003 bao Created
220
221 =============================================================================*/
222
223 PROCEDURE process_asl_activity_tbl;
224
225 -- <ASL ERECORD FPJ END>
226
227 END PO_ASL_SV;