Hello,
I am using product community 2.1 v, the invoices does not work.
i know there are lot of issues reported on this but, its appearing on product addition.
we are using this version for production. can some one suggest the fix for it
does not allow me to submit invoice.

@nmallepally ,
Couple of questions.
(i) Did you upgrade to CE 2.1.0? if so what was the upgrade path?
(ii) Do you have sample data installed with it?
(iii) Also can you details the steps to reproduce the issue?
I can't seem to reproduce the problem in the screenshot in CE version 2.1.0.
This is a really well known issue in version 2.1.0 (@dthampy: why aren't you aware of this ?)
Is already fixed on the develop branch: https://github.com/magento/magento2/issues/4785
We are eagerly awaiting version 2.1.1 which will most likely fix this, but we have been waiting on this for over a month now ...
For a quick fix, see: https://github.com/magento/magento2/issues/5324
@dthampy its an upgrade from 2.0.7 to 2.1.
@hostep , after running the query it fixed the invoice issue, but i'm unable to pay using paypal.
after going to paypal payment gateway, and then clicking on continue, it redirects to website and gives me an error, cannot place order.



@nmallepally , do you have any error in system.log or exception.log, or maybe a crash report ?
Can you set language to english. Flush all caches. Disable caches... And try PayPal order ?
@quienti this is what it showed on exception log,
] main.CRITICAL: Exception: Wrong order ID: "000000129". in /var/www/vhosts/edwia.eu/httpdocs/vendor/magento/module-paypal/Model/Ipn.php:140
Stack trace:
System log
@quienti Merci l'aide... Il faut voir si il s'agit de probl猫mes js car c'est une plaie... je vais voir pour remplacer les ' par un caract猫re sp茅cial.
It seem there is a closure problem...
@Imaginaerum @quienti i did try to change the locale to english and try to do the paypal, when i clicked on paypal, without going to the gateway, it returned me a

PayPal gateway has rejected request. Payment has already been made for this InvoiceID (#10412: Duplicate invoice).
@nmallepally This order already exists.
Please, create a new test order.
@quienti I create a translation test with no single quote. I've create an issue on french language pack
@nmallepally , yes, try with a new order
@Imaginaerum Okay, I will try to simulate an order with Paypal with french pack in the day.
@nmallepally @quienti can you try with this Dictionary ?
@Imaginaerum @quienti this is what i found

@nmallepally same bug into english.
@Imaginaerum Yes,
we can't place the order
So, this is a bug from Magento, you need to wait a response from a Magento members, sorry @nmallepally
@quienti thanks for your time, so the errors from log above are normal? is there a way to fix them?
No, this is not normal, but this error can help Magento members to resolve this problem.
@quienti yeah i just found that there are plenty of similar issues being reported , there is no solution for it at the moment i suppose its better to stop paypal payments. i found its being fixed on MAGETWO-54787 internally.
Good, so if there are another issue like you, you can close this issue, and you can click on the button "subcribe" in this issue related, and when a person add comment on this issue, you are notified!
@quienti I'm not sure, where to track the fix as well, paypal is our main payment method.
we have less time to fix, before we go live. It works well with authipay payment method.
Paypal does not work, gives me this error every time.
@nmallepally , I understand, but I can not help you for this problem, you need to wait a response from Magento members :/
@quienti Yeah, sure. thanks. I even did try to do the real payment, it returns me the same error.
will wait for the magento guys to come back. Thanks again for the support.
Hi @nmallepally , let me inform you that the fix is already in develop branch and will be available in 2.1.1 patch.
Best,
Anton.
Hi @antboiko Can you give me the link to fix on develop branch, so that i can fix it on my website.
Hi @nmallepally , please the following commits 65f263b2bc1d1af62235099007e45da5f1f732f8, 7f5b6443c8aad774bb3389fca9c4d372aaa3f1af, 4173292aab6d4f84dfbe61da0fd7a09765f0db6e, b110260645313f4a9c3749637e6f8a7b37a2fffb, 0fff31d5cac793b7f7dfc4788a8c4911973d26b6, 93402f5c3e992e74de87444b11224adb5c4fe395
Regards,
Anton.
Great. Thanks @antboiko Thanks, will implement and let you know the output.
Does above fixes would also work for paypal payment action method-> order and authorization as well?.
@antboiko
where do i find the structure app/code/Magento/Sales/Setup/InstallSchema.php
app/code/Magento/Sales/Setup/UpgradeSchema.php
should i do the above changes here httpdocs / vendor / magento / module-sales / Setup / InstallSchema.php
httpdocs / vendor / magento / module-sales / Setup / UpgradeSchema.php
Depending on whether you did a composer install or a clone ,the modules are deployed in different location in the directory structure.
if you did a clone, they would be in app/code/Magento/module
However, if you install via composer, they would be in vendor/magento/module-xyz .
Hope this helps.
@dthampy Thank you.
@antboiko I have done the above commits, The paypal does not work for payment action ORDER, it works for sale and authorization type, when tested in real mode.
But three of them does not work during test mode.
Another strange error is that, It does not allow me to order cash on delivery or other payment methods. Gives me an error unable to pay at this time only for a single customer account, it works when tested as a guest and other customer accounts.
IT also gives me duplicate invoice error, gets stuck with duplicate invoice error.
Paypal error appears on home page and product pages after closing and opening browser as well.



@nmallepally , created an internal jira ticket - MAGETWO-56760 for your issue
Hi,
Do we have an update on this, i'm experiencing a similar bug when i configure Paypal Express Checkout. The payment goes through in my sandbox account, but i'm getting the following critical exception
Exception: Wrong order ID: "000000005".

And when i return back to my site, i'm returned back to the review page, even though i have not enabled the review step. And the following error message is displayed
We can't create the order
I'm also experiencing the same error with a stripe integration, the order isn't created in the backend.
As payments are such a fundamental part of any ecommerce site, i'm disappointed there are seemingly so many issues in this area.
When will the patch 2.1.1 be released, i've tried manually updating the core code in accordance with the revisions above, but this has not resolved the issue and this is becoming a serious problem for our client.
Any update on this would be greatly appreciated.
KInd regards,
Sophie
Any update on this? Could this be to do with setting up a test payment account and configuring it on two environments, i.e. having two potential order streams, within Paypal. I've removed the configured details from all but 1 environment, but still having issues with both Paypal and Stripe. Any help, or an estimate of how long I will need to wait before a fix is found, would be appreciated.
@nmallepally : Do you find the solution regards to PayPal express ? We are facing same issue but no luck.
@vishveskrish It works for me on Live environment, for payment action type - sale and authorization on above commits.
Does not work for orders though. if you are testing in sandbox mode, try switching to live by changing payment action and give a try. may be it should work out.
It isn't a good solution, but we had to to move with something working on paypal as we cannot block go live.
@nmallepally : Have You run the below query to resolve the issue ?
ALTER TABLE sales_invoice_grid ADD base_grand_total decimal(12,4) AFTER grand_total;
Or what steps you have performed can you please list down ?
Thank you!
2.1.8 still have this issue.
[2017-08-30 18:10:00] main.CRITICAL: Exception: Wrong order ID: "XXXXXXXXXX". in /opt/bitnami/apps/magento/htdocs/vendor/magento/module-paypal/Model/Ipn.php:140
Stack trace:
I can confirm that I'm seeing this in 2.1.9.
Is there a workaround for this a.t.m?
@nmallepally, thank you for your report.
We've created internal ticket(s) MAGETWO-56760 to track progress on the issue.
We've also gotten this error on 2.1.9, the invoice failed to turn into an order and returns 500 internal server error every time.
This issue has been there for years. Upgraded to 2.2.2, the error still occurs. Probably the most ignored issue that kills the checkout process. Its really sad
Hi @nmallepally, @s00071609, @zack6849, @maderlock
Fix for the issue should be delivered with the 2.2.4 release with the commit 137dc666d76cc262f435cae22cd7f0f8759999ee
Closing, as the fix is delivered to the 2.2-develop branch.
Most helpful comment
@quienti Yeah, sure. thanks. I even did try to do the real payment, it returns me the same error.
will wait for the magento guys to come back. Thanks again for the support.