Skip to content

Commit 4c789c4

Browse files
authored
Merge pull request #11 from swishbi/dev
Dev
2 parents af1caeb + 44a79cc commit 4c789c4

7 files changed

+59
-2
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# dbt_netsuite_source v0.3.0
2+
3+
## 🚨 Breaking Changes 🚨:
4+
[PR #11](https://github.com/swishbi/dbt_netsuite_source/pull/11) includes the following breaking changes:
5+
- Re-introduces `quantity`, `rateamount`, and `voided` columns to `stg_netsuite__transaction_lines` model. If these have been added as pass through they will need to be removed from the pass through variable.
6+
7+
## 🎉 Feature Updates 🎉
8+
[PR #11](https://github.com/swishbi/dbt_netsuite_source/pull/11) includes the following feature updates:
9+
- Incorporates `isinventoryaffecting` and `accountinglinetype` to the `stg_netsuite__transaction_lines` model as a feature via the `netsuite__inventory_management_enabled` variable.
10+
- Incorporates `bins` and `inventoryassignment` staging models as a feature via the `netsuite__advanced_inventory_management_enabled` variable.
11+
12+
## Contributors
13+
- [phillem15](https://github.com/phillem15) ([#11](https://github.com/swishbi/dbt_netsuite_source/pull/11))
14+
115
# dbt_netsuite_source v0.2.3
216

317
## 🚨 Breaking Changes 🚨:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ It's possible that your Netsuite connector does not sync every table that this p
9797
vars:
9898
netsuite_source:
9999
netsuite__advanced_billing_enabled: true # Enable `billingschedulemilestone`, `billingscheduletype`, and `billingschedule` if you are using the Advanced Billing featre
100+
netsuite__advanced_invnetory_management_enabled: true # Enable `bins` and `inventoryassignment`` if you are using Advanced Inventory management features.
100101
netsuite__advanced_jobs_enabled: true # Enable `jobresources`, `projecttask` and `projecttaskassigneee` if you are using the Advanced Jobs feature
101102
netsuite__advanced_revenue_management_enabled: true # Enable `billingrevenueevent`, `billingschedulerecurrence`, `revenueelement`, `revenueplanplannedcost`, `revenueplanplannedrevenue`, `revenueplanstatus`, revenueplantype`, and `revenueplan` if you are using the Advanced Revenue Management feature
103+
netsuite__inventory_management_enabled: true # Enable the necessary fields in `transactionline` to calculate inventory balances.
102104
netsuite__multibook_accounting_enabled: true # Enable `accountingbooksubsidiary` and `accountingbook` if you are using the Multi-Book Accounting feature
103105
netsuite__multiple_budgets_enabled: true # Enable `budgetcategory` if you are using the Multiple Budgets feature
104106
netsuite__multiple_calendars_enabled: true # Enable `accountingperiodfiscalcalendar` if you are using the Multiple Calendars feature

dbt_project.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
config-version: 2
22
require-dbt-version: [">=1.3.0", "<2.0.0"]
33
name: 'netsuite_source'
4-
version: '0.2.3'
4+
version: '0.3.0'
55

66
models:
77
netsuite_source:
@@ -21,6 +21,7 @@ vars:
2121
netsuite_billing_schedule_recurrences: "{{ source('netsuite', 'billing_schedule_recurrences') }}"
2222
netsuite_billing_schedule_types: "{{ source('netsuite', 'billing_schedule_types') }}"
2323
netsuite_billing_schedules: "{{ source('netsuite', 'billing_schedules') }}"
24+
netsuite_bins: "{{ source('netsuite', 'bins') }}"
2425
netsuite_budget_categories: "{{ source('netsuite', 'budget_categories') }}"
2526
netsuite_budgets_machine: "{{ source('netsuite', 'budgets_machine') }}"
2627
netsuite_budgets: "{{ source('netsuite', 'budgets') }}"
@@ -37,6 +38,7 @@ vars:
3738
netsuite_employees: "{{ source('netsuite', 'employees') }}"
3839
netsuite_entities: "{{ source('netsuite', 'entity') }}"
3940
netsuite_entity_address: "{{ source('netsuite', 'entity_address') }}"
41+
netsuite_inventory_assignments: "{{ source('netsuite', 'inventory_assignments') }}"
4042
netsuite_item_subtypes: "{{ source('netsuite', 'item_subtypes') }}"
4143
netsuite_item_types: "{{ source('netsuite', 'item_types') }}"
4244
netsuite_items: "{{ source('netsuite', 'item') }}"

models/stg_netsuite__bins.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{ config(enabled=(var('netsuite__advanced_inventory_management_enabled', false))) }}
2+
3+
with source as (
4+
select * from {{ var('netsuite_bins') }}
5+
),
6+
renamed as (
7+
select
8+
id as bin_id,
9+
binnumber as bin_number,
10+
location as location_id,
11+
isinactive = "T" as is_inactive,
12+
lastmodifieddate as last_modified_date
13+
14+
from source
15+
)
16+
select * from renamed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{ config(enabled=(var('netsuite__advanced_inventory_management_enabled', false))) }}
2+
3+
with source as (
4+
select * from {{ var('netsuite_inventory_assignments') }}
5+
),
6+
renamed as (
7+
select
8+
id as inventory_assignment_id,
9+
bin as bin_id,
10+
transaction as transaction_id,
11+
transactionline as transaction_line_id,
12+
quantity
13+
14+
from source
15+
)
16+
select * from renamed

models/stg_netsuite__transaction_lines.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ renamed as (
1919
isclosed = 'T' as is_closed,
2020
iscogs = 'T' as is_cogs,
2121
mainline = 'T' as is_main_line,
22-
taxline = 'T' as is_tax_line
22+
taxline = 'T' as is_tax_line,
23+
quantity,
24+
rateamount as rate_amount
25+
{% if var('netsuite__inventory_management_enabled', false) %}
26+
,isinventoryaffecting = 'T' as is_inventory_affecting
27+
,accountinglinetype as accounting_line_type
28+
{% endif %}
2329

2430
--The below macro adds the fields defined within your transaction_lines_pass_through_columns variable into the staging model
2531
{{ fivetran_utils.fill_pass_through_columns('transaction_lines_pass_through_columns') }}

models/stg_netsuite__transactions.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ renamed as (
2222
tranid as transaction_name,
2323
transactionnumber as transaction_number,
2424
type as transaction_type,
25+
voided = 'T' as is_voided,
2526

2627
concat('https://{{ var("netsuite_account_id", "123456") }}.app.netsuite.com/app/accounting/transactions/', lower(type), '.nl?id=', id) as transaction_url_link,
2728
concat(type,'_',id) as reference_id

0 commit comments

Comments
 (0)