增加AP INVOICE 行&分配行
-- 增加行
DECLARE
v_row_id VARCHAR2(1000);
v_line_number number;
g_user_id CONSTANT NUMBER := fnd_global.user_id;
g_login_id CONSTANT NUMBER := fnd_global.conc_login_id;
g_request_id CONSTANT NUMBER := fnd_global.conc_request_id;
g_prog_appl_id CONSTANT NUMBER := fnd_global.prog_appl_id;
g_conc_program_id CONSTANT NUMBER := fnd_global.conc_program_id;
x_ccid number;
BEGIN select max(line_number)
into v_line_number
from AP_INVOICE_LINES_ALL
where invoice_id = 123000;
cux_cuxaprebate_utl.create_account(p_org_id =>106,
p_ccid =>3036,
x_ccid =>x_ccid);
ap_ail_table_handler_pkg.insert_row(p_rowid => v_row_id,
p_invoice_id => 123000,
p_line_number => v_line_number + 1,
p_line_type_lookup_code => 'MISCELLANEOUS',--杂项
p_line_group_number => NULL,
p_requester_id => NULL,
p_description => NULL,
p_line_source => NULL,
p_org_id => NULL,
p_inventory_item_id => NULL,
p_item_description => NULL,
p_serial_number => NULL,
p_manufacturer => NULL,
p_model_number => NULL,
p_warranty_number => NULL,
p_generate_dists => NULL,
p_match_type => NULL,
p_distribution_set_id => NULL,
p_account_segment => NULL,
p_balancing_segment => NULL,
p_cost_center_segment => NULL,
p_overlay_dist_code_concat => NULL,
p_default_dist_ccid => x_ccid,--ccid
p_prorate_across_all_items => NULL,
p_accounting_date => sysdate,--gl_date
p_period_name => NULL,
p_deferred_acctg_flag => NULL,
p_def_acctg_start_date => NULL,
p_def_acctg_end_date => NULL,
p_def_acctg_number_of_periods => NULL,
p_def_acctg_period_type => NULL,
p_set_of_books_id => 2021,--
p_amount => 2,--金额
p_base_amount => NULL,
p_rounding_amt => NULL,
p_quantity_invoiced => NULL,
p_unit_meas_lookup_code => NULL,
p_unit_price => NULL,
p_wfapproval_status => 'NOT REQUIRED',--
p_discarded_flag => NULL,
p_original_amount => NULL,
p_original_base_amount => NULL,
p_original_rounding_amt => NULL,
p_cancelled_flag => NULL,
p_income_tax_region => NULL,
p_type_1099 => NULL,
p_stat_amount => NULL,
p_prepay_invoice_id => NULL,
p_prepay_line_number => NULL,
p_invoice_includes_prepay_flag => NULL,
p_corrected_inv_id => NULL,
p_corrected_line_number => NULL,
p_po_header_id => NULL,
p_po_line_id => NULL,
p_po_release_id => NULL,
p_po_line_location_id => NULL,
p_po_distribution_id => NULL,
p_rcv_transaction_id => NULL,
p_final_match_flag => NULL,
p_assets_tracking_flag => NULL,
p_asset_book_type_code => NULL,
p_asset_category_id => NULL,
p_project_id => NULL,
p_task_id => NULL,
p_expenditure_type => NULL,
p_expenditure_item_date => NULL,
p_expenditure_organization_id => NULL,
p_pa_quantity => NULL,
p_pa_cc_ar_invoice_id => NULL,
p_pa_cc_ar_invoice_line_num => NULL,
p_pa_cc_processed_code => NULL,
p_award_id => NULL,
p_awt_group_id => NULL,
p_pay_awt_group_id => NULL, --NUMBER,--bug6639866
p_reference_1 => NULL,
p_reference_2 => NULL,
p_receipt_verified_flag => NULL,
p_receipt_required_flag => NULL,
p_receipt_missing_flag => NULL,
p_justification => NULL,
p_expense_group => NULL,
p_start_expense_date => NULL,
p_end_expense_date => NULL,
p_receipt_currency_code => NULL,
p_receipt_conversion_rate => NULL,
p_receipt_currency_amount => NULL,
p_daily_amount => NULL,
p_web_parameter_id => NULL,
p_adjustment_reason => NULL,
p_merchant_document_number => NULL,
p_merchant_name => NULL,
p_merchant_reference => NULL,
p_merchant_tax_reg_number => NULL,
p_merchant_taxpayer_id => NULL,
p_country_of_supply => NULL,
p_credit_card_trx_id => NULL,
p_company_prepaid_invoice_id => NULL,
p_cc_reversal_flag => NULL,
p_creation_date => sysdate,
p_created_by => g_user_id,
p_last_updated_by => g_user_id,
p_last_update_date => sysdate,
p_last_update_login => g_login_id,
p_program_application_id => NULL,
p_program_id => NULL,
p_program_update_date => sysdate,
p_request_id => NULL,
p_attribute_category => NULL,
p_attribute1 => NULL,
p_attribute2 => NULL,
p_attribute3 => NULL,
p_attribute4 => NULL,
p_attribute5 => NULL,
/* p_attribute6 VARCHAR2 DEFAULT NULL,
p_attribute7 VARCHAR2 DEFAULT NULL,
p_attribute8 VARCHAR2 DEFAULT NULL,
p_attribute9 VARCHAR2 DEFAULT NULL,
p_attribute10 VARCHAR2 DEFAULT NULL,
p_attribute11 VARCHAR2 DEFAULT NULL,
p_attribute12 VARCHAR2 DEFAULT NULL,
p_attribute13 VARCHAR2 DEFAULT NULL,
p_attribute14 VARCHAR2 DEFAULT NULL,
p_attribute15 VARCHAR2 DEFAULT NULL,
p_global_attribute_category VARCHAR2 DEFAULT NULL,
p_global_attribute1 VARCHAR2 DEFAULT NULL,
p_global_attribute2 VARCHAR2 DEFAULT NULL,
p_global_attribute3 VARCHAR2 DEFAULT NULL,
p_global_attribute4 VARCHAR2 DEFAULT NULL,
p_global_attribute5 VARCHAR2 DEFAULT NULL,
p_global_attribute6 VARCHAR2 DEFAULT NULL,
p_global_attribute7 VARCHAR2 DEFAULT NULL,
p_global_attribute8 VARCHAR2 DEFAULT NULL,
p_global_attribute9 VARCHAR2 DEFAULT NULL,
p_global_attribute10 VARCHAR2 DEFAULT NULL,
p_global_attribute11 VARCHAR2 DEFAULT NULL,
p_global_attribute12 VARCHAR2 DEFAULT NULL,
p_global_attribute13 VARCHAR2 DEFAULT NULL,
p_global_attribute14 VARCHAR2 DEFAULT NULL,
p_global_attribute15 VARCHAR2 DEFAULT NULL,
p_global_attribute16 VARCHAR2 DEFAULT NULL,
p_global_attribute17 VARCHAR2 DEFAULT NULL,
p_global_attribute18 VARCHAR2 DEFAULT NULL,
p_global_attribute19 VARCHAR2 DEFAULT NULL,
p_global_attribute20 VARCHAR2 DEFAULT NULL,
p_primary_intended_use VARCHAR2 DEFAULT NULL,
p_ship_to_location_id NUMBER DEFAULT NULL,
p_product_fisc_classification VARCHAR2 DEFAULT NULL,
p_user_defined_fisc_class VARCHAR2 DEFAULT NULL,
p_trx_business_category VARCHAR2 DEFAULT NULL,
p_product_type VARCHAR2 DEFAULT NULL,
p_product_category VARCHAR2 DEFAULT NULL,
p_assessable_value NUMBER DEFAULT NULL,
p_control_amount NUMBER DEFAULT NULL,
p_tax_regime_code VARCHAR2 DEFAULT NULL,
p_tax VARCHAR2 DEFAULT NULL,
p_tax_status_code VARCHAR2 DEFAULT NULL,*/
p_tax_rate_code => 'CN_VAT_IN_17',
/* p_tax_rate_id NUMBER DEFAULT NULL,
p_tax_rate NUMBER DEFAULT NULL,
p_tax_jurisdiction_code VARCHAR2 DEFAULT NULL,
p_purchasing_category_id NUMBER DEFAULT NULL,
p_cost_factor_id NUMBER DEFAULT NULL,
p_retained_amount NUMBER DEFAULT NULL,
p_retained_invoice_id NUMBER DEFAULT NULL,
p_retained_line_number NUMBER DEFAULT NULL,
p_tax_classification_code VARCHAR2 DEFAULT NULL,*/
p_calling_sequence => NULL);
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLERRM);
END;
--增加分配行
DECLARE
v_row_id VARCHAR2(1000);
v_line_number NUMBER;
g_user_id CONSTANT NUMBER := fnd_global.user_id;
g_login_id CONSTANT NUMBER := fnd_global.conc_login_id;
g_request_id CONSTANT NUMBER := fnd_global.conc_request_id;
g_prog_appl_id CONSTANT NUMBER := fnd_global.prog_appl_id;
g_conc_program_id CONSTANT NUMBER := fnd_global.conc_program_id;
x_ccid number := 0;
p_invoice_distribution_id NUMBER;
V_period_name VARCHAR2(100);
BEGIN SELECT MAX( NVL(DISTRIBUTION_LINE_NUMBER,0))
INTO v_line_number
FROM AP_INVOICE_DISTRIBUTIONS_ALL
WHERE invoice_id = 145000
AND invoice_line_number = 1; V_period_name := cux_gl_public_pkg.get_period_name(p_org_id =>106, p_gl_date =>SYSDATE); SELECT ap_invoice_distributions_s.nextval INTO p_invoice_distribution_id FROM DUAL;
ap_aid_table_handler_pkg.insert_row(p_rowid => v_row_id,
p_invoice_id => 145000,
p_invoice_line_number => null,--行上的信息
p_distribution_class => null,
p_invoice_distribution_id => p_invoice_distribution_id,
p_dist_code_combination_id => x_ccid,--ccid
p_last_update_date => SYSDATE,
p_last_updated_by => g_user_id,
p_accounting_date => sysdate,--gl date
p_period_name => V_period_name,
p_set_of_books_id=> 2021,
p_amount => 2,--金额
p_description => null,
p_type_1099 => null,
p_posted_flag => null,
p_batch_id => null,
p_quantity_invoiced => null,
p_unit_price => null,
p_match_status_flag => null,
p_attribute_category => null,
p_attribute1 => null,
p_attribute2 => null,
p_attribute3 => null,
p_attribute4 => null,
p_attribute5 => null,
p_prepay_amount_remaining => null,
p_assets_addition_flag => 'U',
p_assets_tracking_flag => 'N',
p_distribution_line_number => 3,--v_line_number + 1,--
p_line_type_lookup_code => 'MISCELLANEOUS',--杂项
p_po_distribution_id => null,
p_base_amount => null,
p_pa_addition_flag => null,
p_posted_amount => null,
p_posted_base_amount => null,
p_encumbered_flag => null,
p_accrual_posted_flag => null,
p_cash_posted_flag => null,
p_last_update_login => null,
p_creation_date => null,
p_created_by => null,
p_stat_amount => null,
p_attribute11 => null,
p_attribute12 => null,
p_attribute13 => null,
p_attribute14 => 'N',
p_attribute6 => null,
p_attribute7=> null,
p_attribute8 => null,
p_attribute9 => null,
p_attribute10 => null,
p_attribute15 => 'Y',
p_accts_pay_code_comb_id => null,
p_reversal_flag => null,
p_parent_invoice_id => null,
p_income_tax_region => null,
p_final_match_flag => null,
-- Removed for bug 4277744
-- p_Ussgl_Transaction_Code VARCHAR2,
-- p_Ussgl_Trx_Code_Context VARCHAR2,
p_expenditure_item_date => null,
p_expenditure_organization_id => null,
p_expenditure_type => null,
p_pa_quantity => null,
p_project_id => null,
p_task_id => null,
p_quantity_variance => null,
p_base_quantity_variance => null,
p_packet_id => null,
p_awt_flag => null,
p_awt_group_id => null,
p_pay_awt_group_id => null, --bug6639866
p_awt_tax_rate_id => null,
p_awt_gross_amount => null,
p_reference_1 => null,
p_reference_2 => null,
p_org_id => null,
p_other_invoice_id => null,
p_awt_invoice_id => null,
p_awt_origin_group_id => null,
p_program_application_id => null,
p_program_id => null,
p_program_update_date => null,
p_request_id => null,
p_tax_recoverable_flag => null,
p_award_id => null,
p_start_expense_date => null,
p_merchant_document_number => null,
p_merchant_name => null,
p_merchant_tax_reg_number => null,
p_merchant_taxpayer_id => null,
p_country_of_supply => null,
p_merchant_reference => null,
p_parent_reversal_id => null,
p_rcv_transaction_id => null,
p_matched_uom_lookup_code => null,
/* p_global_attribute_category VARCHAR2 DEFAULT NULL,
p_global_attribute1 VARCHAR2 DEFAULT NULL,
p_global_attribute2 VARCHAR2 DEFAULT NULL,
p_global_attribute3 VARCHAR2 DEFAULT NULL,
p_global_attribute4 VARCHAR2 DEFAULT NULL,
p_global_attribute5 VARCHAR2 DEFAULT NULL,
p_global_attribute6 VARCHAR2 DEFAULT NULL,
p_global_attribute7 VARCHAR2 DEFAULT NULL,
p_global_attribute8 VARCHAR2 DEFAULT NULL,
p_global_attribute9 VARCHAR2 DEFAULT NULL,
p_global_attribute10 VARCHAR2 DEFAULT NULL,
p_global_attribute11 VARCHAR2 DEFAULT NULL,
p_global_attribute12 VARCHAR2 DEFAULT NULL,
p_global_attribute13 VARCHAR2 DEFAULT NULL,
p_global_attribute14 VARCHAR2 DEFAULT NULL,
p_global_attribute15 VARCHAR2 DEFAULT NULL,
p_global_attribute16 VARCHAR2 DEFAULT NULL,
p_global_attribute17 VARCHAR2 DEFAULT NULL,
p_global_attribute18 VARCHAR2 DEFAULT NULL,
p_global_attribute19 VARCHAR2 DEFAULT NULL,
p_global_attribute20 VARCHAR2 DEFAULT NULL,*/
p_calling_sequence=>NULL,
/* p_receipt_verified_flag VARCHAR2 DEFAULT NULL,
p_receipt_required_flag VARCHAR2 DEFAULT NULL,
p_receipt_missing_flag VARCHAR2 DEFAULT NULL,
p_justification VARCHAR2 DEFAULT NULL,
p_expense_group VARCHAR2 DEFAULT NULL,
p_end_expense_date DATE DEFAULT NULL,
p_receipt_currency_code VARCHAR2 DEFAULT NULL,
p_receipt_conversion_rate VARCHAR2 DEFAULT NULL,
p_receipt_currency_amount NUMBER DEFAULT NULL,
p_daily_amount NUMBER DEFAULT NULL,
p_web_parameter_id NUMBER DEFAULT NULL,
p_adjustment_reason VARCHAR2 DEFAULT NULL,
p_credit_card_trx_id NUMBER DEFAULT NULL,
p_company_prepaid_invoice_id NUMBER DEFAULT NULL,
-- Invoice Lines Project Stage 1
p_rounding_amt NUMBER DEFAULT NULL,
p_charge_applicable_to_dist_id NUMBER DEFAULT NULL,
p_corrected_invoice_dist_id NUMBER DEFAULT NULL,
p_related_id NUMBER DEFAULT NULL,
p_asset_book_type_code VARCHAR2 DEFAULT NULL,
p_asset_category_id NUMBER DEFAULT NULL,
--ETAX: Invwkb
p_intended_use VARCHAR2 DEFAULT NULL,*\*/
p_rcv_charge_addition_flag => 'N');
--COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLERRM);
END;
增加AP INVOICE 行&分配行的更多相关文章
- windows 增加右键功能 -->用命令行打开
windows 增加右键功能 -->用命令行打开 实现 注册表 以管理员权限CMD 到指定文件夹 Windows Registry Editor Version 5.00 [HKEY_CLASS ...
- SQL SERVER大话存储结构(3)_数据行的行结构
一行数据是如何来存储的呢? 变长列与定长列,NULL与NOT NULL,实际是如何整理存放到 8k的数据页上呢? 对表格进行增减列,修改长度,添加默认值等DDL SQL ...
- (转载)delphi实例TDBGrid用右键菜单复制行粘贴行
delphi实例TDBGrid用右键菜单复制行粘贴行 这个从本质上来说就是DBGrid后台数据库的插入 右键复制当前行的相关数据到临时变量点粘贴时,覆盖数据或插入数据! db为数据库: 字段名id,n ...
- jquery的2.0.3版本源码系列(2):21行-94行定义了一些变量和函数 jQuery=function(){}
2.1.bug通过索引查询 这里的#13335是bug的索引,如何查询呢? 第一步,浏览器地址栏输入"https://bugs.jquery.com/". 第二步,在网页的搜索框里 ...
- WPF DataGrid 绑定行双击行命令
WPF DataGrid 绑定行双击行命令 <DataGrid ...> <DataGrid.InputBindings> <MouseBinding MouseActi ...
- jqgrid 单击行启用行编辑,切换行保存原编辑行
为了加速表格互动编辑,我们往往希望通过选中行就触发了行编辑,完成行编辑后,再选中另一个行做编辑,同时上一个编辑行被自动保存,直至完成需要的编辑内容. 页面效果可能如下: 1)设置需要编辑的列 edit ...
- notepad++ 如何选择10000行-20000行之间的文本?
最近要上传导入一批数据,但是数据太多,一次上传不了,所以就要分批上传,而且数据全部在一个txt里面,这时就想一次复制一部分出来导入,直到导入完成,但是问题来了,数据太多,选择1到10000行,鼠标要拉 ...
- Hadoop HBase概念学习系列之行、行键(十一)
行是由列簇中的列组成.行根据行键依照字典顺序排序. HBase的行使用行键标识,可以使用行键查询整行的数据. 对同一个行键的访问都会落在同样的物理节点上.如果表包含2个列簇,属于两个列簇的文件还是保存 ...
- jquery datatable 多行(单行)选择(select),行获取/行删除
jquery datatable 多行(单行)选择(select),行获取/行删除 代码展示 // 示例数据源 var dataSet = [ ['Tasman','Internet Explorer ...
随机推荐
- boost::asio::spawn 将一统C++网络库
boost::asio::spawn 将一统C++网络库(金庆的专栏)boost::asio::spawn()创建一个协程,使C++网络编程大大简化,个人认为这使得 asio 成为C++首选网络库.b ...
- PHP学习(2)——运行环境搭建
学习PHP首先要搞定PHP的运行环境.PHP的运行环境包括:PHP语言解析器本身以及Apache服务器.MySQL数据库等.因为只是学习嘛,尽快的搭建起来运行环境就好,到后期慢慢懂得多了再去想规范化搭 ...
- ORACLE异常(整理网上资料)
一.oracle预定义异常 命名的系统异常 产生原因 Oracle Error SQLCODE Value ACCESS_INTO_NULL 未定义对象 ORA-06530 -6530 CASE_N ...
- JBOSS EAP6 系列二 客户端访问位于EAR中的EJB时,jndi name要遵守的规则
EJB 的 jndi语法(在整个调用远程ejb的过程中语法的遵循是相当重要的) 参见jboss-as-quickstarts-7.1.1.CR2\ejb-remote\client\src\main\ ...
- Linux文件上传工具下载工具及详细使用说明
对于经常使用Linux系统的人员来说,少不了将本地的文件上传到服务器或者从服务器上下载文件到本地,rz / sz命令很方便的帮我们实现了这个功能,但是很多Linux系统初始并没有这两个命令.今天,我们 ...
- Spring Boot微服务架构入门
概述 还记得在10年毕业实习的时候,当时后台三大框架为主流的后台开发框架成软件行业的标杆,当时对于软件的认识也就是照猫画虎,对于为什么会有这么样的写法,以及这种框架的优势或劣势,是不清楚的,Sprin ...
- 18 UI美化状态集合的位图selector
当我们某个控件 想在不同状态下显示不同的背景图的需求 如我们需要按钮在正常状态显示一种图 按下显示另一背景图 或者单选框被选中时是一种显示图片 没选中是另一种背景图 例子 按钮在不同状态显示不同的背景 ...
- iOS7 CookBook精彩瞬间(二)NSSet、通过Subscript访问类成员等
1.NSSet的用法 ①NSSet是一种无序集合,基于hash实现,可以在线性时间复杂度内查找某个元素,如果要让元素有序,应当使用NSOrderedSet,要让集合可变,与NSArray类似,使用NS ...
- [ExtJS5学习笔记]第二十节 Extjs5配合数组的push方法,动态创建并加载组件
本文地址:http://blog.csdn.net/sushengmiyan/article/details/39226773 官方例子:http://docs.sencha.com/extjs/5. ...
- [openwrt] uci 的shell和lua接口
uci是openwrt上配置操作的接口,不管是自动化的shell脚本,还是使用luci来二次开发配置界面,都会用到这部分知识. uci提供了lua, shell, c接口,这里主要用到了前两种 she ...