/* Formatted on 6/24/2014 10:53:28 AM (QP5 v5.115.810.9015) */
DECLARE
p_chr_id NUMBER;
p_cle_id NUMBER;
x_rail_rec apps.oks_tax_util_pvt.ra_rec_type;
l_return_status VARCHAR2 (20);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (2000);
l_msg_index_out NUMBER;
l_error_message VARCHAR2 (2000);
l_num NUMBER;
BEGIN
p_chr_id := 1549063;
p_cle_id := 364326736554364142775004706891329465584;
apps.oks_tax_util_pvt.get_tax (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_chr_id => p_chr_id,
p_cle_id => p_cle_id,
px_rail_rec => x_rail_rec,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_return_status => l_return_status
);
IF l_return_status <> fnd_api.g_ret_sts_success
THEN
l_num := 40;
IF l_msg_count > 0
THEN
FOR i IN 1 .. l_msg_count
LOOP
l_num := 50;
apps.fnd_msg_pub.get (p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out
);
IF l_error_message IS NULL
THEN
l_error_message := SUBSTR (l_msg_data, 1, 250);
ELSE
l_error_message :=
l_error_message || ' /' || SUBSTR (l_msg_data, 1, 250);
END IF;
END LOOP;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_error_message);
DBMS_OUTPUT.put_line ('*****************************************');
ELSE
apps.fnd_msg_pub.get (p_msg_index => 1,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out
);
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_msg_data);
DBMS_OUTPUT.put_line ('*****************************************');
END IF;
ELSE
l_num := 60;
DBMS_OUTPUT.put_line('******************************************');
DBMS_OUTPUT.put_line ('API Success');
DBMS_OUTPUT.put_line ('Header Id : ' || x_rail_rec.header_id);
DBMS_OUTPUT.put_line ('Line Id : ' || x_rail_rec.line_id);
DBMS_OUTPUT.put_line('Tax Exempt Flag : ' || x_rail_rec.tax_exempt_flag);
DBMS_OUTPUT.put_line('Tax exempt reason : '
|| x_rail_rec.tax_exempt_reason);
DBMS_OUTPUT.put_line('Tax exempt number : '
|| x_rail_rec.tax_exempt_number);
DBMS_OUTPUT.put_line ('Sales Tax ID : ' || x_rail_rec.sales_tax_id);
DBMS_OUTPUT.put_line ('Org Id : ' || x_rail_rec.org_id);
DBMS_OUTPUT.put_line('Orig_system_ship_address_id : '
|| x_rail_rec.orig_system_ship_address_id);
DBMS_OUTPUT.put_line('Orig_system_ship_contact_id : '
|| x_rail_rec.orig_system_ship_contact_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_SHIP_CUSTOMER_I : '
|| x_rail_rec.orig_system_ship_customer_id);
DBMS_OUTPUT.put_line('SHIP_TO_SITE_USE_ID : '
|| x_rail_rec.ship_to_site_use_id);
DBMS_OUTPUT.put_line('SHIP_TO_POSTAL_CODE : '
|| x_rail_rec.ship_to_postal_code);
DBMS_OUTPUT.put_line('SHIP_TO_LOCATION_ID : '
|| x_rail_rec.ship_to_location_id);
DBMS_OUTPUT.put_line('SHIP_TO_CUSTOMER_NUMBER : '
|| x_rail_rec.ship_to_customer_number);
DBMS_OUTPUT.put_line('SHIP_TO_CUSTOMER_NAME : '
|| x_rail_rec.ship_to_customer_name);
DBMS_OUTPUT.put_line('SHIP_TO_ORG_ID : '
|| x_rail_rec.ship_to_org_id);
DBMS_OUTPUT.put_line('WAREHOUSE_ID : '
|| x_rail_rec.warehouse_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_SOLD_CUSTOMER_I : '
|| x_rail_rec.orig_system_sold_customer_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_CUSTOMER_I : '
|| x_rail_rec.orig_system_bill_customer_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_ADDRESS_ID : '
|| x_rail_rec.orig_system_bill_address_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_CONTACT_ID : '
|| x_rail_rec.orig_system_bill_contact_id);
DBMS_OUTPUT.put_line('BILL_TO_SITE_USE_ID : '
|| x_rail_rec.bill_to_site_use_id);
DBMS_OUTPUT.put_line('BILL_TO_POSTAL_CODE : '
|| x_rail_rec.bill_to_postal_code);
DBMS_OUTPUT.put_line('BILL_TO_LOCATION_ID : '
|| x_rail_rec.bill_to_location_id);
DBMS_OUTPUT.put_line('BILL_TO_CUSTOMER_NUMBER : '
|| x_rail_rec.bill_to_customer_number);
DBMS_OUTPUT.put_line('BILL_TO_CUSTOMER_NAME : '
|| x_rail_rec.bill_to_customer_name);
DBMS_OUTPUT.put_line('BILL_TO_ORG_ID : '
|| x_rail_rec.bill_to_org_id);
DBMS_OUTPUT.put_line('RECEIPT_METHOD_NAME : '
|| x_rail_rec.receipt_method_name);
DBMS_OUTPUT.put_line('RECEIPT_METHOD_ID : '
|| x_rail_rec.receipt_method_id);
DBMS_OUTPUT.put_line('CONVERSION_TYPE : '
|| x_rail_rec.conversion_type);
DBMS_OUTPUT.put_line('CONVERSION_DATE : '
|| x_rail_rec.conversion_date);
DBMS_OUTPUT.put_line('CONVERSION_RATE : '
|| x_rail_rec.conversion_rate);
DBMS_OUTPUT.put_line('CUSTOMER_TRX_ID : '
|| x_rail_rec.customer_trx_id);
DBMS_OUTPUT.put_line('TRX_DATE : '
|| x_rail_rec.trx_date);
DBMS_OUTPUT.put_line('GL_DATE : '
|| x_rail_rec.gl_date);
DBMS_OUTPUT.put_line('DOCUMENT_NUMBER : '
|| x_rail_rec.document_number);
DBMS_OUTPUT.put_line('TRX_NUMBER : '
|| x_rail_rec.trx_number);
DBMS_OUTPUT.put_line('LINE_NUMBER : '
|| x_rail_rec.line_number);
DBMS_OUTPUT.put_line('QUANTITY : '
|| x_rail_rec.quantity);
DBMS_OUTPUT.put_line('QUANTITY_ORDERED : '
|| x_rail_rec.quantity_ordered);
DBMS_OUTPUT.put_line('UNIT_SELLING_PRICE : '
|| x_rail_rec.unit_selling_price);
DBMS_OUTPUT.put_line('UNIT_STANDARD_PRICE : '
|| x_rail_rec.unit_standard_price);
DBMS_OUTPUT.put_line('PRINTING_OPTION : '
|| x_rail_rec.printing_option);
DBMS_OUTPUT.put_line('INVENTORY_ITEM_ID : '
|| x_rail_rec.inventory_item_id);
DBMS_OUTPUT.put_line('INVENTORY_ORG_ID : '
|| x_rail_rec.inventory_org_id);
DBMS_OUTPUT.put_line('UOM_CODE : '
|| x_rail_rec.uom_code);
DBMS_OUTPUT.put_line('UOM_NAME : '
|| x_rail_rec.uom_name);
DBMS_OUTPUT.put_line('RELATED_TRX_NUMBER : '
|| x_rail_rec.related_trx_number);
DBMS_OUTPUT.put_line('RELATED_CUSTOMER_TRX_ID : '
|| x_rail_rec.related_customer_trx_id);
DBMS_OUTPUT.put_line('PREVIOUS_CUSTOMER_TRX_ID : '
|| x_rail_rec.previous_customer_trx_id);
DBMS_OUTPUT.put_line('REASON_CODE : '
|| x_rail_rec.reason_code);
DBMS_OUTPUT.put_line('TAX_RATE : '
|| x_rail_rec.tax_rate);
DBMS_OUTPUT.put_line('TAX_CODE : '
|| x_rail_rec.tax_code);
DBMS_OUTPUT.put_line('TAX_PRECEDENCE : '
|| x_rail_rec.tax_precedence);
DBMS_OUTPUT.put_line('INVOICING_RULE_NAME : '
|| x_rail_rec.invoicing_rule_name);
DBMS_OUTPUT.put_line('INVOICING_RULE_ID : '
|| x_rail_rec.invoicing_rule_id);
DBMS_OUTPUT.put_line('PURCHASE_ORDER : '
|| x_rail_rec.purchase_order);
DBMS_OUTPUT.put_line('SET_OF_BOOKS_ID : '
|| x_rail_rec.set_of_books_id);
DBMS_OUTPUT.put_line('LINE_TYPE : '
|| x_rail_rec.line_type);
DBMS_OUTPUT.put_line('DESCRIPTION : '
|| x_rail_rec.description);
DBMS_OUTPUT.put_line('CURRENCY_CODE : '
|| x_rail_rec.currency_code);
DBMS_OUTPUT.put_line('AMOUNT : '
|| x_rail_rec.amount);
DBMS_OUTPUT.put_line('CUST_TRX_TYPE_NAME : '
|| x_rail_rec.cust_trx_type_name);
DBMS_OUTPUT.put_line('CUST_TRX_TYPE_ID : '
|| x_rail_rec.cust_trx_type_id);
DBMS_OUTPUT.put_line('PAYMENT_TERM_ID : '
|| x_rail_rec.payment_term_id);
DBMS_OUTPUT.put_line('AMOUNT_INCLUDES_TAX_FLAG : '
|| x_rail_rec.amount_includes_tax_flag);
DBMS_OUTPUT.put_line('TAX_CAL_PLSQL_BLOCK : '
|| x_rail_rec.tax_cal_plsql_block);
DBMS_OUTPUT.put_line('MINIMUM_ACCOUNTABLE_UNIT : '
|| x_rail_rec.minimum_accountable_unit);
DBMS_OUTPUT.put_line('PRECISION : '
|| x_rail_rec.precision);
DBMS_OUTPUT.put_line('FOB_POINT : '
|| x_rail_rec.fob_point);
DBMS_OUTPUT.put_line('TAXABLE_BASIS : '
|| x_rail_rec.taxable_basis);
DBMS_OUTPUT.put_line('VAT_TAX_ID : '
|| x_rail_rec.vat_tax_id);
DBMS_OUTPUT.put_line('TAX_VALUE : '
|| x_rail_rec.tax_value);
DBMS_OUTPUT.put_line('TOTAL_PLUS_TAX : '
|| x_rail_rec.total_plus_tax);
DBMS_OUTPUT.put_line('****************************************');
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line( l_num
|| ' Unexpected Error : '
|| SUBSTR (SQLERRM, 1, 250));
END;
DECLARE
p_chr_id NUMBER;
p_cle_id NUMBER;
x_rail_rec apps.oks_tax_util_pvt.ra_rec_type;
l_return_status VARCHAR2 (20);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (2000);
l_msg_index_out NUMBER;
l_error_message VARCHAR2 (2000);
l_num NUMBER;
BEGIN
p_chr_id := 1549063;
p_cle_id := 364326736554364142775004706891329465584;
apps.oks_tax_util_pvt.get_tax (p_api_version => 1.0,
p_init_msg_list => fnd_api.g_false,
p_chr_id => p_chr_id,
p_cle_id => p_cle_id,
px_rail_rec => x_rail_rec,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_return_status => l_return_status
);
IF l_return_status <> fnd_api.g_ret_sts_success
THEN
l_num := 40;
IF l_msg_count > 0
THEN
FOR i IN 1 .. l_msg_count
LOOP
l_num := 50;
apps.fnd_msg_pub.get (p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out
);
IF l_error_message IS NULL
THEN
l_error_message := SUBSTR (l_msg_data, 1, 250);
ELSE
l_error_message :=
l_error_message || ' /' || SUBSTR (l_msg_data, 1, 250);
END IF;
END LOOP;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_error_message);
DBMS_OUTPUT.put_line ('*****************************************');
ELSE
apps.fnd_msg_pub.get (p_msg_index => 1,
p_encoded => fnd_api.g_false,
p_data => l_msg_data,
p_msg_index_out => l_msg_index_out
);
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error : ' || l_msg_data);
DBMS_OUTPUT.put_line ('*****************************************');
END IF;
ELSE
l_num := 60;
DBMS_OUTPUT.put_line('******************************************');
DBMS_OUTPUT.put_line ('API Success');
DBMS_OUTPUT.put_line ('Header Id : ' || x_rail_rec.header_id);
DBMS_OUTPUT.put_line ('Line Id : ' || x_rail_rec.line_id);
DBMS_OUTPUT.put_line('Tax Exempt Flag : ' || x_rail_rec.tax_exempt_flag);
DBMS_OUTPUT.put_line('Tax exempt reason : '
|| x_rail_rec.tax_exempt_reason);
DBMS_OUTPUT.put_line('Tax exempt number : '
|| x_rail_rec.tax_exempt_number);
DBMS_OUTPUT.put_line ('Sales Tax ID : ' || x_rail_rec.sales_tax_id);
DBMS_OUTPUT.put_line ('Org Id : ' || x_rail_rec.org_id);
DBMS_OUTPUT.put_line('Orig_system_ship_address_id : '
|| x_rail_rec.orig_system_ship_address_id);
DBMS_OUTPUT.put_line('Orig_system_ship_contact_id : '
|| x_rail_rec.orig_system_ship_contact_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_SHIP_CUSTOMER_I : '
|| x_rail_rec.orig_system_ship_customer_id);
DBMS_OUTPUT.put_line('SHIP_TO_SITE_USE_ID : '
|| x_rail_rec.ship_to_site_use_id);
DBMS_OUTPUT.put_line('SHIP_TO_POSTAL_CODE : '
|| x_rail_rec.ship_to_postal_code);
DBMS_OUTPUT.put_line('SHIP_TO_LOCATION_ID : '
|| x_rail_rec.ship_to_location_id);
DBMS_OUTPUT.put_line('SHIP_TO_CUSTOMER_NUMBER : '
|| x_rail_rec.ship_to_customer_number);
DBMS_OUTPUT.put_line('SHIP_TO_CUSTOMER_NAME : '
|| x_rail_rec.ship_to_customer_name);
DBMS_OUTPUT.put_line('SHIP_TO_ORG_ID : '
|| x_rail_rec.ship_to_org_id);
DBMS_OUTPUT.put_line('WAREHOUSE_ID : '
|| x_rail_rec.warehouse_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_SOLD_CUSTOMER_I : '
|| x_rail_rec.orig_system_sold_customer_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_CUSTOMER_I : '
|| x_rail_rec.orig_system_bill_customer_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_ADDRESS_ID : '
|| x_rail_rec.orig_system_bill_address_id);
DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_CONTACT_ID : '
|| x_rail_rec.orig_system_bill_contact_id);
DBMS_OUTPUT.put_line('BILL_TO_SITE_USE_ID : '
|| x_rail_rec.bill_to_site_use_id);
DBMS_OUTPUT.put_line('BILL_TO_POSTAL_CODE : '
|| x_rail_rec.bill_to_postal_code);
DBMS_OUTPUT.put_line('BILL_TO_LOCATION_ID : '
|| x_rail_rec.bill_to_location_id);
DBMS_OUTPUT.put_line('BILL_TO_CUSTOMER_NUMBER : '
|| x_rail_rec.bill_to_customer_number);
DBMS_OUTPUT.put_line('BILL_TO_CUSTOMER_NAME : '
|| x_rail_rec.bill_to_customer_name);
DBMS_OUTPUT.put_line('BILL_TO_ORG_ID : '
|| x_rail_rec.bill_to_org_id);
DBMS_OUTPUT.put_line('RECEIPT_METHOD_NAME : '
|| x_rail_rec.receipt_method_name);
DBMS_OUTPUT.put_line('RECEIPT_METHOD_ID : '
|| x_rail_rec.receipt_method_id);
DBMS_OUTPUT.put_line('CONVERSION_TYPE : '
|| x_rail_rec.conversion_type);
DBMS_OUTPUT.put_line('CONVERSION_DATE : '
|| x_rail_rec.conversion_date);
DBMS_OUTPUT.put_line('CONVERSION_RATE : '
|| x_rail_rec.conversion_rate);
DBMS_OUTPUT.put_line('CUSTOMER_TRX_ID : '
|| x_rail_rec.customer_trx_id);
DBMS_OUTPUT.put_line('TRX_DATE : '
|| x_rail_rec.trx_date);
DBMS_OUTPUT.put_line('GL_DATE : '
|| x_rail_rec.gl_date);
DBMS_OUTPUT.put_line('DOCUMENT_NUMBER : '
|| x_rail_rec.document_number);
DBMS_OUTPUT.put_line('TRX_NUMBER : '
|| x_rail_rec.trx_number);
DBMS_OUTPUT.put_line('LINE_NUMBER : '
|| x_rail_rec.line_number);
DBMS_OUTPUT.put_line('QUANTITY : '
|| x_rail_rec.quantity);
DBMS_OUTPUT.put_line('QUANTITY_ORDERED : '
|| x_rail_rec.quantity_ordered);
DBMS_OUTPUT.put_line('UNIT_SELLING_PRICE : '
|| x_rail_rec.unit_selling_price);
DBMS_OUTPUT.put_line('UNIT_STANDARD_PRICE : '
|| x_rail_rec.unit_standard_price);
DBMS_OUTPUT.put_line('PRINTING_OPTION : '
|| x_rail_rec.printing_option);
DBMS_OUTPUT.put_line('INVENTORY_ITEM_ID : '
|| x_rail_rec.inventory_item_id);
DBMS_OUTPUT.put_line('INVENTORY_ORG_ID : '
|| x_rail_rec.inventory_org_id);
DBMS_OUTPUT.put_line('UOM_CODE : '
|| x_rail_rec.uom_code);
DBMS_OUTPUT.put_line('UOM_NAME : '
|| x_rail_rec.uom_name);
DBMS_OUTPUT.put_line('RELATED_TRX_NUMBER : '
|| x_rail_rec.related_trx_number);
DBMS_OUTPUT.put_line('RELATED_CUSTOMER_TRX_ID : '
|| x_rail_rec.related_customer_trx_id);
DBMS_OUTPUT.put_line('PREVIOUS_CUSTOMER_TRX_ID : '
|| x_rail_rec.previous_customer_trx_id);
DBMS_OUTPUT.put_line('REASON_CODE : '
|| x_rail_rec.reason_code);
DBMS_OUTPUT.put_line('TAX_RATE : '
|| x_rail_rec.tax_rate);
DBMS_OUTPUT.put_line('TAX_CODE : '
|| x_rail_rec.tax_code);
DBMS_OUTPUT.put_line('TAX_PRECEDENCE : '
|| x_rail_rec.tax_precedence);
DBMS_OUTPUT.put_line('INVOICING_RULE_NAME : '
|| x_rail_rec.invoicing_rule_name);
DBMS_OUTPUT.put_line('INVOICING_RULE_ID : '
|| x_rail_rec.invoicing_rule_id);
DBMS_OUTPUT.put_line('PURCHASE_ORDER : '
|| x_rail_rec.purchase_order);
DBMS_OUTPUT.put_line('SET_OF_BOOKS_ID : '
|| x_rail_rec.set_of_books_id);
DBMS_OUTPUT.put_line('LINE_TYPE : '
|| x_rail_rec.line_type);
DBMS_OUTPUT.put_line('DESCRIPTION : '
|| x_rail_rec.description);
DBMS_OUTPUT.put_line('CURRENCY_CODE : '
|| x_rail_rec.currency_code);
DBMS_OUTPUT.put_line('AMOUNT : '
|| x_rail_rec.amount);
DBMS_OUTPUT.put_line('CUST_TRX_TYPE_NAME : '
|| x_rail_rec.cust_trx_type_name);
DBMS_OUTPUT.put_line('CUST_TRX_TYPE_ID : '
|| x_rail_rec.cust_trx_type_id);
DBMS_OUTPUT.put_line('PAYMENT_TERM_ID : '
|| x_rail_rec.payment_term_id);
DBMS_OUTPUT.put_line('AMOUNT_INCLUDES_TAX_FLAG : '
|| x_rail_rec.amount_includes_tax_flag);
DBMS_OUTPUT.put_line('TAX_CAL_PLSQL_BLOCK : '
|| x_rail_rec.tax_cal_plsql_block);
DBMS_OUTPUT.put_line('MINIMUM_ACCOUNTABLE_UNIT : '
|| x_rail_rec.minimum_accountable_unit);
DBMS_OUTPUT.put_line('PRECISION : '
|| x_rail_rec.precision);
DBMS_OUTPUT.put_line('FOB_POINT : '
|| x_rail_rec.fob_point);
DBMS_OUTPUT.put_line('TAXABLE_BASIS : '
|| x_rail_rec.taxable_basis);
DBMS_OUTPUT.put_line('VAT_TAX_ID : '
|| x_rail_rec.vat_tax_id);
DBMS_OUTPUT.put_line('TAX_VALUE : '
|| x_rail_rec.tax_value);
DBMS_OUTPUT.put_line('TOTAL_PLUS_TAX : '
|| x_rail_rec.total_plus_tax);
DBMS_OUTPUT.put_line('****************************************');
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line( l_num
|| ' Unexpected Error : '
|| SUBSTR (SQLERRM, 1, 250));
END;
No comments:
Post a Comment