21: p_employee_id in number,
22: p_Comments in varchar2,
23: x_parent_interface_txn_id IN OUT NOCOPY number);
24:
25: PROCEDURE insert_interface_errors ( rcv_trx IN OUT NOCOPY rcv_transactions_interface%ROWTYPE,
26: X_column_name IN VARCHAR2,
27: X_err_message IN VARCHAR2);
28:
29: function get_rtv_id(p_transaction_id in number) return number;
70: INTO X_PRIMARY_UOM,
71: X_ITEM_ID,
72: X_PARENT_TYPE,
73: X_TXN_ORG_ID
74: FROM RCV_TRANSACTIONS RT,
75: RCV_SHIPMENT_LINES RL,
76: PO_HEADERS_ALL PH,
77: OE_ORDER_HEADERS_ALL OH
78: WHERE RT.TRANSACTION_ID = P_PARENT_TRANSACTION_ID
149: select rt2.transaction_type,
150: rt2.transaction_id
151: into x_grandparent_type,
152: x_grandparent_id
153: from rcv_transactions rt1,
154: rcv_transactions rt2
155: where rt1.transaction_id = p_parent_transaction_id
156: and rt2.transaction_id = rt1.parent_transaction_id;
157:
150: rt2.transaction_id
151: into x_grandparent_type,
152: x_grandparent_id
153: from rcv_transactions rt1,
154: rcv_transactions rt2
155: where rt1.transaction_id = p_parent_transaction_id
156: and rt2.transaction_id = rt1.parent_transaction_id;
157:
158: -- correct receive first if qty is +'ve
196: select rt2.transaction_type,
197: rt2.transaction_id
198: into x_grandparent_type,
199: x_grandparent_id
200: from rcv_transactions rt1,
201: rcv_transactions rt2
202: where rt1.transaction_id = p_parent_transaction_id
203: and rt2.transaction_id = rt1.parent_transaction_id;
204:
197: rt2.transaction_id
198: into x_grandparent_type,
199: x_grandparent_id
200: from rcv_transactions rt1,
201: rcv_transactions rt2
202: where rt1.transaction_id = p_parent_transaction_id
203: and rt2.transaction_id = rt1.parent_transaction_id;
204:
205: -- correct deliver first if qty is -'ve
346: return number is
347:
348: CURSOR rcv_get_interface_rows IS
349: SELECT *
350: FROM rcv_transactions_interface
351: WHERE group_id = p_group_id OR group_id = p_group_id2
352: ORDER BY interface_transaction_id;
353:
354: rcv_trx rcv_transactions_interface%ROWTYPE;
350: FROM rcv_transactions_interface
351: WHERE group_id = p_group_id OR group_id = p_group_id2
352: ORDER BY interface_transaction_id;
353:
354: rcv_trx rcv_transactions_interface%ROWTYPE;
355: x_return number;
356: valid_wip_info NUMBER :=0;
357: X_column_name VARCHAR2(30);
358: X_err_message VARCHAR2(240);
370: rcv_trx;
371: EXIT WHEN rcv_get_interface_rows%NOTFOUND;
372:
373: IF (rcv_trx.destination_type_code = 'SHOP FLOOR') THEN
374: valid_wip_info := rcv_transactions_sv.val_wip_info (
375: rcv_trx.to_organization_id,
376: rcv_trx.wip_entity_id,
377: rcv_trx.wip_operation_seq_num,
378: rcv_trx.wip_resource_seq_num,
464: nvl(quantity, amount),
465: transaction_type,
466: parent_transaction_id
467: FROM
468: rcv_transactions
469: START WITH transaction_id = c_transaction_id
470: CONNECT BY parent_transaction_id = PRIOR transaction_id;
471:
472: begin
504: transaction_type
505: INTO
506: v_parent_type
507: FROM
508: rcv_transactions
509: WHERE
510: transaction_id = v_parent_id;
511:
512: IF v_parent_type = 'DELIVER' THEN
546: quantity,
547: transaction_type,
548: parent_transaction_id
549: FROM
550: rcv_transactions
551: START WITH transaction_id = c_transaction_id
552: CONNECT BY parent_transaction_id = PRIOR transaction_id;
553:
554: begin
579: transaction_type
580: INTO
581: v_parent_type
582: FROM
583: rcv_transactions
584: WHERE
585: transaction_id = v_parent_id;
586:
587: IF v_parent_type in ('RETURN TO RECEIVING', 'RETURN TO VENDOR') THEN
639: begin
640: if fnd_profile.Value('POR_ENABLE_DEBIT_MEMO') = 'Y' then
641: select povs.create_debit_memo_flag
642: into x_create_debit_memo_flag
643: from po_vendor_sites povs, rcv_transactions rt
644: where povs.vendor_site_id = rt.vendor_site_id
645: and rt.transaction_id = p_parent_transaction_id;
646: else
647: x_create_debit_memo_flag := 'N';
656: p_txn_qty < 0
657: then
658: select rt.subinventory, rt.locator_id
659: into x_from_subinventory, x_from_locator_id
660: from rcv_transactions rt
661: where rt.transaction_id = p_parent_transaction_id;
662: else
663: select rt.from_subinventory, rt.from_locator_id
664: into x_from_subinventory, x_from_locator_id
661: where rt.transaction_id = p_parent_transaction_id;
662: else
663: select rt.from_subinventory, rt.from_locator_id
664: into x_from_subinventory, x_from_locator_id
665: from rcv_transactions rt
666: where rt.transaction_id = p_parent_transaction_id;
667: end if;
668:
669: -- Setting validation flag to Y for ROI
666: where rt.transaction_id = p_parent_transaction_id;
667: end if;
668:
669: -- Setting validation flag to Y for ROI
670: Select RCV_TRANSACTIONS_INTERFACE_S.NEXTVAL
671: INTO x_interface_id
672: FROM DUAL;
673:
674: insert into RCV_TRANSACTIONS_INTERFACE
670: Select RCV_TRANSACTIONS_INTERFACE_S.NEXTVAL
671: INTO x_interface_id
672: FROM DUAL;
673:
674: insert into RCV_TRANSACTIONS_INTERFACE
675: ( receipt_source_code,
676: interface_transaction_id,
677: group_id,
678: org_id,
862: rt.job_id,
863: pol.matching_basis,
864: x_parent_interface_txn_id,
865: nvl(x_uom_code,rt.uom_code)
866: from rcv_transactions rt,
867: rcv_shipment_lines rl,
868: rcv_shipment_headers rh,
869: mtl_system_items msi,
870: po_Lines_all pol
892: select rt2.transaction_id,
893: rt2.parent_transaction_id
894: into x_deliver_id,
895: x_receive_id
896: from rcv_transactions rt1,
897: rcv_transactions rt2
898: where rt1.parent_transaction_id = rt2.transaction_id
899: and rt1.transaction_id = p_transaction_id;
900:
893: rt2.parent_transaction_id
894: into x_deliver_id,
895: x_receive_id
896: from rcv_transactions rt1,
897: rcv_transactions rt2
898: where rt1.parent_transaction_id = rt2.transaction_id
899: and rt1.transaction_id = p_transaction_id;
900:
901: -- Get the RTV transaction
901: -- Get the RTV transaction
902:
903: select min(transaction_id)
904: into x_rtv_id
905: from rcv_transactions
906: where parent_transaction_id = x_receive_id
907: and transaction_type = 'RETURN TO VENDOR'
908: and get_net_returned_qty(transaction_id) = get_net_returned_qty(p_transaction_id);
909:
996: ** Insert into PO_INTERFACE_ERRORS table
997: */
998:
999:
1000: PROCEDURE insert_interface_errors ( rcv_trx IN OUT NOCOPY rcv_transactions_interface%ROWTYPE,
1001: X_column_name IN VARCHAR2,
1002: X_err_message IN VARCHAR2) as
1003:
1004: X_progress VARCHAR2(3) := '000';