698: -- RFQs, Consumption Advice among others
699: --Parameters:
700: --IN:
701: --p_api_version
702: -- API standard IN parameter
703: --p_batch_id
704: -- The id that will be used to identify the rows in the interface table. The unique identifier
705: -- for the all the documents to be created. It will be the same as interface_header_id
706: -- as we always create 1 doc at a time.
722: -- Used as IN for document id to ADD to N/A for sourcing.
723: -- Used as OUT for returning the id of the document created.
724: --OUT:
725: --x_return_status
726: -- The standard OUT parameter giving return status of the API call.
727: --x_msg_count
728: -- The count of number of messages added to the message list in this call
729: --x_msg_data
730: -- If the count is 1 then x_msg_data contains the message returned
772: l_progress VARCHAR2(3) := '000'; --< Bug 3210331 >
773:
774: BEGIN
775: --
776: -- Standard Start of API savepoint
777: SAVEPOINT create_documents_pvt;
778:
779: -- Standard call to check for call compatibility.
780: IF NOT FND_API.compatible_api_call (
775: --
776: -- Standard Start of API savepoint
777: SAVEPOINT create_documents_pvt;
778:
779: -- Standard call to check for call compatibility.
780: IF NOT FND_API.compatible_api_call (
781: p_current_version_number => l_api_version,
782: p_caller_version_number => p_api_version,
783: p_api_name => l_api_name,
869: --
870: -- tax is calculated for this document type
871:
872: IF (g_document_type = 'PO' and
873: g_document_subtype in ('STANDARD', 'PLANNED', 'RELEASE')) THEN
874: g_calculate_tax_flag := 'Y';
875: END IF;
876:
877:
1076: if x_number_lines>0 and x_document_id is not null then
1077: x_return_status := FND_API.G_RET_STS_SUCCESS ;
1078: --
1079: -- Need to populate document number for autocreate success message
1080: IF g_document_subtype = 'STANDARD' THEN
1081: select segment1
1082: into x_document_number
1083: from po_headers_all
1084: where po_header_id = x_document_id;
1105:
1106: IF (g_interface_source_code = 'CONSUMPTION_ADVICE') and
1107: (x_errorcode = 1 ) THEN
1108:
1109: IF g_document_subtype = 'STANDARD' THEN
1110:
1111: l_progress:= '160';
1112: update po_headers_all
1113: set authorization_status = 'APPROVED',
1497: end if;
1498: -- Bug 3807992 end
1499:
1500: -- Bug 2816396 START
1501: -- Default the pay_on_code for a Standard PO based
1502: -- on the vendor site value.
1503: if (vendor.pay_on_code = 'RECEIPT_AND_USE') then
1504: vendor.pay_on_code := 'RECEIPT';
1505: elsif (vendor.pay_on_code = 'USE') then
1517: -- g_rate_for_req_fields
1518: --
1519: IF (g_interface_source_code <> 'SOURCING'
1520: AND g_purchasing_ou_id <> g_hdr_requesting_ou_id
1521: AND interface.document_subtype = 'STANDARD')
1522: THEN
1523: get_rate_for_req_price(
1524: p_requesting_ou_id => g_hdr_requesting_ou_id, --
1525: p_purchasing_ou_id => g_purchasing_ou_id, --
1541:
1542: IF (g_mode = 'ADD') THEN
1543: /*Bug no 718918:sarunach
1544: The x_new_revised_date was added for bug no 491306 to update
1545: the revised_date.But it was inside the loop for standard and planned
1546: po's only.So the revised_date was Releases was incorrect.
1547: Removed those line and put it here to update the revised date for
1548: Standard,planned and Releases.
1549: */
1544: The x_new_revised_date was added for bug no 491306 to update
1545: the revised_date.But it was inside the loop for standard and planned
1546: po's only.So the revised_date was Releases was incorrect.
1547: Removed those line and put it here to update the revised date for
1548: Standard,planned and Releases.
1549: */
1550: -- Bug 902976, zxzhang, 10/04/99
1551: -- Change REVISED_DATE from VarChar(25) to Date.
1552: /*
1569: interface.vendor_site_id,
1570: vendor.invoice_match_option);
1571: end if;
1572:
1573: IF(interface.document_subtype = 'STANDARD' or
1574: interface.document_subtype = 'PLANNED') THEN
1575:
1576: l_progress:='100';
1577:
1741: /** BUG 873209
1742: * The date mask on interface.h_rate_date causes this insertion
1743: * failed on tst115 database.
1744: */
1745: IF(interface.document_subtype = 'STANDARD' or
1746: interface.document_subtype = 'PLANNED' or
1747: --
1748: --Allow to create blanket also
1749: interface.document_subtype = 'BLANKET'
1994: g_purchasing_ou_id --
1995: ,p_conterms_exist_flag --
1996: ,l_document_creation_method --
1997: ,decode(g_interface_source_code,'CONSUMPTION_ADVICE',
1998: PO_DOC_STYLE_GRP.get_standard_doc_style ,interface.style_id) --
2000: , interface.created_language --
2001: , interface.cpa_reference --
2002: );
2128: end if; --attachments for header
2129:
2130: l_progress:= '260';
2131: -- the call to procedure calculate_local should happen only for doc_type PO
2132: if (g_document_subtype='STANDARD' or g_document_subtype='PLANNED') then
2133: calculate_local('PO', 'HEADER', interface.po_header_id);
2134: end if;
2135:
2136: IF g_debug_stmt THEN
2236: -- Bug 882050: Release header level global attribute
2237:
2238: calculate_local('RELEASE', 'HEADER', g_po_release_id);
2239:
2240: END IF; /* of Standard/Planned */
2241: END IF; /* of NEW/ADD */ --Bug#5024876: Uncommenting the END IF commented by Bug#4886821
2242:
2243: l_progress:='300';
2244: --
2426:
2427: l_progress := '360';
2428: /* FPI GA start Update the terms after the successful completion of PO */
2429:
2430: IF (g_document_subtype = 'STANDARD') and
2431: (g_interface_source_code <> 'CONSUMPTION_ADVICE') then -- CONSIGNED FPI
2432: po_interface_s2.update_terms(x_document_id);
2433: END IF;
2434:
2494: l_progress:='400';
2495:
2496: -- Bug 882050: Document level global attribute
2497:
2498: if (interface.document_subtype = 'STANDARD' or
2499: interface.document_subtype = 'PLANNED') THEN
2500:
2501: calculate_local('PO', 'DOCUMENT', interface.po_header_id);
2502: elsif (g_document_subtype='RELEASE') THEN
2513: -- Removed multiple tax calls from procedure
2514: -- create_shipment and placed a single call here for calculating
2515: -- tax for the whole document
2516: --
2517: IF (g_document_subtype in ('STANDARD', 'PLANNED')) THEN
2518: l_progress := '413';
2519: l_return_status := NULL;
2520: -- Bug 5067321. For Add To, x_document_id is null, use
2521: -- interface.po_header_id instead
2856: -- If called from Sourcing, simply use the rate specified in the interface
2857: -- table.
2858: IF (g_interface_source_code <> 'SOURCING'
2859: AND g_purchasing_ou_id <> l_requesting_ou_id
2860: AND interface.document_subtype = 'STANDARD')
2861: THEN
2862: get_rate_for_req_price(
2863: p_requesting_ou_id => l_requesting_ou_id, -- IN
2864: p_purchasing_ou_id => g_purchasing_ou_id, -- IN
2914: ** Note that we do not need to check if the line exists in the
2915: ** interface table since we are in the process of inserting
2916: ** lines into the po lines table on a record by record basis.
2917: */
2918: IF(g_document_subtype='STANDARD' or g_document_subtype='PLANNED' or
2919: g_document_type = 'RFQ'
2920: --
2921: --do the select for blanket also
2922: or g_document_subtype = 'BLANKET') THEN
3021: --mchandak 02/11/2002
3022: --Bug# 2219743
3023: --Added logic to default secondary qnty,UOM and grade in po_lines
3024: --if common purchasing is installed for OPM dual item
3025: IF(g_document_subtype='STANDARD' or g_document_subtype='PLANNED') AND NOT GML_PO_FOR_PROCESS.check_po_for_proc
3026: THEN
3027: x_retvar := FND_INSTALLATION.get_app_info(x_product,x_opm_installed,x_dummy,x_dummy);
3028: BEGIN
3029: l_progress := '060';
3113: -- GA line have different UOM's, convert to the GA's UOM if the
3114: -- UOM Convert profile is Yes. If UOM Convert is No, do not create
3115: -- this line.
3116: IF (interface.from_line_id IS NOT NULL)
3117: AND (g_document_subtype = 'STANDARD') THEN
3118:
3119: l_progress := '110';
3120: BEGIN
3121: --bug#3612701 modified the sql to fetch type lookup code
3673: --
3674:
3675: l_progress := '290';
3676:
3677: IF(g_document_subtype='STANDARD' or g_document_subtype='PLANNED' or
3678: --
3679: --insert Blankets also
3680: g_document_subtype='BLANKET' or
3681: g_document_type = 'RFQ') THEN
3695: --
3696: --
3697: -- Call the Pricing API only when...
3698: --
3699: -- 1) Autocreating a Standard PO
3700: -- 2) Source Document exists
3701: -- 3) Not a Consumption Advice
3702: -- 4) Requisition Line's Contractor Status is not 'ASSIGNED'
3703: -- ( if the contractor status is 'ASSIGNED',
3704: -- then we take the price directly from the Requisition Line )
3705: --
3706: -- 5) Not a complex work PO
3707: l_contractor_status := PO_SERVICES_PVT.get_contractor_status(interface.requisition_line_id); --
3708: IF ( ( g_document_subtype = 'STANDARD' )
3709: AND ( interface.from_line_id IS NOT NULL OR
3710: --
3711: interface.contract_id IS NOT NULL)
3712: --
3779:
3780: /* GA FPI end */
3781: l_progress := '360';
3782:
3783: --
3785: --
3786: -- This functionality is not supported from Sourcing. One cannot
3787: -- create a Standard PO from Sourcing with Temp Labor lines (with price
3783: --
3784: -- then setup the Interface tables to copy over Price Differentials.
3785: --
3786: -- This functionality is not supported from Sourcing. One cannot
3787: -- create a Standard PO from Sourcing with Temp Labor lines (with price
3788: -- differentials).
3789: IF ( g_document_subtype = 'STANDARD' AND
3790: --
3791: g_interface_source_code not in ('SOURCING', 'CONSUMPTION_ADVICE')
3785: --
3786: -- This functionality is not supported from Sourcing. One cannot
3787: -- create a Standard PO from Sourcing with Temp Labor lines (with price
3788: -- differentials).
3789: IF ( g_document_subtype = 'STANDARD' AND
3790: --
3791: g_interface_source_code not in ('SOURCING', 'CONSUMPTION_ADVICE')
3792: AND (NOT p_is_complex_work_po)) --
3793: THEN
3886: l_progress := '420';
3887:
3888: --
3889: -- IF secondary quantity is null and item is dual uom control , default the secondary qty.
3890: IF (g_document_subtype='STANDARD' OR g_document_subtype='PLANNED' OR g_document_type = 'PA')
3891: THEN
3892: IF interface.item_id is not null THEN
3893: IF item.secondary_uom_code IS NOT NULL THEN
3894: IF (interface.secondary_quantity IS NULL OR
4202: --
4203:
4204: l_progress := '440';
4205:
4206: /* Bug 2962568 globalization procedure shouldn't be called for Standard RFQ's
4207: as it is not significant for the same.
4208: */
4209: if g_document_type = 'RFQ' then
4210: null;
4207: as it is not significant for the same.
4208: */
4209: if g_document_type = 'RFQ' then
4210: null;
4211: elsif (interface.document_subtype = 'STANDARD' or
4212: interface.document_subtype = 'PLANNED' or
4213: --
4214: interface.document_subtype = 'BLANKET'
4215: ) THEN
4488: bug 935866 */
4489: -- update secondary quantity to somevalue only if old or new secondary_quantity is not null else update it
4490: -- to null(for discrete items) - 1548597
4491:
4492: /* GA FPI start : For a standard PO if the source document exists then we call the pricing
4493: API to get the correct price for the parameters on the requisition */
4494:
4495: IF (g_document_subtype='STANDARD')
4496: AND nvl(l_manual_price_change_flag, 'N') <> 'Y' --bug 3495772
4491:
4492: /* GA FPI start : For a standard PO if the source document exists then we call the pricing
4493: API to get the correct price for the parameters on the requisition */
4494:
4495: IF (g_document_subtype='STANDARD')
4496: AND nvl(l_manual_price_change_flag, 'N') <> 'Y' --bug 3495772
4497: AND (interface.from_line_id IS NOT NULL OR
4498: --
4499: interface.contract_id IS NOT NULL)
4617: WHERE po_line_id = x_po_line_id;
4618:
4619: --
4620: --All the shipments which have been created need to get the
4621: --new price as on the line for Standard POs.
4622: UPDATE po_line_locations_all
4623: -- Bug 3417479
4624: -- SET price_override = x_unit_price
4625: SET price_override = nvl(x_unit_price, price_override)
4767: -- If Job Long Description exists, convert it to an attachment.
4768: --
4769: IF ( l_job_long_description IS NOT NULL ) THEN
4770:
4771: -- Initialize Standard WHO Columns.
4772: --
4773: l_who_rec.created_by := interface.created_by;
4774: l_who_rec.creation_date := interface.creation_date;
4775: l_who_rec.last_update_login := interface.last_update_login;
4940: END IF;
4941:
4942: --copy attachments/notes from negotiation/bid to po/blanket line
4943: if g_interface_source_code = 'SOURCING' then
4944: if interface.document_subtype = 'STANDARD' then
4945: if interface.requisition_line_id is not null then
4946: x_column1:='NEGREQ';
4947: l_progress:='710';
4948: SELECT requisition_header_id
4954: end if;
4955: elsif interface.document_subtype = 'BLANKET' then
4956: x_column1:='NEG';
4957: end if;
4958: if interface.document_subtype in ('BLANKET','STANDARD') then
4959: l_progress:='720';
4960:
4961: po_negotiations_sv2.handle_sourcing_attachments(
4962: interface.auction_header_id,
4984:
4985: -- Bug 2875346 start.
4986: -- If autocreating a SPO or PPO, and the requisition line has a one-time
4987: -- location, move the attachment from the PO line to the PO shipment
4988: IF (g_document_subtype IN ('STANDARD', 'PLANNED')) AND
4989: (has_one_time_location(interface.requisition_line_id))
4990: THEN
4991: -- Bug 2894378. Use BEGIN-EXCEPTION-END for exception handling to
4992: -- support original FPH behavior.
5339: p_token => l_progress,
5340: p_message => 'from line id :'||interface.from_line_id||'from header id:'||interface.from_header_id);
5341: END IF;
5342:
5343: IF (interface.from_line_id IS NOT NULL) AND (g_document_subtype = 'STANDARD') THEN
5344:
5345: l_progress := '015';
5346:
5347: BEGIN
5383: -- bug 5208159 : end
5384:
5385: IF (g_document_subtype='RELEASE')
5386: -- Bug 2735840 Convert UOM when autocreating a PO that references a GA
5387: OR ((g_document_subtype='STANDARD')
5388: AND (interface.from_line_id is not null)) THEN
5389:
5390: /* Enh : 1660036
5391: get the uom from the PO . This will be used for uom conversion */
5470: */
5471:
5472: x_ship_to_location_id := get_ship_to_loc(interface.deliver_to_location_id); -- FPI
5473:
5474: IF(g_document_subtype='STANDARD' or g_document_subtype='PLANNED' or
5475: g_document_type = 'RFQ')THEN
5476: l_progress := '060';
5477: BEGIN
5478: SELECT poll.line_location_id,poll.secondary_unit_of_measure --
5482: WHERE poll.po_header_id = interface.po_header_id
5483: AND poll.po_line_id = pol.po_line_id
5484: AND poll.shipment_num = interface.shipment_num
5485: AND pol.line_num = interface.line_num
5486: AND poll.shipment_type in ('STANDARD','PLANNED', 'RFQ');
5487: EXCEPTION
5488: WHEN NO_DATA_FOUND THEN
5489: IF g_debug_stmt THEN --< Bug 3210331: use proper debugging >
5490: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
6320:
6321: -- Bug 882050: Shipment level global attribute
6322: if g_document_type = 'RFQ' then
6323: null;
6324: elsif (interface.document_subtype = 'STANDARD' or
6325: interface.document_subtype = 'PLANNED') THEN
6326:
6327: calculate_local('PO', 'SHIPMENT', x_line_location_id);
6328: elsif (g_document_subtype='RELEASE') THEN
6692:
6693: -- bug 5208159 : Conversion of req UOM to Quotation UOM should always happen if the
6694: -- source document is a quote and profile 'PO: Convert Requisition UOM to Source Document UOM'
6695: -- should be ignored in that case
6696: IF (interface.from_line_id IS NOT NULL) AND (g_document_subtype = 'STANDARD') THEN
6697: l_progress := '085';
6698:
6699: BEGIN
6700:
6719: -- bug 5208159 end
6720:
6721: IF (g_document_subtype='RELEASE')
6722: -- Bug 2735840 Convert UOM when autocreating a PO that references a GA
6723: OR ((g_document_subtype='STANDARD')
6724: AND (interface.from_line_id is not null)) THEN
6725:
6726: /* get the uom from the PO . This will be used for uom conversion */
6727: BEGIN
7143: fetch c_dist into x_po_distribution_id;
7144:
7145: exit when c_dist%NOTFOUND;
7146:
7147: if (interface.document_subtype = 'STANDARD' or
7148: interface.document_subtype = 'PLANNED') THEN
7149:
7150: l_progress := '220';
7151: calculate_local('PO', 'DISTRIBUTION', x_po_distribution_id);
8028: END IF;
8029:
8030: -- Ignore for RFQ's and Blankets
8031: IF ( g_document_type <> 'PO' OR
8032: g_document_subtype <> 'STANDARD' ) THEN
8033:
8034: l_progress := '010';
8035: IF g_debug_stmt THEN --< Bug 3210331: use proper debugging >
8036: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
8819:
8820: /* Adding Req Line to New PO/RFQ */
8821: ELSIF(g_mode='NEW') THEN
8822:
8823: IF(g_document_subtype='STANDARD' or g_document_subtype='PLANNED'
8824: or g_document_type = 'RFQ'
8825: --
8826: or (g_document_subtype='BLANKET' and g_interface_source_code='SOURCING')) THEN
8827: l_progress:='060';
8944: p_token => l_progress,
8945: p_message => 'Setup: Header id of Blanket: '||x_po_header_id);
8946: END IF;
8947:
8948: END IF;/* of standard/planned/release */
8949:
8950: l_progress:='090';
8951:
8952: SELECT min(interface_line_id)
10055:
10056: l_progress := '030';
10057:
10058:
10059: IF ((x_document_subtype IN ('STANDARD', 'PLANNED')) OR
10060: (g_document_type = 'RFQ'))
10061: THEN
10062:
10063: -- Bug 3825483
10060: (g_document_type = 'RFQ'))
10061: THEN
10062:
10063: -- Bug 3825483
10064: -- For Standard and Planned POs and RFQs, the line number
10065: -- will be the same as the req line number if the profile
10066: -- is set to 'Y' otherwise use sequential numbers
10067:
10068: IF (FND_PROFILE.VALUE('PO_USE_REQ_NUM_IN_AUTOCREATE') = 'Y') THEN
10308:
10309: -- mode = 'ADD'
10310: -- add to a po/release with the same order as on the req.
10311:
10312: IF ((x_document_subtype IN ('STANDARD', 'PLANNED'))
10313: OR (g_document_type = 'RFQ'))
10314: THEN
10315:
10316: -- The inteface table will hold the requisition line id that we
10576: ELSE
10577:
10578: -- group code is DEFAULT
10579:
10580: IF ((x_document_subtype IN ('STANDARD', 'PLANNED', 'BLANKET')) OR
10581: (g_document_type = 'RFQ'))
10582: THEN
10583:
10584: l_progress := '230';
11645:
11646: END LOOP;
11647: CLOSE interface_lines;
11648:
11649: END IF; -- If STANDARD/PLANNED/RELEASE
11650:
11651: END IF; -- of same as REQUISITION mode
11652:
11653: END IF; -- of PO mode
11838: x_ship_to_location_id := get_ship_to_loc(x_deliver_to_location_id); -- FPI
11839:
11840: x_po_shipment_num := -1;
11841:
11842: IF ((g_document_subtype='STANDARD' OR g_document_subtype='PLANNED')
11843: AND g_document_type = 'PO') THEN
11844:
11845: l_progress:='030';
11846:
11999: PO_SYSTEM_PARAMETERS_ALL PSP --
12000: WHERE PLL.LINE_LOCATION_ID = x_line_location_to_check
12001: AND PRL.REQUISITION_LINE_ID = x_requisition_line_id
12002: AND rtrim(nvl(PLL.note_to_receiver,'99')) = rtrim(nvl(x_note_to_receiver,'99'))
12003: AND PLL.SHIPMENT_TYPE in ('STANDARD', 'SCHEDULED',
12004: 'BLANKET')
12005: AND NVL(PLL.ENCUMBERED_FLAG,'N') = 'N'
12006: AND NVL(PLL.CANCEL_FLAG,'N') = 'N'
12007: AND NVL(psp.org_id, -99) = NVL(g_purchasing_ou_id, -99)
12208: AND rtrim(nvl(PLL.note_to_receiver,'99')) = rtrim(nvl(x_note_to_receiver,'99'))
12209: AND PLL.SHIP_TO_LOCATION_ID = x_ship_to_location_id
12210: AND PLL.SHIP_TO_ORGANIZATION_ID =
12211: x_destination_org_id
12212: AND PLL.SHIPMENT_TYPE in ('STANDARD', 'SCHEDULED',
12213: 'BLANKET')
12214: AND NVL(PLL.ENCUMBERED_FLAG,'N') = 'N'
12215: AND NVL(PLL.CANCEL_FLAG,'N') = 'N'
12216: -- start of 1548597
12767: ** Get the maximum shipment number in the po tables
12768: */
12769: l_progress := '020';
12770:
12771: IF (g_document_subtype = 'STANDARD'
12772: OR g_document_subtype = 'PLANNED' OR
12773: g_document_type = 'RFQ')
12774: THEN
12775:
12775:
12776: /* GA FPI start : if create new line parameter is 'Y' then we need to reset
12777: the shipment number and create a new line with one shipment */
12778:
12779: IF nvl(x_create_new_line,'N') = 'Y' and g_document_subtype = 'STANDARD' THEN
12780:
12781: x_int_shipment_num := 0;
12782: x_shipment_num := 0;
12783:
12831: select nvl(max(shipment_num),0)
12832: into x_shipment_num
12833: from po_line_locations_all poll --
12834: where poll.po_line_id = x_po_line_id
12835: and poll.shipment_type in ('STANDARD', 'PLANNED', 'RFQ');
12836:
12837: -- Bug 605715, lpo, 01/05/98
12838: -- We now check to see if the line_num matches as well by
12839: -- appending an AND condition in the WHERE clause.
13243:
13244: l_value_basis PO_LINES_ALL.order_type_lookup_code%TYPE; --
13245:
13246: BEGIN
13247: -- Standard start of API savepoint
13248: SAVEPOINT create_price_break_pvt;
13249:
13250: IF g_debug_stmt THEN --< Bug 3210331: use proper debugging >
13251: PO_DEBUG.debug_begin(p_log_head => g_log_head||l_api_name);
13597: --Modifies:
13598: -- None
13599: --Locks:
13600: -- None
13601: --Function: Verifies that Config ID lines are only placed on the Standard PO
13602: -- document type.
13603: --Parameters:
13604: --IN:
13605: --p_interface_header_id
13604: --IN:
13605: --p_interface_header_id
13606: -- header ID of the interface records to check
13607: --Returns:
13608: -- TRUE if the document type is Standard PO, or if none of the lines have
13609: -- Config ID; FALSE otherwise.
13610: --Testing:
13611: -- None
13612: --End of Comments
13621: l_progress VARCHAR2(3) := '000'; --< Bug 3210331 >
13622:
13623: BEGIN
13624:
13625: IF (g_document_type = 'PO' AND g_document_subtype = 'STANDARD') THEN
13626: RETURN TRUE; -- The lines are being placed on a Standard PO.
13627: END IF;
13628:
13629: SELECT count(*)
13622:
13623: BEGIN
13624:
13625: IF (g_document_type = 'PO' AND g_document_subtype = 'STANDARD') THEN
13626: RETURN TRUE; -- The lines are being placed on a Standard PO.
13627: END IF;
13628:
13629: SELECT count(*)
13630: INTO l_num_config_id_lines
13637: RETURN TRUE; -- None of the lines have Config ID.
13638: ELSE
13639: l_progress := '010';
13640: -- We do not allow req lines with Config ID to be placed on any document type
13641: -- other than Standard PO.
13642: IF g_debug_stmt THEN --< Bug 3210331: use proper debugging >
13643: PO_DEBUG.debug_stmt(p_log_head => g_log_head||l_api_name,
13644: p_token => l_progress,
13645: p_message => FND_MESSAGE.get_string('PO','PO_CONFIG_ID_ONLY_ON_STD_PO'));
13984: -- p_precision: precision of the currency desired. Used to round amounts.
13985: -- p_ext_precision: extended precision of the currency desired.
13986: -- Used to round prices
13987: -- OUT:
13988: -- x_line_location_id: id of the first actuals (STANDARD) payitem
13989: -- in po_line_locations_all
13990: -- x_line_loc_id_tbl: ids of all payitems created in po_line_locations_all
13991: --Notes:
13992: -- None
14184:
14185: d_progress := 70;
14186:
14187: -- if financing case, create actual delivery payitem
14188: -- this payitem has a shipment_type of STANDARD and payment_type of DELIVERY
14189:
14190: --SQL WHAT: Insert information for delivery payitem into
14191: -- po_line_locations_interface table
14192: --SQL WHY : We will use line_locations_interface as a
14216: , l_line_quantity
14217: , l_line_amount
14218: , l_line_unit_price
14219: , 'DELIVERY'
14220: , 'STANDARD'
14221: , interface.item_description
14222: , 1
14223: , interface.need_by_date
14224: , interface.promised_date --Bug5532424
14296:
14297: IF (l_isFinancing) THEN
14298: l_shipment_type := 'PREPAYMENT';
14299: ELSE
14300: l_shipment_type := 'STANDARD';
14301: END IF;
14302:
14303: d_progress := 110;
14304:
14632: x_line_loc_id_tbl(l_payitems_created) := l_line_loc_id;
14633: l_payitem_tax_code_id_tbl.EXTEND;
14634: l_payitem_tax_code_id_tbl(l_payitems_created) := l_tax_code_id;
14635:
14636: -- set x_line_location_id to id of first actual (STANDARD) payitem
14637: IF ((x_line_location_id IS NULL)
14638: AND (line_location_rec.shipment_type = 'STANDARD')) THEN
14639: x_line_location_id := l_line_loc_id;
14640: END IF;
14634: l_payitem_tax_code_id_tbl(l_payitems_created) := l_tax_code_id;
14635:
14636: -- set x_line_location_id to id of first actual (STANDARD) payitem
14637: IF ((x_line_location_id IS NULL)
14638: AND (line_location_rec.shipment_type = 'STANDARD')) THEN
14639: x_line_location_id := l_line_loc_id;
14640: END IF;
14641:
14642: END LOOP; -- poll_interface_cursor loop
15241: AND deliv.line_location_id =
15242: ( SELECT poll.line_location_id
15243: FROM po_line_locations_all poll
15244: WHERE poll.po_line_id = p_po_line_id
15245: AND poll.shipment_type = 'STANDARD'
15246: AND poll.shipment_num =
15247: ( SELECT min(poll2.shipment_num)
15248: FROM po_line_locations_all poll2
15249: WHERE poll2.po_line_id = poll.po_line_id
15246: AND poll.shipment_num =
15247: ( SELECT min(poll2.shipment_num)
15248: FROM po_line_locations_all poll2
15249: WHERE poll2.po_line_id = poll.po_line_id
15250: AND poll2.shipment_type = 'STANDARD'))
15251: AND pod.line_location_id = deliv.line_location_id;
15252:
15253: d_progress := 150;
15254: IF (PO_LOG.d_stmt) THEN