329: -- Name
330: -- PROCESS_LINE
331: -- Purpose
332: -- Creates or updates a BPO Line
333: -- By creating a row in PO_LINES_INTERFACE
334: -- Updates the collaboration,
335: -- Based on Catalog line details
336: -- Arguments
337: -- Catalog line header details
440: -- Need to find if it a duplicate item
441: BEGIN
442: SELECT line_num
443: INTO l_line_num
444: FROM PO_LINES_INTERFACE
445: WHERE interface_header_id = p_itf_hdr_id
446: AND nvl(ITEM, '-1') = nvl(p_item, '-1')
447: AND nvl(UOM_CODE, '-1') = nvl(l_uom_code, '-1')
448: AND ROWNUM < 2; -- All the rows returned by this query have either the same line_num or no rows
504: END IF;
505:
506: x_line_num := l_line_num;
507:
508: INSERT INTO po_lines_interface(interface_header_id,
509: interface_line_id,
510: item,
511: ITEM_REVISION,
512: CATEGORY,
569: SELECT cln_generic_s.nextval
570: INTO l_line_num
571: FROM DUAL;
572: x_line_num := l_line_num;
573: INSERT INTO po_lines_interface(interface_header_id,
574: interface_line_id,
575: item,
576: ITEM_REVISION,
577: CATEGORY,
653: INTO l_line_num
654: FROM DUAL;
655: x_line_num := l_line_num;
656: cln_debug_pub.Add('x_line_num:' || x_line_num, 1);
657: INSERT INTO po_lines_interface(interface_header_id,
658: interface_line_id,
659: item,
660: line_num)
661: values(p_itf_hdr_id,
743:
744: -- Name
745: -- PROCESS_PRICE_BREAKS
746: -- Purpose
747: -- Creates a PRICE BREAK row in PO_LINES_INTERFACE
748: -- based on Catalog line details
749: -- Arguments
750: -- Catalog line details and price break details
751: -- Notes
840:
841: -- Is this the first timephase price break
842: SELECT count(*)
843: INTO l_count
844: FROM po_lines_interface
845: WHERE interface_header_id = p_itf_hdr_id
846: AND interface_line_id = interface_line_id
847: AND line_num = p_line_num;
848: IF (l_Debug_Level <= 1) THEN
854:
855: -- Get the unit price at line level
856: SELECT unit_price
857: INTO l_line_price
858: FROM po_lines_interface
859: WHERE interface_header_id = p_itf_hdr_id
860: AND interface_line_id = interface_line_id
861: AND line_num = p_line_num;
862: IF (l_Debug_Level <= 1) THEN
866:
867: IF l_line_price IS NULL OR l_line_price = 0 THEN
868: -- Update the line price because price at line level is not available
869: -- it comes as the first timephase price break
870: UPDATE po_lines_interface
871: SET unit_price = p_price
872: WHERE interface_header_id = p_itf_hdr_id
873: AND interface_line_id = interface_line_id
874: AND line_num = p_line_num;
880: SELECT cln_generic_s.nextval
881: INTO l_line_ship_num
882: FROM DUAL;
883:
884: INSERT INTO po_lines_interface(interface_header_id,
885: interface_line_id,
886: item,
887: ITEM_REVISION,
888: line_num,