Greetings,
We are experiencing some unwanted behavior with Version 3.8 (and 3.9) of the "AVALARA TAX PROVIDER provided by the NOP Commerce Team".
The issue results in the AvalaraOrderProcessingService.cs...the following code is the culprit.
//prepare order details
var details = PreparePlaceOrderDetails(processPaymentRequest);
//the only difference from the original PlaceOrder() method
//get tax total from the Avalara tax service, it may slightly differ from the previously calculated tax
var taxTotal = GetTaxTotal(processPaymentRequest, details);
if (taxTotal.HasValue)
{
details.OrderTotal += (taxTotal.Value - details.OrderTaxTotal);
processPaymentRequest.OrderTotal = details.OrderTotal;
details.OrderTaxTotal = taxTotal.Value;
}
The main issues are:
1. If a gift certificate is used to cover the entire order, and the tax that Avalara returns for the taxTotal is 1 cent higher (this happens around the $250 order total amount and rounding) than what the store calculates, then the customer is unable to checkout because the store is trying to charge the extra 1 cent to a payment method, which there is no payment method because the customer is using a gift card. Customer can't check out.
2. The TaxRates Dictionary calculation happens before the above code so if Avalara returns a different tax rate amount ( for example customer orders an article of clothing and a hard good and ships to Minnesota). Minnesota does not charge tax on clothing, but the store first calculates tax for the entire order using every item in the cart and shipping, completely ignoring tax Nexus data or calculations from Avalara and that tax amount the store calculates is being left in the TaxRates Dictionary and not getting updated with correct tax amount that Avalara returns. The tax rate amount shown on the order in the admin section does not match the actual tax charged.
3. Order totals at the bottom of the page are never accurate. On the confirmation page, the tax and order total do not match what is actually being charged to the customer. Again using Minnesota as an example, if customer has hard goods and clothing in their cart, order total and tax total on order confirmation page do not match what is actually charged to the customer as the above code and the final tax call (var taxTotal = GetTaxTotal(processPaymentRequest, details) ) happens after the confirm button is hit. The customer sees the total tax charge for all the goods and shipping, regardless of what Avalara returns.
4. Gift Certificates are not deducted properly again using Minnesota as a guide. If the tax returned from Avalara is less than what the stores calculates, the gift certificates has the full tax the store calculated deducted from it instead of the adjust tax total from Avalara deducted from it. The Gift Certificate total deducted is calculated before the final Avalara Tax Call the tax used to determine the Gift Certificate total is the tax the store has determined outside of the Avalara Tax Plugin. The Gift Certificate logic happens before the final Avalara tax call code above.
In summary, we migrated to the Avalara Tax system Jan 1st of 2019 and now we have a hug accounting tax nightmare due the "Certified" Avalara Tax Plugin from NOP Commerce. This has cost us thousands of dollars in manual labor to adjust the orders and to refund tax dollar amounts not to mention the high cost of the Avalara Tax program itself. When doing our research for a tax provider, we saw the certified Avalara Tax plugin from NOP Commerce and went with it, before finding out the plugin simply does not work as intended as both 3.8 and 3.9 exhibit the same behavior.
We are hoping that someone from the NOP Commerce team can lend a hand and correct the logic errors so that we have a working plugin that correctly displays and calculates the correct tax and order totals to us and our customers.
Thanks,
Brian