AR 調整應收發票指令碼

2021-08-06 05:43:51 字數 2626 閱讀 9260

declare

g_created_by number := fnd_global.user_id;

g_creation_date date := sysdate;

g_last_updated_by number := fnd_global.user_id;

g_last_updated_date date := sysdate;

g_last_updated_login number := fnd_global.login_id;

l_msg_count number;

l_msg_data varchar2(2000);

l_return_status varchar2(30);

l_adj_rec   ar_adjustments%rowtype;

l_new_adjust_number   ar_adjustments.adjustment_number%type;

l_new_adjust_id   ar_adjustments.adjustment_id%type;

l_error_msg  varchar2(2000);

begin

mo_global.init('ar');

mo_global.set_policy_context('s',101);

resp_id      => 50838,

l_adj_rec.created_by := g_created_by;

l_adj_rec.creation_date := g_creation_date;

l_adj_rec.last_updated_by := g_last_updated_by;

l_adj_rec.last_update_date := g_last_updated_date;

l_adj_rec.last_update_login := g_last_updated_login;

l_adj_rec.amount :=  100;

l_adj_rec.gl_date := trunc(sysdate);

l_adj_rec.set_of_books_id := 2021;

l_adj_rec.code_combination_id := 7003;

l_adj_rec.type := 'line';

l_adj_rec.status := 'a'; --'w'等待審批 ,'a' 審批

l_adj_rec.customer_trx_id := 13008;

l_adj_rec.payment_schedule_id := '13029';--計畫付款表id

l_adj_rec.receivables_trx_id := '1003';--收款型別

l_adj_rec.created_from  := 'arxtwadj';  

ar_adjust_pub.create_adjustment (

p_api_name    => 'ar_adjust_pub',

p_api_version   => 1.0,

p_init_msg_list => fnd_api.g_true,

p_commit_flag   => fnd_api.g_false,

p_msg_count   => l_msg_count,

p_msg_data    => l_msg_data,

p_return_status => l_return_status,

p_adj_rec   => l_adj_rec,

p_new_adjust_number => l_new_adjust_number,

p_new_adjust_id => l_new_adjust_id

);dbms_output.put_line('l_msg_count := '||l_msg_count);

dbms_output.put_line('l_msg_data := '||l_msg_data);

dbms_output.put_line('l_return_status := '||l_return_status);

dbms_output.put_line('l_new_adjust_number := '||l_new_adjust_number);

dbms_output.put_line('l_new_adjust_id := '||l_new_adjust_id);

if l_msg_count = 1 then  

dbms_output.put_line('error_msg_data := '||fnd_message.get);

else

for i in 1 .. l_msg_count loop

l_error_msg:=  substr(fnd_msg_pub.get(p_encoded => fnd_api.g_false), 1, 255);

dbms_output.put_line('l_error_msg := '||l_error_msg);

end loop;     

end if;

end ;

--應收賬款經理 -> 設定 -> 審批限額 設定使用者審批許可權

--當使用者許可權不足時候,生生的調整賬單是未審批的

AR應收賬款彙總

select customer name,customer number,extended amount,description,price,quantity,salename,startdate,enddate from select hpt.party name customer name,hc...

應收發票相關指令碼

formatted on 2018 3 15 10 20 35 qp5 v5.256.13226.35538 select from hr organization units v ar 事物處理安全性限制 begin mo global.set policy context s 107 end 備...

應收發票相關指令碼

formatted on 2018 3 15 10 20 35 qp5 v5.256.13226.35538 select from hr organization units v ar 事物處理安全性限制 begin mo global.set policy context s 107 end 備...