Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] New variables to configure account type value filters #98

Merged
merged 12 commits into from
Aug 7, 2023
Merged
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# dbt_quickbooks v0.11.1
[PR #98](https://github.com/fivetran/dbt_quickbooks/pull/98) includes the following updates:

## 🎉 Feature Update 🎉
- Updated intermediate double entry models that have `account_type` and `account_sub_type` filters with configurable variables, since the type names used in the filter can be adjusted internally by QuickBooks customers. The intermediate models where these variables were introduced included:

## 🐛 Bug Fixes 🩹
| **Updated model** | **New variables to filter on** |
| ----------| -------------------- |
| [int_quickbooks__bill_payment_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__bill_payment_double_entry) | `quickbooks__accounts_payable_reference` |
| [int_quickbooks__credit_memo_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__credit_memo_double_entry) | `quickbooks__accounts_receivable_reference` |
| [int_quickbooks__deposit_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__deposit_double_entry) | `quickbooks__undeposited_funds_reference` |
| [int_quickbooks__invoice_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__invoice_double_entry) | `quickbooks__sales_of_product_income_reference`, `quickbooks__accounts_receivable_reference` |
| [int_quickbooks__payment_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__payment_double_entry) | `quickbooks__accounts_receivable_reference` |
Copy link
Contributor

Choose a reason for hiding this comment

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

I would actually consider the new variables as the feature and then what how they may be configured as the bugfix. See my suggestion below.

Suggested change
## 🎉 Feature Update 🎉
- Updated intermediate double entry models that have `account_type` and `account_sub_type` filters with configurable variables, since the type names used in the filter can be adjusted internally by QuickBooks customers. The intermediate models where these variables were introduced included:
## 🐛 Bug Fixes 🩹
| **Updated model** | **New variables to filter on** |
| ----------| -------------------- |
| [int_quickbooks__bill_payment_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__bill_payment_double_entry) | `quickbooks__accounts_payable_reference` |
| [int_quickbooks__credit_memo_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__credit_memo_double_entry) | `quickbooks__accounts_receivable_reference` |
| [int_quickbooks__deposit_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__deposit_double_entry) | `quickbooks__undeposited_funds_reference` |
| [int_quickbooks__invoice_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__invoice_double_entry) | `quickbooks__sales_of_product_income_reference`, `quickbooks__accounts_receivable_reference` |
| [int_quickbooks__payment_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__payment_double_entry) | `quickbooks__accounts_receivable_reference` |
## 🐛 Bug Fixes 🩹
- Updated intermediate double entry models that have `account_type` and `account_sub_type` filters with configurable variables, since the type names used in the filter may be different than the defaults for QuickBooks customers.
## 🎉 Feature Updates 🎉
- The variables to define the `account_type` and `account_sub_type` references were introduced in the following intermediate models:
| **Updated model** | **New variables to filter on** |
| ----------| -------------------- |
| [int_quickbooks__bill_payment_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__bill_payment_double_entry) | `quickbooks__accounts_payable_reference` |
| [int_quickbooks__credit_memo_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__credit_memo_double_entry) | `quickbooks__accounts_receivable_reference` |
| [int_quickbooks__deposit_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__deposit_double_entry) | `quickbooks__undeposited_funds_reference` |
| [int_quickbooks__invoice_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__invoice_double_entry) | `quickbooks__sales_of_product_income_reference`, `quickbooks__accounts_receivable_reference` |
| [int_quickbooks__payment_double_entry](https://fivetran.github.io/dbt_quickbooks/#!/model/model.quickbooks.int_quickbooks__payment_double_entry) | `quickbooks__accounts_receivable_reference` |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was fixed.


## Documentation
- Updated README with additional steps for configuration. This is an optional step since most customers will rely on the default account type/subtype values available.
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved

# dbt_quickbooks v0.11.0
## 🚨 Breaking Changes 🚨
[PR #95](https://github.com/fivetran/dbt_quickbooks/pull/95) includes the following updates:
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ vars:
quickbooks_union_databases: ['quickbooks_usa','quickbooks_canada'] # use this if the data is in different databases/projects but uses the same schema name
```

### Configuring Account Type Names
Within a few of the double entry models in this package a mapping takes place to assign certain transaction type's debits/credits to the appropriate offset account (ie. Accounts Payable, Accounts Receivable, Undeposited Funds, and SalesOfProductIncome) reference. While our current filtered logic within our intermediate models account for the default values, it's possible your use case relies on different account types to reference.

If you have a different value to reference for each type, you will need to configure the `account_type` and `account_sub_type` variables that account for these variables in your `dbt_project.yml`.

```yml
vars:
quickbooks__accounts_payable_reference: accounts_payable_value # 'Accounts Payable' is the default filter set for the account_type reference.
quickbooks__accounts_receivable_reference: account_receivable_value # 'Accounts Receivable' is the default filter set for the account_type reference.
quickbooks__undeposited_funds_reference: account_undeposited_funds_value # 'UndepositedFunds' is the default filter set for the account_subtype reference.
quickbooks__sales_of_product_income_reference: account_sales_of_product_income_value # 'SalesOfProductIncome' is the default filter set for the account_subtype reference.
```

### 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
2 changes: 1 addition & 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: '0.11.0'
version: '0.11.1'

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

Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion integration_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
target/
dbt_modules/
dbt_packages/
logs/
logs/
env/
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'quickbooks_integration_tests'

version: '0.11.0'
version: '0.11.1'

profile: 'integration_tests'
config-version: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ ap_accounts as (
source_relation
from accounts

where account_type = 'Accounts Payable'
where account_type = '{{ var('quickbooks__accounts_payable_reference', 'Accounts Payable') }}'
and is_active
and not is_sub_account
),

bill_payment_join as (

select
bill_payments.bill_payment_id as transaction_id,
bill_payments.source_relation,
Expand All @@ -51,7 +52,6 @@ bill_payment_join as (

inner join ap_accounts
on ap_accounts.source_relation = bill_payments.source_relation

),

final as (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ df_accounts as (
source_relation
from accounts

where account_type = 'Accounts Receivable'
where account_type = '{{ var('quickbooks__accounts_receivable_reference', 'Accounts Receivable') }}'
and is_active
and not is_sub_account
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ uf_accounts as (
source_relation
from accounts

where account_sub_type = 'UndepositedFunds'
where account_sub_type = '{{ var('quickbooks__undeposited_funds_reference', 'UndepositedFunds') }}'
and is_active
and not is_sub_account
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ income_accounts as (
select *
from accounts

where account_sub_type = 'SalesOfProductIncome'
where account_sub_type = '{{ var('quickbooks__sales_of_product_income_reference', 'SalesOfProductIncome') }}'
),

bundle_income_accounts as (
Expand Down Expand Up @@ -90,7 +90,7 @@ ar_accounts as (
source_relation
from accounts

where account_type = 'Accounts Receivable'
where account_type = '{{ var('quickbooks__accounts_receivable_reference', 'Accounts Receivable') }}'
),

invoice_join as (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ar_accounts as (
source_relation
from accounts

where account_type = 'Accounts Receivable'
where account_type = '{{ var('quickbooks__accounts_receivable_reference', 'Accounts Receivable') }}'
and is_active
and not is_sub_account
),
Expand Down