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

Customer Tax Group not applied on order creation #10412

Closed
er453r opened this issue Aug 2, 2017 · 2 comments
Closed

Customer Tax Group not applied on order creation #10412

er453r opened this issue Aug 2, 2017 · 2 comments
Labels
bug report Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@er453r
Copy link

er453r commented Aug 2, 2017

Preconditions

  1. Magento 2.1.7

Steps to reproduce

  1. Crated different Customer Tax Classes (Retail/Company)
  2. Created different Tax Rates (21%/0%) and applied them with Tax Rule
  3. In Store Config enabled Enable Automatic Assignment to Customer Group and selected correct Customer Tax Classes based on Billing Address and Validate on each transaction

Expected result

In the store front everything works as expected. The prices during checkout are calculated with different Tax Rates based on the billing address with and without VAT ID.

BUT the Order is saved with the Retail tax values, even though the Company tax group is saved properly.

So both the admin Sales -> Orders and API show that order correctly with the Company customer tax group, but the tax rates are applied from the Retail class.

Actual result

  1. Wrong Tax Class is applied

Workaround

Fixed this by modifing app/code/Magento/Quote/Model/QuoteManagement.php by adding 3 lines after the first one in the following method:

 public function placeOrder($cartId, PaymentInterface $paymentMethod = null){
    $quote = $this->quoteRepository->getActive($cartId);

    $quote->setTotalsCollectedFlag(false); // add this lines
    $quote->collectTotals(); // add this lines
    $quote->save(); // add this lines

This forces Magento to recollect prices according to the billing address before saving it to the database.

Also this link for reference: https://magento.stackexchange.com/questions/187479/customer-tax-group-not-applied-on-order-creation/187587#187587

@magento-engcom-team magento-engcom-team added G1 Passed bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Sep 18, 2017
@magento-engcom-team
Copy link
Contributor

@er453r thank you for your bug report.
We cannot reproduce this issue as described. Please provide the detailed steps we must follow to reproduce this issue.
Please give all param values from Configuration>Customers>Customer Configuration>Create New Account Options and all param values from your Tax Rule(s)

@magento-engcom-team
Copy link
Contributor

@er453r, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests

3 participants