92: l_prof_value VARCHAR2(240);
93: l_hash_value NUMBER;
94: BEGIN
95: l_tab_index := dbms_utility.get_hash_value(p_concat_segment,1,TABLE_SIZE);
96: --l_prof_value := FND_PROFILE.VALUE_SPECIFIC('AR_ALLOW_TAX_CODE_OVERRIDE',p_user_id,p_resp_id,p_appl_id);
97: l_prof_value := FND_PROFILE.VALUE_SPECIFIC('ZX_ALLOW_TAX_CLASSIF_OVERRIDE',p_user_id,p_resp_id,p_appl_id);
98: oe_debug_pub.add('Put:hash_value:'||l_tab_index,1);
99: IF Prf_Tbl.EXISTS(l_tab_index) THEN
100: IF Prf_Tbl(l_tab_index).concat_segment = p_concat_segment THEN
93: l_hash_value NUMBER;
94: BEGIN
95: l_tab_index := dbms_utility.get_hash_value(p_concat_segment,1,TABLE_SIZE);
96: --l_prof_value := FND_PROFILE.VALUE_SPECIFIC('AR_ALLOW_TAX_CODE_OVERRIDE',p_user_id,p_resp_id,p_appl_id);
97: l_prof_value := FND_PROFILE.VALUE_SPECIFIC('ZX_ALLOW_TAX_CLASSIF_OVERRIDE',p_user_id,p_resp_id,p_appl_id);
98: oe_debug_pub.add('Put:hash_value:'||l_tab_index,1);
99: IF Prf_Tbl.EXISTS(l_tab_index) THEN
100: IF Prf_Tbl(l_tab_index).concat_segment = p_concat_segment THEN
101: Prf_Tbl(l_tab_index).prf_value := l_prof_value;
783: END IF;
784:
785: --Added for bug # 6945716 start
786: IF p_line_rec.line_category_code = 'RETURN'
787: AND(NVL(FND_PROFILE.VALUE('ONT_GENERATE_CREDIT_REJECTED_RETURNS'), 'N')='N'
788: AND NVL(p_line_rec.shipped_quantity,0) = 0
789: AND NVL(p_line_rec.fulfilled_quantity,0) = 0 ) THEN
790:
791: IF l_debug_level > 0 THEN
1614: BEGIN
1615: IF l_debug_level > 0 THEN
1616: oe_debug_pub.add( ' ENTERING GET_INVOICE_SOURCE' , 5 ) ;
1617: END IF;
1618: IF FND_PROFILE.VALUE('WSH_INVOICE_NUMBERING_METHOD')= 'D' AND
1619: (Return_Line(p_line_rec) OR NOT Shipping_Info_Available(p_line_rec) OR
1620: (p_interface_line_rec.interface_line_attribute3 = '0')) THEN
1621: SELECT NVL(lt.non_delivery_invoice_source_id,
1622: ot.non_delivery_invoice_source_id)
5144: p_x_charges_rec.INTERFACE_LINE_ATTRIBUTE9 := '0'; -- customer item number
5145: p_x_charges_rec.INTERFACE_LINE_ATTRIBUTE12 := lpad('0', 30); -- shipment number
5146: p_x_charges_rec.INTERFACE_LINE_ATTRIBUTE13 := lpad('0', 30); -- option number
5147: p_x_charges_rec.INTERFACE_LINE_ATTRIBUTE14 := lpad('0', 30); -- service number
5148: -- l_vat_flag := NVL(FND_PROFILE.VALUE('AR_ALLOW_TAX_CODE_OVERRIDE'), 'N');
5149: l_freight_as_line := NVL(oe_sys_parameters.value('OE_INVOICE_FREIGHT_AS_LINE',p_line_rec.org_id), 'N'); --moac
5150: IF l_debug_level > 0 THEN
5151: oe_debug_pub.add( 'INVOICE FREIGHT AS REVENUE '||L_FREIGHT_AS_LINE ) ;
5152: END IF;
5329: -- END IF;
5330: p_x_charges_rec.PROMISED_COMMITMENT_AMOUNT := 0; -- For bug 6798675 NULL;
5331: -- Adding for bug# 4071445
5332: IF p_x_charges_rec.LINE_TYPE = 'FREIGHT' OR
5333: nvl(FND_PROFILE.VALUE('ONT_TAX_CODE_FOR_FREIGHT'), 'N') = 'N' THEN
5334: p_x_charges_rec.Tax_Code := NULL;
5335: IF l_debug_level > 0 THEN
5336: oe_debug_pub.add('tax_code for freight is set as ' ||p_x_charges_rec.tax_code , 5 ) ;
5337: END IF;
6245: END;
6246:
6247: --4483722
6248: IF l_max_actual_shipment_date IS NULL THEN
6249: IF (fnd_profile.value('OE_RECEIVABLES_DATE_FOR_NONSHIP_LINES') = 'Y') THEN
6250: l_max_actual_shipment_date := SYSDATE;
6251: ELSE
6252: --Should we let the date be null?
6253: Null;
6256: --4483722
6257:
6258: p_x_interface_line_rec.SHIP_DATE_ACTUAL := l_max_actual_shipment_date;
6259: -- for non-shippable line not in a fulfillment set
6260: ELSIF (fnd_profile.value('OE_RECEIVABLES_DATE_FOR_NONSHIP_LINES') = 'Y') THEN
6261: IF l_debug_level > 0 THEN
6262: oe_debug_pub.add( 'SETTING TRANSACTION DATE AS CURRENT DATE FOR THIS NONSHIP LINE ' , 5 ) ;
6263: END IF;
6264: p_x_interface_line_rec.SHIP_DATE_ACTUAL := SYSDATE;
6304: p_x_interface_line_rec.CREATION_DATE := sysdate;
6305: p_x_interface_line_rec.LAST_UPDATED_BY := NVL(oe_standard_wf.g_user_id, fnd_global.user_id); -- 3169637
6306: p_x_interface_line_rec.LAST_UPDATE_DATE := sysdate;
6307: -- bug 8494362 start
6308: --p_x_interface_line_rec.INTERFACE_LINE_CONTEXT := FND_PROFILE.VALUE('ONT_SOURCE_CODE');
6309:
6310: l_cur_user_id := fnd_global.user_id;
6311: l_cur_resp_id := fnd_global.RESP_ID;
6312: l_cur_appl_id := fnd_global.RESP_APPL_ID;
6312: l_cur_appl_id := fnd_global.RESP_APPL_ID;
6313:
6314:
6315:
6316: p_x_interface_line_rec.INTERFACE_LINE_CONTEXT := fnd_profile.value_specific('ONT_SOURCE_CODE',l_cur_user_id,l_cur_resp_id,l_cur_appl_id,null,null);
6317:
6318: oe_debug_pub.add('After Value Specific -' || p_x_interface_line_rec.INTERFACE_LINE_CONTEXT , 1 ) ;
6319:
6320: -- bug 8494362 end
6721: p_x_interface_line_rec.Primary_salesrep_Id := NVL(p_line_rec.Salesrep_Id, p_header_rec.Salesrep_Id);
6722: p_x_interface_line_rec.Sales_Order := to_char(p_header_rec.Order_Number);
6723: p_x_interface_line_rec.Sales_Order_Line := to_char(p_line_rec.Line_Number);
6724: p_x_interface_line_rec.Sales_Order_Date := p_header_rec.Ordered_Date;
6725: p_x_interface_line_rec.Sales_Order_Source := FND_PROFILE.VALUE('ONT_SOURCE_CODE');
6726: p_x_interface_line_rec.Agreement_Id := p_line_rec.Agreement_Id;
6727: p_x_interface_line_rec.Purchase_Order := p_line_rec.Cust_PO_Number;
6728: p_x_interface_line_rec.Inventory_Item_Id := p_line_rec.Inventory_Item_Id;
6729:
6767: oe_debug_pub.add('l_concat_segment'||l_concat_segment,1);
6768: l_table_index := FIND(l_concat_segment);
6769: IF l_table_index < TABLE_SIZE THEN
6770: IF l_debug_level > 0 THEN
6771: --oe_debug_pub.add( 'cached FND PROFILE AR_ALLOW_TAX_CODE_OVERRIDE: '||Prf_Tbl(l_table_index).prf_value,1);
6772: oe_debug_pub.add( 'cached FND PROFILE ZX_ALLOW_TAX_CLASSIF_OVERRIDE: '||Prf_Tbl(l_table_index).prf_value,1);
6773: END IF;
6774: l_prof_value := Prf_Tbl(l_table_index).prf_value;
6775: ELSE
6768: l_table_index := FIND(l_concat_segment);
6769: IF l_table_index < TABLE_SIZE THEN
6770: IF l_debug_level > 0 THEN
6771: --oe_debug_pub.add( 'cached FND PROFILE AR_ALLOW_TAX_CODE_OVERRIDE: '||Prf_Tbl(l_table_index).prf_value,1);
6772: oe_debug_pub.add( 'cached FND PROFILE ZX_ALLOW_TAX_CLASSIF_OVERRIDE: '||Prf_Tbl(l_table_index).prf_value,1);
6773: END IF;
6774: l_prof_value := Prf_Tbl(l_table_index).prf_value;
6775: ELSE
6776: put(l_concat_segment,l_user_id,l_resp_id,l_appl_id,l_prof_value);
6774: l_prof_value := Prf_Tbl(l_table_index).prf_value;
6775: ELSE
6776: put(l_concat_segment,l_user_id,l_resp_id,l_appl_id,l_prof_value);
6777: IF l_debug_level > 0 THEN
6778: --oe_debug_pub.add( ' Uncached first time FND PROFILE AR_ALLOW_TAX_CODE_OVERRIDE: '||l_prof_value,1);
6779: oe_debug_pub.add( ' Uncached first time FND PROFILE ZX_ALLOW_TAX_CLASSIF_OVERRIDE: '||l_prof_value,1);
6780: END IF;
6781: END IF;
6782: -- 3757279
6775: ELSE
6776: put(l_concat_segment,l_user_id,l_resp_id,l_appl_id,l_prof_value);
6777: IF l_debug_level > 0 THEN
6778: --oe_debug_pub.add( ' Uncached first time FND PROFILE AR_ALLOW_TAX_CODE_OVERRIDE: '||l_prof_value,1);
6779: oe_debug_pub.add( ' Uncached first time FND PROFILE ZX_ALLOW_TAX_CLASSIF_OVERRIDE: '||l_prof_value,1);
6780: END IF;
6781: END IF;
6782: -- 3757279
6783:
6819: p_line_rec.actual_shipment_date;
6820: END IF;
6821:
6822: IF p_x_interface_line_rec.Ship_Date_Actual is NULL THEN
6823: IF (fnd_profile.value('OE_RECEIVABLES_DATE_FOR_NONSHIP_LINES') = 'Y')
6824: THEN
6825: p_x_interface_line_rec.Ship_Date_Actual := SYSDATE;
6826: END IF;
6827: END IF;
7247: oe_debug_pub.add( 'BEFORE CALLING AR PACKAGE PROCESS_CUST_BANK_ACCOUNT ( ) ' , 5 ) ;
7248: END IF;
7249: --
7250: l_trx_date := nvl(p_header_rec.ordered_date, sysdate)
7251: - nvl( to_number(fnd_profile.value('ONT_DAYS_TO_BACKDATE_BANK_ACCT')), 0);
7252: BEGIN
7253: /*
7254: ** Fix Bug # 2438201
7255: ** p_trx_date to be passed as order creation date so that autoinvoice succceds
7291: p_x_interface_line_rec.customer_bank_account_name
7292: := p_header_rec.credit_card_holder_name;
7293: /* Fix FP Bug # 3647389: Get the Current Context Values */
7294: l_cur_user_id := fnd_global.user_id;
7295: fnd_profile.get('RESP_ID',l_cur_resp_id);
7296: fnd_profile.get('RESP_APPL_ID',l_cur_appl_id);
7297:
7298: /* Fix FP Bug # 3647389: Set the Context using Original Values */
7299: fnd_global.apps_initialize(l_user_id, l_resp_id, l_appl_id);
7292: := p_header_rec.credit_card_holder_name;
7293: /* Fix FP Bug # 3647389: Get the Current Context Values */
7294: l_cur_user_id := fnd_global.user_id;
7295: fnd_profile.get('RESP_ID',l_cur_resp_id);
7296: fnd_profile.get('RESP_APPL_ID',l_cur_appl_id);
7297:
7298: /* Fix FP Bug # 3647389: Set the Context using Original Values */
7299: fnd_global.apps_initialize(l_user_id, l_resp_id, l_appl_id);
7300:
7500: IF l_debug_level > 0 THEN
7501: oe_debug_pub.add('Before creating receipt method assignment at site level if it does not exist');
7502: END IF;
7503: l_trx_date := nvl(p_header_rec.ordered_date, sysdate)
7504: - nvl( to_number(fnd_profile.value('ONT_DAYS_TO_BACKDATE_BANK_ACCT')), 0);
7505: --bug6025064 Using SQL Statement since API arp_bank_pkg.process_cust_pay_method has been obsoleted
7506: l_cust_pay_method_id := arp_bank_pkg.process_cust_pay_method
7507: ( p_pay_method_id => l_receipt_method_id
7508: , p_customer_id => p_header_rec.sold_to_org_id
7539: oe_debug_pub.add('Before creating receipt method assignment at site level if it does not exist', 5);
7540: oe_debug_pub.add('Invoice To Customer : ' || l_invoice_to_customer_id ||'; Invoice To Site : ' || p_header_rec.invoice_to_org_id, 5);
7541: END IF;
7542: l_trx_date := nvl(p_header_rec.ordered_date, sysdate)
7543: - nvl( to_number(fnd_profile.value('ONT_DAYS_TO_BACKDATE_BANK_ACCT')), 0);
7544:
7545: l_cust_pay_method_id := arp_ext_bank_pkg.process_cust_pay_method
7546: ( p_pay_method_id => l_receipt_method_id
7547: , p_customer_id => l_invoice_to_customer_id -- p_header_rec.sold_to_org_id -- Bug 6911267
7902: END IF;--End if of line level l_trxn_extension_id check
7903: END IF;-- cc reversal ER flag check
7904: --CC Reversal ER#16014135 end
7905: IF ( (OE_GLOBALS.G_ASO_INSTALLED = 'Y') OR
7906: (NVL(FND_PROFILE.VALUE('ONT_DBI_INSTALLED'),'N') = 'Y') ) THEN
7907:
7908: l_Line_tbl(1) := p_line_rec;
7909: l_Old_Line_tbl(1) := p_line_rec;
7910: l_Line_tbl(1).calculate_price_flag := 'N';
9279: END IF; -- noninvoiceable line
9280: /* Bug#2666125 end-check freight records and holds for non invoiceable items*/
9281: IF
9282: -- l_freight_count = 0 OR
9283: FND_PROFILE.VALUE('WSH_INVOICE_NUMBERING_METHOD') = 'A' THEN
9284: oe_debug_pub.add('Handling non-invoiceable lines with no freight or automatic numbering',1);
9285: -- sol_ord_er #16014165 end
9286: IF l_line_rec.service_bill_option_code = 'FBOKS' THEN
9287: l_inv_stat := 'BILLED_FROM_CONTRACTS';
9462: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9463: x_result_out := OE_GLOBALS.G_WFR_INCOMPLETE;
9464: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9465: END IF;
9466: IF FND_PROFILE.VALUE('WSH_INVOICE_NUMBERING_METHOD') = 'D' THEN
9467: IF l_debug_level > 0 THEN
9468: oe_debug_pub.add( 'INVOICE NUMBERING SET TO MANUAL' , 5 ) ;
9469: END IF;
9470: IF Shipping_Info_Available(l_line_rec) AND NOT Return_Line(l_line_rec) THEN