Skip to content

[Bug] Sales Receipt Tax Amounts not flowing back up to the GL/IS/BS #132

@brandonrf94

Description

@brandonrf94

Is there an existing issue for this?

  • I have searched the existing issues

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:


&

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?

  • Yes.
  • Yes, but I will need assistance and will schedule time during our office hours for guidance
  • No.

Metadata

Metadata

Assignees

No one assigned

    Labels

    error:forcedstatus:staleIssue was blocked or had no user response for more than 30 daystype:bugSomething is broken or incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions