Partial Invoices & Refunds

Product Fees are stored on sales items and are automatically prorated by quantity for invoices and credit memos.

Partial Invoices

When creating an invoice for a subset of ordered quantity, fee amounts are calculated as:

fee_on_invoice_item = fee_on_order_item * (invoiced_qty / ordered_qty)

The prorated values are stored on the invoice item — as fee amounts, tax amounts and a JSON snapshot of which fee types applied. The order item carries the same data, so the invoice row always traces back to what was charged.

Partial Refunds (Credit Memos)

Credit memos use the same ratio logic:

fee_on_creditmemo_item = fee_on_order_item * (refunded_qty / ordered_qty)

This keeps fee totals consistent across multiple partial invoices / refunds.

Sales, email, and PDF blocks read fee data from the invoice or credit memo item when available. This keeps displayed fee rows aligned with the prorated document instead of showing the full order-item amount on every partial document.