-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Bill Payments using the wrong FX rate #151
Comments
My code isn't accurate, it's closer in some ways but not 100% there. A single bill payment can be associated with multiple bills, and there seems to be some QBO logic where the sum of all the bill_payment_lines is not equal to the bill_payment total amount in many cases. This is still an issue, if anyone has any ideas on how to do this - happy to collab. |
Hey @brandonrf94 , thanks for opening this issue! The logic makes sense from my end, just a few clairifying questions: You use For Re: your last comment, is that a separate issue from the wrong FX rate? Do you want to open a separate issue if that's the case? And do you see any patterns for when the sum of the bill payment lines does not equate to the bill payment total amount? |
Hi @fivetran-avinash - I switched from using bill_payments.total_amount to bill_payment_lines.amount because of a few reasons:
I think these 2 things are related:
I don't think it's a bug but I also couldn't find any explicit pattern on how to get the lines to match the header. It likely has to do with the types of transactions the bill_payment is being tied to. Just to clarify what I think makes this harder.. |
Is there an existing issue for this?
Describe the issue
According to Quickbooks it looks like when a bill payment is applied, the FX rate that should be used is the FX rate of the originating bill when possible. If you use the FX rate of the bill_payment then the accounts payable account will not match what QBO expects.
Relevant error log or model output
No response
Expected behavior
AP account balances with QBO.
Possible solution
I have my own local fork of this repo and I will share the code I use. Note it looks a little different than your version of the
"int_quickbooks__bill_payment_Double_entry.sql" as I have deviated a bit from your model due to ongoing changes.
I essentially join to the bill table and use the FX rate from there if I am able to successfully join, then I fall back to the bill payment FX rate.
dbt Project configurations
quickstart
Package versions
quickstart most recent
What database are you using dbt with?
snowflake
How are you running this dbt package?
Fivetran Quickstart Data Model, dbt Core™
dbt Version
most recent
Additional Context
No response
Are you willing to open a PR to help address this issue?
The text was updated successfully, but these errors were encountered: