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

schema, docs, and invoice cast updates #9

Merged
merged 2 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ vars:
quickbooks_schema: your_schema_name
```

### Changing the Build Schema
By default this package will build the QuickBooks staging models within a schema titled (<target_schema> + `_quickbooks_staging`) in your target database. If this is not where you would like you QuickBooks staging data to be written to, add the following configuration to your `dbt_project.yml` file:

```yml
# dbt_project.yml

...
models:
quickbooks_source:
+schema: my_new_schema_name
```
### Disabling models

This package takes into consideration that not every QuickBooks account utilizes the same transactional tables, and allows you to disable the corresponding functionality. By default, most variables' values are assumed to be `true` (with exception of purchase orders). Add variables for only the tables you want to disable or enable respectively:
Expand All @@ -45,7 +56,7 @@ This package takes into consideration that not every QuickBooks account utilizes
...
vars:
quickbooks_source:
using_bill: false #disable if you don't have bils or bill payments in QuickBooks
using_bill: false #disable if you don't have bills or bill payments in QuickBooks
using_credit_memo: false #disable if you don't have credit memos in QuickBooks
using_department: false #disable if you don't have departments in QuickBooks
using_deposit: false #disable if you don't have deposits in QuickBooks
Expand Down
3 changes: 2 additions & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
config-version: 2

name: 'quickbooks_source'
version: '0.1.2'
version: '0.2.0'

require-dbt-version: [">=0.18.0", "<0.20.0"]

models:
quickbooks_source:
+schema: quickbooks_staging
materialized: table
tmp:
materialized: view
Expand Down
1 change: 1 addition & 0 deletions docs/catalog.json

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions docs/index.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/manifest.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/run_results.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'quickbooks_source_integration_tests'
version: '0.1.2'
version: '0.2.0'
profile: 'integration_tests'
config-version: 2

Expand All @@ -11,6 +11,7 @@ models:

vars:
quickbooks_source:
using_purchase_order: True
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As the purchase order models are false by default, I decided to set the variable as true within the integration tests so the docs would still contain these models once we deploy to github pages.

account: "{{ ref('account_data') }}"
address: "{{ ref('address_data') }}"
bill_line: "{{ ref('bill_line_data') }}"
Expand Down
2 changes: 1 addition & 1 deletion models/stg_quickbooks__invoice.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final as (
total_amount,
currency_id,
department_id,
deposit_to_account_id,
cast(deposit_to_account_id as {{ dbt_utils.type_int() }}) as deposit_to_account_id,
exchange_rate,
transaction_date,
customer_id,
Expand Down