Sylius / InvoicingPlugin

Generate an Invoice for every placed order
MIT License
79 stars 82 forks source link

Partial Invoicing #57

Open PatrickJuergens opened 6 years ago

PatrickJuergens commented 6 years ago

Currently, you can only create an invoice for the entire purchase order.

There are business cases for which a partial invoice is necessary.

interface InvoiceGeneratorInterface
{
    public function generateForOrder(OrderInterface $order, \DateTimeInterface $date): InvoiceInterface;

    /**
     * @param array $orderItemData [['orderItem' => $orderItem1, 'quantity' => 1],['orderItem' => $orderItem2, 'quantity' => 1]]
     * @param int $shippingAmount Shipping amount for this invoivce
     * @param \DateTimeInterface $date
     * @return InvoiceInterface
     */
    public function generateForOrderItems(array $orderItemData, int $shippingAmount, \DateTimeInterface $date): InvoiceInterface;
}
diimpp commented 4 years ago

It also may be dependant on multiple partial payment https://github.com/Sylius/InvoicingPlugin/issues/142