Skip to content

Commit

Permalink
Update int_quickbooks__invoice_double_entry.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-joemarkiewicz authored May 2, 2023
1 parent 4fbc6c6 commit bb5941a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ invoice_join as (
case when invoice_lines.detail_type is not null then invoice_lines.detail_type
when coalesce(invoice_lines.account_id, items.parent_income_account_id, items.income_account_id, bundle_income_accounts.account_id) is not null then 'SalesItemLineDetail'
when invoice_lines.discount_account_id is not null then 'DiscountLineDetail'
when coalesce(invoice_lines.account_id, items.parent_income_account_id, items.income_account_id, bundle_income_accounts.account_id, invoice_lines.discount_account_id) is null then 'DescriptionOnly'
when coalesce(invoice_lines.account_id, items.parent_income_account_id, items.income_account_id, bundle_income_accounts.account_id, invoice_lines.discount_account_id) is null then 'NoAccountMapping'
end as invoice_line_transaction_type,
coalesce(invoice_lines.account_id, items.parent_income_account_id, items.income_account_id, bundle_income_accounts.account_id, invoice_lines.discount_account_id) as account_id,
{% else %}
case when invoice_lines.detail_type is not null then invoice_lines.detail_type
when coalesce(invoice_lines.account_id, items.parent_income_account_id, items.income_account_id) is not null then 'SalesItemLineDetail'
when invoice_lines.discount_account_id is not null then 'DiscountLineDetail'
when coalesce(invoice_lines.account_id, items.parent_income_account_id, items.income_account_id, invoice_lines.discount_account_id) is null then 'DescriptionOnly'
when coalesce(invoice_lines.account_id, items.parent_income_account_id, items.income_account_id, invoice_lines.discount_account_id) is null then 'NoAccountMapping'
end as invoice_line_transaction_type,
coalesce(invoice_lines.account_id, items.income_account_id, invoice_lines.discount_account_id) as account_id,
{% endif %}
Expand Down Expand Up @@ -145,7 +145,7 @@ invoice_filter as (

select *
from invoice_join
where invoice_line_transaction_type not in ('SubTotalLineDetail','DescriptionOnly')
where invoice_line_transaction_type not in ('SubTotalLineDetail','NoAccountMapping')
),

final as (
Expand Down

0 comments on commit bb5941a

Please sign in to comment.