简体   繁体   English

将 Netsuite 后端集成到 Snowflake - 如何找到准确的货币汇率?

[英]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:差异的常见来源:

  • bank transfers between currencies - you use the bank's forex rate货币之间的银行转账 - 您使用银行的外汇汇率
  • negotiated exchange rates for trading partners贸易伙伴的谈判汇率
  • user error where a transaction all takes place in one currency and the data entry person puts 1.0 as the rate.用户错误,交易全部以一种货币进行,数据输入人员将 1.0 作为汇率。 (eg Your company uses USD. You have a Canadian supplier who invoices in CAD and whom you pay from a CAD bank account. A naive user might put 1 as the exchange rate because all the transactions are in CAD but all the transactions actually should have had the USD - CAD rate for the date of the transaciton) (例如,您的公司使用美元。您有一个加拿大供应商,他用加元开具发票,您从加元银行账户付款。一个天真的用户可能会将 1 作为汇率,因为所有交易都使用加元,但实际上所有交易都应该有有交易日期的美元 - 加元汇率)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM