-
Notifications
You must be signed in to change notification settings - Fork 301
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
Canadian Tax Line Error #529
Comments
Thanks for the feedback. Yes it does look like the library is not auto-inserting the tax_detail = Quickbooks::Model::TransactionTaxDetail.new
tax_detail.txn_tax_code_ref = Quickbooks::Model::BaseReference.new(invoice_transaction_tax_code_rate_ref())
tax_detail.total_tax = supplier_order.total_tax
tax_line = Quickbooks::Model::TaxLine.new
tax_line.amount = tax_detail.total_tax
tax_line.detail_type = 'TaxLineDetail'
tax_line_detail = Quickbooks::Model::TaxLineDetail.new
tax_line_detail.percent_based = true
tax_line_detail.net_amount_taxable = supplier_order.total_excluding_taxes_cents
tax_line_detail.tax_percent = supplier_order.tax_percent_rate.to_f
tax_line_detail.tax_rate_ref = Quickbooks::Model::BaseReference.new(invoice_transaction_tax_detail_rate_ref())
tax_line.tax_line_detail = tax_line_detail
tax_detail.lines = [tax_line]
invoice.txn_tax_detail = tax_detail So yeah I am doing it pretty manually. |
Thanks @ruckus, oddly this just started happening with no code changes on our end. When I use your method above to build the TaxLine manually, I get a different error...
This is very odd, when I specify the TaxRateRef by setting tl = Quickbooks::Model::TaxLine.new(detail_type: "TaxLineDetail")
tld = Quickbooks::Model::TaxLineDetail.new
tld.percent_based = true
#tld.tax_rate_ref = code <-- this causes an error
tld.tax_rate_id = code.id
tl.tax_line_detail = tld
txn_tax_detail.lines ||= []
txn_tax_detail.lines << tl The generated XML is different (working version on the right)... I am not sure why things stopped working, possibly a change on the QBO side so I am trying to post as much debug info as possible if that helps. |
I am using a numeric reference to the def invoice_transaction_tax_detail_rate_ref
184
end
...
tax_line_detail.tax_rate_ref = Quickbooks::Model::BaseReference.new(invoice_transaction_tax_detail_rate_ref())
... What is the value of your
? |
I had an issue when creating new QB invoices that were untaxed for QB Canada. Ultimately I needed to set |
This is probably user error but I think worth mentioning as an issue for posterity.
I am building an invoice in Canadian Quickbooks and assigning the TransactionTaxDetail like this...
Adding the TaxLine like this results in a Quickbooks Business Validation Error:
TxnTaxDetail.TaxLine.DetailTypeEnum is missing in the request
It appears that
quickbooks-ruby
is creating theTaxLine
wrapper automatically but theTaxLine
element is missing the detail type attribute.Notice the
TaxLine
entries are missing theDetailType
attribute, which should beTaxLineDetail
.The text was updated successfully, but these errors were encountered: