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

[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 this issue Jan 29, 2024 · 15 comments
Assignees
Labels
Investigating We are working on this issue together with the customer. Question / Issue Further information is requested

Comments

@MathiasBobbie
Copy link

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

  • Magento Version number: 2.4.5-p5
  • Open source/Enterprise/B2b: Open source
  • Mollie version number (Check configuration): (composer.lock: 2.32.4 / admin-backend: v2.28.0)

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 Frank-Magmodules added the Investigating We are working on this issue together with the customer. label Jan 30, 2024
@Frank-Magmodules
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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

@MathiasBobbie
Copy link
Author

@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

@Frank-Magmodules Frank-Magmodules self-assigned this Feb 2, 2024
@alexgran
Copy link

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
Copy link
Collaborator

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
Copy link

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.

@alexgran alexgran removed their assignment Feb 19, 2024
@Frank-Magmodules
Copy link
Collaborator

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 Frank-Magmodules changed the title Problem with TAX calc on Creditmemo when surcharge is set (surcharge is not set to all parts of the tax calc) [BUG] Problem with TAX calc on Creditmemo when surcharge is set (surcharge is not set to all parts of the tax calc) Feb 22, 2024
@Frank-Magmodules Frank-Magmodules added the Question / Issue Further information is requested label Feb 22, 2024
@Frank-Magmodules
Copy link
Collaborator

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
Copy link

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

@Frank-Magmodules
Copy link
Collaborator

@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
Copy link
Collaborator

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
Copy link
Author

MathiasBobbie commented Mar 26, 2024 via email

@Frank-Magmodules
Copy link
Collaborator

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigating We are working on this issue together with the customer. Question / Issue Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants