Implement functionality that allows users to attach payments to sales or purchase invoices. Only display unpaid invoices for the logged-in user, filtered by the same currency. Once selected, generate the corresponding sales or purchase invoice payment and attach it to the appropriate invoice.