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

Release/v0.9.0 #86

Merged
merged 44 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
22e40b8
Add invoice discount to invoice_double_entry
SellJamHere Nov 30, 2022
342ba06
Fix indentation in int_quickbooks__invoice_double_entry.sql
SellJamHere Nov 30, 2022
11885d2
Adds department id to general ledger
MarcelloMolinaro Aug 10, 2022
9493d5b
Fix copy/paste problem in README
antoon-r Feb 28, 2023
86aebdc
release/v0.9.0
fivetran-joemarkiewicz Apr 10, 2023
5d9b00a
feature/add-department-id
fivetran-joemarkiewicz Apr 10, 2023
06c29c5
release/v0.8.0
fivetran-joemarkiewicz Apr 10, 2023
f28eda3
Merge pull request #63 from MozartData/MarcelloMolinaro/adds-departme…
fivetran-joemarkiewicz Apr 10, 2023
fa90d3b
Merge branch 'feature/add-department-id' into release/v0.8.0
fivetran-joemarkiewicz Apr 10, 2023
de1b146
Merge pull request #81 from fivetran/release/v0.8.0
fivetran-joemarkiewicz Apr 10, 2023
c347f81
changelog and other updates
fivetran-joemarkiewicz Apr 11, 2023
54863ae
readme edit
fivetran-joemarkiewicz Apr 11, 2023
c98d9f7
Merge pull request #76 from fivetran/antoon-r-fix-typo
fivetran-joemarkiewicz Apr 11, 2023
3eea979
bugfix/invoice-discount-consideration
fivetran-joemarkiewicz Apr 11, 2023
2849f72
release/v0.5.3
fivetran-joemarkiewicz Apr 11, 2023
c0fdd1f
Merge pull request #60 from apt304/main
fivetran-joemarkiewicz Apr 11, 2023
1c4ff4e
Merge branch 'bugfix/invoice-discount-consideration' into release/v0.5.3
fivetran-joemarkiewicz Apr 11, 2023
f54eb8e
Merge pull request #84 from fivetran/release/v0.5.3
fivetran-joemarkiewicz Apr 11, 2023
3c263b2
invoice discount consideration adjustments
fivetran-joemarkiewicz Apr 11, 2023
786ff19
detail type seed addition
fivetran-joemarkiewicz Apr 11, 2023
76813dc
decisionlog addition
fivetran-joemarkiewicz Apr 12, 2023
963cea0
discountlinedetail update
fivetran-joemarkiewicz Apr 12, 2023
b03a2dd
docs regen
fivetran-joemarkiewicz Apr 12, 2023
e8726d9
changelog source ref
fivetran-joemarkiewicz Apr 12, 2023
3d572ef
version bumps in readme
fivetran-joemarkiewicz Apr 12, 2023
c381a99
removing department from partition
fivetran-joemarkiewicz Apr 12, 2023
46efed6
Update CHANGELOG.md
fivetran-joemarkiewicz Apr 19, 2023
fc9c176
Update CHANGELOG.md
fivetran-joemarkiewicz Apr 19, 2023
c4c3b1f
Update CHANGELOG.md
fivetran-joemarkiewicz Apr 19, 2023
ebc3f58
Merge pull request #82 from fivetran/feature/add-department-id
fivetran-joemarkiewicz Apr 19, 2023
7099728
Update packages.yml
fivetran-joemarkiewicz Apr 19, 2023
e2ae1fa
Update CHANGELOG.md
fivetran-joemarkiewicz Apr 20, 2023
4356ffb
Update CHANGELOG.md
fivetran-joemarkiewicz Apr 20, 2023
1128696
review updates
fivetran-joemarkiewicz Apr 20, 2023
ef2c50f
address merge conflicts
fivetran-joemarkiewicz Apr 20, 2023
aadd941
Merge pull request #85 from fivetran/bugfix/invoice-discount-consider…
fivetran-joemarkiewicz Apr 21, 2023
41d8d61
github and readme updates
fivetran-joemarkiewicz Apr 21, 2023
e6aedc7
testing
fivetran-jamie Apr 21, 2023
94d7d79
Merge branch 'release/v0.9.0' into MagicBot/integation-test-webhooks-14
fivetran-joemarkiewicz Apr 27, 2023
b84366c
Merge pull request #87 from fivetran/MagicBot/integation-test-webhook…
fivetran-joemarkiewicz Apr 27, 2023
ea77f47
minor updates prior to release
fivetran-joemarkiewicz Apr 27, 2023
0f87c6e
Update CHANGELOG.md
fivetran-joemarkiewicz May 1, 2023
4fbc6c6
Update packages.yml
fivetran-joemarkiewicz May 2, 2023
bb5941a
Update int_quickbooks__invoice_double_entry.sql
fivetran-joemarkiewicz May 2, 2023
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
2 changes: 2 additions & 0 deletions .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ dbt run --target "$db" --full-refresh
dbt test --target "$db"
dbt run --vars '{using_credit_card_payment_txn: true, using_address: false, using_bill: false, using_credit_memo: false, using_department: false, using_deposit: false, using_estimate: false, using_invoice: false, using_invoice_bundle: false, using_journal_entry: false, using_payment: false, using_refund_receipt: false, using_transfer: false, using_vendor_credit: false, using_sales_receipt: false}' --target "$db" --full-refresh
dbt test --target "$db"

dbt run-operation fivetran_utils.drop_schemas_automation --target "$db"
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🐞 Bug
description: Report a bug or an issue you've found within the dbt package
title: "[Bug] <title>"
labels: ["bug", "triage"]
labels: ["type:bug"]
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🎉 Feature
description: Suggest a new feature for the Fivetran dbt package
title: "[Feature] <title>"
labels: ["enhancement"]
labels: ["type:enhancement"]
body:
- type: markdown
attributes:
Expand Down
51 changes: 51 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## PR Overview
**This PR will address the following Issue/Feature:**

**This PR will result in the following new package version:**
<!--- Please add details around your decision for breaking vs non-breaking version upgrade. If this is a breaking change, were backwards-compatible options explored? -->

**Please detail what change(s) this PR introduces and any additional information that should be known during the review of this PR:**

## PR Checklist
### Basic Validation
Please acknowledge that you have successfully performed the following commands locally:
- [ ] dbt compile
- [ ] dbt run –full-refresh
- [ ] dbt run
- [ ] dbt test
- [ ] dbt run –vars (if applicable)

Before marking this PR as "ready for review" the following have been applied:
- [ ] The appropriate issue has been linked and tagged
- [ ] You are assigned to the corresponding issue and this PR
- [ ] BuildKite integration tests are passing

### Detailed Validation
Please acknowledge that the following validation checks have been performed prior to marking this PR as "ready for review":
- [ ] You have validated these changes and assure this PR will address the respective Issue/Feature.
- [ ] You are reasonably confident these changes will not impact any other components of this package or any dependent packages.
- [ ] You have provided details below around the validation steps performed to gain confidence in these changes.
<!--- Provide the steps you took to validate your changes below. -->

### Standard Updates
Please acknowledge that your PR contains the following standard updates:
- Package versioning has been appropriately indexed in the following locations:
- [ ] indexed within dbt_project.yml
- [ ] indexed within integration_tests/dbt_project.yml
- [ ] CHANGELOG has individual entries for each respective change in this PR
<!--- If there is a parallel upstream change, remember to reference the corresponding CHANGELOG as an individual entry. -->
- [ ] README updates have been applied (if applicable)
<!--- Remember to check the following README locations for common updates. →
<!--- Suggested install range (needed for breaking changes) →
<!--- Dependency matrix is appropriately updated (if applicable) →
<!--- New variable documentation (if applicable) -->
- [ ] DECISIONLOG updates have been updated (if applicable)
- [ ] Appropriate yml documentation has been added (if applicable)

### dbt Docs
Please acknowledge that after the above were all completed the below were applied to your branch:
- [ ] docs were regenerated (unless this PR does not include any code or yml updates)

### If you had to summarize this PR in an emoji, which would it be?
<!--- For a complete list of markdown compatible emojis check our this git repo (https://gist.github.com/rxaviers/7360908) -->
:dancer:
51 changes: 16 additions & 35 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,33 @@
**Are you a current Fivetran customer?**
<!--- Please tell us your name, title and company -->
**Please provide your name and company**

**What change(s) does this PR introduce?**
<!--- Describe what changes your PR introduces to the package and how to leverage this new feature. -->
**Link the issue/feature request which this PR is meant to address**
<!--- If an issue was not created, please create one first so we may discuss the PR prior to opening one. -->

**Did you update the CHANGELOG?**
**Detail what changes this PR introduces and how this addresses the issue/feature request linked above.**

**How did you validate the changes introduced within this PR?**

**Which warehouse did you use to develop these changes?**

**Did you update the CHANGELOG?**
<!--- Please update the new package version’s CHANGELOG entry detailing the changes included in this PR. -->
<!--- To select a checkbox you simply need to add an "x" with no spaces between the brackets (eg. [x] Yes). -->
- [ ] Yes

**Does this PR introduce a breaking change?**
<!--- Does this PR introduce changes that will cause current package users' jobs to fail or require a `--full-refresh`? -->
<!--- To select a checkbox you simply need to add an "x" with no spaces between the brackets (eg. [x] Yes). -->
- [ ] Yes (please provide breaking change details below.)
- [ ] No (please provide an explanation as to how the change is non-breaking below.)

**Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)**
**Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)**
<!--- The dbt_project.yml and the integration_tests/dbt_project.yml files contain the version number. Be sure to upgrade it accordingly -->
<!--- To select a checkbox you simply need to add an "x" with no spaces between the brackets (eg. [x] Yes). -->
- [ ] Yes

**Is this PR in response to a previously created Bug or Feature Request**
<!--- If an Issue was created it is helpful to track the progress by linking it in the PR. -->
<!--- To select a checkbox you simply need to add an "x" with no spaces between the brackets (eg. [x] Yes). -->
- [ ] Yes, Issue/Feature [link bug/feature number here]
- [ ] No

**How did you test the PR changes?**
<!--- Proof of testing is required in order for the PR to be approved. -->
<!--- To check a box, remove the space and insert an x in the box (eg. [x] BuildKite). -->
<!--- To select a checkbox you simply need to add an "x" with no spaces between the brackets (eg. [x] Yes). -->
- [ ] BuildKite <!--- BuildKite testing is only applicable to Fivetran employees. -->
- [ ] Local (please provide additional testing details below)

**Select which warehouse(s) were used to test the PR**
<!--- To check a warehouse remove the space and insert an x in the box (eg. [x] Bigquery). -->
<!--- To select a checkbox you simply need to add an "x" with no spaces between the brackets (eg. [x] Yes). -->
- [ ] BigQuery
- [ ] Redshift
- [ ] Snowflake
- [ ] Postgres
- [ ] Databricks
- [ ] Other (provide details below)

**Provide an emoji that best describes your current mood**
<!--- For a complete list of markdown compatible emojis check our this git repo (https://gist.github.com/rxaviers/7360908) -->
:dancer:

**Feedback**

We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next.

**PR Template**
- [Community Pull Request Template](?expand=1&template=pull_request_template.md) (default)

- [Maintainer Pull Request Template](?expand=1&template=maintainer_pull_request_template.md) (to be used by maintainers)
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
# dbt_quickbooks v0.9.0
## Bug Fixes
- Added logic to the `int_quickbooks__invoice_double_entry` model to account for invoice discounts as they should be treated as contra revenue accounts that behavior differently from normal sale item detail invoice line items. ([#85](https://github.com/fivetran/dbt_quickbooks/pull/85))
- Updated the `cash_beginning_period` and `cash_net_period` values to coalesce to 0 in the `quickbooks__cash_flow_statement` in order to ensure every row has a value, especially the first row in the sequence since it will always be null. ([#88](https://github.com/fivetran/dbt_quickbooks/issues/88))

## Additional Features
- Added `department_id` to the `quickbooks__general_ledger` and the upstream tables required for that change. ([#63](https://github.com/fivetran/dbt_quickbooks/pull/63))
- Please note that this field was not added to the downstream `quickbooks__general_ledger_by_period`, `quickbooks__balance_sheet`, `quickbooks__profit_and_loss`, or `quickbooks__cash_flow_statement` models as this would require the grain of these models to be adjusted for the `department_id`. This would likely cause more confusion in the initial output. As such, the field was omitted in the aggregate models to ensure consistency of these models. If you wish this to be included, please open a [Feature Request](https://github.com/fivetran/dbt_quickbooks/issues/new?assignees=&labels=enhancement&template=feature-request.yml&title=%5BFeature%5D+%3Ctitle%3E) to let us know!

## Documentation
- Included documentation [within the DECISIONLOG](https://github.com/fivetran/dbt_quickbooks/blob/main/DECISIONLOG.md) centered around the behavior of how invoice discounts are handled within the `int_quickbooks__invoice_double_entry` model. ([#85](https://github.com/fivetran/dbt_quickbooks/pull/85))

## Under the Hood
- Leveraged the new `detail_type` field to ensure better accuracy when identifying invoice lines that should be accounted for in the general ledger calculations. ([#85](https://github.com/fivetran/dbt_quickbooks/pull/85))
- Incorporated the new `fivetran_utils.drop_schemas_automation` macro into the end of each Buildkite integration test job. ([#87](https://github.com/fivetran/dbt_quickbooks/pull/87))
- Updated the pull request [templates](/.github). ([#87](https://github.com/fivetran/dbt_quickbooks/pull/87))

## Complimentary Release Notes
- See the source package [CHANGELOG](https://github.com/fivetran/dbt_quickbooks_source/blob/main/CHANGELOG.md#dbt_quickbooks_source-v080) for updates made to the staging layer in `dbt_quickbooks_source v0.8.0`.

## Contributors
- [@MarcelloMolinaro](https://github.com/MarcelloMolinaro) ([#63](https://github.com/fivetran/dbt_quickbooks/pull/63))
- [@SellJamHere](https://github.com/SellJamHere) ([#60](https://github.com/fivetran/dbt_quickbooks/pull/60))
- [@caffeinebounce](https://github.com/caffeinebounce) ([#88](https://github.com/fivetran/dbt_quickbooks/issues/88))

# dbt_quickbooks v0.8.1

## 🐛 Bug Fixes 🔨
- Adding partitions by `class_id` in appropriate models to ensure correct account amount aggregations in `quickbooks__general_ledger`, `quickbooks__general_ledger_by_period`, `quickbooks__balance_sheet`, and `quickbooks__profit_and_loss` models. ([#77](https://github.com/fivetran/dbt_quickbooks/pull/77))
- Modifying join in `int_quickbooks__general_ledger_balances` to account for null `class_id` values and bring in the correct non-zero balances. ([#77](https://github.com/fivetran/dbt_quickbooks/pull/77))


# dbt_quickbooks v0.8.0
## 🚨 Breaking Changes 🚨
- Replacing `account_name` with `account_id` as input for the `generate_surrogate_key` function to fix `unique_id` uniqueness issues in the `quickbooks__general_ledger` model. A full refresh is recommended for accurate and consistent surrogate keys. ([#73](https://github.com/fivetran/dbt_quickbooks/pull/73))
Expand Down Expand Up @@ -65,6 +92,7 @@
- Addition of the `credit_card_payment_txn` (enabled/disabled using the `using_credit_card_payment_txn` variable) source as well as the accompanying staging and intermediate models. This source includes all credit card payment transactions and will be used in downstream General Ledger generation to ensure accurate reporting of all transaction types. ([#61](https://github.com/fivetran/dbt_quickbooks/pull/61))
>**Note**: the `credit_card_payment_txn` source and models are disabled by default. In order to enable them, you will want to set the `using_credit_card_payment_txn` variable to `true` in your dbt_project.yml.

## Contributors
- [@mikerenderco](https://github.com/mikerenderco) ([#50](https://github.com/fivetran/dbt_quickbooks/pull/50), [#47](https://github.com/fivetran/dbt_quickbooks/issues/47))
- [@mel-restori](https://github.com/mel-restori) ([#54](https://github.com/fivetran/dbt_quickbooks/pull/54), [#47](https://github.com/fivetran/dbt_quickbooks/issues/47))
Expand Down
23 changes: 23 additions & 0 deletions DECISIONLOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
# Decision Log
## Invoice Discounts Logic
The `int_quickbooks__invoice_double_entry` model has some unique logic to account for invoice discounts at the invoice line item level. These `DiscountLineDetail` invoice line detail types are handled differently from the normal `SalesItemLineDetail` lines. In the QuickBooks data for invoice lines these entries will not show up as a negative amount, but will instead be shown as a positive value that is to be discounted from the subtotal. As such, we do not want to add these discount lines to the total invoice cost. However, we still want to recognize them in the downstream general ledger models as they are contra revenue accounts that reduce the revenue accounts. Therefore, we need to take a different approach to debit and credit these discounts accordingly.

In particular, to handle these discounts we apply a debit to the `discount_account_id` (provided in the invoice line record) and a credit to the Accounts Receivable account. This is inherently different from the other behaviors of the invoice double entry model and it is handled accordingly with appropriate case when statements within the final cte.

As an example, if we have the following invoice with the relevant line items:
| **invoice_id** | **index** | **amount** | **detail_type** | **account_id** | **discount_account_id** |
| ------------------ | ----------------- | ----------------- | ----------------- | ----------------- | ----------------- |
| 1111 | 0 | 80000 | SalesItemLineDetail | 55 | |
| 1111 | 1 | 32000 | SalesItemLineDetail | 55 | |
| 1111 | 2 | 112000 | SubTotalLineDetail | | |
| 1111 | 3 | 14000 | DiscountLineDetail | | 44 |

The corresponding entry that would result from the `int_quickbooks__invoice_double_entry` model would look like the following:

| **account_id** | **account_name** | **debit** | **credit** |
| ------------------ | ----------------- | ----------------- | ----------------- |
| 1 | accounts receivable | 32000 | |
| 1 | accounts receivable | 80000 | |
| 44 | discount account | 14000 | |
| 1 | accounts receivable | | 14000 |
| 55 | cash account | | 80000 |
| 55 | other cash account | | 32000 |

## QuickBooks Cash Flow Type Logic
- In the `int_quickbooks__cash_flow_classifications` model, our default behavior is to classify the `cash_flow_type` based on the `account_type`, `account_class` or `account_name` fields of the balance sheet line. This logic was based on best available financial practices, with the cash flow being calculated using the indirect method rather than the direct method. Cash flow types usually fall into one of four buckets:
Expand Down
Loading