63: /* Business object constants. */
64: l_api_name CONSTANT VARCHAR2(30) := 'Update_PoLine';
65: l_api_version CONSTANT NUMBER := 1.0;
66:
67: /* rec_po_line_locations */
68: TYPE lloc_rec IS RECORD (
69: line_location_id po_line_locations.line_location_id%TYPE,
70: quantity po_line_locations.quantity%TYPE,
71: quantity_received po_line_locations.quantity_received%TYPE,
65: l_api_version CONSTANT NUMBER := 1.0;
66:
67: /* rec_po_line_locations */
68: TYPE lloc_rec IS RECORD (
69: line_location_id po_line_locations.line_location_id%TYPE,
70: quantity po_line_locations.quantity%TYPE,
71: quantity_received po_line_locations.quantity_received%TYPE,
72: quantity_accepted po_line_locations.quantity_accepted%TYPE,
73: quantity_billed po_line_locations.quantity_billed%TYPE,
66:
67: /* rec_po_line_locations */
68: TYPE lloc_rec IS RECORD (
69: line_location_id po_line_locations.line_location_id%TYPE,
70: quantity po_line_locations.quantity%TYPE,
71: quantity_received po_line_locations.quantity_received%TYPE,
72: quantity_accepted po_line_locations.quantity_accepted%TYPE,
73: quantity_billed po_line_locations.quantity_billed%TYPE,
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
67: /* rec_po_line_locations */
68: TYPE lloc_rec IS RECORD (
69: line_location_id po_line_locations.line_location_id%TYPE,
70: quantity po_line_locations.quantity%TYPE,
71: quantity_received po_line_locations.quantity_received%TYPE,
72: quantity_accepted po_line_locations.quantity_accepted%TYPE,
73: quantity_billed po_line_locations.quantity_billed%TYPE,
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
75: qty_rcv_exception_code po_line_locations.qty_rcv_exception_code%TYPE,
68: TYPE lloc_rec IS RECORD (
69: line_location_id po_line_locations.line_location_id%TYPE,
70: quantity po_line_locations.quantity%TYPE,
71: quantity_received po_line_locations.quantity_received%TYPE,
72: quantity_accepted po_line_locations.quantity_accepted%TYPE,
73: quantity_billed po_line_locations.quantity_billed%TYPE,
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
75: qty_rcv_exception_code po_line_locations.qty_rcv_exception_code%TYPE,
76: closed_code po_line_locations.closed_code%TYPE,
69: line_location_id po_line_locations.line_location_id%TYPE,
70: quantity po_line_locations.quantity%TYPE,
71: quantity_received po_line_locations.quantity_received%TYPE,
72: quantity_accepted po_line_locations.quantity_accepted%TYPE,
73: quantity_billed po_line_locations.quantity_billed%TYPE,
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
75: qty_rcv_exception_code po_line_locations.qty_rcv_exception_code%TYPE,
76: closed_code po_line_locations.closed_code%TYPE,
77: receive_close_tolerance po_line_locations.receive_close_tolerance%TYPE,
70: quantity po_line_locations.quantity%TYPE,
71: quantity_received po_line_locations.quantity_received%TYPE,
72: quantity_accepted po_line_locations.quantity_accepted%TYPE,
73: quantity_billed po_line_locations.quantity_billed%TYPE,
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
75: qty_rcv_exception_code po_line_locations.qty_rcv_exception_code%TYPE,
76: closed_code po_line_locations.closed_code%TYPE,
77: receive_close_tolerance po_line_locations.receive_close_tolerance%TYPE,
78: process_date po_line_locations.creation_date%TYPE,
71: quantity_received po_line_locations.quantity_received%TYPE,
72: quantity_accepted po_line_locations.quantity_accepted%TYPE,
73: quantity_billed po_line_locations.quantity_billed%TYPE,
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
75: qty_rcv_exception_code po_line_locations.qty_rcv_exception_code%TYPE,
76: closed_code po_line_locations.closed_code%TYPE,
77: receive_close_tolerance po_line_locations.receive_close_tolerance%TYPE,
78: process_date po_line_locations.creation_date%TYPE,
79: new_quantity NUMBER,
72: quantity_accepted po_line_locations.quantity_accepted%TYPE,
73: quantity_billed po_line_locations.quantity_billed%TYPE,
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
75: qty_rcv_exception_code po_line_locations.qty_rcv_exception_code%TYPE,
76: closed_code po_line_locations.closed_code%TYPE,
77: receive_close_tolerance po_line_locations.receive_close_tolerance%TYPE,
78: process_date po_line_locations.creation_date%TYPE,
79: new_quantity NUMBER,
80: changed NUMBER
73: quantity_billed po_line_locations.quantity_billed%TYPE,
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
75: qty_rcv_exception_code po_line_locations.qty_rcv_exception_code%TYPE,
76: closed_code po_line_locations.closed_code%TYPE,
77: receive_close_tolerance po_line_locations.receive_close_tolerance%TYPE,
78: process_date po_line_locations.creation_date%TYPE,
79: new_quantity NUMBER,
80: changed NUMBER
81: );
74: qty_rcv_tolerance po_line_locations.qty_rcv_tolerance%TYPE,
75: qty_rcv_exception_code po_line_locations.qty_rcv_exception_code%TYPE,
76: closed_code po_line_locations.closed_code%TYPE,
77: receive_close_tolerance po_line_locations.receive_close_tolerance%TYPE,
78: process_date po_line_locations.creation_date%TYPE,
79: new_quantity NUMBER,
80: changed NUMBER
81: );
82: /* table_po_line_locations_ot */
78: process_date po_line_locations.creation_date%TYPE,
79: new_quantity NUMBER,
80: changed NUMBER
81: );
82: /* table_po_line_locations_ot */
83: TYPE lloc_tab IS TABLE OF lloc_rec
84: INDEX BY BINARY_INTEGER;
85:
86: CURSOR po_line_csr IS
218: receive_close_tolerance,
219: NVL(need_by_date, promised_date) process_date,
220: 0 new_quantity,
221: 0 changed
222: FROM po_line_locations_all
223: WHERE po_line_id = l_rec.po_line_id
224: ORDER BY process_date;
225: ELSE
226: /* Negative quantity, this is a RETURN against standard POs.
238: receive_close_tolerance,
239: NVL(promised_date, need_by_date) process_date,
240: 0 new_quantity,
241: 0 changed
242: FROM po_line_locations_all
243: WHERE po_line_id = l_rec.po_line_id
244: ORDER BY process_date DESC;
245: END IF;
246: ELSE
262: receive_close_tolerance,
263: NVL(need_by_date, promised_date) process_date,
264: 0 new_quantity,
265: 0 changed
266: FROM po_line_locations_all
267: WHERE po_release_id = l_release_id
268: AND po_header_id = g_po_id
269: ORDER BY process_date;
270: ELSE
283: receive_close_tolerance,
284: NVL(promised_date, need_by_date) process_date,
285: 0 new_quantity,
286: 0 changed
287: FROM po_line_locations_all
288: WHERE po_release_id = l_release_id
289: AND po_header_id = g_po_id
290: ORDER BY process_date DESC;
291: END IF;
616: quantity_delivered
617: FROM po_requisition_lines_all
618: WHERE line_location_id IN (
619: SELECT line_location_id
620: FROM po_line_locations_all
621: WHERE po_line_id = l_rec.po_line_id)
622: ORDER BY need_by_date;
623:
624: TYPE po_req_lines_rec IS RECORD (
737:
738: /* ~processReceipt */
739: PROCEDURE process_receipt_doc IS
740: i NUMBER;
741: l_closed_code po_line_locations.closed_code%TYPE;
742: l_doc_type VARCHAR2(10);
743: l_doc_subtype VARCHAR2(10);
744: l_return_code VARCHAR2(25) := ' ';
745: l_lltab lloc_tab;
783: l_lltab(i).new_quantity, 0);
784: aa_rllocs(l_lltab(i).new_quantity);
785: END IF;
786:
787: ITG_Debug.msg('PRD', 'update po_line_locations_all');
788: UPDATE po_line_locations_all
789: SET quantity_received = l_lltab(i).quantity_received,
790: last_update_date = SYSDATE,
791: last_updated_by = FND_GLOBAL.user_id
784: aa_rllocs(l_lltab(i).new_quantity);
785: END IF;
786:
787: ITG_Debug.msg('PRD', 'update po_line_locations_all');
788: UPDATE po_line_locations_all
789: SET quantity_received = l_lltab(i).quantity_received,
790: last_update_date = SYSDATE,
791: last_updated_by = FND_GLOBAL.user_id
792: WHERE line_location_id = l_lltab(i).line_location_id;
865: RAISE FND_API.G_EXC_ERROR;
866: END IF;
867:
868: FOR i IN 1 .. l_lltab.count LOOP
869: UPDATE po_line_locations_all
870: SET quantity_accepted = l_lltab(i).quantity_accepted,
871: last_update_date = SYSDATE,
872: last_updated_by = FND_GLOBAL.user_id
873: WHERE line_location_id = l_lltab(i).line_location_id;
870: SET quantity_accepted = l_lltab(i).quantity_accepted,
871: last_update_date = SYSDATE,
872: last_updated_by = FND_GLOBAL.user_id
873: WHERE line_location_id = l_lltab(i).line_location_id;
874: ITG_Debug.msg('PID', 'Update po_line_locations_all');
875: ITG_Debug.msg('PID', 'quantity_accepted',
876: l_lltab(i).quantity_accepted);
877: ITG_Debug.msg('PID', 'line_location_id',
878: l_lltab(i).line_location_id);
888:
889: /* ~processInvoice */
890: PROCEDURE process_invoice_doc IS
891: i NUMBER;
892: l_closed_code po_line_locations.closed_code%TYPE;
893: l_doc_type VARCHAR2(10);
894: l_doc_subtype VARCHAR2(10);
895: l_return_code VARCHAR2(25) := ' ';
896: l_qty NUMBER;
930: l_closed_code := get_closed_code(
931: l_lltab(i), l_lltab(i).quantity_billed);
932:
933: /* Update the table for the quantity billed */
934: ITG_Debug.msg('PI', 'Update po_line_locations_all ...');
935: ITG_Debug.msg('PI', 'quantity_billed', l_lltab(i).quantity_billed);
936: ITG_Debug.msg('PI', 'line_location_id', l_lltab(i).line_location_id);
937: UPDATE po_line_locations_all
938: SET quantity_billed = l_lltab(i).quantity_billed,
933: /* Update the table for the quantity billed */
934: ITG_Debug.msg('PI', 'Update po_line_locations_all ...');
935: ITG_Debug.msg('PI', 'quantity_billed', l_lltab(i).quantity_billed);
936: ITG_Debug.msg('PI', 'line_location_id', l_lltab(i).line_location_id);
937: UPDATE po_line_locations_all
938: SET quantity_billed = l_lltab(i).quantity_billed,
939: last_update_date = SYSDATE,
940: last_updated_by = FND_GLOBAL.user_id
941: WHERE line_location_id = l_lltab(i).line_location_id;