Advice on table processing for invoice-allocation-payment structure for invoices of zero amount
In the end I went with option 1. That way it copes with people paying unnecessarily as there is an invoice against which to place the payment. It also allows for refunds to be made against zero amount invoices if someone pays unnecessarily but then wants a refund. The payment / refund can be put in the cash_payment table and allocated to the invoice through the payment_allocation table just like any other invoice.