I am using Magento 1.7.0.2 and I have a problem with some orders. They are paid by CC and the order is now Completed but I can not create an Invoice. I can not see the invoice button on Order and I can not invoice it Pro-grammatically too. I tried to invoice it with a custom module that I created but still it is blocked on $order->canInvoice().
How can I force it to create or at least how can I see the detailed error?
I am printing out the caught $e and it says data_invalid that is all.
Any help will be appreciated.
Best Answer
This is what app/code/core/Mage/Sales/Model/Order.php say on what happens in
$order->canInvoice();
line 603. To summarize:It must NOT have an
unhold
orinvoice
action flag. Apparently this could be reversed by setting all flags off:It should NOT be of the following status:
canceled
,complete
,payment_review
,holded
orclosed
. (Programatically resetting status tonew
can get you out of this).I admit it's a pretty long list to just to get that pesky
Invoice
button back.