Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4832c88
feature/exchange-gain-loss
fivetran-catfritz Jun 26, 2026
1b004fa
fixes
fivetran-catfritz Jun 26, 2026
32a70b8
decisionlog
fivetran-catfritz Jun 30, 2026
94498cd
yml
fivetran-catfritz Jun 30, 2026
8458080
Merge branch 'main' into feature/exchange-gain-loss
fivetran-catfritz Jun 30, 2026
c67d3c5
Apply suggestion from @fivetran-catfritz
fivetran-catfritz Jun 30, 2026
02d2ae2
ad some aliases
fivetran-catfritz Jul 6, 2026
0546876
convert to full
fivetran-catfritz Jul 6, 2026
7d30d3e
Generate dbt docs via GitHub Actions
github-actions[bot] Jul 6, 2026
ab37ec4
update vars
fivetran-catfritz Jul 6, 2026
76d1595
update docs
fivetran-catfritz Jul 6, 2026
288ff86
Generate dbt docs via GitHub Actions
github-actions[bot] Jul 6, 2026
8a527f9
Apply suggestions from code review
fivetran-catfritz Jul 7, 2026
22f70ee
resolve conflicts
fivetran-catfritz Jul 7, 2026
dcd1f37
fix seed ids
fivetran-catfritz Jul 7, 2026
a0b989d
fix seed dupes
fivetran-catfritz Jul 7, 2026
052720a
put the seeds back
fivetran-catfritz Jul 7, 2026
1901141
Merge branch 'release/1.9.0' into feature/exchange-gain-loss
fivetran-catfritz Jul 7, 2026
19dace7
restore seeds again
fivetran-catfritz Jul 7, 2026
6ec394d
restore seeds again
fivetran-catfritz Jul 7, 2026
cad79f2
restore seeds again
fivetran-catfritz Jul 7, 2026
66c07c7
update col seed types
fivetran-catfritz Jul 7, 2026
25070ea
Generate dbt docs via GitHub Actions
github-actions[bot] Jul 8, 2026
075a53f
merge conflicts
fivetran-catfritz Jul 8, 2026
eab7a5a
merge conflicts
fivetran-catfritz Jul 8, 2026
89629a6
Merge branch 'release/1.9.0' into feature/exchange-gain-loss
fivetran-catfritz Jul 10, 2026
8e671ea
Merge branch 'release/1.9.0' into feature/exchange-gain-loss
fivetran-catfritz Jul 11, 2026
dcac347
Update CHANGELOG with tax line model changes
fivetran-catfritz Jul 11, 2026
5e32fc2
Update CHANGELOG.md
fivetran-catfritz Jul 11, 2026
6b11c81
Revise CHANGELOG for new features and updates
fivetran-catfritz Jul 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .quickstart/quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ supported_vars:
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."
display_name: "Home Currency"

using_exchange_gain_loss:
type: boolean
value: true
description: "When enabled, the package generates exchange gain/loss entries for foreign currency bill payments and customer payments where the exchange rate differs between the original transaction and the payment. Disable if your QuickBooks data does not include multi-currency transactions or if you do not have an Exchange Gain or Loss account configured."
display_name: "Generate Exchange Gain/Loss Entries"
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# dbt_quickbooks v1.9.0-a1
[PR #212](https://github.com/fivetran/dbt_quickbooks/pull/212) includes the following updates:

## Schema/Data Change
**2 total changes • 0 possible breaking changes**

| Data Model(s) | Change type | Old | New | Notes |
| ------------- | ----------- | --- | --- | ----- |
| `quickbooks__general_ledger`<br>`quickbooks__general_ledger_by_period` | New records | — | Exchange gain/loss entries | |

## Feature Update
- Adds realized exchange gain/loss entries to `int_quickbooks__bill_payment_double_entry` and `int_quickbooks__payment_double_entry` to capture the currency impact when a foreign currency transaction is settled at a different exchange rate than when it was originally recorded. Requires an `ExchangeGainOrLoss` account in QuickBooks to generate entries.

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.

In the validation, it appears to be both an account_name value and an account_sub_type value. Do we need to call that out explicitly?

@fivetran-catfritz fivetran-catfritz Jun 30, 2026 •

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 question. It's the account_sub_type that is a pre-set list coming from Quickbook, and the name should follow, so yes I should clarify what field we're talking about here.

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
fivetran-catfritz marked this conversation as resolved.
Resolved
- Adds the `using_exchange_gain_loss` variable (default `true`) to disable exchange gain/loss entry generation for users without multi-currency transactions or an Exchange Gain or Loss account. See the [README](https://github.com/fivetran/dbt_quickbooks/tree/main#disabling-exchange-gainloss-entries) for details.

# dbt_quickbooks v1.8.1
[PR #214](https://github.com/fivetran/dbt_quickbooks/pull/214) includes the following update:

Expand Down
11 changes: 11 additions & 0 deletions DECISIONLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ If neither of those accounts are available, the `quickbooks__sales_tax_account_r

This behavior pertains to the invoice, journal entry, refund receipt, and sales receipt tax line entries. (Purchase tax lines will be associated with their purchase accounts).

## Exchange Gain/Loss: Clearing AR/AP at the Original Transaction Rate
Comment thread
fivetran-catfritz marked this conversation as resolved.
Resolved
When a foreign currency payment or bill payment is settled at a different exchange rate than the original invoice or bill, we generate exchange gain/loss entries in `int_quickbooks__payment_double_entry` and `int_quickbooks__bill_payment_double_entry`.

The AR credit (payment model) and AP debit (bill payment model) use the **original invoice/bill exchange rate** to compute `converted_amount`, not the payment exchange rate. The difference between the payment rate and the original rate is posted separately to the Exchange Gain or Loss account. This mirrors QuickBooks's own behavior.
Comment thread
fivetran-catfritz marked this conversation as resolved.
Resolved

An alternative considered was to credit/debit AR/AP at the payment rate and add a secondary offsetting AR/AP entry to walk back the difference. This was rejected because:
- It produced a positive `adjusted_converted_amount` for the AR/AP offset entry, making the general ledger appear unbalanced to end users (both the gain/loss entry and its offset showed the same sign).
- It introduced an additional entry per transaction with no user-facing benefit.

Using the original rate clears AR/AP at book value with a single entry, and the exchange gain/loss entry stands alone as income or expense recognition, which is consistent with standard accrual accounting.

## Designating a single Accounts Payable/Accounts Receivable account
The `int_quickbooks__bill_payment_double_entry` model requires a single account designated as 'Accounts Payable' per currency. Similarly, the `int_quickbooks__invoice_double_entry`, `int_quickbooks__credit_memo_double_entry`, and `int_quickbooks__payment_double_entry` models require a single account designated as 'Accounts Receivable' per currency. This aligns with QuickBooks Online requirements and accounting best practices. If you have multiple accounts designated as 'Accounts Payable' or 'Accounts Receivable' in the `account_type` field, all accounts will be brought into the join, causing data fanout. See example [join logic](https://github.com/fivetran/dbt_quickbooks/blob/main/models/double_entry_transactions/int_quickbooks__bill_payment_double_entry.sql#L57) here.

Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Include the following QuickBooks package version in your `packages.yml` file.
```yaml
packages:
- package: fivetran/quickbooks
version: [">=1.8.0", "<1.9.0"] # we recommend using ranges to capture non-breaking changes automatically
version: 1.9.0-a1 # we recommend using ranges to capture non-breaking changes automatically
```

> All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/quickbooks_source` in your `packages.yml` since this package has been deprecated.
Expand Down Expand Up @@ -185,6 +185,17 @@ vars:

**Note:** Use the same 3-letter ISO currency code (e.g., "USD", "EUR", "GBP") that appears in your QuickBooks `currency_id` field.

#### Disabling Exchange Gain/Loss Entries

By default, the package generates exchange gain/loss entries for foreign currency bill payments and customer payments where the exchange rate differs between the original transaction and the settlement. This requires an `ExchangeGainOrLoss` account to be configured in QuickBooks.

If your QuickBooks data does not include multi-currency transactions, or if you do not have an Exchange Gain or Loss account configured, disable this feature by setting the following variable in your `dbt_project.yml`:

```yml
vars:
using_exchange_gain_loss: false
```

#### Customize the Cash Flow Model
**IMPORTANT**: It is very likely you will need to reconfigure your `cash_flow_type` to make sure your cash flow statement matches your specific use case. Please examine the following instructions.

Expand Down
3 changes: 2 additions & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2
name: 'quickbooks'

version: '1.8.1'
version: '1.9.0'

require-dbt-version: [">=1.3.0", "<3.0.0"]

Expand Down Expand Up @@ -99,6 +99,7 @@ vars:
using_invoice_tax_line: false
using_tax_agency: false
using_tax_rate: false
using_exchange_gain_loss: true

analysis-paths: ["analysis"]
clean-targets:
Expand Down
5 changes: 5 additions & 0 deletions integration_tests/ci/test_scenarios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ test_scenarios:
using_customer_type: false
include_incremental: false

- name: "Exchange Gain/Loss disabled"
vars:
using_exchange_gain_loss: false
Comment thread
fivetran-catfritz marked this conversation as resolved.
Resolved
include_incremental: false

- name: "MDLS"
vars:
fivetran_using_source_casing: true
Expand Down
4 changes: 3 additions & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'quickbooks_integration_tests'
version: '1.8.1'
version: '1.9.0'

profile: 'integration_tests'
config-version: 2
Expand Down Expand Up @@ -82,6 +82,7 @@ seeds:
+column_types:
due_date: date
transaction_date: date
exchange_rate: float
bill_line_data:
+column_types:
item_expense_billable_status: "{{ 'varchar(100)' if target.type in ('redshift', 'postgres') else 'string' }}"
Expand Down Expand Up @@ -133,6 +134,7 @@ seeds:
payment_data:
+column_types:
transaction_date: date
exchange_rate: float
purchase_data:
+column_types:
credit: "{{ 'boolean' if target.type in ('snowflake', 'spark', 'databricks') else 'bool' }}"
Expand Down
4 changes: 3 additions & 1 deletion integration_tests/seeds/account_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ id,_fivetran_synced,account_number,account_sub_type,account_type,active,balance,
91004,2024-06-30 12:00:00,914,SalesTaxPayable,Other Current Liability,TRUE,0,0,Liability,2024-06-30 00:00:00,USD,Tax liability account for State Department of Revenue,State Department of Revenue Payable,State Department of Revenue Payable,,FALSE,1,,2025-06-30 12:00:00,FALSE
91005,2024-06-30 12:00:00,915,SalesTaxPayable,Other Current Liability,TRUE,0,0,Liability,2024-06-30 00:00:00,USD,Tax liability account for Local Business Tax Agency,Local Business Tax Agency Payable,Local Business Tax Agency Payable,,FALSE,1,,2025-06-30 12:00:00,FALSE
92001,2024-06-30 12:00:00,9201,AccountsReceivable,Accounts Receivable,TRUE,0,0,Asset,2024-06-30 00:00:00,USD,Primary accounts receivable account,Accounts Receivable,Accounts Receivable,,FALSE,1,,2025-06-30 12:00:00,FALSE
92002,2026-02-01 12:00:00,9202,AccountsReceivable,Accounts Receivable,TRUE,0,0,Asset,2026-01-15 00:00:00,EUR,EUR accounts receivable account,Accounts Receivable EUR,Accounts Receivable EUR,,FALSE,1,,2026-01-15 00:00:00,FALSE
92002,2026-02-01 12:00:00,9202,AccountsReceivable,Accounts Receivable,TRUE,0,0,Asset,2026-01-15 00:00:00,EUR,EUR accounts receivable account,Accounts Receivable EUR,Accounts Receivable EUR,,FALSE,1,,2026-01-15 00:00:00,FALSE
93001,2026-01-15 00:00:00,9301,ExchangeGainOrLoss,Other Income,TRUE,0,0,Revenue,2026-01-15 00:00:00,USD,Exchange gain or loss account,Exchange Gain or Loss,Exchange Gain or Loss,,FALSE,1,,2026-01-15 00:00:00,FALSE
93002,2026-01-15 00:00:00,9302,AccountsPayable,Accounts Payable,TRUE,0,0,Liability,2026-01-15 00:00:00,EUR,EUR accounts payable account,Accounts Payable EUR,Accounts Payable EUR,,FALSE,1,,2026-01-15 00:00:00,FALSE
3 changes: 2 additions & 1 deletion integration_tests/seeds/bill_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ id,_fivetran_deleted,_fivetran_synced,balance,created_at,currency_id,department_
111,FALSE,2020-11-10 21:00:00,0,2020-11-10 20:59:00,USD,1,,,,,,,,,,5000,2020-11-10,2020-11-10 20:59:00,1
112,FALSE,2020-11-10 21:00:01,0,2020-11-10 20:59:01,USD,1,,,,,,,,,,7000,2020-11-10,2020-11-10 20:59:01,1
5000,FALSE,2024-01-01 12:00:00,100,2024-01-01 12:00:01,USD,1,,2024-01-10,1,,,500,,,0,100,2024-01-01,2024-01-01,100
5001,FALSE,2024-01-01 12:00:00,150,2024-01-01 12:00:01,USD,1,,2024-01-10,1,,,501,,,0,150,2024-01-01,2024-01-01,101
5001,FALSE,2024-01-01 12:00:00,150,2024-01-01 12:00:01,USD,1,,2024-01-10,1,,,501,,,0,150,2024-01-01,2024-01-01,101
5002,FALSE,2026-01-15 00:00:00,500,2026-01-15 00:00:00,EUR,,,2026-02-15,1.2,,,,,,1,500,2026-01-15,2026-01-15 00:00:00,1
3 changes: 2 additions & 1 deletion integration_tests/seeds/bill_payment_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ id,_fivetran_deleted,_fivetran_synced,check_bank_account_id,check_print_status,c
132,FALSE,2020-10-30 19:31:59,28,faf396cbd83927b72a84d2616fac76ff,2020-10-30 19:27:05,,USD,,,,4cce1cfcb51137c1ea3971e31a5ea598,,,,,51931,2020-10-30,2020-10-30 19:27:05,1
133,FALSE,2020-10-30 19:31:59,28,faf396cbd83927b72a84d2616fac76ff,2020-10-30 19:27:40,,USD,,,,4cce1cfcb51137c1ea3971e31a5ea598,,,,,83210,2020-10-30,2020-10-30 19:27:40,1
134,FALSE,2020-11-01 16:02:01,28,faf396cbd83927b72a84d2616fac76ff,2020-11-01 16:00:40,,USD,,,,4cce1cfcb51137c1ea3971e31a5ea598,,,,,37040,2020-11-01,2020-11-01 16:00:40,1
150,FALSE,2020-11-12 12:00:00,99,faf396cbd83927b72a84d2616fac76ff,2020-11-12 12:00:00,,USD,,,0.9,4cce1cfcb51137c1ea3971e31a5ea598,,,,,52353,2020-11-12,2020-11-12 12:00:00,1
150,FALSE,2020-11-12 12:00:00,99,faf396cbd83927b72a84d2616fac76ff,2020-11-12 12:00:00,,USD,,,0.9,4cce1cfcb51137c1ea3971e31a5ea598,,,,,52353,2020-11-12,2020-11-12 12:00:00,1
9001,FALSE,2026-02-01 00:00:00,99,,2026-02-01 00:00:00,,EUR,,,1.3,Check,93002,,,1,500,2026-02-01,2026-02-01 00:00:00,1
3 changes: 2 additions & 1 deletion integration_tests/seeds/bill_payment_line_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ bill_payment_id,index,_fivetran_synced,amount,bill_id,check_id,credit_card_charg
133,0,2020-10-30 19:27:40,83210,113,,,,,,,,,
134,0,2020-11-01 16:00:40,20000,114,,,,,,,,,
134,1,2020-11-01 16:00:41,17040,115,,,,,,,,,
150,0,2020-11-12 12:10:00,52353,120,,,,,,262,,,
150,0,2020-11-12 12:10:00,52353,120,,,,,,262,,,
9001,0,2026-02-01 00:00:00,500,5002,,,,,,,,,
3 changes: 2 additions & 1 deletion integration_tests/seeds/payment_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ id,_fivetran_deleted,_fivetran_synced,created_at,credit_card_amount,credit_card_
5814,FALSE,2020-01-15 0:03:27,2019-01-03 19:03:04,,,,,,,,,,,,,USD,827,40,,5,,FALSE,,463,0,19960,2019-01-03,,,0,2019-01-03 19:03:04
5936,FALSE,2020-01-15 0:03:27,2019-01-08 0:42:04,,,,,,,,,,,,,USD,698,40,,5,,FALSE,,308,0,8324.1,2019-01-07,,,0,2019-01-08 0:42:04
11653,FALSE,2020-01-15 0:03:27,2019-06-11 14:14:59,,,,,,,,,,,,,USD,1589,40,,5,,FALSE,,8245,0,11000,2019-06-11,,,0,2019-06-11 14:14:59
10777,FALSE,2020-01-15 0:03:27,2019-05-14 14:36:36,,,,,,,,,,,,,USD,858,40,,5,,FALSE,,2669,0,12853,2019-05-14,,,0,2019-05-14 14:36:36
10777,FALSE,2020-01-15 0:03:27,2019-05-14 14:36:36,,,,,,,,,,,,,USD,858,40,,5,,FALSE,,2669,0,12853,2019-05-14,,,0,2019-05-14 14:36:36
9001,FALSE,2026-02-01 00:00:00,2026-02-01 00:00:00,,,,,,,,,,,,,EUR,698,40,1.4,,,,92002,,1,1000,2026-02-01,,,0,2026-02-01 00:00:00
3 changes: 2 additions & 1 deletion integration_tests/seeds/payment_line_data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ index,payment_id,_fivetran_synced,amount,check_id,credit_card_charge_id,credit_c
0,24685,2020-03-04 2:01:35,16668,,,,,,,23531,
0,24819,2020-03-05 18:16:45,25149.04,,,,,,,23532,
0,24420,2020-02-27 15:46:05,17381.5,,,,,,,23566,
0,24183,2020-02-21 3:15:37,16147.5,,,,,,,23568,
0,24183,2020-02-21 3:15:37,16147.5,,,,,,,23568,
0,9001,2026-02-01 00:00:00,1000,,,,,,,50001,
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ ap_accounts as (
and not is_sub_account
),

{% if var('using_exchange_gain_loss', True) %}
exchange_gain_loss_accounts as (

select
account_id,
source_relation
from accounts

where account_sub_type = 'ExchangeGainOrLoss'
Comment thread
fivetran-joemarkiewicz marked this conversation as resolved.
Resolved
),
{% endif %}

bill_payment_join as (

select
Expand Down Expand Up @@ -63,8 +75,75 @@ bill_payment_join as (
and ap_accounts.source_relation = bill_payments.source_relation
),

{% if var('using_exchange_gain_loss', True) %}
bills as (

select *
from {{ ref('stg_quickbooks__bill') }}
),

bill_original_amounts as (

-- computes the AP amount to clear using each bill's original exchange rate
select
bill_payments.bill_payment_id,
bill_payments.source_relation,
sum(bill_payment_lines.amount * coalesce(bills.exchange_rate, 1)) as ap_converted_amount
from bill_payments

inner join bill_payment_lines
on bill_payments.bill_payment_id = bill_payment_lines.bill_payment_id
and bill_payments.source_relation = bill_payment_lines.source_relation

inner join bills
on bill_payment_lines.bill_id = bills.bill_id
and bill_payment_lines.source_relation = bills.source_relation

where bill_payments.currency_id != '{{ var('quickbooks__home_currency', '') }}'

group by 1,2
),

gain_loss_join as (

select
bill_payments.bill_payment_id as transaction_id,
bill_payments.source_relation,
bill_payment_lines.index,
bill_payments.transaction_date,
abs((coalesce(bill_payments.exchange_rate, 1) - coalesce(bills.exchange_rate, 1)) * bill_payment_lines.amount) as amount,
abs((coalesce(bill_payments.exchange_rate, 1) - coalesce(bills.exchange_rate, 1)) * bill_payment_lines.amount) as converted_amount,
exchange_gain_loss_accounts.account_id,
bill_payments.vendor_id,
bill_payments.department_id,
bill_payments.created_at,
bill_payments.updated_at,
cast(case
when (coalesce(bill_payments.exchange_rate, 1) - coalesce(bills.exchange_rate, 1)) * bill_payment_lines.amount >= 0
then 'debit'
else 'credit'
end as {{ dbt.type_string() }}) as transaction_type
from bill_payments

inner join bill_payment_lines
on bill_payments.bill_payment_id = bill_payment_lines.bill_payment_id
and bill_payments.source_relation = bill_payment_lines.source_relation

inner join bills
on bill_payment_lines.bill_id = bills.bill_id
and bill_payment_lines.source_relation = bills.source_relation

inner join exchange_gain_loss_accounts
on exchange_gain_loss_accounts.source_relation = bill_payments.source_relation

where bill_payments.currency_id != '{{ var('quickbooks__home_currency', '') }}'
and coalesce(bill_payments.exchange_rate, 1) != coalesce(bills.exchange_rate, 1)
),
{% endif %}

final as (

-- credit to cash/bank account
select
transaction_id,
source_relation,
Expand All @@ -85,15 +164,20 @@ final as (

union all

-- debit to accounts payable at the original bill exchange rate
select
transaction_id,
source_relation,
bill_payment_join.source_relation,
index,
transaction_date,
cast(null as {{ dbt.type_string() }}) as customer_id,
vendor_id,
amount,
{% if var('using_exchange_gain_loss', True) %}
coalesce(bill_original_amounts.ap_converted_amount, bill_payment_join.converted_amount) as converted_amount,
{% else %}
converted_amount,
{% endif %}
account_id,
cast(null as {{ dbt.type_string() }}) as class_id,
department_id,
Expand All @@ -102,7 +186,35 @@ final as (
cast('debit' as {{ dbt.type_string() }}) as transaction_type,
cast('bill payment' as {{ dbt.type_string() }}) as transaction_source
from bill_payment_join

{% if var('using_exchange_gain_loss', True) %}
left join bill_original_amounts
on bill_original_amounts.bill_payment_id = bill_payment_join.transaction_id
and bill_original_amounts.source_relation = bill_payment_join.source_relation

union all

-- debit/credit to exchange gain or loss account for foreign currency rate difference
select
transaction_id,
source_relation,
index,
transaction_date,
cast(null as {{ dbt.type_string() }}) as customer_id,
vendor_id,
amount,
converted_amount,
account_id,
cast(null as {{ dbt.type_string() }}) as class_id,
department_id,
created_at,
updated_at,
transaction_type,
cast('bill payment' as {{ dbt.type_string() }}) as transaction_source
from gain_loss_join

{% endif %}
)

select *
from final
from final
Loading