logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Tuesday, May 31, 2022 10:25:55 AM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
Steps to reproduce:

1. Set tax settings to commit-when-paid and place a taxable order
2. Pay for the order
3. Check Avalara, order should now be showing as a transaction
4. Add something to the order (happens all the time to us)

At this point, the order is now 'unpaid' because adding to the order created an order balance that must be paid.

Add a payment to the order to pay it off.

This fires the commit-when-paid routine (again) which then calls the Commit() routine in Avalara (again).

The Avalara Commit(Order order) routine will try and create an uncommitted Avalara transaction. This fails with error 'DocType is invalid for the requested transaction."

The error handling sees the transaction failed, and bails out entirely.

This is what I've been trying to tell you guys. You can't just always call Commit() when an order is paid. Because there are plenty of ways for an order to become paid AFTER the order is already created as a transaction in Avalara. And Avalara is going throw back an error every single time.

The Taxes.TaxHelper.CommitTaxWhenOrderPaid(order) routine has to check to see if the order is already in Avalara as a transaction. If not, THEN do the commit because it's brand new. Otherwise you have to make the call to update the existing Avalara transaction.

The only workaround possible is using the Recalculate button. Except that's built to fire in the wrong sequence, so things get messed up a different way.

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyar  
#2 Posted : Tuesday, May 31, 2022 11:47:13 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Thanks for pointing this out. I am also getting an error following the steps you have mentioned.
I will register this issue to look for details.
thanks 1 user thanked shaharyar for this useful post.
Joe Payne2 on 5/31/2022(UTC)
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.