mollie / magento2

Mollie Payments for Magento 2
https://www.mollie.com
Other
98 stars 50 forks source link

[BUG] Problem with TAX calc on Creditmemo when surcharge is set (surcharge is not set to all parts of the tax calc) #737

Open MathiasBobbie opened 5 months ago

MathiasBobbie commented 5 months ago

Describe the bug The Problem is the TAX calc do not work well on Creditmemo when surcharge is set. I our case is was 3% on paypal.

To reproduce the bug you need to setup a payment_surcharge_percentage >0 and payment_surcharge_type = percentage like:

`

'payment_surcharge_fixed_amount' => null,

'payment_surcharge_limit' => null,

'payment_surcharge_percentage' => '3',

'payment_surcharge_tax_class' => '1',

'payment_surcharge_type' => 'percentage',`

Used versions

To Reproduce Steps to reproduce the behavior:

To reproduce the bug you need to setup a payment_surcharge_percentage >0 and payment_surcharge_type = percentage like:

'payment_surcharge_fixed_amount' => null,

'payment_surcharge_limit' => null,

'payment_surcharge_percentage' => '3',

'payment_surcharge_tax_class' => '1',

'payment_surcharge_type' => 'percentage',`
  1. User creates a Order over with payment type paypal.
  2. The Invoice is created automaticaly.
  3. Than create a creditmemo triggered from magento/admin.
  4. See error: In the creation prozess the error is visible first (please check img) image image
  5. Error exists: Than the error is visible in the created creditmemo in the View and all following documents.

Expected behavior The Total TAX should be the sum of all sub Taxes.

In this case in the picture: Total Tax should be €723.89... (the sum over one-times €723.98) The Grand Total should be: €4533.86

Actual behavior The Total Tax is in this case: €702.81 but this is wrong. It looks like it is just the TAX for the items and not for the item with fee.

Additional context The TAX calc for Order and Invoice work fine. The TAX cac work fine without the fee/payment_surcharge_percentage as well for creditmemo, but with fee/surcharge it is broken.

Frank-Magmodules commented 5 months ago

Hi There @MathiasBobbie ,

Thank you for opening this issue. One thing that stands out in your issue is the version shown in the backend. That indicates that there is something wrong with the deployment of new versions. That version is directly read from the etc/config.xml file so it always shows the actually installed version.

That being said, could it be that the payment fee has a different tax class than the product? If that is the case, we have fixed that bug in version v2.32.3. So please check if you have deployed the last version to your production server.

Let me know!

MathiasBobbie commented 5 months ago

Thank you @Frank-Magmodules ,

the different versions looks suspicious to me, too. Looking to the etc/config.xml, we ran v2.32.4 that should work.

I updated my dev system to v2.34.0 (according to config.xml and composer.lock, they are aligned now). For me the the problem looks fixed and we can not reproduce it on v2.34.0.

Sorry, opening an Issue for an old version.

Thank you very much!

Frank-Magmodules commented 5 months ago

Welcome @MathiasBobbie , no worries, glad that your issue is solved now. Have a great day!

MathiasBobbie commented 5 months ago

@Frank-Magmodules Sorry, ignore my message form before. I tested bad.

Perhaps it is a different case / with the same symptoms.

Created a new Order on the Testsystem. Fetched status image Automatic created Invoice The Invoice has the same problem as described for the creditmemo: image

alexgran commented 4 months ago

Hi, when can we expect a fix here? We are now issuing wrong credit memos, which is causing an issue with outer customers!

Frank-Magmodules commented 4 months ago

Hi There @alexgran ,

We just took another look into this. It still looks like you are running on an older version. Are you 100% sure that you are on the latest version of this environment? If you are, could you please provide us with access to an environment where this problem exists so we can take a deeper look? Thank you in advance!

alexgran commented 4 months ago

Hi, well, this looks like another bug :D our code is 2.34.0, according to composer.json and etc/config.xml However the admin UI show 2.28.0, which is pulled from Config.php->getVersion, which in turn seems to pull it from magento config, which we have under version control (i.e. our magento app/etc/config.php is in git, we are not using database, to make sure this is controlled). This has 2.28.0, which is when we initially installed.

I think you need to fix that and pull the shown version from the composer package registry (which is available via PHP as well), and not from a config value.

Frank-Magmodules commented 4 months ago

Hi there @alexgran ,

That specific value is typically pulled from the config.xml. In the situation you described, saving all configuration values to config.php could potentially result in displaying the wrong version number. It might be a bug, but in our opinion, it's not really an urgent issue but surely we will take a look into it for you later.

However, we're still facing the original issue: missing tax on an invoice. In my previous reply, I requested access to an environment where we can investigate this matter more effectively. Could you please provide that?

Frank-Magmodules commented 4 months ago

Hi There @alexgran , we haven't received the necessary information regarding this issue yet. Since we're unable to reproduce it on our end, it would be greatly appreciated if we could delve deeper into it together to find a solution. Thank you! :)

alexgran commented 4 months ago

Yes, sorry. Can I have a secure way to contact you for credentials for a demo machine?

Frank-Magmodules commented 4 months ago

@alexgran , sure! Feel free to reach out to us directly here, and use a self-destruct optionally to securely exchange sensitive information, if needed.

Frank-Magmodules commented 3 months ago

Hi @alexgran or @MathiasBobbie , Is this issue still relevant? If it is, could you please share additional details or information about it? We are more than happy to address it, of course!

MathiasBobbie commented 3 months ago

Hi Frank,

please create a Creditmemo like written in an Email before. This is a Creditmemo I created from a Invoice, which was created by you or your team before. It looks like that the tax working deferent on Invoice than on Creditmemo. So the steps to reproduce are correct just the step of creating the Creditmemo missed.

Nikolas will create you a video from the prozess, to have a walkthrough.

Kind Regards, Mathias [image: Creditmemo.png]

Am Mo., 25. März 2024 um 16:48 Uhr schrieb Frank Tiggelman < @.***>:

Hi @alexgran https://github.com/alexgran or @MathiasBobbie https://github.com/MathiasBobbie , Is this issue still relevant? If it is, could you please share additional details or information about it? We are more than happy to address it, of course!

— Reply to this email directly, view it on GitHub https://github.com/mollie/magento2/issues/737#issuecomment-2018323704, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3OWF3AGME6KZTGTJIEN7P3Y2BBN7AVCNFSM6AAAAABCP3CLQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJYGMZDGNZQGQ . You are receiving this because you were mentioned.Message ID: @.***>

-- Freundliche Grüße Mathias Kohs

[image: Bobbie] https://www.bobbie.de [image: Facebook] https://www.facebook.com/bobbie.business [image: LinkedIn] https://www.linkedin.com/company/bobbie-derbaustoff-spezialist/ [image: Instagram] https://www.instagram.com/bobbie.business/ [image: https://lh3.googleusercontent.com/a-/ALV-UjV_lcXdGubub9_7y3A16ER9CJTMfdSlnRS-nagqaA87oTk=s96-c] Mathias Kohs Teamleiter Softwareentwicklung / SW-Entwicklung und IT Kontakt @.** +49 89 2154015 - 60 +49 178 1373987 bobbie Deutschland GmbH* Kasinostraße 44, 52066 Aachen +49 89 2154015-0 www.bobbie.de

[image: Aktuell können Sie einige Informationen nicht sehen. Bitte aktivieren Sie externe Inhalte, um die Mail vollständig angezeigt zu bekommen oder klicken Sie hier.] https://app.mailtastic.de/api/linkserve/campaign/a1f4799d-1b26-4871-befe-4fd83d1e657e/23602

Frank-Magmodules commented 1 month ago

Hi There @MathiasBobbie, It seems I didn't receive the video walkthrough, and I may still be missing some context to reproduce this issue accurately. Can you update me on the status of this issue and let me know if it is still occurring in our latest release? I'm happy to close this issue once it's resolved!

MathiasBobbie commented 1 month ago

Hi There,

Nikolas send a Video on the 28.03.2024 To: Mathias Kohs mathias@bobbie.de Cc: Frank Tiggelman frank@magmodules.eu; Magmodules - Contact contact@magmodules.eu

Perhaps this Video did not show what expected... To have it here:https://drive.google.com/file/d/1Qk02OZx_5HCuuqKWfME5HyUxpYDs4ymZ/view?usp=sharing

The Problem can be seen at point: 2:20 after refund, the CreditMemo shows two different TAXes for: for Total TAX: 374.52€ for DE Standard MwSt: 383.08€

The CreditMemo should have the sum of all local Taxes to be the Total Tax. In this case the same...

We running the lates Vesion: 2.38.0 and there is the same issue. New Video: https://drive.google.com/file/d/1kmcZG6C5_8iHoItFMAcU7hhyfiSBuq4g/view?usp=sharing

Frank-Magmodules commented 1 month ago

Hi @MathiasBobbie, Could you please verify if you can reproduce this issue on a default Magento environment without any third-party plugins installed? It looks like you have several external plugins running that might be affecting this. Thanks!