Typically the customer will send payment and then you'll record a Payment transaction and select the invoice it applies to. Then you'll deposit the payment into your bank account, perhaps with other payments.
Year end / closing books doesn't come into play in this process, which is perpetual.