[Home] [Help]
PACKAGE: APPS.POS_ASN
Source
1 PACKAGE pos_asn AUTHID CURRENT_USER AS
2 /* $Header: POSASNES.pls 115.6 2000/08/02 12:44:48 pkm ship $ */
3
4 MAX_ERROR_LEN CONSTANT NUMBER := 32000;
5
6 l_language VARCHAR2(5);
7 l_script_name VARCHAR2(240);
8 l_org_id NUMBER;
9 l_user_id NUMBER;
10 l_session_id NUMBER;
11 l_responsibility_id NUMBER;
12 l_request_id NUMBER;
13 l_header_id NUMBER;
14 l_line_id NUMBER;
15 l_date_format VARCHAR2(200);
16 error_message VARCHAR2(32000); /* length should be same as MAX_ERROR_LEN */
17 sub_state VARCHAR2(100);
18 but1 VARCHAR2(2000);
19 but2 VARCHAR2(2000);
20 but3 VARCHAR2(2000);
21
22 x_ship_date VARCHAR2(200);
23 x_receipt_date VARCHAR2(200);
24 l_ship_date DATE;
25 l_receipt_date DATE;
26 ship_date_error BOOLEAN;
27 receipt_date_error BOOLEAN;
28 header_error BOOLEAN;
29
30
31 cursor c_shipment_err is
32 select TO_CHAR(ASND.ASN_LINE_ID) ||
33 DECODE(ASND.ASN_LINE_SPLIT_ID, 0,
34 '', '-' ||
35 TO_CHAR(ASND.ASN_LINE_SPLIT_ID)) error_seq,
36 replace(replace(err.error_message, '
37 ', null), '''', '\''') error_message
38 from po_interface_errors err,
39 pos_asn_shop_cart_details asnd
40 where err.INTERFACE_HEADER_ID = l_header_id and
41 asnd.HEADER_INTERFACE_ID = err.INTERFACE_HEADER_ID and
42 asnd.INTERFACE_TRANSACTION_ID = err.INTERFACE_LINE_ID;
43
44 cursor c_header_err is
45 select replace(replace(err.error_message,'
46 ', null),'''', '\''') error_message
47 from po_interface_errors err
48 where INTERFACE_HEADER_ID = l_header_id and
49 INTERFACE_LINE_ID is null;
50
51
52 cursor c_lines is
53 select
54 l_header_id HEADER_ID,
55 l_request_id GROUP_ID,
56 decode(pla.vendor_id || pla.vendor_site_id,
57 null, 'SHIP', 'RECEIVE') TRANSACTION_TYPE,
58 sysdate TRANSACTION_DATE,
59 'RUNNING' PROCESSING_STATUS_CODE,
60 'BATCH' PROCESSING_MODE_CODE,
61 'RUNNING' TRANSACTION_STATUS_CODE,
62 decode(pla.vendor_id || pla.vendor_site_id,
63 null, 'SHIP', 'DELIVER') AUTO_TRANSACT_CODE,
64 'VENDOR' RECEIPT_SOURCE_CODE,
65 'PO' SOURCE_DOCUMENT_CODE,
66 pl.PO_HEADER_ID PO_HEADER_ID,
67 pl.PO_LINE_ID PO_LINE_ID,
68 pl.PO_LINE_LOCATION_ID PO_LINE_LOCATION_ID,
69 pl.QUANTITY_SHIPPED QUANTITY,
70 pl.UNIT_OF_MEASURE UNIT_OF_MEASURE,
71 pl.UOM_CODE UOM_CODE,
72 pl.LAST_UPDATE_DATE LAST_UPDATE_DATE,
73 pl.LAST_UPDATED_BY LAST_UPDATED_BY,
74 pl.LAST_UPDATE_DATE CREATION_DATE,
75 pl.LAST_UPDATED_BY CREATED_BY,
76 pl.LAST_UPDATE_LOGIN LAST_UPDATE_LOGIN,
77 pl.ITEM_ID ITEM_ID,
78 pl.EXPECTED_RECEIPT_DATE EXPECTED_RECEIPT_DATE,
79 pl.COMMENTS COMMENTS,
80 pl.WAYBILL_AIRBILL_NUM WAYBILL_AIRBILL_NUM,
81 pl.BARCODE_LABEL BARCODE_LABEL,
82 pl.BILL_OF_LADING BILL_OF_LADING,
83 pl.CONTAINER_NUM CONTAINER_NUM,
84 pl.COUNTRY_OF_ORIGIN_CODE COUNTRY_OF_ORIGIN_CODE,
85 pl.VENDOR_CUM_SHIPPED_QTY VENDOR_CUM_SHIPPED_QTY,
86 pl.FREIGHT_CARRIER_CODE FREIGHT_CARRIER_CODE,
87 pl.VENDOR_LOT_NUM VENDOR_LOT_NUM,
88 pl.TRUCK_NUM TRUCK_NUM,
89 pl.NUM_OF_CONTAINERS NUM_OF_CONTAINERS,
90 pl.PACKING_SLIP PACKING_SLIP,
91 pl.REASON_ID REASON_ID,
92 pl.ACTUAL_COST ACTUAL_COST,
93 pl.TRANSFER_COST TRANSFER_COST,
94 pl.TRANSPORTATION_COST TRANSPORTATION_COST,
95 pl.RMA_REFERENCE RMA_REFERENCE,
96 'Y' VALIDATION_FLAG,
97 pl.asn_line_id ASN_LINE_ID,
98 pl.asn_line_split_id ASN_LINE_SPLIT_ID,
99 pl.WIP_ENTITY_ID WIP_ENTITY_ID,
100 pl.WIP_LINE_ID WIP_LINE_ID,
101 pl.WIP_OPERATION_SEQ_NUM WIP_OPERATION_SEQ_NUM,
102 pl.PO_DISTRIBUTION_ID PO_DISTRIBUTION_ID,
103 POS_QUANTITIES_S.get_invoice_qty(PO_LINE_LOCATION_ID,
104 UNIT_OF_MEASURE,
105 ITEM_ID,
106 QUANTITY_SHIPPED) QUANTITY_INVOICED
107 from pos_asn_shop_cart_details pl,
108 pos_asn_shop_cart_headers ph,
109 po_location_associations pla
110 where pl.session_id = l_session_id and
111 ph.session_id = l_session_id and
112 pla.location_id(+) = ph.ship_to_location_id;
113
114 cursor c_wip is
115 select
116 pl.po_distribution_id p_po_distribution_id,
117 pl.quantity_shipped p_shipped_qty,
118 pl.unit_of_measure p_shipped_uom,
119 pl.wip_entity_id p_wip_entity_id,
120 ph.ship_date p_shipped_date,
121 nvl(pl.expected_receipt_date, ph.expected_receipt_date) p_expected_receipt_date,
122 nvl(pl.packing_slip, ph.packing_slip) p_packing_slip,
123 nvl(pl.waybill_airbill_num, ph.waybill_airbill_num) p_airbill_waybill,
124 nvl(pl.bill_of_lading, ph.bill_of_lading) p_bill_of_lading,
125 ph.packaging_code p_packaging_code,
126 nvl(pl.num_of_containers, ph.num_of_containers) p_num_of_container,
127 ph.gross_weight p_gross_weight,
128 ph.gross_weight_uom_code p_gross_weight_uom,
129 ph.net_weight p_net_weight,
130 ph.net_weight_uom_code p_net_weight_uom,
131 ph.tar_weight p_tar_weight,
132 ph.tar_weight_uom_code p_tar_weight_uom,
133 -- null p_hazard_class,
134 -- null p_hazard_code,
135 -- null p_hazard_desc,
136 ph.special_handling_code p_special_handling_code,
137 nvl(pl.freight_carrier_code, ph.freight_carrier_code) p_freight_carrier,
138 ph.freight_terms p_freight_carrier_terms,
139 ph.carrier_equipment p_carrier_equip,
140 ph.carrier_method p_carrier_method,
141 ph.freight_bill_number p_freight_bill_num
142 -- null p_receipt_num,
143 -- null p_ussgl_txn_code
144 from pos_asn_shop_cart_headers ph,
145 pos_asn_shop_cart_details pl
146 where ph.session_id = l_session_id and
147 pl.session_id = l_session_id and
148 exists (select 'ok'
149 from po_location_associations pla
150 where pla.location_id = ph.ship_to_location_id and
151 pla.vendor_id is not null and
152 pla.vendor_site_id is not null);
153
154 cursor c_buyer is
155 select poh.agent_id buyer_id,
156 posh.shipment_num shipment_num,
157 posh.ship_date ship_date,
158 nvl(posd.expected_receipt_date, posh.expected_receipt_date)
159 expected_receipt_date,
160 posh.vendor_id supplier_id,
161 pov.vendor_name supplier
162 from pos_asn_shop_cart_headers posh,
163 pos_asn_shop_cart_details posd,
164 po_headers_all poh,
165 po_vendors pov
166 where posh.session_id = l_session_id and
167 posd.session_id = l_session_id and
168 poh.po_header_id = posd.po_header_id and
169 pov.vendor_id = posh.vendor_id;
170
171
172 TYPE t_text_table is table of varchar2(240) index by binary_integer;
173 g_dummy t_text_table;
174
175 FUNCTION set_session_info RETURN BOOLEAN;
176 FUNCTION get_result_value(p_index in number, p_col in number) return varchar2;
177
178 FUNCTION item_reqd(l_index in number) RETURN VARCHAR2;
179 FUNCTION item_halign(l_index in number) RETURN VARCHAR2;
180 FUNCTION item_valign(l_index in number) RETURN VARCHAR2;
181 FUNCTION item_name(l_index in number) RETURN VARCHAR2;
182 FUNCTION item_code(l_index in number) RETURN VARCHAR2;
183 FUNCTION item_style(l_index in number) RETURN VARCHAR2;
184 FUNCTION item_displayed(l_index in number) RETURN BOOLEAN;
185 FUNCTION item_updateable(l_index in number) RETURN BOOLEAN;
186 FUNCTION item_size (l_index in number) RETURN VARCHAR2;
187 FUNCTION item_maxlength (l_index in number) RETURN VARCHAR2;
188 FUNCTION item_lov(l_index in number) RETURN VARCHAR2;
189 FUNCTION item_lov_multi(l_index in number, l_row in number, l_wip_row in number) RETURN VARCHAR2;
190 FUNCTION item_wrap(l_index in number) RETURN VARCHAR2;
191
192 PROCEDURE hidden_label(l_index in number);
193 PROCEDURE hidden_field(l_index in number,
194 l_res_index in number,
195 l_col in number);
196
197 PROCEDURE single_row_label(l_index in number);
198 PROCEDURE multi_row_label (l_index in number);
199
200 PROCEDURE non_updateable(l_index in number,
201 l_res_index in number,
202 l_col in number);
203 PROCEDURE updateable(l_index in number,
204 l_res_index in number,
205 l_col in number,
206 l_row in number default null,
207 l_wip_row in number default null);
208 PROCEDURE image(l_index in number,
209 href in varchar2);
210
211 PROCEDURE button(src1 IN varchar2,
212 txt1 IN varchar2,
213 src2 IN varchar2,
214 txt2 IN varchar2);
215
216 PROCEDURE buyer_notify;
217
218 PROCEDURE init_page;
219 PROCEDURE init_body;
220 PROCEDURE close_page;
221
222 PROCEDURE show_edit_page;
223 PROCEDURE show_edit_header;
224 PROCEDURE show_shipment_help;
225 PROCEDURE show_edit_shipments;
226 PROCEDURE show_delete_frame;
227
228 PROCEDURE err_htp(msg IN VARCHAR2);
229 PROCEDURE show_error_page;
230 PROCEDURE show_ok_page;
231
232 PROCEDURE print_edit_header;
233 PROCEDURE print_edit_shipments;
234 PROCEDURE print_simple_head_err_page;
235 PROCEDURE print_error_page;
236
237 PROCEDURE create_rcv_header;
238 PROCEDURE create_rcv_transaction;
239
240 PROCEDURE call_wip_api;
241
242 FUNCTION valid_asn RETURN BOOLEAN;
243 PROCEDURE submit;
244
245 PROCEDURE update_shipments(pos_quantity_shipped IN t_text_table DEFAULT g_dummy,
246 pos_select IN t_text_table DEFAULT g_dummy,
247 pos_unit_of_measure IN t_text_table DEFAULT g_dummy,
248 pos_comments IN t_text_table DEFAULT g_dummy,
249 pos_asn_line_id IN t_text_table DEFAULT g_dummy,
250 pos_asn_line_split_id IN t_text_table DEFAULT g_dummy,
251 pos_po_line_location_id IN t_text_table DEFAULT g_dummy,
252 pos_po_distribution_id IN t_text_table DEFAULT g_dummy,
253 pos_asn_wip_job IN t_text_table DEFAULT g_dummy,
254 pos_wip_entity_id IN t_text_table DEFAULT g_dummy,
255 pos_wip_line_id IN t_text_table DEFAULT g_dummy,
256 pos_wip_operation_seq_num IN t_text_table DEFAULT g_dummy,
257 pos_item_id IN t_text_table DEFAULT g_dummy,
258 pos_uom_class IN t_text_table DEFAULT g_dummy,
259 pos_po_header_id IN t_text_table DEFAULT g_dummy,
260 pos_submit IN VARCHAR2 DEFAULT null);
261
262 PROCEDURE update_header( pos_asn_shipment_num IN VARCHAR2 DEFAULT null,
263 pos_bill_of_lading IN VARCHAR2 DEFAULT null,
264 pos_waybill_airbill_num IN VARCHAR2 DEFAULT null,
265 pos_ship_date IN VARCHAR2 DEFAULT null,
266 pos_expected_receipt_date IN VARCHAR2 DEFAULT null,
267 pos_num_of_containers IN VARCHAR2 DEFAULT null,
268 pos_comments IN VARCHAR2 DEFAULT null,
269 pos_packing_slip IN VARCHAR2 DEFAULT null,
270 pos_freight_carrier IN VARCHAR2 DEFAULT null,
271 pos_freight_carrier_code IN VARCHAR2 DEFAULT null,
272 pos_freight_term IN VARCHAR2 DEFAULT null,
273 pos_freight_term_code IN VARCHAR2 DEFAULT null,
274 pos_freight_bill_num IN VARCHAR2 DEFAULT null,
275 pos_carrier_method IN VARCHAR2 DEFAULT null,
276 pos_carrier_equipment IN VARCHAR2 DEFAULT null,
277 pos_gross_weight IN VARCHAR2 DEFAULT null,
278 pos_gross_weight_uom IN VARCHAR2 DEFAULT null,
279 pos_gross_weight_uom_code IN VARCHAR2 DEFAULT null,
280 pos_net_weight IN VARCHAR2 DEFAULT null,
281 pos_net_weight_uom IN VARCHAR2 DEFAULT null,
282 pos_net_weight_uom_code IN VARCHAR2 DEFAULT null,
283 pos_tar_weight IN VARCHAR2 DEFAULT null,
284 pos_tar_weight_uom IN VARCHAR2 DEFAULT null,
285 pos_tar_weight_uom_code IN VARCHAR2 DEFAULT null,
286 pos_packaging_code IN VARCHAR2 DEFAULT null,
287 pos_special_handling_code IN VARCHAR2 DEFAULT null,
288 pos_ship_to_organization_id IN VARCHAR2 DEFAULT null);
289
290 END pos_asn;