I want to code an invoice so that it will zero out (marked paid) when it is paid.
I want to code an invoice so that it will zero out (marked paid) when it is paid.
I want to code an invoice so that it will zero out (marked paid) when it is paid.

Invoice are marked paid when they are paid. Exactly what do you want? Do you want something to appear in the customer's transactions list? You can see the paid watermark when you click on the invoice. The customer's balance is reduced by the amount of the invoice.
So can you explain what you want?