[英]Integrating Netsuite back-end into Snowflake - how to find the exact currency exchange rates?
I'm using imported back-end tables from Netsuite in Snowflake.我在 Snowflake 中使用从 Netsuite 导入的后端表。
I'm trying to determine exact exchange rates for foreign currency transactions to get the identical totals Netsuite has on the front-end.我正在尝试确定外币交易的确切汇率,以获得 Netsuite 在前端的相同总额。 So I tried using Netsuite's "Currency" and "CurrencyRate" tables, but the amounts I am getting are incorrect.
所以我尝试使用 Netsuite 的“Currency”和“CurrencyRate”表,但我得到的金额不正确。
The exchange rates from the table don't seem the same as those used on the front-end.表格中的汇率似乎与前端使用的汇率不同。 Every amount I get is off by a little, which adds up when there are many transactions.
我得到的每一笔金额都会减少一点,当有很多交易时,这会加起来。
Is there another table I should keep an eye out for, or do they do something completely different to keep track of all the effective exchange rates on the back-end?是否有另一张表我应该留意,或者他们是否做了一些完全不同的事情来跟踪后端的所有有效汇率? Here's the query I have so far:
这是我到目前为止的查询:
select
transline.transaction,
transline.id as line_item_id,
transline.creditforeignamount,
transline.rate,
transline.rateamount,
tran.currency as transaction_currency,
tran.recordtype,
tran.trandate::date as trandate,
tran.TRANID as netsuite_document_number,
tran.custbody_cust_primcurrfxrate,
transline.custcol_invoice_prim_curr_fx_rate, tran.exchangerate as tran_exchange_rate,
cr.exchangerate as officialexchangerate,
round((case
when cr.exchangerate not like 'null' then (cr.exchangerate * transline.creditforeignamount)
else creditforeignamount
end), 2) as amount
from transactionline transline
inner join transaction tran
on tran.id = transline.transaction
left join currencyrate cr
on (tran.currency = cr.transactioncurrency
and tran.custbody_cust_primcurrfxrate = cr.basecurrency
and tran.closedate = cr.effectivedate)
The issue may be that each transaction has an exchangerate
field.问题可能是每笔交易都有一个
exchangerate
字段。 This is because each transaction may have been done at a custom rate and Netsuite should calculate an exchange rate gain/loss for you based on the difference between the transaction exchange rate and the official posted exchange rate (ie the currencyrate
tables).这是因为每笔交易都可能以自定义汇率完成,Netsuite 应根据交易汇率与官方公布的汇率(即
currencyrate
表)之间的差异为您计算汇率损益。
Common sources of differences:差异的常见来源:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.