Open markjuliusuy opened 5 years ago
Hello! Markjuliusuy can you please confirm the issue is only with virtual or downloadable product?
Hi @markjuliusuy
I have the same problem (Magento 2.4.1). If I create the invoice using this:
$invoice = $this->_invoiceService->prepareInvoice($order); $invoice->register(); $invoice->setState(\Magento\Sales\Model\Order\Invoice::STATE_PAID); $invoice->save(); $transactionSave =$this->_transaction->addObject( $invoice->getOrder() ); $transactionSave->save(); $this->invoiceSender->send($invoice); $order->addStatusHistoryComment( __('Notified customer about invoice #%1.', $invoice->getId()) ) ->setIsCustomerNotified(true) ->save();
The invoice is to create perfectly, but when the delivery is created (on the panel), the order has a closed status. If I leave to generate the invoice by clicking on the panel, this problem does not happen.
Is there any parameter missing when creating the invoice?
@BushraAsif yes, it's only with the unshippable products.
@arielcugenotta it's bug, the code is correct. You can use the fix below with a plugin or a preference (like I did).
This has been fixed in 2.4-develop https://github.com/magento/magento2/commit/4f90cf54c303bdcb3de6d010a63fb8af87d46eec
@magento give me 2.4.2-p1 instance
We created a module to enable canCapture and canCapturePartial on bank transfer so that we can select if it's pending or paid
Preconditions (*)
Steps to reproduce (*)
I. Scenario
Expected result (*)
I. Scenario
Actual result (*)