Feature: Exchange rate addition - #223
Conversation
Resolves conflicts in dbt_project.yml/integration_tests/dbt_project.yml (kept 1.10.0), account_data.csv (combined both branches' new seed accounts), and CHANGELOG.md (kept newest-first order: 1.10.0, 1.9.2, 1.9.1).
Merge branch 'feature/exchange-rate' of https://github.com/fivetran/dbt_quickbooks into feature/exchange-rate
fivetran-jamie
left a comment
There was a problem hiding this comment.
Looks good, just some doc-related comments
| type: string | ||
| value: "" | ||
| description: "The primary reporting currency, use the same 3-letter ISO currency code (e.g., USD, EUR, GBP, CAD) that appears in your QuickBooks `currency_id` field. Relevant for organizations with multiple currencies, this field defaults to an empty string; when not set, the package applies exchange rate conversions to all transactions, regardless of currency." | ||
| description: "The primary reporting currency, use the same 3-letter ISO currency code (e.g., USD, EUR, GBP, CAD) that appears in your QuickBooks `currency_id` field. Relevant for organizations with multiple currencies, this field defaults to an empty string; when not set, the package applies exchange rate conversions to all transactions, regardless of currency. Required if `using_report_date_fx_conversion` is enabled." |
There was a problem hiding this comment.
Since this description is only surfaced in Quickstart, I'd recommend referencing the display_name of using_report_date_fx_conversion, as this is what customers will see in the UI
There was a problem hiding this comment.
Good catch, updated
| using_report_date_fx_conversion: | ||
| type: boolean | ||
| value: false | ||
| description: "Enable to revalue foreign-currency balance sheet accounts using the exchange rate as of the report date, matching how QuickBooks Online calculates balance sheet conversions. Requires `quickbooks__home_currency` to also be set; without it, the exchange rate lookup cannot resolve and this feature has no effect." |
There was a problem hiding this comment.
Similar comment about using the display name of quickbooks__home_currency instead
| | Data Model(s) | Change type | Old | New | Notes | | ||
| | ---------- | ----------- | -------- | -------- | ----- | | ||
| | `quickbooks__general_ledger_by_period`, `quickbooks__balance_sheet` | Opt-in calculation change for `converted_amount` fields | Converted balance summed from each transaction's own transaction-date exchange rate | For balance sheet accounts, re-converts the native `period_ending_balance` using the exchange rate as of the period's last day | Opt-in via the new `using_report_date_fx_conversion` variable (default `false`); falls back to the legacy method if disabled or if no matching exchange rate is found. No existing customer is affected unless this variable is enabled. | | ||
| | `stg_quickbooks__exchange_rate` | New model | | | Brings in the new `EXCHANGE_RATE` source table so historical exchange rates can be looked up by date and currency pair. Consumed by `int_quickbooks__general_ledger_balances` to look up the report-date rate for the opt-in conversion described below. | |
There was a problem hiding this comment.
Should probably include _tmp as well
| first_value(period_ending_balance_starter) over (partition by gl_partition {{ fivetran_utils.partition_by_source_relation(package_name='quickbooks') }} | ||
| order by period_last_day rows unbounded preceding)) as period_beginning_balance_final, | ||
| coalesce(period_ending_balance_starter, | ||
| first_value(period_ending_balance_starter) over (partition by gl_partition {{ fivetran_utils.partition_by_source_relation(package_name='quickbooks') }} | ||
| order by period_last_day rows unbounded preceding)) as period_ending_balance_final, | ||
| coalesce(period_beginning_converted_balance_starter, | ||
| first_value(period_ending_converted_balance_starter) over (partition by gl_converted_partition {{ fivetran_utils.partition_by_source_relation(package_name='quickbooks') }} | ||
| order by period_last_day rows unbounded preceding)) as period_beginning_converted_balance_final, | ||
| coalesce(period_ending_converted_balance_starter, | ||
| first_value(period_ending_converted_balance_starter) over (partition by gl_partition {{ fivetran_utils.partition_by_source_relation(package_name='quickbooks') }} |
There was a problem hiding this comment.
I see that period_beginning_converted_balance_final uses gl_converted_partition as a partition while the others use gl_partition -- should these be aligned?
| using_report_date_fx_conversion: | ||
| type: boolean | ||
| value: false | ||
| description: "Enable to revalue foreign-currency balance sheet accounts using the exchange rate as of the report date, matching how QuickBooks Online calculates balance sheet conversions. Requires `quickbooks__home_currency` to also be set; without it, the exchange rate lookup cannot resolve and this feature has no effect." |
There was a problem hiding this comment.
Also should we note that this requires the exchange_rate table?
There was a problem hiding this comment.
Yes absolutely!
|
|
||
| Enable this feature if you want `converted_amount` on balance sheet accounts to match QuickBooks Online's own report-date revaluation approach. This does not affect profit and loss accounts, since period activity is already correctly valued at the transaction date. | ||
|
|
||
| **This feature requires `quickbooks__home_currency` to also be set** (see [Configuring Your Home Currency for Multicurrency Support](#configuring-your-home-currency-for-multicurrency-support) above). The exchange rate lookup matches on your home currency as the conversion target, so without it the lookup never finds a matching rate and every account silently falls back to the legacy method. |
There was a problem hiding this comment.
Probably wanna note that this requires the exchange_rate table / using_exchange_rate to be true
There was a problem hiding this comment.
Good point added
…bt_quickbooks into feature/exchange-rate
fivetran-avinash
left a comment
There was a problem hiding this comment.
@fivetran-jamie Ready for re-review!
PR Overview
Package version introduced in this PR:
This PR addresses the following Issue/Feature(s):
Summary of changes:
Submission Checklist
Changelog