InvoiceQuantityValidator
Magento\Sales\Model\Order\InvoiceQuantityValidator
What it does
This validator ensures that invoice quantities are valid before an invoice is created in Magento 2.
It checks that the invoice has an associated order, verifies that invoice quantities don't exceed available uninvoiced quantities for each product, and ensures the invoice contains at least one product from the original order.
Developers use this class automatically during invoice creation to prevent data integrity issues.
Public Methods
- validate()