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

Invoiced quantity on order_item level is 0 after payment has been captured and invoice has been created #849

Closed
florisvannoyen opened this issue Jan 16, 2025 · 3 comments
Assignees
Labels
Question / Issue Further information is requested

Comments

@florisvannoyen
Copy link

Describe the bug
Mollie is set up to invoice the order once the payment has been authorized. When the payment has been authorized, I see that the state of the order changes to processing, but the payment status in Magento is stuck on "open." Upon further inspection, I noticed that although an invoice with the correct products and amount is created, the qty_invoiced in the sales_order_item table for these order_items is still 0.

Because the items are not invoiced, the order can never reach a "complete" state and can never be refunded because Magento thinks they were never invoiced.

A workaround I've found is to invoice the order again (manually using the button on the order page). This adds the qty_invoiced, and after doing this, we can fetch the order status again, completing the order. The problem with this approach is that it's manual and causes our accounting module to fire twice (two bookings for one order).

My guess is that this is due to some conflict between two modules that causes Mollie to behave weirdly. Any tips on finding this?@

Used versions

  • Magento Version number(eg 2.3.5): 2.4.7-p2
  • Open source/Enterprise/B2b: Open source
  • Mollie version number (Check configuration): v2.42.1

Screenshots

Order showing no invoiced qty
Image

The invoice created by Mollie (correct products, correct amount)
Image
Image

Creating a new (empty) invoice
Image

Order is now complete and payment status from mollie can be fetched again, now returns "Paid"
Image

@Frank-Magmodules
Copy link
Collaborator

Hi @florisvannoyen!

Thank you for bringing this up. You’re right, under normal circumstances, the invoiced amount should match the correct amount displayed on the order page. However, this can sometimes be tricky/hard to debug, as such issues may arise due to multiple processes running simultaneously.

The best approach is to disable as many modules as possible and test until orders are created correctly. Then, re-enable the modules one by one until the issue reappears. This should give you a good idea of which module is causing the conflict.

@Frank-Magmodules Frank-Magmodules added the Question / Issue Further information is requested label Jan 20, 2025
@florisvannoyen
Copy link
Author

I identified the issue. There is a module connecting our ERP to Magento. When the "invoice paid" event is triggered, certain items in our ERP get confirmed. To easily verify this, we add a comment to the order. However, this process of adding a comment to the order was blocking Mollie.

@Frank-Magmodules
Copy link
Collaborator

Great! I’m glad you found it.
Thanks for following up and closing the issue.
Have a wonderful day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question / Issue Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants