Skip to content
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
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# dbt_netsuite v1.2.0

[PR #185](https://github.com/fivetran/dbt_netsuite/pull/185) includes the following updates:

## Schema/Data Change (--full-refresh required after upgrading)
**1 total change • 1 possible breaking change**

| Data Model(s) | Change type | Old | New | Notes |
| ------------- | ----------- | --- | --- | ----- |
| [netsuite2__transaction_details](https://fivetran.github.io/dbt_netsuite/#!/model/model.netsuite.netsuite2__transaction_details) | New columns | | `converted_amount_raw`<br>`transaction_amount_raw`<br>`transaction_line_amount_raw` | Adds raw amount fields without sign adjustments, providing access to original amounts as recorded in the source system. These fields complement the existing sign-adjusted amount fields.<br><br>**Breaking change**: If you already include `amount` or `netamount` from `transaction_lines` via the [passthrough columns](https://github.com/fivetran/dbt_netsuite/blob/main/README.md#passing-through-additional-fields) variable `transaction_lines_pass_through_columns`, remove them from the list to avoid duplicate column errors.<br><br>A full refresh is required after upgrading because the incremental model schema needs to be reset to accommodate the new columns. |

## Documentation
- Enhanced documentation for amount fields in `netsuite2__transaction_details` and `netsuite__transaction_details` to clarify that the sign is flipped for income and other income accounts to follow accounting conventions. All other accounts retain their original sign.

# dbt_netsuite v1.1.0

## Schema/Data Change
Expand Down Expand Up @@ -164,7 +178,7 @@ This release involves **breaking changes** and will require running a **full ref
- `subsidiary_currency_symbol`
> This change **will require running a full refresh**, as we are adding new fields to incrementally materialized models.

## Contribtors
## Contributors
- [@jmongerlyra](https://github.com/jmongerlyra) ([PR #151](https://github.com/fivetran/dbt_netsuite/pull/151))

# dbt_netsuite v0.16.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Include the following netsuite package version in your `packages.yml` file:
```yaml
packages:
- package: fivetran/netsuite
version: [">=1.1.0", "<1.2.0"]
version: [">=1.2.0", "<1.3.0"]
```
### Step 3: Define Netsuite.com or Netsuite2 Source
As of April 2022 Fivetran released a new Netsuite connector version which leverages the Netsuite2 endpoint opposed to the original Netsuite.com endpoint. This package is designed to run for either or, not both. By default the `netsuite_data_model` variable for this package is set to the original `netsuite` value which runs the netsuite.com version of the package. If you would like to run the package on Netsuite2 data, you may adjust the `netsuite_data_model` variable to run the `netsuite2` version of the package.
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config-version: 2
name: 'netsuite'
version: '1.1.0'
version: '1.2.0'
require-dbt-version: [">=1.3.0", "<2.0.0"]

models:
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.

10 changes: 5 additions & 5 deletions integration_tests/ci/sample.profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ integration_tests:
pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
port: 5439
schema: netsuite_integration_tests_9
schema: netsuite_integrations_tests
threads: 8
bigquery:
type: bigquery
method: service-account-json
project: 'dbt-package-testing'
schema: netsuite_integration_tests_9
schema: netsuite_integrations_tests
threads: 8
keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
snowflake:
Expand All @@ -29,7 +29,7 @@ integration_tests:
role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
schema: netsuite_integration_tests_9
schema: netsuite_integrations_tests
threads: 8
postgres:
type: postgres
Expand All @@ -38,13 +38,13 @@ integration_tests:
pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
port: 5432
schema: netsuite_integration_tests_9
schema: netsuite_integrations_tests
threads: 8
databricks:
catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
schema: netsuite_integration_tests_9
schema: netsuite_integrations_tests
threads: 8
token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
type: databricks
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'netsuite_integration_tests'
version: '1.1.0'
version: '1.2.0'
profile: 'integration_tests'
config-version: 2

Expand All @@ -8,7 +8,7 @@ models:
# +schema: "netsuite_{{ var('directed_schema','dev') }}" ## To be used for validation tests

vars:
netsuite_schema: netsuite_integration_tests_9
netsuite_schema: netsuite_integrations_tests
netsuite_data_model_override: netsuite

# Enable below when generating docs
Expand Down
4 changes: 2 additions & 2 deletions models/netsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,6 @@ models:
- name: subsidiary_name
description: Name of the subsidiary.
- name: converted_amount
description: Transaction amount, converted into the primary subsidiary's default currency.
description: Transaction amount, converted into the primary subsidiary's default currency. The sign is flipped for income and other income accounts to follow accounting conventions. All other accounts retain their original sign.
- name: transaction_amount
description: Total amount of the transaction line.
description: Total amount of the transaction line. The sign is flipped for income and other income accounts to follow accounting conventions. All other accounts retain their original sign.
12 changes: 9 additions & 3 deletions models/netsuite2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,17 @@ models:
- name: subsidiary_currency_symbol
description: Currency of the subsidiary.
- name: converted_amount
description: Transaction amount, converted into the primary subsidiary's default currency.
description: Transaction amount, converted into the primary subsidiary's default currency. The sign is flipped for income and other income accounts to follow accounting conventions. All other accounts retain their original sign.
- name: transaction_amount
description: Total amount of the transaction line.
description: Total amount of the transaction line. The sign is flipped for income and other income accounts to follow accounting conventions. All other accounts retain their original sign.
- name: transaction_line_amount
description: Net amount of the transaction line. This is the actual amount entered when it's in a currency other than the functional currency of the subsidiary.
description: Net amount of the transaction line. This is the actual amount entered when it's in a currency other than the functional currency of the subsidiary. The sign is flipped for income and other income accounts to follow accounting conventions. All other accounts retain their original sign.
- name: converted_amount_raw
description: Original converted transaction amount, without sign adjustments. Represents the amount exactly as recorded in the source system.
- name: transaction_amount_raw
description: Original transaction line amount, without sign adjustments. Reflects the raw amount entered in the source system.
- name: transaction_line_amount_raw
description: Original net amount of the transaction line, without sign adjustments. Matches the amount entered in the transaction currency.
- name: accounting_book_id
description: The unique identifier of the accounting book.
- name: accounting_book_name
Expand Down
6 changes: 5 additions & 1 deletion models/netsuite2/netsuite2__transaction_details.sql
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ transaction_details as (
case
when lower(accounts.account_type_id) in ('income', 'othincome') then -transaction_lines.netamount
else transaction_lines.netamount
end as transaction_line_amount
end as transaction_line_amount,

transactions_with_converted_amounts.converted_amount_using_transaction_accounting_period as converted_amount_raw,
transaction_lines.amount as transaction_amount_raw,
transaction_lines.netamount as transaction_line_amount_raw
from transaction_lines

join transactions
Expand Down