1 PACKAGE BODY GMF_PO_AP_MATCH_DATA AS
2 /* $Header: gmfmtchb.pls 115.0 99/07/16 04:21:03 porting shi $ */
3 CURSOR po_send_ap(poheaderid number) IS
4 SELECT po_l_l.quantity,
5 po_l_l.quantity_received,
6 po_l_l.quantity_billed,
7 po_l_l.quantity_cancelled,
8 po_l_l.quantity_accepted,
9 ap_i_d.invoice_id
10 FROM po_line_locations_all po_l_l,
11 po_distributions_all po_d,
12 ap_invoice_distributions_all ap_i_d
13 WHERE po_d.po_header_id = poheaderid AND
14 ap_i_d.po_distribution_id =
15 po_d.po_distribution_id AND
16 po_d.line_location_id =
17 po_l_l.line_location_id;
18 PROCEDURE po_send_ap_match_data(
19 poheaderid number,
20 qty out number,
21 qty_rcvd out number,
22 qty_bill out number,
23 qty_canl out number,
24 qty_acpt out number,
25 inv_num in out number,
26 row_to_fetch in out number,
27 statuscode out number) is
28 Begin /* Beginning of procedure po_send_ap_match_data */
29 IF NOT po_send_ap%ISOPEN THEN
30 OPEN po_send_ap(poheaderid);
31 End if;
32
33 FETCH po_send_ap
34 INTO qty,
35 qty_rcvd,
36 qty_bill,
37 qty_canl,
38 qty_acpt,
39 inv_num;
40 IF po_send_ap%NOTFOUND or row_to_fetch = 1 THEN
41 CLOSE po_send_ap;
42 if po_send_ap%NOTFOUND then
43 statuscode := 100;
44 end if;
45 END IF;
46 EXCEPTION
47 WHEN OTHERS THEN
48 statuscode := SQLCODE;
49 End; /* End of procedure po_send_ap_match_data */
50 END GMF_PO_AP_MATCH_DATA; -- End po_send_ap_match_data