gwharton / autocustomergroup

Magento 2 Module - Auto Assign Customer Group based on Tax Scheme validation
Other
17 stars 4 forks source link

problem with using your module #8

Closed mansato closed 3 years ago

mansato commented 3 years ago

hello,

I have a problem with using your module.

module disabled: if i have a user in the professional group who orders in uk, the vat is not charged. if it is in the general group the vat and well invoiced.

module activated: I put for -135 £ order in uk use group general

I have placed several orders with the module activated and in all cases I have the VAT which and invoiced to the person while the module changes the group.

can you help me? thank you.

gwharton commented 3 years ago

Can you confirm you are using the latest version of the module. There have been some changes recently. The module outputs some debug/information to the var/log/system.log and var/log/debug.log every time the checkout requests totals, and also when the order is placed. It should show when it changes the group.

Are your orders being successfully placed with the correct group, if so, you need to make sure your tax rules are setup correctly. So for the tax rule for UK VAT, link that to customer group general, and do not link any tax rule to group professional. That way, one group will be charged, and the other won't.

First thing to determin if the right group is set for the order. If so, look at tax rules.

Heres an example of my setup for New Zealand.

Customer Groups

chrome_nSphv7G65I

New Zealand Settings

chrome_bJFyn6JXHR

Tax Rates

chrome_osgR0b3x3o

Tax Rules

chrome_RUuNlCgQqg

Customer Group -> Customer Tax Class -> Tax Rule -> Tax Rate

I hope this helps. Let me know how you get on.

gwharton commented 3 years ago

Actually, I may have slightly misunderstood your question. I havent done much testing with customer accounts. Only guest orders. Let me run some tests with customer accounts and I'll get back to you.

gwharton commented 3 years ago

OK, i've found the issue in the code. Im working up a fix today so check in later for an update.

gwharton commented 3 years ago

Please try the latest version 0.6.0

There was an error with processing group changes with existing customer accounts.

Please let me know how you get on.

https://github.com/gwharton/autocustomergroup/releases/tag/v0.6.0

mansato commented 3 years ago

Hello,

I installed the update, have another problem.

Order With your module si disable : image

Same order with your module is enable: image

the VAT is 0 but the price of the product remains in including tax.

Thanks.

gwharton commented 3 years ago

I need to understand how your system is setup, so can you please let me know what all the settings are set to on Config->Sales->Tax

mansato commented 3 years ago

hi,

I updated the module to version 0.6.1 and when i add new tax rule i have :

1 exception(s): Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with taxRuleId =

gwharton commented 3 years ago

OK, try v0.6.2 just released. It should fix that issue.

https://github.com/gwharton/autocustomergroup/releases/tag/v0.6.2

mansato commented 3 years ago

ok, now it works, but I have another problem it is possible that it comes from my configuration.

notice: Undifined index: EU-UK-20.00% in /srv/easypara-web/www_root/app/code/Gw/AutoCustomerGroup/Model/Calculation/TaxRuleExtractor.php on line 50

"$outputRates = $appliedTaxes[$code]->getRates();"

gwharton commented 3 years ago

OK, that was a specific failure case when "Tax included in Price" is set. Please try version 0.6.3

https://github.com/gwharton/autocustomergroup/releases/tag/v0.6.3

gwharton commented 3 years ago

Just be careful of having "Catalog prices include tax" set to "Include Tax". I'm pretty sure that isnt working properly as I just did a test with magento 2.4.3 fresh install and it doesn't work how it is expected to work.

2.4.3 Setting - Tax included in Catalog Price

Tax rule 20% for UK Product with Catalog Price £120 Checkout should show exVAT price £100 and incVAT price £120 Checkout actually shows exVAT price £120 and incVAT price £144

2.4.3 Setting - Tax not included in Catalog Price

Tax rule 20% for UK Product with Catalog Price £100 Checkout correctly shows exVAT price £100 and incVAT price £120

I think this is what you were seeing earlier in this comment https://github.com/gwharton/autocustomergroup/issues/8#issuecomment-890853342

I'm making some enquiries with core team on Slack regarding this.

mansato commented 3 years ago

I did another test it's all good on my side thank you.

gwharton commented 3 years ago

Brilliant. Let me know if you have any more issues.