AR - 收款创建、冲销、删除【标准API】

收款创建API

ar_receipt_api_pub.create_cash

以下部分关键代码,仅供学习参考


   begin
   
      v_user_id := fnd_global.user_id;
   

      
         v_currency                  := 币种
         v_receipt_number            := 收款编号;
         v_amount                    := 收款金额;
         v_gl_date                   := GL日期;
         v_account_number            := 客户编号;
         v_receitp_method            := 收款方法名;
         g_curreny                   := 币种;

      
         v_org_id := imp_rpt.org_id;
      
         ---- 获取汇率日期
         begin
            select last_day(add_months(v_gl_date, -1))
              into v_conversion_date
              from dual;
         
            select r.exchange_date
              into v_conversion_date
              from ra_customer_trx_all r
             where r.trx_number = v_receipt_number;
         
         exception
            when others then
               v_return_status := 'E';
               v_error_message := '获取汇率日期异常' || sqlerrm;
               raise fnd_api.g_exc_error;
         end;
      
         ---- 获取汇率
      
         begin
         
            select g.currency_code
              into v_b_currency
              from hr_operating_units h, gl_sets_of_books g
             where h.organization_id = v_org_id
               and h.set_of_books_id = g.set_of_books_id;
         
            if v_b_currency <> g_curreny then
               select v.conversion_rate, v.user_conversion_type
                 into v_conversion_rate, v_rate_type
                 from gl_daily_rates_v v
                where v.from_currency = g_curreny
                  and v.to_currency = v_b_currency
                  and v.user_conversion_type = 'Corporate'
                  and v.conversion_date = v_conversion_date;
            else
               v_rate_type       := null;
               v_conversion_date := null;
            
            end if;
         
         exception
            when others then
               v_return_status := 'E';
               v_error_message := '获取汇率异常' || sqlerrm;
               goto process_not_cny_end;
         end;
      
       
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值