To apply a prepayment invoice:
View the invoice created from the same sales order.
Click the Apply Prepayment Invoice button. A pop-up window will appear that will show the list of prepayment invoice.
Select the prepayment invoice to be applied.
Click the Submit button. The invoice will be modified to include the prepayment lines.