Skip to content

Commit

Permalink
Merge pull request #44 from jmongerlyra/lyra-v0.10.0
Browse files Browse the repository at this point in the history
Add fields for PR-107 in dbt_netsuite
  • Loading branch information
fivetran-avinash authored Mar 18, 2024
2 parents cce5183 + e0f1885 commit 4ac3af8
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions macros/get_accounts_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
{"name": "accttype", "datatype": dbt.type_string()},
{"name": "sspecacct", "datatype": dbt.type_string()},
{"name": "fullname", "datatype": dbt.type_string()},
{"name": "accountsearchdisplaynamecopy", "datatype": dbt.type_string()},
{"name": "description", "datatype": dbt.type_string()},
{"name": "deferralacct", "datatype": dbt.type_int()},
{"name": "cashflowrate", "datatype": dbt.type_string()},
Expand Down
1 change: 1 addition & 0 deletions macros/get_subsidiaries_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
{"name": "state", "datatype": dbt.type_string()},
{"name": "fiscalcalendar", "datatype": dbt.type_int()},
{"name": "parent", "datatype": dbt.type_int()},
{"name": "iselimination", "datatype": dbt.type_string()},
{"name": "currency", "datatype": dbt.type_int()}
] %}

Expand Down
4 changes: 3 additions & 1 deletion macros/get_transaction_lines_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
{"name": "cleared", "datatype": dbt.type_string()},
{"name": "commitmentfirm", "datatype": dbt.type_string()},
{"name": "mainline", "datatype": dbt.type_string()},
{"name": "taxline", "datatype": dbt.type_string()}
{"name": "taxline", "datatype": dbt.type_string()},
{"name": "eliminate", "datatype": dbt.type_string()},
{"name": "netamount", "datatype": dbt.type_float()}
] %}

{{ fivetran_utils.add_pass_through_columns(columns, var('transaction_lines_pass_through_columns')) }}
Expand Down
6 changes: 6 additions & 0 deletions models/netsuite2/src_netsuite2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ sources:
description: Reference to the parent subsidiary.
- name: currency
description: "{{ doc('currency_id') }}"
- name: iselimination
description: Boolean indicating if the subsidiary is an elimination subsidiary. Represented as "T" or "F" for true and false respectively.

- name: transaction_accounting_line
identifier: "{{ var('netsuite2_transaction_accounting_line_identifier', 'transactionaccountingline') }}"
Expand Down Expand Up @@ -540,6 +542,10 @@ sources:
description: Boolean indicating if the transaction line is a main line entry. Represented as "T" or "F" for true and false respectively.
- name: taxline
description: Boolean indicating if the transaction line is a tax line. Represented as "T" or "F" for true and false respectively.
- name: eliminate
description: Boolean indicating if the transaction line is eliminated. Represented as "T" or "F" for true and false respectively.
- name: netamount
description: Net amount of transaction line.

- name: transaction
identifier: "{{ var('netsuite2_transaction_identifier', 'transaction') }}"
Expand Down
1 change: 1 addition & 0 deletions models/netsuite2/stg_netsuite2__accounts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ final as (
accttype as account_type_id,
sspecacct as special_account_type_id,
fullname as name,
accountsearchdisplaynamecopy as display_name,
description as account_description,
deferralacct as deferral_account_id,
cashflowrate as cash_flow_rate_type,
Expand Down
1 change: 1 addition & 0 deletions models/netsuite2/stg_netsuite2__subsidiaries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ final as (
state,
fiscalcalendar as fiscal_calendar_id,
parent as parent_id,
iselimination = 'T' as is_elimination,
currency as currency_id

--The below macro adds the fields defined within your subsidiaries_pass_through_columns variable into the staging model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ final as (
accountingbook as accounting_book_id,
account as account_id,
posting = 'T' as is_posting,
exchangerate as exchange_rate,
amount,
credit as credit_amount,
debit as debit_amount,
Expand Down
4 changes: 3 additions & 1 deletion models/netsuite2/stg_netsuite2__transaction_lines.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ final as (
cleared = 'T' as is_cleared,
commitmentfirm = 'T' as is_commitment_firm,
mainline = 'T' as is_main_line,
taxline = 'T' as is_tax_line
taxline = 'T' as is_tax_line,
eliminate = 'T' as is_eliminate,
netamount

--The below macro adds the fields defined within your transaction_lines_pass_through_columns variable into the staging model
{{ fivetran_utils.fill_pass_through_columns('transaction_lines_pass_through_columns') }}
Expand Down
6 changes: 6 additions & 0 deletions models/stg_netsuite2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ models:
description: "{{ doc('fiscal_calendar_id') }}"
- name: parent_id
description: Reference to the parent subsidiary.
- name: is_elimination
description: Boolean indicating if the subsidiary is an elimination subsidiary.
- name: currency_id
description: "{{ doc('currency_id') }}"

Expand Down Expand Up @@ -573,6 +575,10 @@ models:
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: is_eliminate
description: Boolean indicating if the transaction line is eliminated.
- name: netamount
description: Net amount of transaction line.

- name: stg_netsuite2__transactions
description: "{{ doc('transaction_table') }}"
Expand Down

0 comments on commit 4ac3af8

Please sign in to comment.