DECLARE
l_status NUMBER;
l_outcome VARCHAR2(2000);
l_expenditure_id NUMBER;
l_expenditure_item_id NUMBER;
BEGIN
fnd_global.apps_initialize(user_id => 4720
,resp_id => 51902
,resp_appl_id => 275);
--group
pa_transactions.insertexpgroupnew(x_expenditure_group => 'test002'
,x_exp_group_status_code => 'WORKING'
,x_ending_date => SYSDATE
,x_system_linkage => 'PJ'
,x_created_by => fnd_global.user_id
,x_transaction_source => NULL
,p_accrual_flag => 'N'
,p_org_id => 81);
-- 支出头
SELECT pa_expenditures_s.nextval
INTO l_expenditure_id
FROM dual;
pa_transactions.insertexp(x_expenditure_id => l_expenditure_id
,x_expend_status => 'WORKING'
,x_expend_ending => SYSDATE
,x_expend_class => 'PU'
,x_inc_by_person => NULL
,x_inc_by_org => 81
,x_expend_group => 'test002'
,x_entered_by_id => NULL
,x_created_by_id => fnd_global.user_id
,x_attribute_category => NULL
,x_attribute1 => NULL
,x_attribute2 => NULL
,x_attribute3 => NULL
,x_attribute4 => NULL
,x_attribute5 => NULL
,x_attribute6 => NULL
,x_attribute7 => NULL
,x_attribute8 => NULL
,x_attribute9 => NULL
,x_attribute10 => NULL
,x_description => NULL
,x_control_total => NULL
,x_denom_currency_code => NULL
,x_acct_currency_code => 'CNY'
,x_acct_rate_type => NULL
,x_acct_rate_date => NULL
,x_acct_exchange_rate => NULL
,x_orig_exp_txn_reference1 => NULL
,x_orig_user_exp_txn_reference => NULL
,x_vendor_id => NULL
,x_orig_exp_txn_reference2 => NULL
,x_orig_exp_txn_reference3 => NULL
,x_person_type => NULL
,p_org_id => 81);
-- 行
SELECT pa_expenditure_items_s.nextval
INTO l_expenditure_item_id
FROM dual;
pa_transactions.loadei(x_expenditure_item_id => l_expenditure_item_id
,x_expenditure_id => l_expenditure_id
,x_expenditure_item_date => SYSDATE
,x_project_id => 71081
,x_task_id => 16116
,x_expenditure_type => '人工'
,x_non_labor_resource => NULL
,x_nl_resource_org_id => NULL
,x_quantity => 10
,x_raw_cost => NULL
,x_raw_cost_rate => NULL
,x_override_to_org_id => NULL
,x_billable_flag => 'Y'
,x_bill_hold_flag => 'N'
,x_orig_transaction_ref => NULL
,x_transferred_from_ei => NULL
,x_adj_expend_item_id => NULL
,x_attribute_category => NULL
,x_attribute1 => NULL
,x_attribute2 => NULL
,x_attribute3 => NULL
,x_attribute4 => NULL
,x_attribute5 => NULL
,x_attribute6 => NULL
,x_attribute7 => NULL
,x_attribute8 => NULL
,x_attribute9 => NULL
,x_attribute10 => NULL
,x_ei_comment => 'test002'
,x_transaction_source => NULL
,x_source_exp_item_id => NULL
,i => 1
,x_job_id => NULL
,x_org_id => 81
,x_labor_cost_multiplier_name => NULL
,x_drccid => NULL
,x_crccid => NULL
,x_cdlsr1 => NULL
,x_cdlsr2 => NULL
,x_cdlsr3 => NULL
,x_gldate => NULL
,x_bcost => NULL
,x_bcostrate => NULL
,x_etypeclass => 'PJ'
,x_burden_sum_dest_run_id => NULL
,x_burden_compile_set_id => NULL --l_expenditure_item_id
,x_receipt_currency_amount => NULL
,x_receipt_currency_code => NULL
,x_receipt_exchange_rate => NULL
,x_denom_currency_code => 'CNY'
,x_denom_raw_cost => NULL
,x_denom_burdened_cost => NULL
,x_acct_currency_code => 'CNY'
,x_acct_rate_date => NULL
,x_acct_rate_type => NULL
,x_acct_exchange_rate => NULL
,x_acct_raw_cost => NULL
,x_acct_burdened_cost => NULL
,x_acct_exchange_rounding_limit => NULL
,x_project_currency_code => 'CNY'
,x_project_rate_date => NULL
,x_project_rate_type => NULL
,x_project_exchange_rate => NULL
,x_cross_charge_type => NULL
,x_cross_charge_code => 'P'
,x_prvdr_organization_id => NULL
,x_recv_organization_id => NULL
,x_recv_operating_unit => NULL
,x_borrow_lent_dist_code => 'X'
,x_ic_processed_code => 'X'
,x_denom_tp_currency_code => NULL
,x_denom_transfer_price => NULL
,x_acct_tp_rate_type => NULL
,x_acct_tp_rate_date => NULL
,x_acct_tp_exchange_rate => NULL
,x_acct_transfer_price => NULL
,x_projacct_transfer_price => NULL
,x_cc_markup_base_code => NULL
,x_tp_base_amount => NULL
,x_tp_ind_compiled_set_id => NULL
,x_tp_bill_rate => NULL
,x_tp_bill_markup_percentage => NULL
,x_tp_schedule_line_percentage => NULL
,x_tp_rule_percentage => NULL
,x_cost_job_id => NULL
,x_prov_proj_bill_job_id => NULL
,x_tp_job_id => NULL
,p_padate => NULL
,p_paperiodname => NULL
,p_recvrpadate => NULL
,p_recvrpaperiodname => NULL
,p_glperiodname => NULL
,p_recvrgldate => NULL
,p_recvrglperiodname => NULL
,p_assignment_id => NULL
,p_work_type_id => NULL
,p_projfunc_currency_code => NULL
,p_projfunc_cost_rate_date => NULL
,p_projfunc_cost_rate_type => NULL
,p_projfunc_cost_exchange_rate => NULL
,p_project_raw_cost => NULL
,p_project_burdened_cost => NULL
,p_tp_amt_type_code => NULL
,p_cdlsr4 => NULL
,p_accrual_date => NULL
,p_recvr_accrual_date => NULL
,p_wip_resource_id => NULL
,p_inventory_item_id => NULL
,p_unit_of_measure => NULL
,p_po_line_id => NULL
,p_po_price_type => NULL
,p_adjustment_type => NULL
,p_src_system_linkage_function => NULL
,p_document_header_id => NULL
,p_document_distribution_id => NULL
,p_document_line_number => NULL
,p_document_payment_id => NULL
,p_vendor_id => NULL
,p_document_type => NULL
,p_document_distribution_type => NULL
,p_si_assets_addition_flag => NULL
,p_sc_xfer_code => NULL
,p_cdlsr5 => NULL);
pa_transactions.insitems(x_user => fnd_global.user_id
,x_login => 0
,x_module => NULL
,x_calling_process => NULL
,rows => 1
,x_status => l_status
,x_gl_flag => 'N');
dbms_output.put_line('l_status:' || l_status);
dbms_output.put_line('l_outcome:' || l_outcome);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('出错了!!!!!!!!');
END;
--select * from hr_operating_units;
项目支出导入
最新推荐文章于 2022-07-07 16:09:06 发布