Invoice payment

After generating an Invoice for a client and the client pays the invoice ammount, how do I reflect that payment so that the client no longer has an outstanding balance and possibly send him a payment receit?

awesome topic

this should be automated if possible