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;
来源:CSDN
作者:huangwenkangz
链接:https://blog.csdn.net/huangwenkangz/article/details/80812746