Oracle EBS AP 应付核销到确定一行预付款

时间:2021-12-08 08:59:17
-- purpose: 应付标准发票核销预付款发票中的一行
-- 12.2.6 环境
-- author:jenrry create_date: 2017-06-08
declare
l_error_message VARCHAR2(2000);
p_prepay_line_num number;
l_prepay_dist_info ap_prepay_pkg.prepay_dist_tab_type;
l_result_boolean BOOLEAN;
begin
BEGIN
FND_GLOBAL.APPS_INITIALIZE(USER_ID => 1110,
RESP_ID => 50897,
RESP_APPL_ID => 20004);
mo_global.init('SQLAP');
MO_GLOBAL.set_policy_context('S', 105);
END;
l_result_boolean := ap_prepay_pkg.apply_prepay_line(p_prepay_invoice_id => 14142,
p_prepay_line_num => 3,
p_prepay_dist_info => l_prepay_dist_info,
p_prorate_flag => 'Y',
p_invoice_id => 14145,
p_invoice_line_number => null,
p_apply_amount => 30,
p_gl_date => sysdate,
p_period_name => '2017-06',
p_prepay_included => 'N',
p_user_id => -1,
p_last_update_login => -1,
p_calling_sequence => 'Apply Prepayment Form',
p_calling_mode => 'PREPAYMENT APPLICATION',
p_error_message => l_error_message);
IF l_result_boolean THEN
DBMS_OUTPUT.put_line('S');
/*ap_approval_pkg.approve(p_run_option => 'ALL',
p_invoice_batch_id => NULL,
p_begin_invoice_date => NULL,
p_end_invoice_date => NULL,
p_vendor_id => 801,
p_pay_group => NULL,
p_invoice_id => 14145,
p_entered_by => NULL,
p_set_of_books_id => NULL,
p_trace_option => NULL,
p_conc_flag => NULL,
p_holds_count => lx_holds_count,
p_approval_status => lx_approval_status,
p_funds_return_code => lv_funds_return_code,
p_calling_mode => 'APPROVE',
p_calling_sequence => 'CUXAPAUTOAPPLY',
p_debug_switch => 'N',
p_budget_control => 'Y',
p_commit => 'N');
log_message('p_approval_status'||lx_approval_status); */ ELSE
DBMS_OUTPUT.put_line('E');
DBMS_OUTPUT.put_line('l_error_message: ' || l_error_message);
END IF; end;