Sometimes due to a failure to save a transaction to the database, you may have an orphaned receipt in your Audit Trail / History. That is to say, a Receipt transaction on its own, without a 'parent' Invoice transaction.

There is a utility below that will try and find & fix orphaned receipts.

Unfortunately this may not always work, sometimes you may have to reverse the receipt and simply re-bill and re-receipt.