144: AND (p_old_header_rec.header_id IS NOT NULL OR
145: p_initial_header_rec.credit_card_number IS NOT NULL))
146: ) -- AND condition added to fix 3098878
147: THEN
148: --oe_debug_pub.add('In credit card number clear ....'||p_x_header_rec.credit_card_number);
149: p_x_header_rec.credit_card_number := FND_API.G_MISS_CHAR;
150:
151: END IF;
152: END CREDIT_CARD_NUMBER;
784:
785:
786: BEGIN
787:
788: oe_debug_pub.add('Entering OE_HEADER_UTIL.Clear_Dependent',1);
789: IF p_src_attr_tbl.COUNT <> 0 THEN
790:
791: OE_Dependencies.Mark_Dependent
792: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
930: END IF;
931: END LOOP;
932: END IF;
933:
934: oe_debug_pub.add('Exiting OE_HEADER_UTIL.Clear_Dependent',1);
935:
936: EXCEPTION
937:
938: WHEN FND_API.G_EXC_ERROR THEN
947: , 'Clear_Dependents'
948: );
949: END IF;
950:
951: oe_debug_pub.add('Error : '||substr(sqlerrm,1,200),1);
952: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
953:
954: END Clear_Dependents;
955:
1546: l_index NUMBER :=0;
1547: l_src_attr_tbl OE_GLOBALS.NUMBER_Tbl_Type;
1548: BEGIN
1549:
1550: oe_debug_pub.add('Entering OE_HEADER_UTIL.CLEAR_DEPENDENT_ATTR', 1);
1551:
1552: IF p_attr_id <> FND_API.G_MISS_NUM THEN
1553:
1554: l_index := l_index + 1.0;
1705: --can be cleared during the future calls when the cc is not selected
1706: --from the LOV.
1707: g_is_cc_selected_from_LOV := 'N';
1708:
1709: oe_debug_pub.add('Exiting OE_HEADER_UTIL.CLEAR_DEPENDENT_ATTR', 1);
1710:
1711: EXCEPTION
1712: WHEN FND_API.G_EXC_ERROR THEN
1713: RAISE FND_API.G_EXC_ERROR;
1735: l_header_rec OE_AK_ORDER_HEADERS_V%ROWTYPE;
1736: l_old_header_rec OE_AK_ORDER_HEADERS_V%ROWTYPE;
1737: l_initial_header_rec OE_AK_ORDER_HEADERS_V%ROWTYPE;
1738: BEGIN
1739: oe_debug_pub.add('Security code in Clear_dep_attr....'||p_x_header_rec.instrument_security_code);
1740: API_Rec_To_Rowtype_Rec(p_x_header_rec, l_header_rec);
1741: API_Rec_To_Rowtype_Rec(p_old_header_rec, l_old_header_rec);
1742:
1743: l_initial_header_rec := l_header_rec;
1801: -- ER#3667551 end
1802:
1803: BEGIN
1804:
1805: oe_debug_pub.add('Entering OE_HEADER_UTIL.APPLY_ATTRIBUTE_CHANGES', 1);
1806:
1807: -- Load out record
1808:
1809: IF NOT OE_GLOBALS.Equal(p_x_header_rec.booked_flag,p_old_header_rec.booked_flag)
1821: p_old_header_rec,
1822: l_return_status);
1823: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1824: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1825: oe_debug_pub.ADD('Update Line Process Order return UNEXP_ERROR');
1826: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1827: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1828: oe_debug_pub.ADD('Update Line Process Order return RET_STS_ERROR');
1829: RAISE FND_API.G_EXC_ERROR;
1824: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1825: oe_debug_pub.ADD('Update Line Process Order return UNEXP_ERROR');
1826: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1827: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1828: oe_debug_pub.ADD('Update Line Process Order return RET_STS_ERROR');
1829: RAISE FND_API.G_EXC_ERROR;
1830: END IF;
1831: END IF;
1832:
1834:
1835: END IF; -- cancelled flag
1836:
1837: END IF;
1838: oe_debug_pub.add('Raj1', 1);
1839: oe_debug_pub.add('Operation--'||p_x_header_rec.operation);
1840: oe_debug_pub.add('payment type--'||nvl(p_x_header_rec.payment_type_code,'xxx'));
1841: oe_debug_pub.add('Old inv to ...'||p_x_header_rec.invoice_to_org_id);
1842: oe_debug_pub.add('New inv to...'||p_old_header_rec.invoice_to_org_id);
1835: END IF; -- cancelled flag
1836:
1837: END IF;
1838: oe_debug_pub.add('Raj1', 1);
1839: oe_debug_pub.add('Operation--'||p_x_header_rec.operation);
1840: oe_debug_pub.add('payment type--'||nvl(p_x_header_rec.payment_type_code,'xxx'));
1841: oe_debug_pub.add('Old inv to ...'||p_x_header_rec.invoice_to_org_id);
1842: oe_debug_pub.add('New inv to...'||p_old_header_rec.invoice_to_org_id);
1843:
1836:
1837: END IF;
1838: oe_debug_pub.add('Raj1', 1);
1839: oe_debug_pub.add('Operation--'||p_x_header_rec.operation);
1840: oe_debug_pub.add('payment type--'||nvl(p_x_header_rec.payment_type_code,'xxx'));
1841: oe_debug_pub.add('Old inv to ...'||p_x_header_rec.invoice_to_org_id);
1842: oe_debug_pub.add('New inv to...'||p_old_header_rec.invoice_to_org_id);
1843:
1844: IF NOT OE_GLOBALS.Equal(p_x_header_rec.invoice_to_org_id,p_old_header_rec.invoice_to_org_id)
1837: END IF;
1838: oe_debug_pub.add('Raj1', 1);
1839: oe_debug_pub.add('Operation--'||p_x_header_rec.operation);
1840: oe_debug_pub.add('payment type--'||nvl(p_x_header_rec.payment_type_code,'xxx'));
1841: oe_debug_pub.add('Old inv to ...'||p_x_header_rec.invoice_to_org_id);
1842: oe_debug_pub.add('New inv to...'||p_old_header_rec.invoice_to_org_id);
1843:
1844: IF NOT OE_GLOBALS.Equal(p_x_header_rec.invoice_to_org_id,p_old_header_rec.invoice_to_org_id)
1845: THEN
1838: oe_debug_pub.add('Raj1', 1);
1839: oe_debug_pub.add('Operation--'||p_x_header_rec.operation);
1840: oe_debug_pub.add('payment type--'||nvl(p_x_header_rec.payment_type_code,'xxx'));
1841: oe_debug_pub.add('Old inv to ...'||p_x_header_rec.invoice_to_org_id);
1842: oe_debug_pub.add('New inv to...'||p_old_header_rec.invoice_to_org_id);
1843:
1844: IF NOT OE_GLOBALS.Equal(p_x_header_rec.invoice_to_org_id,p_old_header_rec.invoice_to_org_id)
1845: THEN
1846: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
1855: IF l_delete_payment_count > 0 THEN
1856: l_log_delete_payment_req := 'Y';
1857: END IF;
1858:
1859: oe_debug_pub.add('Payment_type code in invoice to '||p_x_header_rec.payment_type_code);
1860: oe_debug_pub.add('Delete Payment Count count'||l_delete_payment_count);
1861: oe_debug_pub.add('Log delete payment req Flag'||l_log_delete_payment_req);
1862: IF l_log_delete_payment_req = 'Y' THEN
1863: OE_delayed_requests_Pvt.log_request
1856: l_log_delete_payment_req := 'Y';
1857: END IF;
1858:
1859: oe_debug_pub.add('Payment_type code in invoice to '||p_x_header_rec.payment_type_code);
1860: oe_debug_pub.add('Delete Payment Count count'||l_delete_payment_count);
1861: oe_debug_pub.add('Log delete payment req Flag'||l_log_delete_payment_req);
1862: IF l_log_delete_payment_req = 'Y' THEN
1863: OE_delayed_requests_Pvt.log_request
1864: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER_PAYMENT,
1857: END IF;
1858:
1859: oe_debug_pub.add('Payment_type code in invoice to '||p_x_header_rec.payment_type_code);
1860: oe_debug_pub.add('Delete Payment Count count'||l_delete_payment_count);
1861: oe_debug_pub.add('Log delete payment req Flag'||l_log_delete_payment_req);
1862: IF l_log_delete_payment_req = 'Y' THEN
1863: OE_delayed_requests_Pvt.log_request
1864: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER_PAYMENT,
1865: p_entity_id => p_x_Header_rec.header_id,
1872: END IF;--Log delayed req.
1873: END IF;--Payment type code check for deleting payments
1874: --R12 CC Encryption
1875: IF p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
1876: oe_debug_pub.add('Log Verify Payment Delayed Request in Invoice To');
1877: -- Set Flag to Log a request for Verify Payment
1878: l_verify_payment_flag := 'Y';
1879: ELSE
1880: -- BUG 2114156
1877: -- Set Flag to Log a request for Verify Payment
1878: l_verify_payment_flag := 'Y';
1879: ELSE
1880: -- BUG 2114156
1881: oe_debug_pub.add('Call OE_CREDIT_CHECK_UTIL.GET_credit_check_level ');
1882: l_level := NULL ;
1883:
1884: l_level :=
1885: OE_CREDIT_CHECK_UTIL.GET_credit_check_level
1886: ( p_calling_action => 'UPDATE'
1887: , p_order_type_id =>
1888: p_x_header_rec.order_type_id
1889: ) ;
1890: oe_debug_pub.add('l_level = '|| l_level );
1891:
1892: IF l_level = 'ORDER'
1893: THEN
1894:
1893: THEN
1894:
1895:
1896: -- Set Flag to Log a request for Verify Payment
1897: oe_debug_pub.add('Log Verify Payment Delayed Request in Invoice To - Credit Check');
1898: --
1899: l_verify_payment_flag := 'Y';
1900: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := FALSE; --ER 12363706
1901: --ER 12363706 start
1907: END IF;
1908: END IF;
1909: END IF;--Operation - Update
1910: END IF;
1911: oe_debug_pub.add('Raj2', 1);
1912: oe_debug_pub.add('p_x_header_rec.open_flag:'||p_x_header_rec.open_flag);
1913: oe_debug_pub.add('p_old_header_rec.open_flag:'||p_old_header_rec.open_flag);
1914:
1915:
1908: END IF;
1909: END IF;--Operation - Update
1910: END IF;
1911: oe_debug_pub.add('Raj2', 1);
1912: oe_debug_pub.add('p_x_header_rec.open_flag:'||p_x_header_rec.open_flag);
1913: oe_debug_pub.add('p_old_header_rec.open_flag:'||p_old_header_rec.open_flag);
1914:
1915:
1916: IF (NOT OE_GLOBALS.Equal(p_x_header_rec.open_flag,
1909: END IF;--Operation - Update
1910: END IF;
1911: oe_debug_pub.add('Raj2', 1);
1912: oe_debug_pub.add('p_x_header_rec.open_flag:'||p_x_header_rec.open_flag);
1913: oe_debug_pub.add('p_old_header_rec.open_flag:'||p_old_header_rec.open_flag);
1914:
1915:
1916: IF (NOT OE_GLOBALS.Equal(p_x_header_rec.open_flag,
1917: p_old_header_rec.open_flag)) OR
1939:
1940: IF p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
1941:
1942: -- Set Flag to Log a request for Verify Payment
1943: oe_debug_pub.add('Log Verify Payment Delayed Request in Order Type');
1944: l_verify_payment_flag := 'Y';
1945: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := FALSE; --ER 12363706
1946: ELSE
1947:
1951:
1952: IF p_x_header_rec.booked_flag ='Y'
1953: THEN
1954:
1955: oe_debug_pub.add('Log Verify Payment Delayed Request in Order Type',3);
1956: l_verify_payment_flag := 'Y';
1957: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := FALSE; --ER 12363706
1958: END IF;
1959:
2001: END IF;
2002:
2003: NULL;
2004: END IF;
2005: oe_debug_pub.add('Raj3', 1);
2006:
2007: IF NOT OE_GLOBALS.Equal(p_x_header_rec.sold_to_org_id,p_old_header_rec.sold_to_org_id)
2008: THEN
2009: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2009: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2010: AND p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
2011:
2012: -- Set Flag to Log a request for Verify Payment
2013: oe_debug_pub.add('Log Verify Payment Delayed Request in Sold To',3);
2014: --
2015: l_verify_payment_flag := 'Y';
2016: END IF;
2017:
2016: END IF;
2017:
2018: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
2019: -- Log request to evaluate Holds.
2020: oe_debug_pub.ADD('Customer update: logging request for eval_hold_source',1);
2021: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2022: 'Entity ID:' || to_char(p_x_header_rec.sold_to_org_id),1);
2023: OE_delayed_requests_Pvt.log_request
2024: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2017:
2018: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE THEN
2019: -- Log request to evaluate Holds.
2020: oe_debug_pub.ADD('Customer update: logging request for eval_hold_source',1);
2021: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2022: 'Entity ID:' || to_char(p_x_header_rec.sold_to_org_id),1);
2023: OE_delayed_requests_Pvt.log_request
2024: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2025: p_entity_id => p_x_header_rec.header_id,
2029: p_request_unique_key1 => 'CUSTOMER',
2030: p_param1 => 'C',
2031: p_param2 => p_x_header_rec.sold_to_org_id,
2032: x_return_status => l_return_status);
2033: oe_debug_pub.ADD('after call to log_request: l_return_status: '||l_return_status , 1);
2034: END IF;
2035:
2036:
2037: END IF;
2042: THEN
2043: -- only if system parameter is set to BTH then processing for BTH case needs to be done
2044: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE AND l_credithold_cust ='BTH' THEN
2045: -- Log request to evaluate Holds.
2046: oe_debug_pub.ADD('Bill to Customer update: logging request for eval_hold_source',1);
2047: l_bill_to_cust_id := OE_Bulk_Holds_PVT.CustAcctID_func
2048: (p_in_site_id => p_x_header_rec.invoice_to_org_id,
2049: p_out_IDfound=> l_new_tbl_entry);
2050:
2047: l_bill_to_cust_id := OE_Bulk_Holds_PVT.CustAcctID_func
2048: (p_in_site_id => p_x_header_rec.invoice_to_org_id,
2049: p_out_IDfound=> l_new_tbl_entry);
2050:
2051: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2052: 'Entity ID:' || to_char(l_bill_to_cust_id),1);
2053:
2054:
2055: OE_delayed_requests_Pvt.log_request
2061: p_request_unique_key1 => 'BILL_TO_CUSTOMER',
2062: p_param1 => 'BTH',
2063: p_param2 => l_bill_to_cust_id,
2064: x_return_status => l_return_status);
2065: oe_debug_pub.ADD('after call to log_request: l_return_status: '||l_return_status , 1);
2066: END IF;
2067:
2068:
2069: END IF;
2081:
2082: IF p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
2083:
2084: -- Set Flag to Log a request for Verify Payment
2085: oe_debug_pub.add('Log Verify Payment Delayed Request in Curr Code',3);
2086: l_verify_payment_flag := 'Y';
2087: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := FALSE; --ER 12363706
2088: ELSE
2089: /* Additional Task - If the payment type is not CREDIT CARD,
2090: then also log delayed req for verify payment if the
2091: order is booked */
2092:
2093: if p_x_header_rec.booked_flag ='Y' then
2094: oe_debug_pub.add('Log Verify Payment Delayed Request in Currency Code',3);
2095: l_verify_payment_flag := 'Y';
2096: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := FALSE; --ER 12363706
2097: end if;
2098: END IF;
2107: --now be handled in pre_write_process procedure
2108: IF p_x_header_rec.payment_type_code IS NOT NULL
2109: AND p_x_header_rec.payment_type_code <> 'CREDIT_CARD' THEN
2110: -- Set Flag Log a request for Verify Payment
2111: oe_debug_pub.add('Log Verify Payment Delayed Request in Payment Type',3);
2112: l_verify_payment_flag := 'Y';
2113: OE_CREDIT_ENGINE_GRP.TOLERANCE_CHECK_REQUIRED := FALSE; --ER 12363706
2114: l_payments_upd_flag := 'Y';
2115: END IF;
2123: AND p_x_header_rec.payment_type_code in ('CASH', 'CHECK')
2124: THEN
2125:
2126: -- Set Flag to Log a request for Verify Payment
2127: oe_debug_pub.add('Log Update Payments Delayed',3);
2128: --
2129: --l_verify_payment_flag := 'Y';
2130:
2131: l_payments_upd_flag := 'Y';
2139: AND p_x_header_rec.payment_type_code = 'CHECK'
2140: THEN
2141:
2142: -- Set Flag to Log a request for Verify Payment
2143: oe_debug_pub.add('Log Update Payments Delayed',3);
2144: --
2145: --l_verify_payment_flag := 'Y';
2146:
2147: l_payments_upd_flag := 'Y';
2155: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2156: AND p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
2157:
2158: -- Set Flag to Log a request for Verify Payment
2159: oe_debug_pub.add('Log Verify Payment Delayed Request in CC Holder',3);
2160: --
2161: l_verify_payment_flag := 'Y';
2162:
2163: --R12 CC Encryption
2176: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2177: AND p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
2178:
2179: -- Set Flag to Log a request for Verify Payment
2180: oe_debug_pub.add('Log Verify Payment Delayed Request in CC Number',3);
2181: --
2182: l_verify_payment_flag := 'Y';
2183:
2184: --R12 CC Encryption
2187:
2188: --R12 CC Encryption
2189: END IF;
2190: END IF;
2191: oe_debug_pub.add('Raj4', 1);
2192:
2193: IF NOT OE_GLOBALS.Equal(p_x_header_rec.credit_card_expiration_date,p_old_header_rec.credit_card_expiration_date)
2194: THEN
2195: /* Fix Bug # 3686048(FP 3659342): Set the Exp Date as the Last Day of the Month */
2199: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2200: AND p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
2201:
2202: -- Set Flag to Log a request for Verify Payment
2203: oe_debug_pub.add('Log Verify Payment Delayed Request in CC Exp Date',3);
2204: --
2205: l_verify_payment_flag := 'Y';
2206:
2207: --R12 CC Encryption
2217: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2218: AND p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
2219:
2220: -- Set Flag to Log a request for Verify Payment
2221: oe_debug_pub.add('Log Verify Payment Delayed Request in CC Approval',3);
2222: --
2223: l_verify_payment_flag := 'Y';
2224:
2225: --R12 CC Encryption
2245: -- Added IF condition for bug 6697401
2246: IF OE_ORDER_COPY_UTIL.G_COPY_REC.line_price_mode =
2247: OE_ORDER_COPY_UTIL.G_CPY_ORIG_PRICE THEN
2248:
2249: oe_debug_pub.add(' Copy as original price');
2250: -- bug 6697401
2251: -- Log a request to copy Freight Charges to the copied order.
2252: oe_debug_pub.add('Log Delayed Request To Copy Charges in SRC Doc Type Id',3);
2253:
2248:
2249: oe_debug_pub.add(' Copy as original price');
2250: -- bug 6697401
2251: -- Log a request to copy Freight Charges to the copied order.
2252: oe_debug_pub.add('Log Delayed Request To Copy Charges in SRC Doc Type Id',3);
2253:
2254: OE_delayed_requests_Pvt.log_request(
2255: p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2256: p_entity_id => p_x_header_rec.header_id,
2273: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_CREATE
2274: AND p_x_header_rec.source_document_type_id = 2 THEN
2275:
2276: -- Log a request to copy header adjustments to the copied order.
2277: oe_debug_pub.add('Log Delayed Request To Copy header adjustments ',3);
2278: --
2279:
2280: IF OE_ORDER_COPY_UTIL.G_COPY_REC.line_price_mode IN (OE_ORDER_COPY_UTIL.G_CPY_ORIG_PRICE,OE_ORDER_COPY_UTIL.G_CPY_REPRICE_PARTIAL) THEN
2281: oe_debug_pub.add(' Copy as original price');
2277: oe_debug_pub.add('Log Delayed Request To Copy header adjustments ',3);
2278: --
2279:
2280: IF OE_ORDER_COPY_UTIL.G_COPY_REC.line_price_mode IN (OE_ORDER_COPY_UTIL.G_CPY_ORIG_PRICE,OE_ORDER_COPY_UTIL.G_CPY_REPRICE_PARTIAL) THEN
2281: oe_debug_pub.add(' Copy as original price');
2282: OE_delayed_requests_Pvt.log_request(
2283: p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2284: p_entity_id => p_x_header_rec.header_id,
2285: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2338: x_return_status => l_return_status);
2339: -- sol_ord_er #16014165 end
2340:
2341: -- Bug 10194125 : Start
2342: oe_debug_pub.add('Logging GET_COST request for all lines ...',5);
2343: FOR i in lines_cur LOOP
2344: oe_debug_pub.add('Fetching line_id :' || i.line_id ,0);
2345:
2346: IF Oe_Sys_Parameters.Value('COMPUTE_MARGIN') <> 'N' Then
2340:
2341: -- Bug 10194125 : Start
2342: oe_debug_pub.add('Logging GET_COST request for all lines ...',5);
2343: FOR i in lines_cur LOOP
2344: oe_debug_pub.add('Fetching line_id :' || i.line_id ,0);
2345:
2346: IF Oe_Sys_Parameters.Value('COMPUTE_MARGIN') <> 'N' Then
2347: oe_debug_pub.add( 'before oe_delayed_requests_pvt.log_request call',5 ) ;
2348: oe_delayed_requests_pvt.log_request(
2343: FOR i in lines_cur LOOP
2344: oe_debug_pub.add('Fetching line_id :' || i.line_id ,0);
2345:
2346: IF Oe_Sys_Parameters.Value('COMPUTE_MARGIN') <> 'N' Then
2347: oe_debug_pub.add( 'before oe_delayed_requests_pvt.log_request call',5 ) ;
2348: oe_delayed_requests_pvt.log_request(
2349: p_entity_code => OE_GLOBALS.G_ENTITY_LINE,
2350: p_entity_id => i.line_id,
2351: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_ALL,
2351: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_ALL,
2352: p_requesting_entity_id => p_x_header_rec.header_id,
2353: p_request_type => 'GET_COST',
2354: x_return_status => l_return_status);
2355: oe_debug_pub.add( 'After OE_DELAYED_REQUESTS_PVT.LOG_REQUEST CALL '||l_return_status ,5) ;
2356: END IF;
2357: END LOOP;
2358: -- Bug 10194125 : End
2359: End If;
2364: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2365: THEN
2366: OE_Holds_PUB.G_PAYMENT_HOLD_APPLIED := 'N';
2367: OE_Holds_PUB.G_HDR_PAYMENT := 'Y';
2368: oe_debug_pub.ADD('payment type update: logging request for eval_hold_source',1);
2369: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2370: 'Entity ID:' || to_char(p_x_header_rec.payment_type_code),1);
2371: OE_delayed_requests_Pvt.log_request
2372: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2365: THEN
2366: OE_Holds_PUB.G_PAYMENT_HOLD_APPLIED := 'N';
2367: OE_Holds_PUB.G_HDR_PAYMENT := 'Y';
2368: oe_debug_pub.ADD('payment type update: logging request for eval_hold_source',1);
2369: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2370: 'Entity ID:' || to_char(p_x_header_rec.payment_type_code),1);
2371: OE_delayed_requests_Pvt.log_request
2372: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2373: p_entity_id => p_x_header_rec.header_id,
2377: p_request_unique_key1 => 'PAYMENT_TYPE',
2378: p_param1 => 'P',
2379: p_param2 => p_x_header_rec.payment_type_code,
2380: x_return_status => l_return_status);
2381: oe_debug_pub.ADD('after call to log_request: l_return_status: '||l_return_status , 1);
2382:
2383: END IF;
2384:
2385: IF NOT OE_GLOBALS.Equal(p_x_header_rec.transactional_curr_code,p_old_header_rec.transactional_curr_code)
2384:
2385: IF NOT OE_GLOBALS.Equal(p_x_header_rec.transactional_curr_code,p_old_header_rec.transactional_curr_code)
2386: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2387: THEN
2388: oe_debug_pub.ADD('Currency update: logging request for eval_hold_source',1);
2389: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2390: 'Entity ID:' || to_char(p_x_header_rec.transactional_curr_code),1);
2391: OE_delayed_requests_Pvt.log_request
2392: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2385: IF NOT OE_GLOBALS.Equal(p_x_header_rec.transactional_curr_code,p_old_header_rec.transactional_curr_code)
2386: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2387: THEN
2388: oe_debug_pub.ADD('Currency update: logging request for eval_hold_source',1);
2389: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2390: 'Entity ID:' || to_char(p_x_header_rec.transactional_curr_code),1);
2391: OE_delayed_requests_Pvt.log_request
2392: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2393: p_entity_id => p_x_header_rec.header_id,
2397: p_request_unique_key1 => 'CURRENCY',
2398: p_param1 => 'TC',
2399: p_param2 => p_x_header_rec.transactional_curr_code,
2400: x_return_status => l_return_status);
2401: oe_debug_pub.ADD('after call to log_request: l_return_status: '||l_return_status , 1);
2402:
2403: END IF;
2404:
2405: IF NOT OE_GLOBALS.Equal(p_x_header_rec.sales_channel_code,p_old_header_rec.sales_channel_code)
2404:
2405: IF NOT OE_GLOBALS.Equal(p_x_header_rec.sales_channel_code,p_old_header_rec.sales_channel_code)
2406: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2407: THEN
2408: oe_debug_pub.ADD('sales channel update: logging request for eval_hold_source',1);
2409: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2410: 'Entity ID:' || to_char(p_x_header_rec.sales_channel_code),1);
2411: OE_delayed_requests_Pvt.log_request
2412: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2405: IF NOT OE_GLOBALS.Equal(p_x_header_rec.sales_channel_code,p_old_header_rec.sales_channel_code)
2406: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2407: THEN
2408: oe_debug_pub.ADD('sales channel update: logging request for eval_hold_source',1);
2409: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2410: 'Entity ID:' || to_char(p_x_header_rec.sales_channel_code),1);
2411: OE_delayed_requests_Pvt.log_request
2412: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2413: p_entity_id => p_x_header_rec.header_id,
2417: p_request_unique_key1 => 'SALES_CHANNEL',
2418: p_param1 => 'SC',
2419: p_param2 => p_x_header_rec.sales_channel_code,
2420: x_return_status => l_return_status);
2421: oe_debug_pub.ADD('after call to log_request: l_return_status: '||l_return_status , 1);
2422:
2423: END IF;
2424:
2425: IF NOT OE_GLOBALS.Equal(p_x_header_rec.price_list_id,p_old_header_rec.price_list_id)
2424:
2425: IF NOT OE_GLOBALS.Equal(p_x_header_rec.price_list_id,p_old_header_rec.price_list_id)
2426: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2427: THEN
2428: oe_debug_pub.ADD('price list update: logging request for eval_hold_source',1);
2429: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2430: 'Entity ID:' || to_char(p_x_header_rec.price_list_id),1);
2431: OE_delayed_requests_Pvt.log_request
2432: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2425: IF NOT OE_GLOBALS.Equal(p_x_header_rec.price_list_id,p_old_header_rec.price_list_id)
2426: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2427: THEN
2428: oe_debug_pub.ADD('price list update: logging request for eval_hold_source',1);
2429: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2430: 'Entity ID:' || to_char(p_x_header_rec.price_list_id),1);
2431: OE_delayed_requests_Pvt.log_request
2432: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2433: p_entity_id => p_x_header_rec.header_id,
2437: p_request_unique_key1 => 'PRICE_LIST',
2438: p_param1 => 'PL',
2439: p_param2 => p_x_header_rec.price_list_id,
2440: x_return_status => l_return_status);
2441: oe_debug_pub.ADD('after call to log_request: l_return_status: '||l_return_status , 1);
2442:
2443: END IF;
2444:
2445: IF NOT OE_GLOBALS.Equal(p_x_header_rec.order_type_id,p_old_header_rec.order_type_id)
2444:
2445: IF NOT OE_GLOBALS.Equal(p_x_header_rec.order_type_id,p_old_header_rec.order_type_id)
2446: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2447: THEN
2448: oe_debug_pub.ADD('Order type update: logging request for eval_hold_source',1);
2449: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2450: 'Entity ID:' || to_char(p_x_header_rec.order_type_id),1);
2451: OE_delayed_requests_Pvt.log_request
2452: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2445: IF NOT OE_GLOBALS.Equal(p_x_header_rec.order_type_id,p_old_header_rec.order_type_id)
2446: AND p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE
2447: THEN
2448: oe_debug_pub.ADD('Order type update: logging request for eval_hold_source',1);
2449: oe_debug_pub.ADD('Header ID:' || to_char(p_x_header_rec.header_id) ||
2450: 'Entity ID:' || to_char(p_x_header_rec.order_type_id),1);
2451: OE_delayed_requests_Pvt.log_request
2452: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
2453: p_entity_id => p_x_header_rec.header_id,
2457: p_request_unique_key1 => 'ORDER_TYPE',
2458: p_param1 => 'OT',
2459: p_param2 => p_x_header_rec.order_type_id,
2460: x_return_status => l_return_status);
2461: oe_debug_pub.ADD('after call to log_request: l_return_status: '||l_return_status , 1);
2462:
2463: END IF;
2464: --ER#7479609 end
2465:
2465:
2466: IF (l_verify_payment_flag = 'Y') THEN
2467:
2468: -- Log a request for Verify Payment
2469: oe_debug_pub.add('Logging Delayed Request for Verify Payment',3);
2470: --
2471: OE_delayed_requests_Pvt.log_request
2472: (p_entity_code => OE_GLOBALS.G_ENTITY_ALL,
2473: p_entity_id => p_x_header_rec.header_id,
2481: /* code added by Renga for multiple payments */
2482: l_payment_count := 0;
2483: Begin
2484:
2485: oe_debug_pub.add('before getting payment count ', 1);
2486: open payment_count_cur;
2487: fetch payment_count_cur into l_payment_count;
2488: close payment_count_cur;
2489:
2497: IF OE_PrePayment_UTIL.IS_MULTIPLE_PAYMENTS_ENABLED = TRUE
2498: and l_payments_upd_flag = 'Y'
2499: and l_payment_count > 0 then --modified for bug 3733877
2500:
2501: oe_debug_pub.add('logging synch payment delayed request', 1);
2502:
2503: OE_delayed_requests_Pvt.log_request
2504: (p_entity_code => OE_GLOBALS.G_ENTITY_ALL,
2505: p_entity_id => p_x_header_rec.header_id,
2522: THEN
2523: OE_Schedule_Util.G_DATE_TYPE := p_x_header_rec.order_date_type_code; END IF;
2524: END IF;
2525: /*-- 3288805 --*/
2526: oe_debug_pub.add('Exiting OE_HEADER_UTIL.APPLY_ATTRIBUTE_CHANGES', 1);
2527:
2528: END Apply_Attribute_Changes;
2529:
2530: -- Procedure Complete_Record
2536: IS
2537:
2538: BEGIN
2539:
2540: oe_debug_pub.add('Entering OE_HEADER_UTIL.COMPLETE_RECORD', 1);
2541:
2542: IF p_x_header_rec.accounting_rule_id = FND_API.G_MISS_NUM THEN
2543: p_x_header_rec.accounting_rule_id := p_old_header_rec.accounting_rule_id;
2544: END IF;
3264:
3265: --8219019 end
3266:
3267:
3268: oe_debug_pub.add('Exiting OE_HEADER_UTIL.COMPLETE_RECORD', 1);
3269:
3270:
3271: END Complete_Record;
3272:
3278: IS
3279: --p_x_header_rec OE_Order_PUB.Header_Rec_Type := p_header_rec;
3280: BEGIN
3281:
3282: oe_debug_pub.add('Entering OE_HEADER_UTIL.CONVERT_MISS_TO_NULL', 1);
3283:
3284: IF p_x_header_rec.accounting_rule_id = FND_API.G_MISS_NUM THEN
3285: p_x_header_rec.accounting_rule_id := NULL;
3286: END IF;
3934: END IF;
3935:
3936: --8219019 end
3937:
3938: oe_debug_pub.add('Exiting OE_HEADER_UTIL.CONVERT_MISS_TO_NULL', 1);
3939:
3940:
3941: END Convert_Miss_To_Null;
3942:
3952: l_index NUMBER;
3953: l_return_status VARCHAR2(1);
3954: BEGIN
3955:
3956: oe_debug_pub.add('Entering OE_HEADER_UTIL.UPDATE_ROW', 1);
3957: --Commented for MOAC start
3958: /*l_org_id := OE_GLOBALS.G_ORG_ID;
3959:
3960: IF l_org_id IS NULL THEN
3980: p_header_id => p_header_rec.header_id,
3981: x_index => l_index,
3982: x_return_status => l_return_status);
3983:
3984: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.update_row is: ' || l_return_status);
3985: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3986: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
3987: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.Update_ROW', 1);
3988: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3982: x_return_status => l_return_status);
3983:
3984: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.update_row is: ' || l_return_status);
3985: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3986: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
3987: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.Update_ROW', 1);
3988: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3989: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3990: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Update_row');
3983:
3984: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.update_row is: ' || l_return_status);
3985: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3986: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
3987: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.Update_ROW', 1);
3988: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3989: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3990: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Update_row');
3991: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.Update_ROW', 1);
3986: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
3987: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.Update_ROW', 1);
3988: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3989: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3990: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Update_row');
3991: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.Update_ROW', 1);
3992: RAISE FND_API.G_EXC_ERROR;
3993: END IF;
3994: END IF; /*code_release_level*/
3987: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.Update_ROW', 1);
3988: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3989: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3990: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Update_row');
3991: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.Update_ROW', 1);
3992: RAISE FND_API.G_EXC_ERROR;
3993: END IF;
3994: END IF; /*code_release_level*/
3995: -- notification framework end
4193: -- to call below procedure to update, updated directly above
4194:
4195: -- OE_Order_Cache.Set_Order_Header(p_header_rec);
4196:
4197: oe_debug_pub.add('Exiting OE_HEADER_UTIL.UPDATE_ROW', 1);
4198:
4199: EXCEPTION
4200:
4201: WHEN OTHERS THEN
4222: l_upgraded_flag varchar2(1) ;
4223: l_lock_control NUMBER := 1;
4224: l_index NUMBER;
4225: l_return_status VARCHAR2(1);
4226: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
4227: BEGIN
4228:
4229: oe_debug_pub.add('Entering OE_HEADER_UTIL.INSERT_ROW', 1);
4230:
4225: l_return_status VARCHAR2(1);
4226: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
4227: BEGIN
4228:
4229: oe_debug_pub.add('Entering OE_HEADER_UTIL.INSERT_ROW', 1);
4230:
4231: --MOAC change
4232: OE_GLOBALS.Set_Context;
4233: l_org_id := OE_GLOBALS.G_ORG_ID;
4233: l_org_id := OE_GLOBALS.G_ORG_ID;
4234: IF l_org_id IS NULL THEN
4235: -- org_id is null, don't do insert. raise an error
4236: If l_debug_level > 0 Then
4237: oe_debug_pub.add('Org_Id is NULL',1);
4238: End If;
4239: FND_MESSAGE.SET_NAME('FND','MO_ORG_REQUIRED');
4240: FND_MSG_PUB.ADD;
4241: RAISE FND_API.G_EXC_ERROR;
4624: p_Header_rec =>p_header_rec,
4625: p_header_id => p_header_rec.header_id,
4626: x_index => l_index,
4627: x_return_status => l_return_status);
4628: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.insert_row is: ' || l_return_status);
4629: OE_DEBUG_PUB.ADD('returned index is: ' || l_index ,1);
4630: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4631: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4632: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4625: p_header_id => p_header_rec.header_id,
4626: x_index => l_index,
4627: x_return_status => l_return_status);
4628: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.insert_row is: ' || l_return_status);
4629: OE_DEBUG_PUB.ADD('returned index is: ' || l_index ,1);
4630: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4631: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4632: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4633: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4627: x_return_status => l_return_status);
4628: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.insert_row is: ' || l_return_status);
4629: OE_DEBUG_PUB.ADD('returned index is: ' || l_index ,1);
4630: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4631: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4632: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4633: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4634: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4635: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Insert_row');
4628: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.insert_row is: ' || l_return_status);
4629: OE_DEBUG_PUB.ADD('returned index is: ' || l_index ,1);
4630: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4631: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4632: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4633: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4634: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4635: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Insert_row');
4636: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4631: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4632: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4633: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4634: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4635: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Insert_row');
4636: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4637: RAISE FND_API.G_EXC_ERROR;
4638: END IF;
4639: END IF; /*code_release_level*/
4632: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4633: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4634: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4635: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Insert_row');
4636: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4637: RAISE FND_API.G_EXC_ERROR;
4638: END IF;
4639: END IF; /*code_release_level*/
4640: -- notification framework end
4638: END IF;
4639: END IF; /*code_release_level*/
4640: -- notification framework end
4641:
4642: oe_debug_pub.add('Exiting OE_HEADER_UTIL.INSERT_ROW', 1);
4643:
4644: EXCEPTION
4645:
4646: WHEN OTHERS THEN
4675: l_msg_count NUMBER;
4676: l_msg_data VARCHAR2(2000);
4677: BEGIN
4678:
4679: oe_debug_pub.add('Entering OE_HEADER_UTIL.DELETE_ROW', 1);
4680: --Commented for MOAC start
4681: /*l_org_id := OE_GLOBALS.G_ORG_ID;
4682: IF l_org_id IS NULL THEN
4683: OE_GLOBALS.Set_Context;
4694: p_Header_rec =>l_new_header_rec,
4695: p_header_id => p_header_id,
4696: x_index => l_index,
4697: x_return_status => l_return_status);
4698: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.delete_row is: ' || l_return_status);
4699:
4700: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4701: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4702: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4697: x_return_status => l_return_status);
4698: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.delete_row is: ' || l_return_status);
4699:
4700: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4701: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4702: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4703: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4704: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4705: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Delete_row');
4698: OE_DEBUG_PUB.ADD('Update_Global Return Status from OE_HEADER_UTIL.delete_row is: ' || l_return_status);
4699:
4700: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4701: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4702: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4703: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4704: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4705: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Delete_row');
4706: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4701: OE_DEBUG_PUB.ADD('EVENT NOTIFY - Unexpected Error');
4702: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4703: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4704: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4705: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Delete_row');
4706: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4707: RAISE FND_API.G_EXC_ERROR;
4708: END IF;
4709: END IF; /* code_release_level*/
4702: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4703: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4704: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4705: OE_DEBUG_PUB.ADD('Update_Global_Picture Error in OE_HEADER_UTIL.Delete_row');
4706: OE_DEBUG_PUB.ADD('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4707: RAISE FND_API.G_EXC_ERROR;
4708: END IF;
4709: END IF; /* code_release_level*/
4710: -- notification framework end
4709: END IF; /* code_release_level*/
4710: -- notification framework end
4711:
4712: -- BUG 2670775 Reverse Limits Begin
4713: oe_debug_pub.add('log request to Reverse_Limits for HEADER level DELETE',1);
4714: OE_Order_Cache.Load_Order_Header(p_header_id);
4715: l_price_request_code := OE_ORDER_CACHE.g_header_rec.price_request_code;
4716: l_transaction_phase_code := OE_ORDER_CACHE.g_header_rec.transaction_phase_code;
4717:
4717:
4718: -- If price_request_code is not cached, retrieve it
4719: IF l_price_request_code = FND_API.G_MISS_CHAR
4720: OR l_price_request_code is NULL THEN
4721: oe_debug_pub.add('Select price_request_code from HEADER',1);
4722: SELECT price_request_code
4723: INTO l_price_request_code
4724: FROM OE_ORDER_HEADERS
4725: WHERE HEADER_ID = p_header_id;
4734: , p_ret_price_request_code => NULL
4735: , p_returned_qty => NULL
4736: , p_line_id => NULL
4737: );
4738: oe_debug_pub.add('Request to Reverse_Limits in OE_HEADER_UTIL.Delete_Row is done',1);
4739: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4740: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4741: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4742: RAISE FND_API.G_EXC_ERROR;
4800: /* AND
4801: (NVL(ORG_ID,NVL(l_org_id,0))= NVL(l_org_id,0))
4802: ;*/
4803:
4804: oe_debug_pub.add('Exiting OE_HEADER_UTIL.DELETE_ROW', 1);
4805:
4806: EXCEPTION
4807: WHEN FND_API.G_EXC_ERROR THEN
4808: --takintoy, added for delete articles
4852: l_payment_type_code VARCHAR2(40) := 'CREDIT_CARD';
4853: l_return_status VARCHAR2(30) := NULL ;
4854: l_msg_count NUMBER := 0 ;
4855: l_msg_data VARCHAR2(2000) := NULL ;
4856: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
4857:
4858: BEGIN
4859: IF l_debug_level >0 THEN
4860: oe_debug_pub.add('Entering Query Card Details....');
4856: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
4857:
4858: BEGIN
4859: IF l_debug_level >0 THEN
4860: oe_debug_pub.add('Entering Query Card Details....');
4861: l_return_status := FND_API.G_RET_STS_SUCCESS;
4862: END IF;
4863:
4864: BEGIN
4871: EXCEPTION
4872: WHEN NO_DATA_FOUND THEN
4873: l_exists := 'N';
4874: IF l_debug_level >0 THEN
4875: oe_debug_pub.add('No record in oe_payments ...in query card details');
4876: oe_debug_pub.add('Header id passed...'||p_header_id);
4877: END IF;
4878: END;
4879:
4872: WHEN NO_DATA_FOUND THEN
4873: l_exists := 'N';
4874: IF l_debug_level >0 THEN
4875: oe_debug_pub.add('No record in oe_payments ...in query card details');
4876: oe_debug_pub.add('Header id passed...'||p_header_id);
4877: END IF;
4878: END;
4879:
4880: IF l_exists = 'Y' and l_trxn_extension_id is not null then
4898: X_msg_data => l_msg_data);
4899:
4900: IF l_return_status = FND_API.G_RET_STS_ERROR OR
4901: l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4902: OE_DEBUG_PUB.add('Error in get payment trxn info...');
4903: ELSIF l_return_status =FND_API.G_RET_STS_SUCCESS THEN
4904: OE_DEBUG_PUB.add('Success in get payment trxn info...');
4905: --oe_debug_pub.add('Card holder name...'||p_credit_card_holder_name);
4906: END IF;
4900: IF l_return_status = FND_API.G_RET_STS_ERROR OR
4901: l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4902: OE_DEBUG_PUB.add('Error in get payment trxn info...');
4903: ELSIF l_return_status =FND_API.G_RET_STS_SUCCESS THEN
4904: OE_DEBUG_PUB.add('Success in get payment trxn info...');
4905: --oe_debug_pub.add('Card holder name...'||p_credit_card_holder_name);
4906: END IF;
4907:
4908: EXCEPTION
4901: l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4902: OE_DEBUG_PUB.add('Error in get payment trxn info...');
4903: ELSIF l_return_status =FND_API.G_RET_STS_SUCCESS THEN
4904: OE_DEBUG_PUB.add('Success in get payment trxn info...');
4905: --oe_debug_pub.add('Card holder name...'||p_credit_card_holder_name);
4906: END IF;
4907:
4908: EXCEPTION
4909: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4908: EXCEPTION
4909: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4910: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4911: IF l_debug_level>0 THEN
4912: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4913: oe_debug_pub.add('Return status'||l_return_status);
4914: oe_debug_pub.add('Msg data'||l_msg_data);
4915: END IF;
4916: WHEN OTHERS THEN
4909: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
4910: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4911: IF l_debug_level>0 THEN
4912: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4913: oe_debug_pub.add('Return status'||l_return_status);
4914: oe_debug_pub.add('Msg data'||l_msg_data);
4915: END IF;
4916: WHEN OTHERS THEN
4917: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4910: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4911: IF l_debug_level>0 THEN
4912: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4913: oe_debug_pub.add('Return status'||l_return_status);
4914: oe_debug_pub.add('Msg data'||l_msg_data);
4915: END IF;
4916: WHEN OTHERS THEN
4917: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4918: IF l_debug_level>0 THEN
4915: END IF;
4916: WHEN OTHERS THEN
4917: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4918: IF l_debug_level>0 THEN
4919: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4920: oe_debug_pub.add('Return status'||l_return_status);
4921: oe_debug_pub.add('Msg data'||l_msg_data);
4922: END IF;
4923: END;
4916: WHEN OTHERS THEN
4917: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4918: IF l_debug_level>0 THEN
4919: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4920: oe_debug_pub.add('Return status'||l_return_status);
4921: oe_debug_pub.add('Msg data'||l_msg_data);
4922: END IF;
4923: END;
4924: ELSIF l_exists = 'Y' and l_trxn_extension_id is null then
4917: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4918: IF l_debug_level>0 THEN
4919: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4920: oe_debug_pub.add('Return status'||l_return_status);
4921: oe_debug_pub.add('Msg data'||l_msg_data);
4922: END IF;
4923: END;
4924: ELSIF l_exists = 'Y' and l_trxn_extension_id is null then
4925: BEGIN
4961:
4962: EXCEPTION
4963: WHEN OTHERS THEN
4964: IF l_debug_level>0 THEN
4965: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4966: oe_debug_pub.add('Return status'||l_return_status);
4967: oe_debug_pub.add('Msg data'||l_msg_data);
4968: END IF;
4969: END Query_card_Details;
4962: EXCEPTION
4963: WHEN OTHERS THEN
4964: IF l_debug_level>0 THEN
4965: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4966: oe_debug_pub.add('Return status'||l_return_status);
4967: oe_debug_pub.add('Msg data'||l_msg_data);
4968: END IF;
4969: END Query_card_Details;
4970: --R12 CC Encryption
4963: WHEN OTHERS THEN
4964: IF l_debug_level>0 THEN
4965: oe_debug_pub.add('Exception in Query card details....'||sqlerrm);
4966: oe_debug_pub.add('Return status'||l_return_status);
4967: oe_debug_pub.add('Msg data'||l_msg_data);
4968: END IF;
4969: END Query_card_Details;
4970: --R12 CC Encryption
4971:
5000: IS
5001: l_org_id NUMBER;
5002: l_x_header_rec_oper VARCHAR2(30);
5003: l_trxn_extension_id NUMBER;
5004: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
5005: l_return_status VARCHAR2(1);
5006: BEGIN
5007:
5008: if l_debug_level > 0 then
5005: l_return_status VARCHAR2(1);
5006: BEGIN
5007:
5008: if l_debug_level > 0 then
5009: oe_debug_pub.add('Entering OE_HEADER_UTIL.QUERY_ROW', 1);
5010: end if;
5011: --Commented for MOAC start
5012: /*l_org_id := OE_GLOBALS.G_ORG_ID;
5013: IF l_org_id IS NULL THEN
5407: END;
5408:
5409: IF l_trxn_extension_id is not null THEN
5410: if l_debug_level > 0 then
5411: oe_debug_pub.add('Calling query card details...');
5412: end if;
5413: Query_card_details
5414: ( p_header_id => x_header_rec.header_id,
5415: p_credit_card_code => x_header_rec.credit_card_code,
5428:
5429: -- aksingh assigning the global record, so later the cached record
5430: -- will be used instead of querying again
5431: if l_debug_level > 0 then
5432: oe_debug_pub.add('Before caching OE_HEADER_UTIL.QUERY_ROW', 1);
5433: end if;
5434:
5435: oe_order_cache.g_header_rec := x_header_rec;
5436: oe_order_cache.g_header_rec.operation := null;
5435: oe_order_cache.g_header_rec := x_header_rec;
5436: oe_order_cache.g_header_rec.operation := null;
5437:
5438: if l_debug_level > 0 then
5439: oe_debug_pub.add('Exiting OE_HEADER_UTIL.QUERY_ROW', 1);
5440: end if;
5441:
5442:
5443: EXCEPTION
5474: l_lock_control NUMBER;
5475: l_db_lock_control NUMBER;
5476: BEGIN
5477:
5478: oe_debug_pub.add('Entering OE_HEADER_UTIL.LOCK_ROW', 1);
5479:
5480: SAVEPOINT Lock_Row;
5481:
5482: l_lock_control := NULL;
5505:
5506: OE_Header_Util.Query_Row(p_header_id => l_header_id,
5507: x_header_rec => p_x_header_rec);
5508:
5509: oe_debug_pub.add('selected for update, now compare', 3);
5510:
5511:
5512: -- If lock_control is not passed(is null or missing), then return the locked record.
5513:
5539: IF OE_GLOBALS.Equal(p_x_header_rec.lock_control,
5540: l_lock_control)
5541: THEN
5542:
5543: oe_debug_pub.add('done comparison, success', 1);
5544: -- Row has not changed. Set out parameter.
5545:
5546: -- Set return status
5547:
5549: p_x_header_rec.return_status := FND_API.G_RET_STS_SUCCESS;
5550:
5551: ELSE
5552:
5553: oe_debug_pub.add('row changed by other user', 1);
5554:
5555: -- Row has changed by another user.
5556:
5557: x_return_status := FND_API.G_RET_STS_ERROR;
5569: END IF;
5570:
5571: END IF;
5572:
5573: oe_debug_pub.add('Exiting OE_HEADER_UTIL.LOCK_ROW', 1);
5574:
5575: OE_GLOBALS.G_LOCK_TEST := 'N';
5576: EXCEPTION
5577:
5579:
5580: x_return_status := FND_API.G_RET_STS_ERROR;
5581: p_x_header_rec.return_status := FND_API.G_RET_STS_ERROR;
5582:
5583: oe_debug_pub.add('no data found in lock_header', 1);
5584:
5585: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
5586: THEN
5587:
5596:
5597: x_return_status := FND_API.G_RET_STS_ERROR;
5598: p_x_header_rec.return_status := FND_API.G_RET_STS_ERROR;
5599:
5600: oe_debug_pub.add('record_lock in lock_header', 1);
5601:
5602: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
5603: THEN
5604:
5608: END IF;
5609: OE_GLOBALS.G_LOCK_TEST := 'N';
5610: WHEN OTHERS THEN
5611:
5612: oe_debug_pub.add('others in lock_header', 1);
5613: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5614: p_x_header_rec.return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5615:
5616: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
5637: l_msg_count NUMBER;
5638: l_msg_data VARCHAR2(2000);
5639: BEGIN
5640:
5641: oe_debug_pub.add('Entering OE_HEADER_UTIL.GET_VALUES', 1);
5642:
5643: l_header_val_rec := OE_Order_PUB.G_MISS_HEADER_VAL_REC;
5644:
5645: IF (p_header_rec.accounting_rule_id IS NULL OR
6157: );
6158:
6159: END IF;
6160:
6161: oe_debug_pub.add('Exiting OE_HEADER_UTIL.GET_VALUES', 1);
6162:
6163: RETURN l_header_val_rec;
6164:
6165: END Get_Values;
6176: l_invoice_to_org_id NUMBER;
6177: l_deliver_to_org_id NUMBER;
6178: BEGIN
6179:
6180: oe_debug_pub.add('Entering OE_HEADER_UTIL.GET_IDS', 1);
6181:
6182:
6183: IF p_header_val_rec.accounting_rule <> FND_API.G_MISS_CHAR
6184: THEN
6346: ( p_ship_method => p_header_val_rec.shipping_method
6347: );
6348:
6349: IF p_x_header_rec.shipping_method_code = FND_API.G_MISS_CHAR THEN
6350: oe_debug_pub.add('Ship Method Conversion Error');
6351: p_x_header_rec.return_status := FND_API.G_RET_STS_ERROR;
6352: END IF;
6353:
6354: END IF;
6835: ----------------------------------------------------------------------
6836: -- Retreiving ids for invoice_to_customer
6837: ----------------------------------------------------------------------
6838:
6839: oe_debug_pub.add('hdr Invoice_to_cust_id='||p_x_header_rec.invoice_to_customer_id);
6840: IF p_header_val_rec.invoice_to_customer_name_oi <> FND_API.G_MISS_CHAR
6841: OR p_header_val_rec.invoice_to_customer_number_oi <> FND_API.G_MISS_CHAR
6842: THEN
6843:
7200: , p_sold_to_location_country => p_header_val_rec.sold_to_location_country
7201: );
7202:
7203:
7204: oe_debug_pub.add('after hdr sold_to_site_use_id='||p_x_header_rec.sold_to_site_use_id);
7205:
7206: IF p_x_header_rec.sold_to_site_use_id = FND_API.G_MISS_NUM THEN
7207: p_x_header_rec.return_status := FND_API.G_RET_STS_ERROR;
7208: END IF;
7387:
7388: END IF;
7389:
7390: ELSE
7391: oe_debug_pub.add('before calling aend customer contact value to id');
7392: p_x_header_rec.end_customer_contact_id := OE_Value_To_Id.end_customer_contact
7393: ( p_end_customer_contact => p_header_val_rec.end_customer_contact
7394: ,p_end_customer_id =>p_x_header_rec.end_customer_id
7395: );
7392: p_x_header_rec.end_customer_contact_id := OE_Value_To_Id.end_customer_contact
7393: ( p_end_customer_contact => p_header_val_rec.end_customer_contact
7394: ,p_end_customer_id =>p_x_header_rec.end_customer_id
7395: );
7396: oe_debug_pub.add('End customer contact id is '||p_x_header_rec.end_customer_contact_id);
7397:
7398: IF p_x_header_rec.end_customer_contact_id = FND_API.G_MISS_NUM THEN
7399: p_x_header_rec.return_status := FND_API.G_RET_STS_ERROR;
7400: END IF;
7427:
7428: END IF;
7429:
7430: ELSE
7431: oe_debug_pub.add('Before calling End custoemr site use value to id');
7432: p_x_header_rec.end_customer_site_use_id := OE_Value_To_Id.end_customer_site
7433: ( p_end_customer_site_address1 => p_header_val_rec.end_customer_site_address1
7434: , p_end_customer_site_address2 => p_header_val_rec.end_customer_site_address2
7435: , p_end_customer_site_address3 => p_header_val_rec.end_customer_site_address3
7444: , p_end_customer_site_use_code => NULL
7445: );
7446:
7447:
7448: oe_debug_pub.add('after hdr sold_to_site_use_id='||p_x_header_rec.end_customer_site_use_id);
7449:
7450: IF p_x_header_rec.end_customer_site_use_id = FND_API.G_MISS_NUM THEN
7451: p_x_header_rec.return_status := FND_API.G_RET_STS_ERROR;
7452: END IF;
7475: p_x_header_rec.ib_owner:=OE_Value_To_Id.ib_owner
7476: ( p_ib_owner => p_header_val_rec.ib_owner_dsp
7477: );
7478:
7479: oe_Debug_pub.add('ib owner id is '||p_x_header_rec.ib_owner);
7480: IF p_x_header_rec.ib_owner = FND_API.G_MISS_CHAR THEN
7481: p_x_header_rec.return_status := FND_API.G_RET_STS_ERROR;
7482: END IF;
7483:
7503:
7504: p_x_header_rec.ib_installed_at_location:=OE_Value_To_Id.ib_installed_at_location
7505: ( p_ib_installed_at_location => p_header_val_rec.ib_installed_at_location_dsp
7506: );
7507: oe_Debug_pub.add('installed at location'||p_x_header_rec.ib_installed_at_location);
7508:
7509: IF p_x_header_rec.ib_installed_at_location = FND_API.G_MISS_CHAR THEN
7510: p_x_header_rec.return_status := FND_API.G_RET_STS_ERROR;
7511: END IF;
7546: ----------------------------------------------------------------------
7547: -- End of get IDs for customer related fields
7548: ----------------------------------------------------------------------
7549:
7550: oe_debug_pub.add('Exiting OE_HEADER_UTIL.GET_IDS', 1);
7551:
7552: END Get_Ids;
7553:
7554:
7574: x_result NUMBER;
7575:
7576: BEGIN
7577:
7578: oe_debug_pub.add('Entering OE_HEADER_UTIL.Get_Ord_Seq_Type',1);
7579:
7580: IF p_order_type_id IS NULL OR
7581: p_order_type_id = FND_API.G_MISS_NUM
7582: THEN
7616: IF x_result <> 0 THEN
7617: RAISE FND_API.G_EXC_ERROR;
7618: END IF;
7619:
7620: oe_debug_pub.add('Exiting OE_HEADER_UTIL.Get_Ord_Seq_Type',1);
7621:
7622: RETURN x_doc_sequence_type;
7623:
7624: EXCEPTION
7645: l_order_number NUMBER;
7646: l_order_type_id NUMBER := 0;
7647: BEGIN
7648:
7649: --Commenting the oe_debug_pub call to fix bug 2105266.
7650:
7651: -- oe_debug_pub.add('Entering OE_HEADER_UTIL.Get_Order_Info',1);
7652:
7653: BEGIN
7647: BEGIN
7648:
7649: --Commenting the oe_debug_pub call to fix bug 2105266.
7650:
7651: -- oe_debug_pub.add('Entering OE_HEADER_UTIL.Get_Order_Info',1);
7652:
7653: BEGIN
7654: SELECT order_number,order_type_id
7655: INTO l_order_number,l_order_type_id
7677: WHEN NO_DATA_FOUND THEN
7678: x_order_type := NULL;
7679: END;
7680:
7681: -- oe_debug_pub.add('Exiting OE_HEADER_UTIL.Get_Order_Info',1);
7682:
7683: END Get_Order_Info;
7684:
7685: FUNCTION Get_Header_Id (p_order_number IN NUMBER,
7725: l_order_type_id NUMBER;
7726: l_order_type VARCHAR2(240);
7727: BEGIN
7728:
7729: oe_debug_pub.add('Entering OR_HEADER_UTIL.Get_Order_Type',1);
7730:
7731: Select order_category_code --name --commented for BUG#7671483
7732: into l_order_type
7733: from oe_order_types_v
7732: into l_order_type
7733: from oe_order_types_v
7734: where transaction_type_id = p_order_type_id;
7735:
7736: oe_debug_pub.add('Exiting OR_HEADER_UTIL.Get_Order_Type',1);
7737:
7738: RETURN l_order_type;
7739:
7740: EXCEPTION
7774: lcount NUMBER;
7775: x_result NUMBER;
7776:
7777: BEGIN
7778: oe_debug_pub.add('Entering OE_HEADER_UTIL.Get_Order_Number',1);
7779: oe_debug_pub.add('Entering OE_HEADER_UTIL.Get_Order_Number',1);
7780: -- Check if Order Number can be updated or not???? bug 4146258
7781: -- Fixed by Srini
7782: IF NOT OE_GLOBALS.EQUAL(p_x_header_rec.order_number,
7775: x_result NUMBER;
7776:
7777: BEGIN
7778: oe_debug_pub.add('Entering OE_HEADER_UTIL.Get_Order_Number',1);
7779: oe_debug_pub.add('Entering OE_HEADER_UTIL.Get_Order_Number',1);
7780: -- Check if Order Number can be updated or not???? bug 4146258
7781: -- Fixed by Srini
7782: IF NOT OE_GLOBALS.EQUAL(p_x_header_rec.order_number,
7783: p_old_header_rec.order_number)
7793: end if;
7794: l_set_of_books_rec := OE_Order_Cache.Load_Set_Of_Books;
7795: x_Set_Of_Books_Id := l_set_of_books_rec.set_of_books_id;
7796: l_order_type_rec := OE_Order_Cache.Load_Order_Type (p_x_header_rec.order_type_id);
7797: oe_debug_pub.add('When Order Number has been changed :'||p_x_header_rec.transaction_phase_code);
7798: IF nvl(p_x_header_rec.transaction_phase_code,'F') = 'F' THEN
7799: X_Doc_Category_Code := to_char(p_x_header_rec.order_type_id);
7800: ELSIF p_x_header_rec.transaction_phase_code = 'N' THEN
7801: X_Doc_Category_Code := to_char(p_x_header_rec.order_type_id)||'-Quote';
7833: p_old_header_rec.transaction_phase_code)
7834: )
7835: THEN
7836:
7837: oe_debug_pub.ADD('Ordertype is :' || to_char(p_x_header_rec.order_type_id),3);
7838:
7839: l_set_of_books_rec := OE_Order_Cache.Load_Set_Of_Books;
7840: x_Set_Of_Books_Id := l_set_of_books_rec.set_of_books_id;
7841:
7844: THEN
7845:
7846: l_order_type_rec := OE_Order_Cache.Load_Order_Type (p_x_header_rec.order_type_id);
7847:
7848: oe_debug_pub.add('transaction phase :'||p_x_header_rec.transaction_phase_code);
7849: -- Quoting Changes
7850: IF nvl(p_x_header_rec.transaction_phase_code,'F') = 'F' THEN
7851: X_Doc_Category_Code := to_char(p_x_header_rec.order_type_id);
7852: ELSIF p_x_header_rec.transaction_phase_code = 'N' THEN
7859: -- QUOTING changes
7860: IF OE_Quote_Util.G_COMPLETE_NEG = 'Y'
7861: AND nvl(l_order_type_rec.quote_num_as_ord_num_flag,'Y') = 'Y' --added nvl for bug4474915
7862: THEN
7863: oe_debug_pub.ADD('retain document number is Yes');
7864: GOTO End_Of_Procedure;
7865: END IF;
7866:
7867: oe_debug_pub.ADD('before calling get_seq_info ', 2);
7863: oe_debug_pub.ADD('retain document number is Yes');
7864: GOTO End_Of_Procedure;
7865: END IF;
7866:
7867: oe_debug_pub.ADD('before calling get_seq_info ', 2);
7868: oe_debug_pub.ADD('Category Code'||x_doc_category_code, 3);
7869: oe_debug_pub.ADD('Set of Books'||x_set_of_books_id, 3);
7870: x_result := fnd_seqnum.get_seq_info(
7871: 660,
7864: GOTO End_Of_Procedure;
7865: END IF;
7866:
7867: oe_debug_pub.ADD('before calling get_seq_info ', 2);
7868: oe_debug_pub.ADD('Category Code'||x_doc_category_code, 3);
7869: oe_debug_pub.ADD('Set of Books'||x_set_of_books_id, 3);
7870: x_result := fnd_seqnum.get_seq_info(
7871: 660,
7872: x_doc_category_code,
7865: END IF;
7866:
7867: oe_debug_pub.ADD('before calling get_seq_info ', 2);
7868: oe_debug_pub.ADD('Category Code'||x_doc_category_code, 3);
7869: oe_debug_pub.ADD('Set of Books'||x_set_of_books_id, 3);
7870: x_result := fnd_seqnum.get_seq_info(
7871: 660,
7872: x_doc_category_code,
7873: x_set_of_books_id,
7882: X_Aud_Tbl_Name,
7883: X_Msg_Flag
7884: );
7885:
7886: oe_debug_pub.ADD('after calling get_seq_info ', 2);
7887:
7888: IF x_result <> FND_SEQNUM.SEQSUCC THEN
7889: IF x_result = FND_SEQNUM.NOTUSED THEN
7890: fnd_message.set_name('ONT','OE_MISS_DOC_SEQ');
7909: IF x_result <> 0 THEN
7910: RAISE FND_API.G_EXC_ERROR;
7911: END IF;
7912:
7913: oe_debug_pub.ADD('fndseqresult'||to_char(x_result), 2);
7914: oe_debug_pub.ADD('fndseqtype'||x_doc_sequence_value, 2);
7915:
7916: -- Quoting Changes
7917: IF nvl(p_x_header_rec.transaction_phase_code,'F') = 'F' THEN
7910: RAISE FND_API.G_EXC_ERROR;
7911: END IF;
7912:
7913: oe_debug_pub.ADD('fndseqresult'||to_char(x_result), 2);
7914: oe_debug_pub.ADD('fndseqtype'||x_doc_sequence_value, 2);
7915:
7916: -- Quoting Changes
7917: IF nvl(p_x_header_rec.transaction_phase_code,'F') = 'F' THEN
7918: p_x_header_rec.order_number := x_doc_sequence_value;
7922: END IF;
7923:
7924:
7925: ELSIF (l_doc_seq_type = 'M') THEN
7926: oe_debug_pub.add('manual sequence');
7927:
7928: -- Quoting Changes
7929: -- Fix for bug 3204076
7930: -- Raise error if manual sequence and quote/order number is
7974: RAISE FND_API.G_EXC_ERROR;
7975: END IF;
7976:
7977: -- Fix for bug# 3526149. Also see bug 3485680
7978: oe_debug_pub.add('p_old_header_rec.order_number:' || p_old_header_rec.order_number,1);
7979: oe_debug_pub.add('p_old_header_rec.transaction_phase_code:' ||
7980: p_old_header_rec.transaction_phase_code,1);
7981: IF (p_x_header_rec.order_number <> p_old_header_rec.order_number AND
7982: p_old_header_rec.order_number is not null AND
7975: END IF;
7976:
7977: -- Fix for bug# 3526149. Also see bug 3485680
7978: oe_debug_pub.add('p_old_header_rec.order_number:' || p_old_header_rec.order_number,1);
7979: oe_debug_pub.add('p_old_header_rec.transaction_phase_code:' ||
7980: p_old_header_rec.transaction_phase_code,1);
7981: IF (p_x_header_rec.order_number <> p_old_header_rec.order_number AND
7982: p_old_header_rec.order_number is not null AND
7983: p_old_header_rec.order_number <> FND_API.G_MISS_NUM) AND
7981: IF (p_x_header_rec.order_number <> p_old_header_rec.order_number AND
7982: p_old_header_rec.order_number is not null AND
7983: p_old_header_rec.order_number <> FND_API.G_MISS_NUM) AND
7984: OE_Quote_Util.G_COMPLETE_NEG = 'N' THEN
7985: oe_debug_pub.add('Ord_Num Changed, Calling Set_Header_User_Key and WF_ENGINE.SetItemUserKey',1);
7986: OE_Order_WF_Util.Set_Header_User_Key(p_x_header_rec);
7987: WF_ENGINE.SetItemUserKey(OE_Globals.G_WFI_HDR, to_char(p_x_header_rec.header_id),
7988: substrb(fnd_message.get, 1, 240));
7989:
8009: RAISE FND_API.G_EXC_ERROR;
8010: END IF;
8011:
8012: -- Fix for bug# 3526149. Also see bug 3485680
8013: oe_debug_pub.add('p_old_header_rec.quote_number:' || p_old_header_rec.quote_number,1);
8014: IF (p_x_header_rec.quote_number <> p_old_header_rec.quote_number AND
8015: p_old_header_rec.quote_number is not null AND
8016: p_old_header_rec.quote_number <> FND_API.G_MISS_NUM) THEN
8017: oe_debug_pub.add('Calling OE_Order_WF_Util.Set_Negotiate_Hdr_User_Key for HeaderID:'
8013: oe_debug_pub.add('p_old_header_rec.quote_number:' || p_old_header_rec.quote_number,1);
8014: IF (p_x_header_rec.quote_number <> p_old_header_rec.quote_number AND
8015: p_old_header_rec.quote_number is not null AND
8016: p_old_header_rec.quote_number <> FND_API.G_MISS_NUM) THEN
8017: oe_debug_pub.add('Calling OE_Order_WF_Util.Set_Negotiate_Hdr_User_Key for HeaderID:'
8018: || to_char(p_x_header_rec.header_id), 1);
8019: OE_Order_WF_Util.Set_Negotiate_Hdr_User_Key
8020: (p_header_id => p_x_header_rec.header_id
8021: ,p_sales_document_type_code => 'O'
8031: END IF; -- Global equal
8032:
8033: <
8034:
8035: oe_debug_pub.add('Exiting OR_HEADER_UTIL.Get_Order_Number',1);
8036:
8037: EXCEPTION
8038: WHEN FND_API.G_EXC_ERROR THEN
8039: oe_debug_pub.ADD('Get Order Number-Exp exception ', 1);
8035: oe_debug_pub.add('Exiting OR_HEADER_UTIL.Get_Order_Number',1);
8036:
8037: EXCEPTION
8038: WHEN FND_API.G_EXC_ERROR THEN
8039: oe_debug_pub.ADD('Get Order Number-Exp exception ', 1);
8040: RAISE FND_API.G_EXC_ERROR;
8041:
8042:
8043: WHEN OTHERS THEN
8040: RAISE FND_API.G_EXC_ERROR;
8041:
8042:
8043: WHEN OTHERS THEN
8044: oe_debug_pub.ADD('Get Order Number-exception ', 1);
8045:
8046:
8047: IF OE_MSG_PUB.Check_Msg_Level (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8048: THEN
8062: IS
8063: l_order_type_id NUMBER;
8064: l_order_type VARCHAR2(240);
8065: --
8066: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
8067: --
8068: BEGIN
8069: IF l_debug_level > 0 THEN
8070: oe_debug_pub.add('Entering OR_HEADER_UTIL.Get_Base_Order_Type ' || p_order_type_id,1);
8066: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
8067: --
8068: BEGIN
8069: IF l_debug_level > 0 THEN
8070: oe_debug_pub.add('Entering OR_HEADER_UTIL.Get_Base_Order_Type ' || p_order_type_id,1);
8071: END IF;
8072:
8073: SELECT NAME
8074: INTO l_order_type
8078: from fnd_languages
8079: where installed_flag = 'B');
8080:
8081: IF l_debug_level > 0 THEN
8082: oe_debug_pub.add('Exiting OR_HEADER_UTIL.Get_Base_Order_Type ' || l_order_type,1);
8083: END IF;
8084:
8085: RETURN l_order_type;
8086:
8101: WHERE oare.rule_id=oar.rule_id
8102: AND oar.DATABASE_OBJECT_NAME='OE_AK_ORDER_HEADERS_V'
8103: GROUP BY oare.ATTRIBUTE_CODE;
8104:
8105: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
8106:
8107: BEGIN
8108: IF l_debug_level > 0 then
8109: oe_debug_pub.add('Entering Load_attachment_rules');
8105: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
8106:
8107: BEGIN
8108: IF l_debug_level > 0 then
8109: oe_debug_pub.add('Entering Load_attachment_rules');
8110: End IF;
8111:
8112: IF g_attachment_rule_count_tab.count = 0 THEN
8113: FOR header_attributes_rec IN header_attributes LOOP
8115: END LOOP;
8116: END IF;
8117:
8118: IF l_debug_level > 0 then
8119: oe_debug_pub.add('Exiting Load_attachment_rules');
8120: End IF;
8121:
8122: END Load_attachment_rules;
8123: --7688372 end
8173: -- R12 CC encryption
8174: l_changed_attribute VARCHAR2(200);
8175: l_modified_from VARCHAR2(30);
8176: --
8177: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
8178: --
8179: l_attr_attach_change boolean := FALSE; --6896311
8180:
8181:
8179: l_attr_attach_change boolean := FALSE; --6896311
8180:
8181:
8182: BEGIN
8183: oe_debug_pub.add('Entering OR_HEADER_UTIL.Pre_Write_Process',1);
8184:
8185: OE_SALES_CAN_UTIL.G_IR_ISO_HDR_CANCEL := FALSE;
8186: -- Setting the global for IR ISO Tracking bug 7667702
8187:
8189:
8190: IF (p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE) THEN
8191:
8192: IF OE_GLOBALS.G_AUDIT_REASON_RQD_FLAG = 'Y' THEN
8193: OE_DEBUG_PUB.add('OEXUHDRB: Audit check requires reason', 5);
8194:
8195: IF (p_x_header_rec.change_reason IS NULL
8196: OR p_x_header_rec.change_reason = FND_API.G_MISS_CHAR
8197: OR NOT OE_Validate.Change_Reason_Code(p_x_header_rec.change_reason)) then
8201: OE_Versioning_Util.Get_Reason_Info(l_reason_code, l_reason_comments);
8202: IF l_reason_code IS NULL THEN
8203: -- bug 3636884, defaulting reason from group API
8204: IF OE_GLOBALS.G_DEFAULT_REASON THEN
8205: oe_debug_pub.add('Defaulting Audit Reason for Order Header', 1);
8206: p_x_header_rec.change_reason := 'SYSTEM';
8207: ELSE
8208: OE_DEBUG_PUB.add('Reason code for change is missing or invalid', 1);
8209: fnd_message.set_name('ONT','OE_AUDIT_REASON_RQD');
8204: IF OE_GLOBALS.G_DEFAULT_REASON THEN
8205: oe_debug_pub.add('Defaulting Audit Reason for Order Header', 1);
8206: p_x_header_rec.change_reason := 'SYSTEM';
8207: ELSE
8208: OE_DEBUG_PUB.add('Reason code for change is missing or invalid', 1);
8209: fnd_message.set_name('ONT','OE_AUDIT_REASON_RQD');
8210: fnd_message.set_token('OBJECT','ORDER');
8211: oe_msg_pub.add;
8212: RAISE FND_API.G_EXC_ERROR;
8213: END IF;
8214: END IF;
8215: END IF;
8216: ELSE
8217: OE_DEBUG_PUB.add('Reason code for change is missing or invalid', 1);
8218: fnd_message.set_name('ONT','OE_AUDIT_REASON_RQD');
8219: fnd_message.set_token('OBJECT','ORDER');
8220: oe_msg_pub.add;
8221: RAISE FND_API.G_EXC_ERROR;
8262: (p_x_header_rec.cancelled_flag <> NVL(p_old_header_rec.cancelled_flag,'N')) THEN -- Bug 9241924
8263:
8264: /* Fix Bug # 3241831: Set Global before Order Cancellation Starts */
8265: IF OE_GLOBALS.G_UI_FLAG = FALSE THEN
8266: oe_debug_pub.add('SET G_ORD_LVL_CAN TO TRUE FOR NON UI ORDER CANCEL');
8267: OE_OE_FORM_CANCEL_LINE.g_ord_lvl_can := TRUE;
8268: END IF;
8269:
8270: /* 7576948: IR ISO Change Management project Start */
8353:
8354: IF (p_x_header_rec.order_source_id = 10) THEN
8355: OE_SALES_CAN_UTIL.G_IR_ISO_HDR_CANCEL := TRUE;
8356: IF l_debug_level > 0 THEN
8357: oe_debug_pub.add(' Setting global Header Cancel for IR ISO to TRUE',5);
8358: END IF;
8359: END IF;
8360: -- Setting this global to TRUE confirming it to be
8361: -- Order header level full cancellation
8366:
8367: IF (p_x_header_rec.order_source_id = 10) THEN
8368: OE_SALES_CAN_UTIL.G_IR_ISO_HDR_CANCEL := FALSE;
8369: IF l_debug_level > 0 THEN
8370: oe_debug_pub.add(' Setting global Header Cancel for IR ISO to FALSE',5);
8371: END IF;
8372: END IF;
8373: -- Resetting the global to FALSE
8374:
8383: ELSE -- If return status is SUCCESS
8384: IF (p_x_header_rec.order_source_id = 10) THEN
8385: IF NOT OE_Internal_Requisition_Pvt.G_Update_ISO_From_Req THEN
8386: IF l_debug_level > 0 THEN
8387: oe_debug_pub.add(' Header level cancellation. Log the IR ISO update delayed request',5);
8388: END IF;
8389:
8390: OE_delayed_requests_Pvt.log_request
8391: ( p_entity_code => OE_GLOBALS.G_ENTITY_HEADER
8448:
8449: -- Valid shipping method.
8450:
8451: IF l_debug_level > 0 THEN
8452: oe_debug_pub.add('l_count : ' || l_count);
8453: oe_debug_pub.add('shipping_method_code : ' || p_x_header_rec.shipping_method_code);
8454: END IF;
8455:
8456: IF l_count = 0 THEN
8449: -- Valid shipping method.
8450:
8451: IF l_debug_level > 0 THEN
8452: oe_debug_pub.add('l_count : ' || l_count);
8453: oe_debug_pub.add('shipping_method_code : ' || p_x_header_rec.shipping_method_code);
8454: END IF;
8455:
8456: IF l_count = 0 THEN
8457:
8463: and list_line_type_code = 'TSN'
8464: and modified_to = p_x_header_rec.shipping_method_code;
8465: IF v_count > 0 THEN
8466: IF l_debug_level > 0 THEN
8467: oe_debug_pub.add('Deleting the header tsn adjustments');
8468: END IF;
8469: DELETE FROM OE_PRICE_ADJUSTMENTS
8470: WHERE HEADER_ID = p_x_header_rec.header_id
8471: AND LIST_LINE_TYPE_CODE = 'TSN'
8512: OE_Order_Util.Get_Attribute_Name('shipping_method_code') || ' ' || l_meaning);
8513: OE_MSG_PUB.Add;
8514: OE_MSG_PUB.Update_Msg_Context(p_attribute_code => null);
8515:
8516: oe_debug_pub.add('Value of shipping Method:'
8517: ||p_x_header_rec.shipping_method_code,2);
8518:
8519: --bug 4190357
8520: for i in line_ids(p_x_header_rec.header_id) loop
8580: p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE) AND --5893276
8581: 6896311*/
8582: IF (p_x_header_rec.operation = OE_GLOBALS.G_OPR_CREATE ) AND --6896311
8583: l_apply_automatic_atchmt = 'Y' THEN
8584: oe_debug_pub.add('log request to apply atcmt');
8585: OE_DELAYED_REQUESTS_PVT.Log_Request
8586: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
8587: p_entity_id => p_x_header_rec.header_id,
8588: p_request_type => OE_GLOBALS.G_APPLY_AUTOMATIC_ATCHMT,
8595: --6896311
8596: IF (p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE ) AND
8597: l_apply_automatic_atchmt = 'Y'
8598: THEN
8599: oe_debug_pub.add('log request to update atcmt');
8600:
8601: --7688372 start
8602: Load_attachment_rules;
8603: --7688372 end
8648: -- 3817802 : New api Get_Base_Order_Type is used to get order type based on base lang
8649: l_new_order_type := Get_Base_Order_Type(p_x_header_rec.order_type_id);
8650: l_order_type := Get_Base_Order_Type(p_old_header_rec.order_type_id);
8651: IF l_debug_level > 0 THEN
8652: oe_debug_pub.add('l_source_code ' || l_source_code,2);
8653: oe_debug_pub.add('l_new_order_type ' || l_new_order_type,2);
8654: oe_debug_pub.add('l_order_type ' || l_order_type,2);
8655: END IF;
8656: l_return_value :=
8649: l_new_order_type := Get_Base_Order_Type(p_x_header_rec.order_type_id);
8650: l_order_type := Get_Base_Order_Type(p_old_header_rec.order_type_id);
8651: IF l_debug_level > 0 THEN
8652: oe_debug_pub.add('l_source_code ' || l_source_code,2);
8653: oe_debug_pub.add('l_new_order_type ' || l_new_order_type,2);
8654: oe_debug_pub.add('l_order_type ' || l_order_type,2);
8655: END IF;
8656: l_return_value :=
8657: inv_salesorder.synch_salesorders_with_om(
8650: l_order_type := Get_Base_Order_Type(p_old_header_rec.order_type_id);
8651: IF l_debug_level > 0 THEN
8652: oe_debug_pub.add('l_source_code ' || l_source_code,2);
8653: oe_debug_pub.add('l_new_order_type ' || l_new_order_type,2);
8654: oe_debug_pub.add('l_order_type ' || l_order_type,2);
8655: END IF;
8656: l_return_value :=
8657: inv_salesorder.synch_salesorders_with_om(
8658: p_original_order_number =>
8663: to_char(p_x_header_rec.order_number),
8664: p_new_order_type => l_new_order_type,
8665: p_new_order_source => l_source_code,
8666: p_multiple_rows => 'N');
8667: oe_debug_pub.add(' Return Value ' || l_return_value,1);
8668: END IF;
8669:
8670: END IF;
8671: --included for the create internal requisition Spares Management (Ikon) project mshenoy
8674: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_CREATE AND
8675: p_x_header_rec.Source_Document_Type_id = 10 AND
8676: p_x_header_rec.Source_Document_id is null AND
8677: p_x_header_rec.Orig_sys_document_ref is null THEN
8678: oe_debug_pub.add('log request to create internal Req for ISO');
8679: OE_delayed_requests_Pvt.Log_Request
8680: (p_entity_code => OE_GLOBALS.G_ENTITY_ALL,
8681: p_entity_id => p_x_header_rec.header_id,
8682: p_request_type => OE_GLOBALS.G_CREATE_INTERNAL_REQ,
8682: p_request_type => OE_GLOBALS.G_CREATE_INTERNAL_REQ,
8683: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
8684: p_requesting_entity_id => p_x_header_rec.header_id,
8685: x_return_status => l_return_status );
8686: oe_debug_pub.add(' Return Status log_request Delayed Requests for Int req ' || l_return_status);
8687:
8688: END IF;
8689:
8690: -- Fix for bug1167537
8745: THEN
8746: l_changed_attribute := l_changed_attribute||',' ||'CREDIT_CARD_EXPIRATION_DATE';
8747:
8748: END IF;
8749: oe_debug_pub.add('changed attr is: '||l_changed_attribute, 3);
8750: END IF;
8751:
8752: -- Bug 1755817: clear the cached constraint results for header entity
8753: -- when order header is updated.
8763: OE_GLOBALS.G_REASON_CODE := p_x_header_rec.change_reason;
8764: OE_GLOBALS.G_REASON_COMMENTS := p_x_header_rec.change_comments;
8765: OE_GLOBALS.G_CAPTURED_REASON := 'Y';
8766: ELSE
8767: OE_DEBUG_PUB.add('Reason code for versioning is missing', 1);
8768: if OE_GLOBALS.G_UI_FLAG THEN
8769: raise FND_API.G_EXC_ERROR;
8770: end if;
8771: END IF;
8771: END IF;
8772: END IF;
8773:
8774: --log delayed request
8775: oe_debug_pub.add('log versioning request',1);
8776: OE_Delayed_Requests_Pvt.Log_Request(p_entity_code => OE_GLOBALS.G_ENTITY_ALL,
8777: p_entity_id => p_x_header_rec.header_id,
8778: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
8779: p_requesting_entity_id => p_x_header_rec.header_id,
8783: END IF;
8784:
8785: IF OE_GLOBALS.G_AUDIT_REASON_RQD_FLAG = 'Y' OR
8786: OE_GLOBALS.G_AUDIT_HISTORY_RQD_FLAG = 'Y' THEN
8787: OE_DEBUG_PUB.add('Call oe_order_chg_pvt to record Header Audit History',5);
8788:
8789: --11.5.10 Versioning/Audit Trail updates
8790: IF OE_CODE_CONTROL.CODE_RELEASE_LEVEL >= '110510' THEN
8791: OE_Versioning_Util.Capture_Audit_Info(p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
8812: x_return_status => l_return_status
8813: );
8814:
8815: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
8816: oe_debug_pub.add('Inserting Header History Caused Error ',1);
8817: if l_return_status = FND_API.G_RET_STS_ERROR then
8818: raise FND_API.G_EXC_ERROR;
8819: else
8820: raise FND_API.G_EXC_UNEXPECTED_ERROR;
8857: Blkt_Req_For_Curr_Upd_And_Del(p_x_header_rec,p_old_header_rec);
8858: END IF;
8859:
8860:
8861: oe_debug_pub.add('Exiting OR_HEADER_UTIL.Pre_Write_Process',1);
8862:
8863: EXCEPTION
8864: -- included to fix bug 1589196 Begin
8865: WHEN FND_API.G_EXC_ERROR THEN
8908: l_payment_exists VARCHAR2(1) := 'N';
8909: l_payment_number NUMBER;
8910: l_old_payment_type_code VARCHAR2(30) := NULL;
8911: --R12 CC Encryption
8912: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
8913: --bug 5258767
8914: l_payment_term_id NUMBER;
8915: l_prepayment_flag VARCHAR2(1) := NULL;
8916: l_prepay_count NUMBER := 0;
8923: L_DOWNPAYMENT number;
8924: l_line_payment_count NUMBER;
8925: --bug 5258767
8926: BEGIN
8927: oe_debug_pub.add('Entering OE_HEADER_UTIL.Post_Write_Process',1);
8928:
8929: -- Added call to new procedure eval_post_write_header for performance
8930: -- and to be consistent with evalualte_post_write for lines.
8931: -- See bug#1777317
8964: -- and to be consistent with evalualte_post_write for lines.
8965: -- See bug#1777317
8966:
8967: /*ER#7479609
8968: oe_debug_pub.add('Before calling eval_post_write_header in HEADER Post Write',1);
8969:
8970: OE_HOLDS_PUB.eval_post_write_header
8971: ( p_entity_code => OE_GLOBALS.G_ENTITY_HEADER
8972: ,p_entity_id => p_x_header_rec.header_id
8983: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
8984: RAISE FND_API.G_EXC_ERROR;
8985: END IF;
8986:
8987: oe_debug_pub.add('After calling eval_post_write_header in HEADER Post Write',1);
8988: ER#7479609*/
8989:
8990: --ER#7479609 start
8991: if l_debug_level > 0 then
8988: ER#7479609*/
8989:
8990: --ER#7479609 start
8991: if l_debug_level > 0 then
8992: oe_debug_pub.add('Call evaluate_holds_post_write for CREATE');
8993: end if;
8994: OE_Holds_PUB.evaluate_holds_post_write
8995: (p_entity_code => OE_GLOBALS.G_ENTITY_HEADER
8996: ,p_entity_id => p_x_header_rec.header_id
9005: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9006: END IF;
9007:
9008: if l_debug_level > 0 then
9009: oe_debug_pub.add('After evaluate_holds_post_write in Header Post Write');
9010: end if;
9011: --ER#7479609 end
9012:
9013: -- Create record in the MTL_SALES_ORDERS table
9011: --ER#7479609 end
9012:
9013: -- Create record in the MTL_SALES_ORDERS table
9014:
9015: oe_debug_pub.add('Before calling OE_SCHEDULE_UTIL',3);
9016: OE_SCHEDULE_UTIL.Insert_into_mtl_sales_orders(p_x_header_rec);
9017:
9018: -- Create and Start the Header level Workflow
9019:
9037: -- were updates due to synchronous activities like booking in
9038: -- the header flow. If yes, refresh the header record
9039:
9040: OE_Order_Cache.Load_Order_Header(p_x_header_rec.header_id);
9041: oe_debug_pub.add('DB lock control :'||
9042: OE_Order_Cache.g_header_rec.lock_control);
9043:
9044: IF OE_Order_Cache.g_header_rec.lock_control
9045: <> p_x_header_rec.lock_control
9087: 'RETRY','CANCEL');
9088:
9089: -- OE_GLOBALS.G_RECURSION_MODE := l_recursion_mode;
9090: -- BUG 2013611 - Increment promotional balance in response to cancellation
9091: oe_debug_pub.add('log request to Reverse_Limits for CANCEL in HEADER Post Write',1);
9092: OE_delayed_requests_Pvt.log_request(
9093: p_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
9094: p_entity_id => p_x_header_rec.header_id,
9095: p_requesting_entity_code => OE_GLOBALS.G_ENTITY_HEADER,
9102: p_param5 => NULL,
9103: p_param6 => NULL,
9104: p_request_type => OE_GLOBALS.G_REVERSE_LIMITS,
9105: x_return_status => l_return_status);
9106: oe_debug_pub.add('Request to Reverse_Limits in HEADER Post Write is done',1);
9107: -- BUG 2013611 End
9108: EXCEPTION
9109: WHEN OTHERS THEN
9110: -- OE_GLOBALS.G_RECURSION_MODE := l_recursion_mode;
9133: END IF;
9134:
9135: ------Added by CKASERA bug 14763723
9136: IF(l_debug_level>0) THEN
9137: oe_debug_pub.ADD('14763723 Rasing the XML Event for Header before line processing');
9138: END IF;
9139:
9140: OE_DELAYED_REQUESTS_PVT.Process_Request_for_Reqtype
9141: (p_request_type =>OE_GLOBALS.G_GENERATE_XML_REQ_HDR
9281: );
9282:
9283: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9284: if l_debug_level > 0 then
9285: oe_debug_pub.ADD('OE_Header_Util.Post_Write unexp error in instantiate doc terms',1);
9286: end if;
9287: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9288: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
9289: if l_debug_level > 0 then
9286: end if;
9287: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9288: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
9289: if l_debug_level > 0 then
9290: oe_debug_pub.ADD('OE_Header_Util.Post_Write exp error in instantiate doc terms',1);
9291: end if;
9292: RAISE FND_API.G_EXC_ERROR;
9293: END IF;
9294:
9292: RAISE FND_API.G_EXC_ERROR;
9293: END IF;
9294:
9295: END IF;
9296: oe_debug_pub.add('Post Write Process R12 CCE changes...'||p_x_header_rec.header_id);
9297: oe_debug_pub.add('Old header id'||p_old_header_rec.header_id);
9298: oe_debug_pub.add('payment type'||p_x_header_rec.payment_type_code);
9299: --oe_debug_pub.add('card number'||p_x_header_rec.credit_Card_number);
9300: --If Bill to site is changed, then the payment record would
9293: END IF;
9294:
9295: END IF;
9296: oe_debug_pub.add('Post Write Process R12 CCE changes...'||p_x_header_rec.header_id);
9297: oe_debug_pub.add('Old header id'||p_old_header_rec.header_id);
9298: oe_debug_pub.add('payment type'||p_x_header_rec.payment_type_code);
9299: --oe_debug_pub.add('card number'||p_x_header_rec.credit_Card_number);
9300: --If Bill to site is changed, then the payment record would
9301: --be deleted through the delayed request. So not calling
9294:
9295: END IF;
9296: oe_debug_pub.add('Post Write Process R12 CCE changes...'||p_x_header_rec.header_id);
9297: oe_debug_pub.add('Old header id'||p_old_header_rec.header_id);
9298: oe_debug_pub.add('payment type'||p_x_header_rec.payment_type_code);
9299: --oe_debug_pub.add('card number'||p_x_header_rec.credit_Card_number);
9300: --If Bill to site is changed, then the payment record would
9301: --be deleted through the delayed request. So not calling
9302: --the process order if bill to site has changed.
9295: END IF;
9296: oe_debug_pub.add('Post Write Process R12 CCE changes...'||p_x_header_rec.header_id);
9297: oe_debug_pub.add('Old header id'||p_old_header_rec.header_id);
9298: oe_debug_pub.add('payment type'||p_x_header_rec.payment_type_code);
9299: --oe_debug_pub.add('card number'||p_x_header_rec.credit_Card_number);
9300: --If Bill to site is changed, then the payment record would
9301: --be deleted through the delayed request. So not calling
9302: --the process order if bill to site has changed.
9303: --bug 4885313
9306: --If the user has modified the bill to site and has entered a new
9307: --credit card before saving the record, then the global flag need
9308: --to be set to Y so that the current trxn extension id would be
9309: --deleted and a new one created (as the context has changed).
9310: oe_debug_pub.add('Old invoice to'||p_x_header_rec.invoice_to_org_id);
9311: oe_debug_pub.add('New invoice to'||p_old_header_rec.invoice_to_org_id);
9312: IF NOT OE_GLOBALS.Equal(p_old_header_rec.invoice_to_org_id,FND_API.G_MISS_NUM)
9313: AND p_old_header_rec.invoice_to_org_id IS NOT NULL AND
9314: p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
9307: --credit card before saving the record, then the global flag need
9308: --to be set to Y so that the current trxn extension id would be
9309: --deleted and a new one created (as the context has changed).
9310: oe_debug_pub.add('Old invoice to'||p_x_header_rec.invoice_to_org_id);
9311: oe_debug_pub.add('New invoice to'||p_old_header_rec.invoice_to_org_id);
9312: IF NOT OE_GLOBALS.Equal(p_old_header_rec.invoice_to_org_id,FND_API.G_MISS_NUM)
9313: AND p_old_header_rec.invoice_to_org_id IS NOT NULL AND
9314: p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
9315: OE_Payment_Trxn_Util.g_old_bill_to_site := p_old_header_rec.invoice_to_org_id;
9313: AND p_old_header_rec.invoice_to_org_id IS NOT NULL AND
9314: p_x_header_rec.payment_type_code = 'CREDIT_CARD' THEN
9315: OE_Payment_Trxn_Util.g_old_bill_to_site := p_old_header_rec.invoice_to_org_id;
9316: END IF;
9317: oe_debug_pub.add('Bill to site changed in post_write_process'||OE_Payment_Trxn_Util.g_old_bill_to_site);
9318: END IF;
9319:
9320: oe_debug_pub.add('Operatoin in post write...in header rec..'||p_x_header_rec.operation);
9321:
9316: END IF;
9317: oe_debug_pub.add('Bill to site changed in post_write_process'||OE_Payment_Trxn_Util.g_old_bill_to_site);
9318: END IF;
9319:
9320: oe_debug_pub.add('Operatoin in post write...in header rec..'||p_x_header_rec.operation);
9321:
9322: --R12 CC Encryption
9323: --As ACH and Direct Debit are not supported in Order Header Others tab
9324: --only Credit card payment type code is checked here.
9391: l_x_Header_Payment_tbl(1).CC_INSTRUMENT_ASSIGNMENT_ID := p_x_header_rec.CC_INSTRUMENT_ASSIGNMENT_ID;
9392: l_x_Header_Payment_tbl(1).instrument_security_code := p_x_header_rec.instrument_security_code;
9393: l_x_Header_Payment_tbl(1).payment_number := l_payment_number;
9394: l_x_Header_Payment_tbl(1).check_number := p_x_header_rec.check_number;
9395: oe_debug_pub.add('Old payment type'||l_old_payment_type_code);
9396: oe_debug_pub.add('New payment type'||p_x_header_rec.payment_type_code);
9397: oe_debug_pub.add('Header_id'||p_x_header_rec.header_id);
9398: /*IF NOT OE_GLOBALS.Equal(l_old_payment_type_code,p_x_header_rec.payment_type_code) THEN
9399: oe_debug_pub.add('ksurendr: Receipt method id in uhdrb post write'||l_x_Header_Payment_tbl(1).receipt_method_id);
9392: l_x_Header_Payment_tbl(1).instrument_security_code := p_x_header_rec.instrument_security_code;
9393: l_x_Header_Payment_tbl(1).payment_number := l_payment_number;
9394: l_x_Header_Payment_tbl(1).check_number := p_x_header_rec.check_number;
9395: oe_debug_pub.add('Old payment type'||l_old_payment_type_code);
9396: oe_debug_pub.add('New payment type'||p_x_header_rec.payment_type_code);
9397: oe_debug_pub.add('Header_id'||p_x_header_rec.header_id);
9398: /*IF NOT OE_GLOBALS.Equal(l_old_payment_type_code,p_x_header_rec.payment_type_code) THEN
9399: oe_debug_pub.add('ksurendr: Receipt method id in uhdrb post write'||l_x_Header_Payment_tbl(1).receipt_method_id);
9400: l_x_Header_Payment_tbl(1).receipt_method_id := FND_API.G_MISS_NUM;
9393: l_x_Header_Payment_tbl(1).payment_number := l_payment_number;
9394: l_x_Header_Payment_tbl(1).check_number := p_x_header_rec.check_number;
9395: oe_debug_pub.add('Old payment type'||l_old_payment_type_code);
9396: oe_debug_pub.add('New payment type'||p_x_header_rec.payment_type_code);
9397: oe_debug_pub.add('Header_id'||p_x_header_rec.header_id);
9398: /*IF NOT OE_GLOBALS.Equal(l_old_payment_type_code,p_x_header_rec.payment_type_code) THEN
9399: oe_debug_pub.add('ksurendr: Receipt method id in uhdrb post write'||l_x_Header_Payment_tbl(1).receipt_method_id);
9400: l_x_Header_Payment_tbl(1).receipt_method_id := FND_API.G_MISS_NUM;
9401: END IF;*/
9395: oe_debug_pub.add('Old payment type'||l_old_payment_type_code);
9396: oe_debug_pub.add('New payment type'||p_x_header_rec.payment_type_code);
9397: oe_debug_pub.add('Header_id'||p_x_header_rec.header_id);
9398: /*IF NOT OE_GLOBALS.Equal(l_old_payment_type_code,p_x_header_rec.payment_type_code) THEN
9399: oe_debug_pub.add('ksurendr: Receipt method id in uhdrb post write'||l_x_Header_Payment_tbl(1).receipt_method_id);
9400: l_x_Header_Payment_tbl(1).receipt_method_id := FND_API.G_MISS_NUM;
9401: END IF;*/
9402:
9403: --Verify
9441: WHEN NO_DATA_FOUND THEN
9442: l_payment_term_id := NULL;
9443: END;
9444: IF l_debug_level > 0 THEN
9445: oe_debug_pub.add('OEXUHDRB post write: term id : ' || l_payment_term_id);
9446: END IF;
9447:
9448: if l_payment_term_id is not null then
9449: l_prepayment_flag := AR_PUBLIC_UTILS.Check_Prepay_Payment_Term(l_payment_term_id);
9447:
9448: if l_payment_term_id is not null then
9449: l_prepayment_flag := AR_PUBLIC_UTILS.Check_Prepay_Payment_Term(l_payment_term_id);
9450: IF l_debug_level > 0 THEN
9451: oe_debug_pub.add('prepayment_flag is : ' || l_prepayment_flag );
9452: END IF;
9453: end if;
9454:
9455: IF nvl(l_prepayment_flag,'N') = 'Y' THEN
9467: l_prepay_count := 0;
9468: END;
9469:
9470: IF l_debug_level > 0 THEN
9471: oe_debug_pub.add('OEXUHDRB post write: prepayment count...'||l_prepay_count);
9472: END IF;
9473:
9474: --Since prepayments should not be allowed when there are line
9475: --payments, checking the line payments count before calling the
9485: l_line_payment_count := 0;
9486: END;
9487:
9488: IF l_debug_level > 0 THEN
9489: oe_debug_pub.add('OEXUHDRB post write: line payment count...'||l_line_payment_count);
9490: END IF;
9491:
9492: --If prepayment count is zero, then need to insert an
9493: --additional prepayment record in Oe_Payments as the payment
9493: --additional prepayment record in Oe_Payments as the payment
9494: --term used has the prepayment check box checked
9495: IF nvl(l_prepay_count,0) = 0 and nvl(l_line_payment_count,0) = 0 THEN
9496: IF l_debug_level > 0 THEN
9497: oe_debug_pub.add('OEXUHDRB: Inside prepayment record insertion....'||l_prepay_count);
9498: oe_debug_pub.add('Payment number value...'||l_payment_number);
9499: oe_debug_pub.add('Header id ----> '||p_x_header_rec.header_id);
9500: END IF;
9501:
9494: --term used has the prepayment check box checked
9495: IF nvl(l_prepay_count,0) = 0 and nvl(l_line_payment_count,0) = 0 THEN
9496: IF l_debug_level > 0 THEN
9497: oe_debug_pub.add('OEXUHDRB: Inside prepayment record insertion....'||l_prepay_count);
9498: oe_debug_pub.add('Payment number value...'||l_payment_number);
9499: oe_debug_pub.add('Header id ----> '||p_x_header_rec.header_id);
9500: END IF;
9501:
9502: l_x_Header_Payment_tbl(2):=OE_ORDER_PUB.G_MISS_HEADER_PAYMENT_REC;
9495: IF nvl(l_prepay_count,0) = 0 and nvl(l_line_payment_count,0) = 0 THEN
9496: IF l_debug_level > 0 THEN
9497: oe_debug_pub.add('OEXUHDRB: Inside prepayment record insertion....'||l_prepay_count);
9498: oe_debug_pub.add('Payment number value...'||l_payment_number);
9499: oe_debug_pub.add('Header id ----> '||p_x_header_rec.header_id);
9500: END IF;
9501:
9502: l_x_Header_Payment_tbl(2):=OE_ORDER_PUB.G_MISS_HEADER_PAYMENT_REC;
9503: l_x_old_Header_Payment_Tbl(2):=OE_ORDER_PUB.G_MISS_HEADER_PAYMENT_REC;
9537:
9538: l_x_Header_Payment_tbl(2).payment_amount := l_downpayment;
9539:
9540: IF l_debug_level > 0 THEN
9541: oe_debug_pub.add('Inside prepayment type'||l_old_payment_type_code);
9542: oe_debug_pub.add('New prepayment type'||p_x_header_rec.payment_type_code);
9543: oe_debug_pub.add('Header_id'||p_x_header_rec.header_id);
9544: END IF;
9545: l_x_Header_Payment_tbl(2).operation := OE_GLOBALS.G_OPR_CREATE;
9538: l_x_Header_Payment_tbl(2).payment_amount := l_downpayment;
9539:
9540: IF l_debug_level > 0 THEN
9541: oe_debug_pub.add('Inside prepayment type'||l_old_payment_type_code);
9542: oe_debug_pub.add('New prepayment type'||p_x_header_rec.payment_type_code);
9543: oe_debug_pub.add('Header_id'||p_x_header_rec.header_id);
9544: END IF;
9545: l_x_Header_Payment_tbl(2).operation := OE_GLOBALS.G_OPR_CREATE;
9546: END IF;
9539:
9540: IF l_debug_level > 0 THEN
9541: oe_debug_pub.add('Inside prepayment type'||l_old_payment_type_code);
9542: oe_debug_pub.add('New prepayment type'||p_x_header_rec.payment_type_code);
9543: oe_debug_pub.add('Header_id'||p_x_header_rec.header_id);
9544: END IF;
9545: l_x_Header_Payment_tbl(2).operation := OE_GLOBALS.G_OPR_CREATE;
9546: END IF;
9547: END IF;
9547: END IF;
9548: END IF;
9549: --bug 5258767
9550: END IF;
9551: oe_debug_pub.add('Operation to be performed....frm post write proces...'||l_x_Header_Payment_tbl(1).operation);
9552:
9553: OE_Order_PVT.Header_Payments
9554: ( p_validation_level => FND_API.G_VALID_LEVEL_NONE
9555: , p_init_msg_list => FND_API.G_FALSE
9562: RAISE FND_API.G_EXC_ERROR;
9563: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9564: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9565: ELSIF l_return_Status = FND_API.G_RET_STS_SUCCESS THEN
9566: oe_debug_pub.add('Success in Header Payments call...');
9567: END IF;
9568: END IF;
9569: --R12 CC Encryption
9570: oe_debug_pub.add('Exiting OE_HEADER_UTIL.Post_Write_Process',1);
9566: oe_debug_pub.add('Success in Header Payments call...');
9567: END IF;
9568: END IF;
9569: --R12 CC Encryption
9570: oe_debug_pub.add('Exiting OE_HEADER_UTIL.Post_Write_Process',1);
9571: EXCEPTION
9572: WHEN FND_API.G_EXC_ERROR THEN
9573: RAISE FND_API.G_EXC_ERROR;
9574: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9599: l_transaction_phase_code VARCHAR2(1)
9600: := oe_header_security.g_record.transaction_phase_code;
9601: BEGIN
9602:
9603: oe_debug_pub.add('Entering OR_HEADER_UTIL.Validate_Gapless_Seq',1);
9604:
9605: select order_type_id into
9606: l_order_type_id
9607: from oe_order_headers_all
9735: x_return_status OUT NOCOPY varchar2
9736: )
9737: IS
9738: l_total_quantity NUMBER;
9739: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
9740:
9741: BEGIN
9742: oe_debug_pub.add(' Entering Cancel_Header_Charges() ');
9743:
9738: l_total_quantity NUMBER;
9739: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
9740:
9741: BEGIN
9742: oe_debug_pub.add(' Entering Cancel_Header_Charges() ');
9743:
9744: -- SELECT sum(ordered_quantity) into l_total_quantity from OE_ORDER_LINES where header_id = p_header_id; --commented for bug#9434723
9745: --bug#9434723: Outer NVL() if the it is last line to be deleted. Inner NVL() if line is in ENTERED status w/out qty.
9746: SELECT Nvl(sum( Nvl(ordered_quantity,0) ),0) into l_total_quantity FROM OE_ORDER_LINES where header_id = p_header_id; --bug#9434723
9743:
9744: -- SELECT sum(ordered_quantity) into l_total_quantity from OE_ORDER_LINES where header_id = p_header_id; --commented for bug#9434723
9745: --bug#9434723: Outer NVL() if the it is last line to be deleted. Inner NVL() if line is in ENTERED status w/out qty.
9746: SELECT Nvl(sum( Nvl(ordered_quantity,0) ),0) into l_total_quantity FROM OE_ORDER_LINES where header_id = p_header_id; --bug#9434723
9747: oe_debug_pub.add(' l_total_quantity = ' ||l_total_quantity, 1 ) ;
9748:
9749: IF l_total_quantity = 0 THEN
9750: OE_Header_Adj_Util.Delete_Header_Charges( p_header_id => p_header_id );
9751: END IF;
9748:
9749: IF l_total_quantity = 0 THEN
9750: OE_Header_Adj_Util.Delete_Header_Charges( p_header_id => p_header_id );
9751: END IF;
9752: oe_debug_pub.add(' Exiting Cancel_Header_Charges() ');
9753: EXCEPTION
9754: WHEN FND_API.G_EXC_ERROR THEN
9755: x_return_status := FND_API.G_RET_STS_ERROR;
9756: WHEN OTHERS THEN
9754: WHEN FND_API.G_EXC_ERROR THEN
9755: x_return_status := FND_API.G_RET_STS_ERROR;
9756: WHEN OTHERS THEN
9757: IF l_debug_level > 0 THEN
9758: oe_debug_pub.add( 'UNEXPECTED ERROR IN ' || G_PKG_NAME || ':' || 'PERFORM_LINE_CANCEL' ) ;
9759: x_return_status := FND_API.G_RET_STS_ERROR;
9760: END IF;
9761: END;
9762:
9941: l_source_document_id NUMBER := p_x_header_rec.source_document_id;
9942: l_source_document_line_id NUMBER;
9943:
9944:
9945: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
9946: x_party_id NUMBER;
9947: x_cust_account_id NUMBER;
9948: begin
9949:
9949:
9950: x_return_status := FND_API.G_RET_STS_SUCCESS;
9951:
9952: IF l_debug_level >0 then
9953: oe_debug_pub.add('Entering OE_HEADER_UTIL.Get_customer_info_ids :'||p_header_customer_info_tbl.count);
9954: End IF;
9955:
9956: OE_CUSTOMER_INFO_PVT.G_SOLD_TO_CUSTOMER_ID := NULL;
9957:
10002: IF p_x_header_rec.operation = OE_GLOBALS.G_OPR_UPDATE AND
10003: p_x_header_rec.sold_to_org_id = FND_API.G_MISS_NUM THEN
10004:
10005: IF l_debug_level > 0 THEN
10006: oe_debug_pub.add('Selecting sold_to_org_id in case of update');
10007: END IF;
10008:
10009: BEGIN
10010: SELECT NVL(SOLD_TO_ORG_ID,p_x_header_rec.sold_to_org_id)
10100:
10101: IF l_debug_level >0 then
10102:
10103:
10104: oe_debug_pub.add('x_return_status :' ||x_return_status);
10105:
10106: oe_debug_pub.add('p_x_header_rec.sold_to_org_id :' ||p_x_header_rec.sold_to_org_id);
10107: oe_debug_pub.add('p_x_header_rec.ship_to_customer_id :' ||p_x_header_rec.ship_to_customer_id);
10108: oe_debug_pub.add('p_x_header_rec.bill_to_customer_id :' ||p_x_header_rec.invoice_to_customer_id);
10102:
10103:
10104: oe_debug_pub.add('x_return_status :' ||x_return_status);
10105:
10106: oe_debug_pub.add('p_x_header_rec.sold_to_org_id :' ||p_x_header_rec.sold_to_org_id);
10107: oe_debug_pub.add('p_x_header_rec.ship_to_customer_id :' ||p_x_header_rec.ship_to_customer_id);
10108: oe_debug_pub.add('p_x_header_rec.bill_to_customer_id :' ||p_x_header_rec.invoice_to_customer_id);
10109: oe_debug_pub.add('p_x_header_rec.deliver_to_customer_id :' ||p_x_header_rec.deliver_to_customer_id);
10110:
10103:
10104: oe_debug_pub.add('x_return_status :' ||x_return_status);
10105:
10106: oe_debug_pub.add('p_x_header_rec.sold_to_org_id :' ||p_x_header_rec.sold_to_org_id);
10107: oe_debug_pub.add('p_x_header_rec.ship_to_customer_id :' ||p_x_header_rec.ship_to_customer_id);
10108: oe_debug_pub.add('p_x_header_rec.bill_to_customer_id :' ||p_x_header_rec.invoice_to_customer_id);
10109: oe_debug_pub.add('p_x_header_rec.deliver_to_customer_id :' ||p_x_header_rec.deliver_to_customer_id);
10110:
10111: oe_debug_pub.add('p_x_header_rec.ship_to_org_id :' ||p_x_header_rec.ship_to_org_id);
10104: oe_debug_pub.add('x_return_status :' ||x_return_status);
10105:
10106: oe_debug_pub.add('p_x_header_rec.sold_to_org_id :' ||p_x_header_rec.sold_to_org_id);
10107: oe_debug_pub.add('p_x_header_rec.ship_to_customer_id :' ||p_x_header_rec.ship_to_customer_id);
10108: oe_debug_pub.add('p_x_header_rec.bill_to_customer_id :' ||p_x_header_rec.invoice_to_customer_id);
10109: oe_debug_pub.add('p_x_header_rec.deliver_to_customer_id :' ||p_x_header_rec.deliver_to_customer_id);
10110:
10111: oe_debug_pub.add('p_x_header_rec.ship_to_org_id :' ||p_x_header_rec.ship_to_org_id);
10112: oe_debug_pub.add('p_x_header_rec.bill_to_org_id :' ||p_x_header_rec.invoice_to_org_id);
10105:
10106: oe_debug_pub.add('p_x_header_rec.sold_to_org_id :' ||p_x_header_rec.sold_to_org_id);
10107: oe_debug_pub.add('p_x_header_rec.ship_to_customer_id :' ||p_x_header_rec.ship_to_customer_id);
10108: oe_debug_pub.add('p_x_header_rec.bill_to_customer_id :' ||p_x_header_rec.invoice_to_customer_id);
10109: oe_debug_pub.add('p_x_header_rec.deliver_to_customer_id :' ||p_x_header_rec.deliver_to_customer_id);
10110:
10111: oe_debug_pub.add('p_x_header_rec.ship_to_org_id :' ||p_x_header_rec.ship_to_org_id);
10112: oe_debug_pub.add('p_x_header_rec.bill_to_org_id :' ||p_x_header_rec.invoice_to_org_id);
10113: oe_debug_pub.add('p_x_header_rec.deliver_to_org_id :' ||p_x_header_rec.deliver_to_org_id);
10107: oe_debug_pub.add('p_x_header_rec.ship_to_customer_id :' ||p_x_header_rec.ship_to_customer_id);
10108: oe_debug_pub.add('p_x_header_rec.bill_to_customer_id :' ||p_x_header_rec.invoice_to_customer_id);
10109: oe_debug_pub.add('p_x_header_rec.deliver_to_customer_id :' ||p_x_header_rec.deliver_to_customer_id);
10110:
10111: oe_debug_pub.add('p_x_header_rec.ship_to_org_id :' ||p_x_header_rec.ship_to_org_id);
10112: oe_debug_pub.add('p_x_header_rec.bill_to_org_id :' ||p_x_header_rec.invoice_to_org_id);
10113: oe_debug_pub.add('p_x_header_rec.deliver_to_org_id :' ||p_x_header_rec.deliver_to_org_id);
10114: oe_debug_pub.add('p_x_header_rec.sold_to_site_use_id :' ||p_x_header_rec.sold_to_site_use_id);
10115:
10108: oe_debug_pub.add('p_x_header_rec.bill_to_customer_id :' ||p_x_header_rec.invoice_to_customer_id);
10109: oe_debug_pub.add('p_x_header_rec.deliver_to_customer_id :' ||p_x_header_rec.deliver_to_customer_id);
10110:
10111: oe_debug_pub.add('p_x_header_rec.ship_to_org_id :' ||p_x_header_rec.ship_to_org_id);
10112: oe_debug_pub.add('p_x_header_rec.bill_to_org_id :' ||p_x_header_rec.invoice_to_org_id);
10113: oe_debug_pub.add('p_x_header_rec.deliver_to_org_id :' ||p_x_header_rec.deliver_to_org_id);
10114: oe_debug_pub.add('p_x_header_rec.sold_to_site_use_id :' ||p_x_header_rec.sold_to_site_use_id);
10115:
10116: oe_debug_pub.add('p_x_header_rec.sold_to_contact_id :' ||p_x_header_rec.sold_to_contact_id);
10109: oe_debug_pub.add('p_x_header_rec.deliver_to_customer_id :' ||p_x_header_rec.deliver_to_customer_id);
10110:
10111: oe_debug_pub.add('p_x_header_rec.ship_to_org_id :' ||p_x_header_rec.ship_to_org_id);
10112: oe_debug_pub.add('p_x_header_rec.bill_to_org_id :' ||p_x_header_rec.invoice_to_org_id);
10113: oe_debug_pub.add('p_x_header_rec.deliver_to_org_id :' ||p_x_header_rec.deliver_to_org_id);
10114: oe_debug_pub.add('p_x_header_rec.sold_to_site_use_id :' ||p_x_header_rec.sold_to_site_use_id);
10115:
10116: oe_debug_pub.add('p_x_header_rec.sold_to_contact_id :' ||p_x_header_rec.sold_to_contact_id);
10117: oe_debug_pub.add('p_x_header_rec.ship_to_contact_id :' ||p_x_header_rec.ship_to_contact_id);
10110:
10111: oe_debug_pub.add('p_x_header_rec.ship_to_org_id :' ||p_x_header_rec.ship_to_org_id);
10112: oe_debug_pub.add('p_x_header_rec.bill_to_org_id :' ||p_x_header_rec.invoice_to_org_id);
10113: oe_debug_pub.add('p_x_header_rec.deliver_to_org_id :' ||p_x_header_rec.deliver_to_org_id);
10114: oe_debug_pub.add('p_x_header_rec.sold_to_site_use_id :' ||p_x_header_rec.sold_to_site_use_id);
10115:
10116: oe_debug_pub.add('p_x_header_rec.sold_to_contact_id :' ||p_x_header_rec.sold_to_contact_id);
10117: oe_debug_pub.add('p_x_header_rec.ship_to_contact_id :' ||p_x_header_rec.ship_to_contact_id);
10118: oe_debug_pub.add('p_x_header_rec.invoice_to_contact_id :' ||p_x_header_rec.invoice_to_contact_id);
10112: oe_debug_pub.add('p_x_header_rec.bill_to_org_id :' ||p_x_header_rec.invoice_to_org_id);
10113: oe_debug_pub.add('p_x_header_rec.deliver_to_org_id :' ||p_x_header_rec.deliver_to_org_id);
10114: oe_debug_pub.add('p_x_header_rec.sold_to_site_use_id :' ||p_x_header_rec.sold_to_site_use_id);
10115:
10116: oe_debug_pub.add('p_x_header_rec.sold_to_contact_id :' ||p_x_header_rec.sold_to_contact_id);
10117: oe_debug_pub.add('p_x_header_rec.ship_to_contact_id :' ||p_x_header_rec.ship_to_contact_id);
10118: oe_debug_pub.add('p_x_header_rec.invoice_to_contact_id :' ||p_x_header_rec.invoice_to_contact_id);
10119: oe_debug_pub.add('p_x_header_rec.deliver_to_contact_id :' ||p_x_header_rec.deliver_to_contact_id);
10120:
10113: oe_debug_pub.add('p_x_header_rec.deliver_to_org_id :' ||p_x_header_rec.deliver_to_org_id);
10114: oe_debug_pub.add('p_x_header_rec.sold_to_site_use_id :' ||p_x_header_rec.sold_to_site_use_id);
10115:
10116: oe_debug_pub.add('p_x_header_rec.sold_to_contact_id :' ||p_x_header_rec.sold_to_contact_id);
10117: oe_debug_pub.add('p_x_header_rec.ship_to_contact_id :' ||p_x_header_rec.ship_to_contact_id);
10118: oe_debug_pub.add('p_x_header_rec.invoice_to_contact_id :' ||p_x_header_rec.invoice_to_contact_id);
10119: oe_debug_pub.add('p_x_header_rec.deliver_to_contact_id :' ||p_x_header_rec.deliver_to_contact_id);
10120:
10121: oe_debug_pub.add('Exiting OE_HEADER_UTIL.Get_customer_info_ids');
10114: oe_debug_pub.add('p_x_header_rec.sold_to_site_use_id :' ||p_x_header_rec.sold_to_site_use_id);
10115:
10116: oe_debug_pub.add('p_x_header_rec.sold_to_contact_id :' ||p_x_header_rec.sold_to_contact_id);
10117: oe_debug_pub.add('p_x_header_rec.ship_to_contact_id :' ||p_x_header_rec.ship_to_contact_id);
10118: oe_debug_pub.add('p_x_header_rec.invoice_to_contact_id :' ||p_x_header_rec.invoice_to_contact_id);
10119: oe_debug_pub.add('p_x_header_rec.deliver_to_contact_id :' ||p_x_header_rec.deliver_to_contact_id);
10120:
10121: oe_debug_pub.add('Exiting OE_HEADER_UTIL.Get_customer_info_ids');
10122: End IF;
10115:
10116: oe_debug_pub.add('p_x_header_rec.sold_to_contact_id :' ||p_x_header_rec.sold_to_contact_id);
10117: oe_debug_pub.add('p_x_header_rec.ship_to_contact_id :' ||p_x_header_rec.ship_to_contact_id);
10118: oe_debug_pub.add('p_x_header_rec.invoice_to_contact_id :' ||p_x_header_rec.invoice_to_contact_id);
10119: oe_debug_pub.add('p_x_header_rec.deliver_to_contact_id :' ||p_x_header_rec.deliver_to_contact_id);
10120:
10121: oe_debug_pub.add('Exiting OE_HEADER_UTIL.Get_customer_info_ids');
10122: End IF;
10123:
10117: oe_debug_pub.add('p_x_header_rec.ship_to_contact_id :' ||p_x_header_rec.ship_to_contact_id);
10118: oe_debug_pub.add('p_x_header_rec.invoice_to_contact_id :' ||p_x_header_rec.invoice_to_contact_id);
10119: oe_debug_pub.add('p_x_header_rec.deliver_to_contact_id :' ||p_x_header_rec.deliver_to_contact_id);
10120:
10121: oe_debug_pub.add('Exiting OE_HEADER_UTIL.Get_customer_info_ids');
10122: End IF;
10123:
10124:
10125: EXCEPTION