QuestionQ64

VerifiedCustomizing Sales Operations

An integration uses a cron service that runs twice daily and sends the Order ID to the integrated ERP system when orders are eligible to create an invoice. The order has already been loaded with the following code:

$order = $this->orderRepository->get($orderId);  

To determine whether the store has invoices that can be created, which implementation should the Adobe Commerce developer use?

Explanation

canInvoice() is the Adobe Commerce order-model eligibility check for invoice creation. It evaluates whether the order can be invoiced, whereas hasInvoice() only reports the presence of an existing invoice and isPaymentReview() only reports the payment-review state.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!