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 written to invoice item fields:
base_productfee_amount,productfee_amountbase_productfee_tax_amount,productfee_tax_amountproductfee_applied_json,productfee_tax_json(prorated from the order item snapshot)
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.