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

Fix net_amount duplication in balance sheet report #30

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# dbt_xero v0.4.2
## Bug Fix
- Fixes duplicate data in the `xero__balance_sheet_report` `net_amount` when multiple xero sources are used.

## Contributors
- [@danieltaft](https://github.com/danieltaft)

# dbt_xero v0.4.1
## Features
- Adds the `xero__using_bank_transaction` variable to disable the associated models on instances of Xero that don't include the `bank_transaction` source table. ([#27](https://github.com/fivetran/dbt_xero/pull/27))
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'xero'
version: '0.4.1'
version: '0.4.2'
config-version: 2
require-dbt-version: [">=1.0.0", "<2.0.0"]

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'xero_integration_tests'
version: '0.4.1'
version: '0.4.2'
profile: 'integration_tests'
config-version: 2

Expand Down
4 changes: 3 additions & 1 deletion models/xero__balance_sheet_report.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ with calendar as (
when cast(extract(year from current_date) || '-' || financial_year_end_month || '-' || financial_year_end_day as date) >= current_date
then cast(extract(year from current_date) || '-' || financial_year_end_month || '-' || financial_year_end_day as date)
else cast(extract(year from {{ dbt_utils.dateadd('year', -1, 'current_date') }}) || '-' || financial_year_end_month || '-' || financial_year_end_day as date)
end as current_year_end_date
end as current_year_end_date,
source_relation
from organization

), joined as (
Expand Down Expand Up @@ -54,6 +55,7 @@ with calendar as (
inner join ledger
on calendar.date_month >= cast({{ dbt_utils.date_trunc('month', 'ledger.journal_date') }} as date)
cross join year_end
where year_end.source_relation = ledger.source_relation
{{ dbt_utils.group_by(7) }}

)
Expand Down