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

Added some of the transaction line booleans to allow downstream filtering #114

16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# dbt_netsuite VERSION
[PR #114](https://github.com/fivetran/dbt_netsuite/pull/114) includes the following updates:

## 🎉 Features
- Added the following columns to model `netsuite2__transaction_details`:
- department_id
- entity_id
- is_closed
- is_main_line
- is_tax_line
- item_id
- transaction_number

## Contributors:
- [@FrankTub](https://github.com/FrankTub) ([#114](https://github.com/fivetran/dbt_netsuite/issues/114))

# dbt_netsuite v0.12.0
## 🎁 Official release for Netsuite2! 🎁
[PR #98](https://github.com/fivetran/dbt_netsuite/pull/98) is the official supported release of [dbt_netsuite v0.12.0-b1](https://github.com/fivetran/dbt_netsuite/releases/tag/v0.12.0-b1).
Expand Down
16 changes: 15 additions & 1 deletion models/netsuite2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,18 @@ models:
description: Surrogate key hashed on `transaction_line_id` and `transaction_id`. Adds `to_subsidiary_id` if using subsidiaries and `accounting_book_id` if using multibook accounting.
tests:
- unique
- not_null
- not_null
- name: department_id
description: "{{ doc('department_id') }}"
- name: entity_id
description: "{{ doc('entity_id') }}"
- name: is_closed
description: Boolean indicating if the accounting period is closed.
- name: is_main_line
description: Boolean indicating if the transaction line is a main line entry.
- name: is_tax_line
description: Boolean indicating if the transaction line is a tax line..
- name: item_id
description: "{{ doc('item_id') }}"
- name: transaction_number
description: The Netsuite generated number of the transaction.
7 changes: 7 additions & 0 deletions models/netsuite2/netsuite2__transaction_details.sql
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ transaction_details as (
transaction_lines.transaction_line_id,
transaction_lines.memo as transaction_memo,
not transaction_lines.is_posting as is_transaction_non_posting,
transaction_lines.is_main_line,
transaction_lines.is_tax_line,
transaction_lines.is_closed,
transactions.transaction_id,
transactions.status as transaction_status,
transactions.transaction_date,
transactions.due_date_at as transaction_due_date,
transactions.transaction_type as transaction_type,
transactions.transaction_number,
coalesce(transaction_lines.entity_id, transactions.entity_id) as entity_id,
transactions.is_intercompany_adjustment as is_transaction_intercompany_adjustment

--The below script allows for transactions table pass through columns.
Expand Down Expand Up @@ -136,6 +141,7 @@ transaction_details as (
customers.date_first_order_at as customer_date_first_order,
customers.customer_external_id,
classes.full_name as class_full_name,
transaction_lines.item_id,
items.name as item_name,
items.type_name as item_type_name,
items.sales_description,
Expand All @@ -149,6 +155,7 @@ transaction_details as (
vendors.create_date_at as vendor_create_date,
currencies.name as currency_name,
currencies.symbol as currency_symbol,
transaction_lines.department_id,
departments.name as department_name

--The below script allows for departments table pass through columns.
Expand Down