buckaroo-it / Magento2

Repository containing the Magento2 plugin by Buckaroo
MIT License
28 stars 35 forks source link

BP-3761 Incorrect calculation of Grand Total Excluding Tax in JS (related to: BP-3564) #978

Open Ahmet-Djedovic opened 6 months ago

Ahmet-Djedovic commented 6 months ago

Issue Overview: The current implementation of the getGrandTotalExclTax function in the module is flawed. view/frontend/web/js/view/checkout/summary/grand-total.js

It calculates the grand total excluding tax using a manual subtraction of the tax amount from the grand total. This method is prone to errors and may not always produce accurate results.

Proposed Solution: Utilize the simplified and more reliable implementation of the getGrandTotalExclTax function from Magento 2 default. This implementation directly returns the grand total from the 'total' object, ensuring accurate calculations without the need for manual adjustments.

Proposed Changes:

Buckaroo-Rene commented 6 months ago

@Ahmet-Djedovic ,

Thank you for logging this issue. We'll take a look at with the team.

Regards, René

Buckaroo-Rene commented 2 months ago

Hi @Ahmet-Djedovic ,

We need to do a release for our Magento 2 plugin first before we can also release a new version for the Hyvä checkout module which contains a fix. Please note that we are currently preparing a new release for our Magento 2 plugin and the release is expected hopefully later today and otherwise tomorrow. Then we will work on releasing a new version of the Hyvä Checkout plugin as well within a short period of time.

Buckaroo-Rene commented 2 months ago

This is released in version 1.50.0 of the Buckaroo Plugin.

JSeverein commented 1 month ago

@Buckaroo-Rene Is it possible this issue re-appeared in 1.50.1? We can still reproduce it after updating.

It seems the view/frontend/web/js/view/checkout/summary/grand-total.js file was removed and later re-added? And the substraction of tax amount is there again: https://github.com/buckaroo-it/Magento2/blob/v1.50.1/view/frontend/web/js/view/checkout/summary/grand-total.js#L74

Buckaroo-Rene commented 1 month ago

@JSeverein thanks for contacting us. We found indeed another issue and are looking into it. I've reopened the ticket and we'll keep you posted.

Buckaroo-Rene commented 1 month ago

@JSeverein , Hereby a new update. We found a solution to resolve this issue and it is currently being tested. Hopefully we can do a hotfix release early next week for it.