DBA Data[Home] [Help]

APPS.PO_AUTOCREATE_MAINPROC_PVT dependencies on PO_AUTOCREATE_PARAMS

Line 73: po_autocreate_params.g_draft_id ,

69: * as procedure po_lines_draft_pkg.sync_draft_from_txn has
70: * the required check. But still we check to be on safe side.
71: */
72: SELECT pla.po_line_id ,
73: po_autocreate_params.g_draft_id ,
74: 'N' -- Need to check with Vinod.
75: BULK COLLECT
76: INTO po_line_id_tbl ,
77: draft_id_tbl ,

Line 82: WHERE PLI.interface_header_id = po_autocreate_params.g_interface_header_id

78: delete_flag_tbl
79: FROM po_lines_interface pli ,
80: po_lines_all pla ,
81: po_headers_interface phi
82: WHERE PLI.interface_header_id = po_autocreate_params.g_interface_header_id
83: AND phi.interface_header_id = PLI.interface_header_id
84: AND PLA.po_header_id = PhI.po_header_id
85: AND PLI.line_num = PLA.line_num
86: AND NOT EXISTS

Line 89: WHERE pld.draft_id = po_autocreate_params.g_draft_id

85: AND PLI.line_num = PLA.line_num
86: AND NOT EXISTS
87: (SELECT 'Y'
88: FROM po_lines_draft_all pld
89: WHERE pld.draft_id = po_autocreate_params.g_draft_id
90: AND pld.po_line_id = PLA.po_line_id
91: );
92:
93: --

Line 96: WHERE po_header_id = po_autocreate_params.g_po_header_id;

92:
93: --
94: SELECT style_id INTO l_style_id
95: FROM po_headers_all
96: WHERE po_header_id = po_autocreate_params.g_po_header_id;
97:
98: IF g_debug_stmt THEN
99: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
100: p_token => l_progress,

Line 124: po_autocreate_params.g_draft_id ,

120: END IF;
121:
122: l_progress := '030';
123: SELECT plla.line_location_id ,
124: po_autocreate_params.g_draft_id ,
125: 'N' -- Need to check with Vinod.
126: BULK COLLECT
127: INTO po_line_loc_id_tbl ,
128: draft_id_tbl ,

Line 134: WHERE PLI.interface_header_id = po_autocreate_params.g_interface_header_id

130: FROM TABLE(po_line_id_tbl) pl ,
131: po_line_locations_all plla ,
132: po_lines_interface PLI ,
133: po_headers_interface phi
134: WHERE PLI.interface_header_id = po_autocreate_params.g_interface_header_id
135: AND phi.interface_header_id = PLI.interface_header_id
136: AND plla.po_header_id = PhI.po_header_id
137: AND PLI.shipment_num = PLlA.shipment_num
138: AND plla.po_line_id = pl.column_value

Line 142: WHERE plld.draft_id = po_autocreate_params.g_draft_id

138: AND plla.po_line_id = pl.column_value
139: AND NOT EXISTS
140: (SELECT 'Y'
141: FROM po_line_locations_draft_all plld
142: WHERE plld.draft_id = po_autocreate_params.g_draft_id
143: AND plld.line_location_id = plla.line_location_id
144: );
145:
146: IF g_debug_stmt THEN

Line 177: po_autocreate_params.g_draft_id ,

173: p_message => 'Before Sync Distributions Draft From Transaction');
174: END IF;
175:
176: SELECT pod.po_distribution_id ,
177: po_autocreate_params.g_draft_id ,
178: 'N' -- Need to check with Vinod.
179: BULK COLLECT
180: INTO po_dist_id_tbl ,
181: draft_id_tbl ,

Line 189: WHERE podd.draft_id = po_autocreate_params.g_draft_id

185: WHERE pod.line_location_id = pll.column_value
186: AND NOT EXISTS
187: (SELECT 'Y'
188: FROM po_distributions_draft_all podd
189: WHERE podd.draft_id = po_autocreate_params.g_draft_id
190: AND podd.po_distribution_id = pod.po_distribution_id
191: );
192:
193: l_progress := '060';

Line 281: IF PO_AUTOCREATE_PARAMS.g_document_type = 'PO' AND x_drop_ship_flag = 'Y' THEN

277: l_progress := '010';
278: -- Do not group shipments if the req has a one-time location.
279: IF(has_one_time_location(x_requisition_line_id))THEN
280: x_po_shipment_num := -1;
281: IF PO_AUTOCREATE_PARAMS.g_document_type = 'PO' AND x_drop_ship_flag = 'Y' THEN
282: x_create_new_line := 'Y';
283: END IF;
284: IF g_debug_stmt THEN
285: PO_DEBUG.debug_stmt(p_log_head => g_log_head || l_api_name, p_token => l_progress, p_message => 'One-time location. Shipment num = -1');

Line 295: IF((PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD' OR PO_AUTOCREATE_PARAMS.g_document_subtype = 'PLANNED') AND PO_AUTOCREATE_PARAMS.g_document_type = 'PO')THEN

291: l_progress := '020';
292: x_ship_to_location_id := get_ship_to_loc(x_deliver_to_location_id); -- FPI
293: x_po_shipment_num := -1;
294:
295: IF((PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD' OR PO_AUTOCREATE_PARAMS.g_document_subtype = 'PLANNED') AND PO_AUTOCREATE_PARAMS.g_document_type = 'PO')THEN
296: l_progress := '030';
297: /* Consigned FPI start : split the following select to determine if a new line
298: is to be created or just a new shipment */
299:

Line 311: AND pll.draft_id =PO_AUTOCREATE_PARAMS.g_draft_id

307: INTO x_po_shipment_num,
308: x_line_location_to_check
309: FROM PO_LINE_LOCATIONS_MERGE_V PLL --
310: WHERE PLL.PO_LINE_ID = x_po_line_id
311: AND pll.draft_id =PO_AUTOCREATE_PARAMS.g_draft_id
312: AND((TO_CHAR(PLL.need_by_date - (to_number(SUBSTR(TO_CHAR(PLL.need_by_date, 'DD-MM-YYYY HH24:MI:SS'), 18, 2)) / 86400), 'DD-MM-YYYY HH24:MI:SS') =
313: TO_CHAR(x_need_by_date - (to_number(SUBSTR(TO_CHAR(x_need_by_date, 'DD-MM-YYYY HH24:MI:SS'), 18, 2)) / 86400), 'DD-MM-YYYY HH24:MI:SS') )
314: OR (PLL.need_by_date IS NULL
315: AND x_need_by_date IS NULL) )

Line 346: AND draft_id =PO_AUTOCREATE_PARAMS.g_draft_id

342: INTO x_po_shipment_num,
343: x_line_location_to_check
344: FROM PO_LINE_LOCATIONS_MERGE_V PLL --
345: WHERE PLL.PO_LINE_ID = x_po_line_id
346: AND draft_id =PO_AUTOCREATE_PARAMS.g_draft_id
347: AND PLL.SHIP_TO_LOCATION_ID = x_ship_to_location_id
348: AND PLL.SHIP_TO_ORGANIZATION_ID = x_destination_org_id
349: AND ROWNUM = 1;
350: EXCEPTION

Line 380: AND pll.draft_id =PO_AUTOCREATE_PARAMS.g_draft_id

376: INTO x_po_shipment_num,
377: x_line_location_to_check
378: FROM PO_LINE_LOCATIONS_MERGE_V PLL --
379: WHERE PLL.PO_LINE_ID = x_po_line_id
380: AND pll.draft_id =PO_AUTOCREATE_PARAMS.g_draft_id
381: AND NVL(PLL.drop_ship_flag, 'N') <> 'Y' -- cannot add to Drop Ship Shipments
382: AND NVL(PLL.CONSIGNED_FLAG, 'N') = NVL(x_consigned_flag, 'N')
383: AND ROWNUM = 1;
384: EXCEPTION

Line 413: AND pll.draft_id =PO_AUTOCREATE_PARAMS.g_draft_id

409: FROM PO_LINE_LOCATIONS_MERGE_V PLL, --
410: PO_REQUISITION_LINES_ALL PRL, --
411: PO_SYSTEM_PARAMETERS_ALL PSP --
412: WHERE PLL.LINE_LOCATION_ID = x_line_location_to_check
413: AND pll.draft_id =PO_AUTOCREATE_PARAMS.g_draft_id
414: AND PRL.REQUISITION_LINE_ID = x_requisition_line_id
415: AND rtrim(NVL(PLL.note_to_receiver, '99')) = rtrim(NVL(x_note_to_receiver, '99'))
416: AND PLL.SHIPMENT_TYPE IN('STANDARD', 'SCHEDULED', 'BLANKET')
417: AND NVL(PLL.ENCUMBERED_FLAG, 'N') = 'N'

Line 419: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99)

415: AND rtrim(NVL(PLL.note_to_receiver, '99')) = rtrim(NVL(x_note_to_receiver, '99'))
416: AND PLL.SHIPMENT_TYPE IN('STANDARD', 'SCHEDULED', 'BLANKET')
417: AND NVL(PLL.ENCUMBERED_FLAG, 'N') = 'N'
418: AND NVL(PLL.CANCEL_FLAG, 'N') = 'N'
419: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99)
420: AND PLL.ACCRUE_ON_RECEIPT_FLAG = DECODE(l_intf_txn_flow_header_id, NULL, --
421: DECODE(prl.destination_type_code,
422: 'EXPENSE', DECODE(psp.expense_accrual_code,
423: 'PERIOD END', 'N', DECODE(NVL(l_item_receipt_required_flag,

Line 425: NVL(PO_AUTOCREATE_PARAMS.g_vendor_receipt_req_flag,

421: DECODE(prl.destination_type_code,
422: 'EXPENSE', DECODE(psp.expense_accrual_code,
423: 'PERIOD END', 'N', DECODE(NVL(l_item_receipt_required_flag,
424: NVL(l_intf_receipt_required_flag,
425: NVL(PO_AUTOCREATE_PARAMS.g_vendor_receipt_req_flag,
426: NVL(PO_AUTOCREATE_PARAMS.g_sys.receiving_flag, 'N')))),
427: 'N', 'N', 'Y')), 'Y'), 'Y') --
428: AND ( (PLL.PREFERRED_GRADE IS NULL
429: AND x_preferred_grade IS NULL)

Line 426: NVL(PO_AUTOCREATE_PARAMS.g_sys.receiving_flag, 'N')))),

422: 'EXPENSE', DECODE(psp.expense_accrual_code,
423: 'PERIOD END', 'N', DECODE(NVL(l_item_receipt_required_flag,
424: NVL(l_intf_receipt_required_flag,
425: NVL(PO_AUTOCREATE_PARAMS.g_vendor_receipt_req_flag,
426: NVL(PO_AUTOCREATE_PARAMS.g_sys.receiving_flag, 'N')))),
427: 'N', 'N', 'Y')), 'Y'), 'Y') --
428: AND ( (PLL.PREFERRED_GRADE IS NULL
429: AND x_preferred_grade IS NULL)
430: OR (PLL.PREFERRED_GRADE = x_preferred_grade) )

Line 462: IF(x_po_shipment_num = -1) AND (PO_AUTOCREATE_PARAMS.g_document_type = 'PO')THEN

458: END IF;
459: END IF;
460: END IF;
461:
462: IF(x_po_shipment_num = -1) AND (PO_AUTOCREATE_PARAMS.g_document_type = 'PO')THEN
463: /*
464: ** Get the receipt required flag that
465: ** will be inserted for the shipment.
466: */

Line 496: AND phi.interface_header_id = po_autocreate_params.g_interface_header_id

492: AND PLT.order_type_lookup_code NOT IN('RATE', 'FIXED PRICE')
493: AND phi.vendor_id = pov.vendor_id( + )
494: --AND phi.interface_header_id = pli.interface_header_id
495: --CLM Phase-2 Autocreate Change
496: AND phi.interface_header_id = po_autocreate_params.g_interface_header_id
497: AND pli.interface_header_id = phi.interface_header_id
498: AND prl.requisition_line_id = pli.requisition_line_id
499: AND pli.requisition_line_id = x_requisition_line_id
500: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --

Line 500: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --

496: AND phi.interface_header_id = po_autocreate_params.g_interface_header_id
497: AND pli.interface_header_id = phi.interface_header_id
498: AND prl.requisition_line_id = pli.requisition_line_id
499: AND pli.requisition_line_id = x_requisition_line_id
500: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
501: AND NVL(fsp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99); --
502:
503: EXCEPTION
504: WHEN NO_DATA_FOUND THEN

Line 501: AND NVL(fsp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99); --

497: AND pli.interface_header_id = phi.interface_header_id
498: AND prl.requisition_line_id = pli.requisition_line_id
499: AND pli.requisition_line_id = x_requisition_line_id
500: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
501: AND NVL(fsp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99); --
502:
503: EXCEPTION
504: WHEN NO_DATA_FOUND THEN
505: IF g_debug_stmt THEN

Line 517: IF(PO_AUTOCREATE_PARAMS.g_document_type = 'PO')THEN

513: RAISE;
514: END;
515:
516: l_progress := '140';
517: IF(PO_AUTOCREATE_PARAMS.g_document_type = 'PO')THEN
518: BEGIN
519: /*
520: ** See if a record that has just been inserted into the
521: ** interface table matches the shipment you are trying to create.

Line 538: AND NVL(psp.org_id,-99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --

534: PO_VENDORS POV,
535: PO_HEADERS_INTERFACE PHI
536: WHERE PLI.LINE_NUM = x_po_line_num
537: AND PLI.shipment_num IS NOT NULL
538: AND NVL(psp.org_id,-99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
539: AND NVL(fsp.org_id,-99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
540: AND PLI.item_id = MSI.inventory_item_id( + )
541: AND NVL(MSI.organization_id, FSP.inventory_organization_id) = FSP.inventory_organization_id
542: AND PLI.line_type_id = PLT.line_type_id

Line 539: AND NVL(fsp.org_id,-99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --

535: PO_HEADERS_INTERFACE PHI
536: WHERE PLI.LINE_NUM = x_po_line_num
537: AND PLI.shipment_num IS NOT NULL
538: AND NVL(psp.org_id,-99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
539: AND NVL(fsp.org_id,-99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
540: AND PLI.item_id = MSI.inventory_item_id( + )
541: AND NVL(MSI.organization_id, FSP.inventory_organization_id) = FSP.inventory_organization_id
542: AND PLI.line_type_id = PLT.line_type_id
543: AND PHI.vendor_id = POV.vendor_id( + )

Line 633: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --

629: AND PLI.line_type_id = PLT.line_type_id
630: AND PHI.vendor_id = POV.vendor_id( + )
631: AND PLI.interface_header_id = PHI.interface_header_id
632: AND PRL.REQUISITION_LINE_ID = x_requisition_line_id
633: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
634: AND NVL(fsp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
635: --Bug 4599140 (included the following OR condition so that the SQL works correctly
636: --for null need by date)
637: AND((TO_CHAR(PLI.need_by_date - (to_number(SUBSTR(TO_CHAR(PLI.need_by_date, 'DD-MM-YYYY HH24:MI:SS'), 18, 2)) / 86400), 'DD-MM-YYYY HH24:MI:SS') =

Line 634: AND NVL(fsp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --

630: AND PHI.vendor_id = POV.vendor_id( + )
631: AND PLI.interface_header_id = PHI.interface_header_id
632: AND PRL.REQUISITION_LINE_ID = x_requisition_line_id
633: AND NVL(psp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
634: AND NVL(fsp.org_id, -99) = NVL(po_autocreate_params.g_purchasing_ou_id, -99) --
635: --Bug 4599140 (included the following OR condition so that the SQL works correctly
636: --for null need by date)
637: AND((TO_CHAR(PLI.need_by_date - (to_number(SUBSTR(TO_CHAR(PLI.need_by_date, 'DD-MM-YYYY HH24:MI:SS'), 18, 2)) / 86400), 'DD-MM-YYYY HH24:MI:SS') =
638: TO_CHAR(x_need_by_date - (to_number(SUBSTR(TO_CHAR(x_need_by_date, 'DD-MM-YYYY HH24:MI:SS'), 18, 2)) / 86400), 'DD-MM-YYYY HH24:MI:SS') )

Line 679: IF PO_AUTOCREATE_PARAMS.g_document_type = 'PO' AND x_drop_ship_flag = 'Y' THEN

675: END IF;
676: --end of change
677: END IF; -- end of grouping
678:
679: IF PO_AUTOCREATE_PARAMS.g_document_type = 'PO' AND x_drop_ship_flag = 'Y' THEN
680: x_po_shipment_num := -1;
681: END IF;
682:
683: IF g_debug_stmt THEN

Line 758: IF ( PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD'

754: /*
755: ** Get the maximum shipment number in the po tables
756: */
757: l_progress := '020';
758: IF ( PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD'
759: OR PO_AUTOCREATE_PARAMS.g_document_subtype = 'PLANNED'
760: OR PO_AUTOCREATE_PARAMS.g_document_type = 'RFQ' ) THEN
761: /* GA FPI start : if create new line parameter is 'Y' then we need to reset
762: the shipment number and create a new line with one shipment */

Line 759: OR PO_AUTOCREATE_PARAMS.g_document_subtype = 'PLANNED'

755: ** Get the maximum shipment number in the po tables
756: */
757: l_progress := '020';
758: IF ( PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD'
759: OR PO_AUTOCREATE_PARAMS.g_document_subtype = 'PLANNED'
760: OR PO_AUTOCREATE_PARAMS.g_document_type = 'RFQ' ) THEN
761: /* GA FPI start : if create new line parameter is 'Y' then we need to reset
762: the shipment number and create a new line with one shipment */
763: IF NVL (x_create_new_line, 'N') = 'Y' AND PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD' THEN

Line 760: OR PO_AUTOCREATE_PARAMS.g_document_type = 'RFQ' ) THEN

756: */
757: l_progress := '020';
758: IF ( PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD'
759: OR PO_AUTOCREATE_PARAMS.g_document_subtype = 'PLANNED'
760: OR PO_AUTOCREATE_PARAMS.g_document_type = 'RFQ' ) THEN
761: /* GA FPI start : if create new line parameter is 'Y' then we need to reset
762: the shipment number and create a new line with one shipment */
763: IF NVL (x_create_new_line, 'N') = 'Y' AND PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD' THEN
764: x_int_shipment_num := 0;

Line 763: IF NVL (x_create_new_line, 'N') = 'Y' AND PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD' THEN

759: OR PO_AUTOCREATE_PARAMS.g_document_subtype = 'PLANNED'
760: OR PO_AUTOCREATE_PARAMS.g_document_type = 'RFQ' ) THEN
761: /* GA FPI start : if create new line parameter is 'Y' then we need to reset
762: the shipment number and create a new line with one shipment */
763: IF NVL (x_create_new_line, 'N') = 'Y' AND PO_AUTOCREATE_PARAMS.g_document_subtype = 'STANDARD' THEN
764: x_int_shipment_num := 0;
765: x_shipment_num := 0;
766: l_progress := '030';
767:

Line 774: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);

770: FROM po_headers_all ph, --
771: po_lines_all pl --
772: WHERE pl.po_header_id = ph.po_header_id
773: AND ph.segment1 = x_document_num
774: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);
775: --
776:
777: l_progress := '040';
778: SELECT NVL (MAX (line_num), 0)

Line 832: AND NVL (pr.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)

828: AND pr.po_header_id = ph.po_header_id
829: AND pr.release_num = x_release_num
830: AND ph.type_lookup_code = 'BLANKET'
831: AND poll.po_release_id = pr.po_release_id
832: AND NVL (pr.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)
833: --
834: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);
835: --
836:

Line 834: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);

830: AND ph.type_lookup_code = 'BLANKET'
831: AND poll.po_release_id = pr.po_release_id
832: AND NVL (pr.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)
833: --
834: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);
835: --
836:
837: l_progress := '090';
838: /*

Line 937: PO_AUTO_HEADER_PROCESS_PVT.fetch_headers( p_interface_header_id => PO_AUTOCREATE_PARAMS.x_interface_header_id, x_headers => x_headers );

933: PO_DEBUG.debug_begin(p_log_head => g_log_head||l_api_name);
934: END IF;
935:
936: l_progress := '010';
937: PO_AUTO_HEADER_PROCESS_PVT.fetch_headers( p_interface_header_id => PO_AUTOCREATE_PARAMS.x_interface_header_id, x_headers => x_headers );
938:
939: l_progress := '020';
940: PO_AUTO_HEADER_PROCESS_PVT.derive_and_default_headers(x_headers);
941:

Line 953: IF (PO_AUTOCREATE_PARAMS.g_document_subtype IN ('STANDARD','PLANNED','BLANKET')) THEN

949: PO_AUTO_HEADER_PROCESS_PVT.merge_to_org_assign_draft(x_headers);
950:
951: l_progress := '060';
952:
953: IF (PO_AUTOCREATE_PARAMS.g_document_subtype IN ('STANDARD','PLANNED','BLANKET')) THEN
954: PO_AUTOCREATE_PVT.calculate_local(PO_AUTOCREATE_PARAMS.g_document_subtype, 'HEADER', x_headers.po_header_id);
955: END IF;
956:
957: IF g_debug_stmt THEN

Line 954: PO_AUTOCREATE_PVT.calculate_local(PO_AUTOCREATE_PARAMS.g_document_subtype, 'HEADER', x_headers.po_header_id);

950:
951: l_progress := '060';
952:
953: IF (PO_AUTOCREATE_PARAMS.g_document_subtype IN ('STANDARD','PLANNED','BLANKET')) THEN
954: PO_AUTOCREATE_PVT.calculate_local(PO_AUTOCREATE_PARAMS.g_document_subtype, 'HEADER', x_headers.po_header_id);
955: END IF;
956:
957: IF g_debug_stmt THEN
958: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name, p_token => l_progress, p_message => 'End of Process');

Line 1089: x_interface_header_id NUMBER := po_autocreate_params.g_interface_header_id;

1085: IS
1086:
1087: l_progress VARCHAR2 (3) := '000';
1088: l_api_name VARCHAR2 (30) := 'group_interface_records';
1089: x_interface_header_id NUMBER := po_autocreate_params.g_interface_header_id;
1090: x_is_complex_work_po BOOLEAN := po_autocreate_params.g_is_complex_work_po;
1091: x_line_num NUMBER;
1092: x_shipment_num NUMBER;
1093: x_document_num VARCHAR2 (30);

Line 1090: x_is_complex_work_po BOOLEAN := po_autocreate_params.g_is_complex_work_po;

1086:
1087: l_progress VARCHAR2 (3) := '000';
1088: l_api_name VARCHAR2 (30) := 'group_interface_records';
1089: x_interface_header_id NUMBER := po_autocreate_params.g_interface_header_id;
1090: x_is_complex_work_po BOOLEAN := po_autocreate_params.g_is_complex_work_po;
1091: x_line_num NUMBER;
1092: x_shipment_num NUMBER;
1093: x_document_num VARCHAR2 (30);
1094: x_release_num NUMBER;

Line 1174: WHERE interface_header_id = po_autocreate_params.g_interface_header_id

1170: CURSOR intf_sourcing_lines
1171: IS
1172: SELECT ROWID
1173: FROM po_lines_interface pli
1174: WHERE interface_header_id = po_autocreate_params.g_interface_header_id
1175: ORDER BY bid_line_number;
1176:
1177: l_sourcing_temp_num NUMBER :=1;
1178: CURSOR interface_lines

Line 1321: p_message => 'Mode is:' || PO_AUTOCREATE_PARAMS.g_mode ||' g_group_code '|| PO_AUTOCREATE_PARAMS.g_group_code );

1317:
1318: l_progress := '020';
1319: IF g_debug_stmt THEN
1320: po_debug.debug_stmt (p_log_head => g_log_head || l_api_name, p_token => l_progress,
1321: p_message => 'Mode is:' || PO_AUTOCREATE_PARAMS.g_mode ||' g_group_code '|| PO_AUTOCREATE_PARAMS.g_group_code );
1322: END IF;
1323:
1324: IF (x_document_type_code IN ('PO', 'PA')) THEN
1325: IF (PO_AUTOCREATE_PARAMS.g_group_code = 'REQUISITION') THEN

Line 1325: IF (PO_AUTOCREATE_PARAMS.g_group_code = 'REQUISITION') THEN

1321: p_message => 'Mode is:' || PO_AUTOCREATE_PARAMS.g_mode ||' g_group_code '|| PO_AUTOCREATE_PARAMS.g_group_code );
1322: END IF;
1323:
1324: IF (x_document_type_code IN ('PO', 'PA')) THEN
1325: IF (PO_AUTOCREATE_PARAMS.g_group_code = 'REQUISITION') THEN
1326: IF (PO_AUTOCREATE_PARAMS.g_mode = 'NEW') THEN
1327: -- Create a new PO with Req. lines in
1328: -- the same order as on the requisition.
1329: -- The interface table will hold the requisition line id

Line 1326: IF (PO_AUTOCREATE_PARAMS.g_mode = 'NEW') THEN

1322: END IF;
1323:
1324: IF (x_document_type_code IN ('PO', 'PA')) THEN
1325: IF (PO_AUTOCREATE_PARAMS.g_group_code = 'REQUISITION') THEN
1326: IF (PO_AUTOCREATE_PARAMS.g_mode = 'NEW') THEN
1327: -- Create a new PO with Req. lines in
1328: -- the same order as on the requisition.
1329: -- The interface table will hold the requisition line id
1330: -- that we need to get the req line number from.

Line 1338: IF (fnd_profile.VALUE ('PO_USE_REQ_NUM_IN_AUTOCREATE') = 'Y' AND po_autocreate_params.g_interface_source_code <> 'SOURCING') THEN

1334: IF (x_document_subtype IN ('STANDARD', 'PLANNED')) THEN
1335: -- For Standard and Planned POs, the line number
1336: -- will be the same as the req line number if the profile
1337: -- is set to 'Y' otherwise use sequential numbers
1338: IF (fnd_profile.VALUE ('PO_USE_REQ_NUM_IN_AUTOCREATE') = 'Y' AND po_autocreate_params.g_interface_source_code <> 'SOURCING') THEN
1339:
1340: -- use requisition numbers
1341: l_progress := '035';
1342: UPDATE po_lines_interface pli

Line 1363: IF po_autocreate_params.g_interface_source_code <> 'SOURCING' THEN

1359: ;
1360: ELSE
1361: -- use sequential numbers
1362: l_progress := '040';
1363: IF po_autocreate_params.g_interface_source_code <> 'SOURCING' THEN
1364:
1365: OPEN interface_lines_temp;
1366: LOOP
1367: x_count := x_count + 1;

Line 1409: END IF; -- po_autocreate_params.g_interface_source_code <> 'SOURCING

1405: AND NVL (clm_info_flag, 'N') = 'N';
1406:
1407: l_sourcing_temp_num := l_sourcing_temp_num + 1;
1408: END LOOP;
1409: END IF; -- po_autocreate_params.g_interface_source_code <> 'SOURCING
1410: END IF; -- if fnd_profile.value(PO_USE_REQ_NUM...) = 'Y'
1411: END IF; -- x_document_subtype IN ('STANDARD', 'PLANNED')
1412:
1413: ELSE

Line 1425: po_debug.debug_stmt (p_log_head => g_log_head || l_api_name, p_token => l_progress, p_message => 'Group_interface_lines: mode is :' || PO_AUTOCREATE_PARAMS.g_mode );

1421: -- Shipment num should be 1.
1422: l_progress := '120';
1423:
1424: IF g_debug_stmt THEN
1425: po_debug.debug_stmt (p_log_head => g_log_head || l_api_name, p_token => l_progress, p_message => 'Group_interface_lines: mode is :' || PO_AUTOCREATE_PARAMS.g_mode );
1426: END IF;
1427:
1428: SELECT NVL (MAX (pl.line_num), 0)
1429: INTO x_line_num

Line 1433: AND pl.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id

1429: INTO x_line_num
1430: FROM po_headers_all ph,
1431: po_lines_merge_v pl
1432: WHERE pl.po_header_id = ph.po_header_id
1433: AND pl.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
1434: AND ph.segment1 = x_document_num
1435: AND ph.type_lookup_code = x_document_subtype
1436: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);
1437:

Line 1436: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);

1432: WHERE pl.po_header_id = ph.po_header_id
1433: AND pl.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
1434: AND ph.segment1 = x_document_num
1435: AND ph.type_lookup_code = x_document_subtype
1436: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);
1437:
1438: l_progress := '130';
1439: OPEN interface_lines_temp;
1440: LOOP

Line 1662: AND pol.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id

1658: x_po_line_num
1659: FROM po_lines_merge_v pol,
1660: po_headers_all poh
1661: WHERE poh.segment1 = x_document_num
1662: AND pol.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
1663: AND pol.line_num = x_interface_line_num
1664: AND poh.type_lookup_code = x_document_subtype
1665: AND poh.po_header_id = pol.po_header_id
1666: AND NVL (poh.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);

Line 1666: AND NVL (poh.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);

1662: AND pol.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
1663: AND pol.line_num = x_interface_line_num
1664: AND poh.type_lookup_code = x_document_subtype
1665: AND poh.po_header_id = pol.po_header_id
1666: AND NVL (poh.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99);
1667:
1668: --
1669: -- In the manual option when a Req. Line is added to the PO
1670: -- and PO has the same Item, the PO Line is matched and

Line 1742: IF (PO_AUTOCREATE_PARAMS.g_document_type IN ('PO', 'PA')) THEN

1738: po_debug.debug_stmt (p_log_head => g_log_head || l_api_name, p_token => l_progress, p_message => 'x_action = ' || x_action );
1739: END IF;
1740:
1741: --: allow lines grouping for blankets also
1742: IF (PO_AUTOCREATE_PARAMS.g_document_type IN ('PO', 'PA')) THEN
1743: --
1744: -- Item could have different grade control for FSP and ship to org.
1745: -- If (shipment)grade is present , compare the grade at line level
1746: -- only if item is grade control for the FSP org.

Line 1754: AND organization_id = po_autocreate_params.g_sys.def_inv_org_id;

1750: SELECT grade_control_flag
1751: INTO l_grade_control_flag
1752: FROM mtl_system_items
1753: WHERE inventory_item_id = x_item_id
1754: AND organization_id = po_autocreate_params.g_sys.def_inv_org_id;
1755:
1756: EXCEPTION
1757: WHEN OTHERS THEN
1758: l_grade_control_flag := 'N';

Line 1787: AND pol2.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id

1783: FROM po_lines_merge_v pol2,
1784: po_headers_all poh,
1785: po_line_types_b plt --
1786: WHERE poh.segment1 = x_document_num
1787: AND pol2.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
1788: AND poh.po_header_id = pol2.po_header_id
1789: AND NVL (poh.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)
1790: --
1791: AND poh.type_lookup_code = x_document_subtype

Line 1789: AND NVL (poh.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)

1785: po_line_types_b plt --
1786: WHERE poh.segment1 = x_document_num
1787: AND pol2.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
1788: AND poh.po_header_id = pol2.po_header_id
1789: AND NVL (poh.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)
1790: --
1791: AND poh.type_lookup_code = x_document_subtype
1792: -- Any new Service line types should
1793: -- cause the SELECT to fail (i.e. should not be matched).

Line 1860: p_message => 'NO_DATA_FOUND: No match to po line: Doc type = ' || PO_AUTOCREATE_PARAMS.g_document_type );

1856: EXCEPTION
1857: WHEN NO_DATA_FOUND THEN
1858: IF g_debug_stmt THEN
1859: po_debug.debug_stmt (p_log_head => g_log_head || l_api_name, p_token => l_progress,
1860: p_message => 'NO_DATA_FOUND: No match to po line: Doc type = ' || PO_AUTOCREATE_PARAMS.g_document_type );
1861: END IF;
1862: x_po_line_num := -1;
1863: WHEN OTHERS THEN
1864: IF g_debug_unexp THEN

Line 1879: IF (PO_AUTOCREATE_PARAMS.g_document_type IN ('PO', 'PA')) THEN

1875: -- Check to see if there is a line in the interface table
1876: -- that matches the line we are attempting to add
1877: IF (x_po_line_num = -1) THEN
1878: --: allow lines grouping for blankets also
1879: IF (PO_AUTOCREATE_PARAMS.g_document_type IN ('PO', 'PA')) THEN
1880: l_progress := '340';
1881: BEGIN
1882: x_ship_to_location_id := get_ship_to_loc (x_deliver_to_location_id);
1883: l_progress := '350';

Line 1988: p_message => 'NO_DATA_FOUND: No match to po line in Interface- Doc type = ' || PO_AUTOCREATE_PARAMS.g_document_type );

1984: EXCEPTION
1985: WHEN NO_DATA_FOUND THEN
1986: IF g_debug_stmt THEN
1987: po_debug.debug_stmt (p_log_head => g_log_head || l_api_name, p_token => l_progress,
1988: p_message => 'NO_DATA_FOUND: No match to po line in Interface- Doc type = ' || PO_AUTOCREATE_PARAMS.g_document_type );
1989: END IF;
1990: x_po_line_num := -1;
1991: WHEN OTHERS THEN
1992: IF g_debug_unexp THEN

Line 2108: AND pl.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id

2104: INTO x_line_num
2105: FROM po_headers_all ph,
2106: po_lines_merge_v pl
2107: WHERE pl.po_header_id = ph.po_header_id
2108: AND pl.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
2109: AND ph.segment1 = x_document_num
2110: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)
2111: AND ph.type_lookup_code = x_document_subtype;
2112:

Line 2110: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)

2106: po_lines_merge_v pl
2107: WHERE pl.po_header_id = ph.po_header_id
2108: AND pl.draft_id = PO_AUTOCREATE_PARAMS.g_draft_id
2109: AND ph.segment1 = x_document_num
2110: AND NVL (ph.org_id, -99) = NVL (po_autocreate_params.g_purchasing_ou_id, -99)
2111: AND ph.type_lookup_code = x_document_subtype;
2112:
2113: -- Get the max line number already assigne in the interface table
2114: l_progress := '420';

Line 2246: IF (po_autocreate_params.g_document_type <> 'PA') THEN

2242: l_progress := '010';
2243: PO_AUTO_LINE_PROCESS_PVT.setup_interface_data;
2244:
2245: l_progress := '020';
2246: IF (po_autocreate_params.g_document_type <> 'PA') THEN
2247: group_interface_records;
2248: END IF;
2249:
2250: IF PO_AUTOCREATE_PARAMS.g_mode = 'ADD' THEN

Line 2250: IF PO_AUTOCREATE_PARAMS.g_mode = 'ADD' THEN

2246: IF (po_autocreate_params.g_document_type <> 'PA') THEN
2247: group_interface_records;
2248: END IF;
2249:
2250: IF PO_AUTOCREATE_PARAMS.g_mode = 'ADD' THEN
2251: l_progress := '030';
2252: merge_to_drafts;
2253: END IF;
2254:

Line 2256: PO_AUTO_LINE_PROCESS_PVT.fetch_lines( p_interface_header_id => PO_AUTOCREATE_PARAMS.x_interface_header_id, p_lines => x_lines );

2252: merge_to_drafts;
2253: END IF;
2254:
2255: l_progress := '040';
2256: PO_AUTO_LINE_PROCESS_PVT.fetch_lines( p_interface_header_id => PO_AUTOCREATE_PARAMS.x_interface_header_id, p_lines => x_lines );
2257:
2258: l_progress := '050';
2259: PO_AUTO_LINE_PROCESS_PVT.derive_and_default_lines(p_lines => x_lines) ;
2260:

Line 2316: IF po_autocreate_params.g_document_subtype = 'BLANKET' THEN

2312: IF g_debug_stmt THEN
2313: PO_DEBUG.debug_begin(p_log_head => g_log_head||l_api_name);
2314: END IF;
2315:
2316: IF po_autocreate_params.g_document_subtype = 'BLANKET' THEN
2317:
2318: IF (po_autocreate_params.g_interface_source_code = 'SOURCING') THEN
2319:
2320: l_progress := '010';

Line 2318: IF (po_autocreate_params.g_interface_source_code = 'SOURCING') THEN

2314: END IF;
2315:
2316: IF po_autocreate_params.g_document_subtype = 'BLANKET' THEN
2317:
2318: IF (po_autocreate_params.g_interface_source_code = 'SOURCING') THEN
2319:
2320: l_progress := '010';
2321: PO_AUTO_LINE_LOC_PROCESS_PVT.create_pricebreak_draft(x_lines);
2322:

Line 2326: ELSIF (po_autocreate_params.g_is_complex_work_po) THEN

2322:
2323: END IF;
2324:
2325: --
2326: ELSIF (po_autocreate_params.g_is_complex_work_po) THEN
2327:
2328: l_progress := '020';
2329: PO_AUTO_LINE_LOC_PROCESS_PVT.create_payitem_draft(x_lines);
2330:

Line 2388: IF (po_autocreate_params.g_is_complex_work_po) THEN

2384: IF g_debug_stmt THEN
2385: PO_DEBUG.debug_begin(p_log_head => g_log_head||l_api_name);
2386: END IF;
2387:
2388: IF (po_autocreate_params.g_is_complex_work_po) THEN
2389:
2390: l_progress := '010';
2391: po_auto_dist_process_pvt.create_payitem_dists( p_lines => x_lines );
2392: IF g_debug_stmt THEN

Line 2743: po_autocreate_params.g_draft_id));

2739: to_pk_col_value_pairs := EGO_COL_NAME_VALUE_PAIR_ARRAY ( EGO_COL_NAME_VALUE_PAIR_OBJ
2740: ( 'PO_LINE_ID', p_po_line_id_tbl(i) ),
2741: EGO_COL_NAME_VALUE_PAIR_OBJ
2742: ( 'DRAFT_ID',
2743: po_autocreate_params.g_draft_id));
2744: IF l_attr_group_tbl.Count > 0
2745: AND l_src_template_id IS NOT NULL
2746: AND l_target_template_id IS NOT NULL
2747: THEN

Line 2871: po_autocreate_params.g_draft_id)),

2867: x_to_pk_col_value_pairs => EGO_COL_NAME_VALUE_PAIR_ARRAY
2868: (EGO_COL_NAME_VALUE_PAIR_OBJ( 'PO_LINE_ID' ,
2869: p_po_line_id_tbl(i)),
2870: EGO_COL_NAME_VALUE_PAIR_OBJ( 'DRAFT_ID' ,
2871: po_autocreate_params.g_draft_id)),
2872: x_copy_attribute_groups => 'SPECIFIC',
2873: x_attribute_group_table => x_attr_group_tbl,
2874: x_return_status => l_return_status,
2875: x_msg_count => l_msg_count,

Line 2921: po_autocreate_params.g_draft_id)),

2917: x_to_pk_col_value_pairs => EGO_COL_NAME_VALUE_PAIR_ARRAY
2918: (EGO_COL_NAME_VALUE_PAIR_OBJ( 'LINE_LOCATION_ID',
2919: p_line_location_id_tbl(i)),
2920: EGO_COL_NAME_VALUE_PAIR_OBJ( 'DRAFT_ID' ,
2921: po_autocreate_params.g_draft_id)),
2922: x_copy_attribute_groups => 'SPECIFIC',
2923: x_attribute_group_table => x_attr_group_tbl,
2924: x_return_status => l_return_status,
2925: x_msg_count => l_msg_count,