采购接收入库外币汇率入库API

守給你的承諾、 提交于 2019-11-28 08:59:06

begin
              if v_header.currency_code = 'USD' then
                select r.conversion_rate
                  into v_conversion_rate
                  from GL_DAILY_RATES r
                 where r.conversion_type = 1000
                   and r.from_currency = 'USD'
                   AND R.TO_CURRENCY = 'RMB'
                   AND TRUNC(R.CONVERSION_DATE) = TRUNC(SYSDATE)
                   and r.status_code = 'C';
                 tl_rcv_transactions_interface.currency_code         := 'USD';
                 tl_rcv_transactions_interface.currency_conversion_type  := 1000;
                 tl_rcv_transactions_interface.currency_conversion_date  := trunc(sysdate);
                 tl_rcv_transactions_interface.currency_conversion_rate  := v_conversion_rate;
              else
                 tl_rcv_transactions_interface.currency_code         := null;
                 tl_rcv_transactions_interface.currency_conversion_type  := null;
                 tl_rcv_transactions_interface.currency_conversion_date  := null;
                 tl_rcv_transactions_interface.currency_conversion_rate  := null;
              end if;
            exception
              when others then
                V_ERROR_MESSAGE := '美金币种汇率为空';
                raise r_j;
            end;

begin
          if v_header.currency_code = 'USD' then
            select r.conversion_rate
              into v_conversion_rate
              from GL_DAILY_RATES r
             where r.conversion_type = 1000
               and r.from_currency = 'USD'
               AND R.TO_CURRENCY = 'RMB'
               AND TRUNC(R.CONVERSION_DATE) = TRUNC(SYSDATE)
               and r.status_code = 'C';
             tl_rcv_headers_interface.currency_code         := 'USD';
             tl_rcv_headers_interface.conversion_rate_type  := 1000;
             tl_rcv_headers_interface.conversion_rate_date  := trunc(sysdate);
             tl_rcv_headers_interface.conversion_rate       := v_conversion_rate;
          else
             tl_rcv_headers_interface.currency_code         := null;
             tl_rcv_headers_interface.conversion_rate_type  := null;
             tl_rcv_headers_interface.conversion_rate_date  := null;
             tl_rcv_headers_interface.conversion_rate       := null;
          end if;
        exception
          when others then
            V_ERROR_MESSAGE := '美金币种汇率为空';
            raise r_j;
        end;


         

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!