Skip to content

Feature: Exchange rate addition - #223

Open
fivetran-avinash wants to merge 11 commits into
mainfrom
feature/exchange-rate
Open

Feature: Exchange rate addition#223
fivetran-avinash wants to merge 11 commits into
mainfrom
feature/exchange-rate

Conversation

@fivetran-avinash

@fivetran-avinash fivetran-avinash commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

PR Overview

Package version introduced in this PR:

  • 1.10.0

This PR addresses the following Issue/Feature(s):

  • GA-1032740

Summary of changes:

  • Bringing in exchange rate data, as well as additional variable support to grab the reporting date for the balance sheet and general ledger by period converted amounts.

Submission Checklist

  • Alignment meeting with the reviewer (if needed)
    • Timeline and validation requirements discussed
  • Provide validation details:
    • Validation Steps: Check for unintentional effects (e.g., add/run consistency & integrity tests)
    • Testing Instructions: Confirm the change addresses the issue(s)
    • Focus Areas: Complex logic or queries that need extra attention
  • Merge any relevant open PRs into this PR

Changelog

  • Draft changelog for PR
  • Final changelog for release review

@fivetran-avinash fivetran-avinash self-assigned this Sep 2, 2026
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).
@fivetran-avinash fivetran-avinash added the docs:ready Triggers the docs generator workflow. label Sep 2, 2026
@fivetran-avinash fivetran-avinash added docs:ready Triggers the docs generator workflow. and removed docs:ready Triggers the docs generator workflow. labels Sep 8, 2026

@fivetran-jamie fivetran-jamie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some doc-related comments

Comment thread .quickstart/quickstart.yml Outdated
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."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, updated

Comment thread .quickstart/quickstart.yml Outdated
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."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment about using the display name of quickbooks__home_currency instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment thread CHANGELOG.md Outdated
| 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. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably include _tmp as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Comment on lines +176 to +185
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') }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh yes

Comment thread .quickstart/quickstart.yml Outdated
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."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should we note that this requires the exchange_rate table?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes absolutely!

Comment thread README.md Outdated

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably wanna note that this requires the exchange_rate table / using_exchange_rate to be true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point added

@fivetran-data-model-bot fivetran-data-model-bot removed the docs:ready Triggers the docs generator workflow. label Sep 11, 2026
@fivetran-avinash fivetran-avinash added the docs:ready Triggers the docs generator workflow. label Sep 11, 2026

@fivetran-avinash fivetran-avinash left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-jamie Ready for re-review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs:ready Triggers the docs generator workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants