Oracle EBS How To Create An Invoice With Manual Tax Lines Using Invoice API
--- start of script ---
set serveroutput on
set serveroutput on size 100000
DECLARE
l_return_status varchar2(1);
l_msg_count number;
l_msg_data varchar2(2000);
l_batch_id number;
l_batch_source_rec ar_invoice_api_pub.batch_source_rec_type;
l_trx_header_tbl ar_invoice_api_pub.trx_header_tbl_type;
l_trx_lines_tbl ar_invoice_api_pub.trx_line_tbl_type;
l_trx_dist_tbl ar_invoice_api_pub.trx_dist_tbl_type;
l_trx_salescredits_tbl ar_invoice_api_pub.trx_salescredits_tbl_type;
l_status varchar2(1);
BEGIN
-- set the proper org context
fnd_global.apps_initialize(&userid, &respid, 222);
-- the value 204 should be changed if you are using another ORG_ID
MO_GLOBAL.set_policy_context('S',204);
-- you need to provide a valid batch source for Manual transactions
l_batch_source_rec.batch_source_id := 1228 ;
-------------------------------------------------------------
-- Define details for the HEADER
-- this information goes into RA_CUSTOMER_TRX_ALL
-------------------------------------------------------------
-- this is a unique number per session, when you start a new SQLPLUS session you can re-use this value
l_trx_header_tbl(1).trx_header_id := 101;
-- provide a valid currency
l_trx_header_tbl(1).trx_currency := 'USD';
-- the following are required if you use a trx_currency <> functional currency
l_trx_header_tbl(1).exchange_rate_type := null;
l_trx_header_tbl(1).exchange_date := null;
l_trx_header_tbl(1).exchange_rate := null;
-- provide a valid trx_type_id, for type = INV
l_trx_header_tbl(1).cust_trx_type_id := 1;
-- provide a valid bill_to_customer_id
l_trx_header_tbl(1).bill_to_customer_id := 1005;</