Skip to content

Commit

Permalink
Pre release for multicurrency variable config
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-avinash committed Feb 13, 2025
1 parent 83f0939 commit 22b036c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .buildkite/scripts/run_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ dbt deps
dbt seed --target "$db" --full-refresh
dbt run --target "$db" --full-refresh
dbt test --target "$db"
dbt run --vars '{zuora__using_credit_balance_adjustment: false, zuora__using_taxation_item: false, zuora__using_refund: false, zuora__using_refund_invoice_payment: false}' --target "$db"
dbt test --target '{zuora__using_credit_balance_adjustment: false, zuora__using_taxation_item: false, zuora__using_refund: false, zuora__using_refund_invoice_payment: false}' --target "$db"
dbt run --vars '{zuora__using_credit_balance_adjustment: false, zuora__using_taxation_item: false, zuora__using_refund: false, zuora__using_refund_invoice_payment: false}' --target "$db" --full-refresh
dbt test --target "$db"

dbt run-operation fivetran_utils.drop_schemas_automation --target "$db"

13 changes: 7 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# dbt_zuora v0.3.2-a2
This pre-release introduces the following updates.

## Bug Fixes
- Modified the variable logic in `zuora__using_multicurrency` in these models so that the `*_amount` values are called by default rather than `*_amount_home_currency` when the variable isn't configured:
- `int_zuora__transaction_grouped`
- `zuora__line_item_history`
- `zuora__monthly_recurring_revenue`
- Single currency is now the proper default and multicurrency customers must leverage the variable to enable that functionality. ([#21](https://github.com/fivetran/dbt_zuora/pull/21))
## Bug Fixes
- Flipped the variable logic in `zuora__using_multicurrency` in these models so that the `*_amount` values are called by default rather than `*_amount_home_currency` when the variable isn't set: ([#21](https://github.com/fivetran/dbt_zuora/pull/21))
- `zuora__line_item_history`: For setting the `gross_revenue` and `discount_revenue` values (these values are then used to calculate `net_revenue`).
- `zuora__monthly_recurring_revenue`: For setting the `mrr_expected_current_month` value.
- `int_zuora__transaction_grouped`: For setting daily amount values for invoices, discounts, taxes and credit balance adjustments to flow downsteram into the `zuora__account_daily_overview` model.
- Multicurrency customers must set the `zuora__using_multicurrency` variable to `true` to enable that functionality. ([#21](https://github.com/fivetran/dbt_zuora/pull/21))

## Under the Hood
- Created consistency test within `integration_tests` for the `zuora__monthly_recurring_revenue` model. ([#21](https://github.com/fivetran/dbt_zuora/pull/21))
- Updated `run_models.sh` to remove duplicative Buildkite script.

# dbt_zuora v0.3.2-a1
This pre-release introduces the following updates.
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

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 integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ vars:
# Uncomment when regenerating docs
# zuora__standardized_billing_model_enabled: true

zuora_schema: zz_dbt_avinash
zuora_schema: zuora_integration_tests_2
zuora_source:
zuora_account_identifier: "zuora_account_data"
zuora_amendment_identifier: "zuora_amendment_data"
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/int_zuora__transactions_grouped.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ transactions_grouped as (
sum(invoice_items) as daily_invoice_items,

{% for col in sum_cols %}
{% if not var('zuora__using_multicurrency', true) %}
{% if var('zuora__using_multicurrency', false) %}
sum({{ col }}_home_currency) as daily_{{ col }},
{% else %}
sum({{ col }}) as daily_{{ col }},
Expand Down
2 changes: 1 addition & 1 deletion models/zuora__line_item_history.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ invoice_revenue_items as (

select
invoice_item_id,
{% if not var('zuora__using_multicurrency', true) %}
{% if var('zuora__using_multicurrency', false) %}
charge_amount_home_currency as gross_revenue,
case when cast(processing_type as {{ dbt.type_string() }})= '1'
then charge_amount_home_currency else 0 end as discount_revenue
Expand Down
2 changes: 1 addition & 1 deletion models/zuora__monthly_recurring_revenue.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mrr_by_account as (
coalesce(month_spine.account_id, line_items.account_id) as account_id,
coalesce(month_spine.account_month, line_items.service_start_month) as account_month,

{% if not var('zuora__using_multicurrency', true) %}
{% if var('zuora__using_multicurrency', false) %}
sum(case when charge_mrr_home_currency is null then 0 else charge_mrr_home_currency end) as mrr_expected_current_month,
{% else %}
sum(case when charge_mrr is null then 0 else charge_mrr end) as mrr_expected_current_month,
Expand Down

0 comments on commit 22b036c

Please sign in to comment.