Is there an existing issue for this?
Describe the issue
Right now if there is a sales receipt that has a tax amount, that amount is not flowing through the DBT transformations. I rolled out a change on my local repo that you may want to consider:
|
sales_receipt_lines.amount, |
&
|
sales_receipt_lines.amount, |
Replace
sales_receipt_lines.amount,
with
case
when sales_receipt_lines.index = 0 then (sales_receipt_lines.amount + sales_receipts.total_tax)
else sales_receipt_lines.amount
end amount,
The idea being to just apply the taxable amount to the first line item. There may be a better solution to evenly distribute across the lines, but this seemingly does that trick just fine.
Additionally,
Here: https://github.com/fivetran/dbt_quickbooks_source/blob/7a2ef84dfc79bb441a059bdac13bb252edc119e9/models/stg_quickbooks__sales_receipt.sql#L42
You would need to also select
total_tax
Relevant error log or model output
No response
Expected behavior
The amounts for sales receipts should be inclusive of the tax amount.
Tax amount is only stored on the sales_receipt header table, not the sales_receipt_line table.
dbt Project configurations
Default
Package versions
Most recent
What database are you using dbt with?
snowflake
dbt Version
N.A
Additional Context
No response
Are you willing to open a PR to help address this issue?
Is there an existing issue for this?
Describe the issue
Right now if there is a sales receipt that has a tax amount, that amount is not flowing through the DBT transformations. I rolled out a change on my local repo that you may want to consider:
dbt_quickbooks/models/double_entry_transactions/int_quickbooks__sales_receipt_double_entry.sql
Line 39 in e604697
&
dbt_quickbooks/models/transaction_lines/int_quickbooks__sales_receipt_transactions.sql
Line 41 in e604697
Replace
sales_receipt_lines.amount,with
The idea being to just apply the taxable amount to the first line item. There may be a better solution to evenly distribute across the lines, but this seemingly does that trick just fine.
Additionally,
Here: https://github.com/fivetran/dbt_quickbooks_source/blob/7a2ef84dfc79bb441a059bdac13bb252edc119e9/models/stg_quickbooks__sales_receipt.sql#L42
You would need to also select
total_taxRelevant error log or model output
No response
Expected behavior
The amounts for sales receipts should be inclusive of the tax amount.
Tax amount is only stored on the sales_receipt header table, not the sales_receipt_line table.
dbt Project configurations
Default
Package versions
Most recent
What database are you using dbt with?
snowflake
dbt Version
N.A
Additional Context
No response
Are you willing to open a PR to help address this issue?