From ec956fe3c646e1364146fbd3634bb3c9130faa54 Mon Sep 17 00:00:00 2001 From: Jared Monger <95247581+jmongerlyra@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:47:37 -0500 Subject: [PATCH] Fix is_account_intercompany on balance_sheet --- models/netsuite2/netsuite2__balance_sheet.sql | 5 +++++ models/netsuite2/netsuite2__transaction_details.sql | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/models/netsuite2/netsuite2__balance_sheet.sql b/models/netsuite2/netsuite2__balance_sheet.sql index c4cbe36..f95b56c 100644 --- a/models/netsuite2/netsuite2__balance_sheet.sql +++ b/models/netsuite2/netsuite2__balance_sheet.sql @@ -119,6 +119,10 @@ balance_sheet as ( end as account_number, case when not accounts.is_balancesheet then false + else accounts.is_eliminate + end as is_account_intercompany, + case + when not accounts.is_balancesheet then false else accounts.is_leftside end as is_account_leftside @@ -233,6 +237,7 @@ balance_sheet as ( 'cumulative_translation_adjustment' as account_type_id, null as account_id, (select accounts.account_number from accounts where lower(accounts.special_account_type_id) = 'cumultransadj' limit 1) as account_number, + false as is_account_intercompany, false as is_account_leftside, {% if var('accounts_pass_through_columns') %} diff --git a/models/netsuite2/netsuite2__transaction_details.sql b/models/netsuite2/netsuite2__transaction_details.sql index 468f6a5..023fc17 100644 --- a/models/netsuite2/netsuite2__transaction_details.sql +++ b/models/netsuite2/netsuite2__transaction_details.sql @@ -233,7 +233,7 @@ transaction_details as ( --The below script allows for subsidiaries table pass through columns. {{ fivetran_utils.persist_pass_through_columns('subsidiaries_pass_through_columns', identifier='subsidiaries') }}, - + case when lower(accounts.account_type_id) in ('income', 'othincome') then -transactions_with_converted_amounts.converted_amount_using_transaction_accounting_period else transactions_with_converted_amounts.converted_amount_using_transaction_accounting_period