本文主要是介绍PA创建协议,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
PA创建协议可以使用 PA_AGREEMENT_PUB.CREATE_AGREEMENT 和 PA_AGREEMENT_PUB.ADD_FUNDING,但是这两个函数创建PA协议的校验实在太多了,很多没有必要。查找系统选择 pa_agreement_utils 创建PA协议。代码如下所示
DECLAREl_row_id VARCHAR2(30);l_agreement_id NUMBER;l_project_funding_id NUMBER;l_err_code VARCHAR2(240);l_err_msg VARCHAR2(240);BEGINmo_global.set_policy_context('S',106);pa_agreement_utils.create_agreement(p_rowid => l_row_id,p_agreement_id => l_agreement_id,p_customer_id => 32088 --客户,p_agreement_num => 'AGREEMENT_0006' --协议编号,p_agreement_type => '立即-收款' --协议类型,p_last_update_date => SYSDATE,p_last_updated_by => fnd_global.user_id,p_creation_date => SYSDATE,p_created_by => fnd_global.login_id,p_last_update_login => fnd_global.user_id,p_owned_by_person_id => 88 --管理员,p_term_id => 1000 --付款方式,p_revenue_limit_flag => 'N' --收入硬限制,p_amount => 10000 --系欸金额,p_description => 'DEMO AGRREMENT IMPORT' --备注,p_expiration_date => NULL --到期日,p_attribute_category => NULL,p_attribute1 => NULL,p_attribute2 => NULL,p_attribute3 => NULL,p_attribute4 => NULL,p_attribute5 => NULL,p_attribute6 => NULL,p_attribute7 => NULL,p_attribute8 => NULL,p_attribute9 => NULL,p_attribute10 => NULL,p_template_flag => NULL,p_pm_agreement_reference => NULL,p_pm_product_code => NULL/* MCB2 params begin */,p_owning_organization_id => 106 -- 组织,p_agreement_currency_code => 'CNY' --协议币种,p_invoice_limit_flag => 'N' --发票限制/*Federal*/,p_customer_order_number => NULL --客户PO,p_advance_required => 'N' -- 要求预付款,p_start_date => NULL --起始日期,p_billing_sequence => NULL --开单序号,p_line_of_account => NULL -- 会计账户 ,p_attribute11 => NULL,p_attribute12 => NULL,p_attribute13 => NULL,p_attribute14 => NULL,p_attribute15 => NULL,p_attribute16 => NULL,p_attribute17 => NULL,p_attribute18 => NULL,p_attribute19 => NULL,p_attribute20 => NULL,p_attribute21 => NULL,p_attribute22 => NULL,p_attribute23 => NULL,p_attribute24 => NULL,p_attribute25 => NULL);dbms_output.put_line('l_agreement_id = ' || l_agreement_id);pa_agreement_utils.create_funding(p_rowid => l_row_id,p_project_funding_id => l_project_funding_id,p_last_update_date => SYSDATE,p_last_updated_by => fnd_global.user_id,p_creation_date => SYSDATE,p_created_by => fnd_global.user_id,p_last_update_login => fnd_global.login_id,p_agreement_id => l_agreement_id --协议ID ,p_project_id => 3001 --项目ID ,p_task_id => NULL --任务,p_allocated_amount => 10000 --分配金额 ,p_date_allocated => trunc(SYSDATE),p_attribute_category => NULL,p_attribute1 => NULL,p_attribute2 => NULL,p_attribute3 => NULL,p_attribute4 => NULL,p_attribute5 => NULL,p_attribute6 => NULL,p_attribute7 => NULL,p_attribute8 => NULL,p_attribute9 => NULL,p_attribute10 => NULL,p_pm_funding_reference => NULL,p_pm_product_code => NULL,p_project_rate_type => NULL,p_project_rate_date => NULL,p_project_exchange_rate => NULL,p_projfunc_rate_type => NULL,p_projfunc_rate_date => NULL,p_projfunc_exchange_rate => NULL,x_err_code => l_err_code,x_err_msg => l_err_msg,p_funding_category => 'ORIGINAL' --资金分配分类 );dbms_output.put_line('l_project_funding_id = ' || l_project_funding_id);IF l_err_code <> '0' THENRETURN;dbms_output.put_line('error_msg = ' || l_err_msg);END IF;pa_agreement_utils.summary_funding_insert_row(p_agreement_id => l_agreement_id,p_project_id => 3001,p_task_id => NULL,p_login_id => fnd_global.login_id,p_user_id => fnd_global.user_id);COMMIT;
EXCEPTIONWHEN OTHERS THENROLLBACK;dbms_output.put_line('SQLERRM = ' || SQLERRM);
END;
生成的采购协议如下图所示:
这篇关于PA创建协议的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!