Skip to content
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

Support TaxIncluded in AvaTax Line Items #117

Closed
raymondberg opened this issue Sep 27, 2021 · 1 comment
Closed

Support TaxIncluded in AvaTax Line Items #117

raymondberg opened this issue Sep 27, 2021 · 1 comment

Comments

@raymondberg
Copy link

Happy to move this elsewhere if there's a formal process for submitting issues.

Problem statement

The TransactionBuilder doesn't support the taxIncluded attribute which is required
on a per-line item basis if used. See full docs here: https://developer.avalara.com/avatax/dev-guide/customizing-transaction/using-tax-included/

Desired Behavior

As a user of the transaction builder I would like to be able to use something like the following

builder.with_line(amount=100, quantity=1, tax_code=MY_TAX_CODE, tax_included=True)

or (less ideal)

(
  builder
    .with_line(amount=100, quantity=1, tax_code=MY_TAX_CODE)
    .with_tax_included()
)

Workaround

One can work around this by abandoning the TransactionBuilder or by breaking into the model a bit.
This could be done with conditions for item info, but a simple pass for all items is:

for item in builder.create_model["items"]:
  item["taxIncluded"] = True

Notes

It's worth noting two items related to this:

  1. the builder currently requires tax_code which is also not a true requirement.
  2. with_exempt_line is currently a single quantity, but almost entirely the same as add item

Suggestion for improving might be to do three, backwards-compatible steps to align all three:

  • move tax_code to be optional (non-breaking) so that it is only added to the request if not-none
  • with_exempt_line calls with_line with minimal alteration (quantity=1 for backwards compatibility, tax_code=None)
  • add tax_included to with_line

I'd be happy to PR if you would be amenable.

@svc-developer
Copy link
Collaborator

Released in v22.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants