first of all, bank rec is about to match leger entries under a bank account against the a bank statement from that bank. for example, user has a posted invoice of 100 and get a payment from customer of 100 which is shown under that bank ledger entry.
later user gets a bank statement showing amount of 100, which could match up to the ledger entry and is able to be posted.
for another invoice, where total amount is 100 but customer only pays 98, the bank ledger entry shows 98 as the payment. when user gets a bank statement, it shows 98 as well. in this case, even though, the invoice might be showing as closed (due to payment tolerance) or not closed, user is still able to reconcile the bank ledger entry with the bank statement and post the bank rec.
the second scenario, if the invoice is still only with remaining balance of 2, user could close the invoice as needed by either
create a credit memo of 2 dollar, apply against the opening invoice to close it.
or
pursue the customer for the remaining balance and close the invoice in the future.
there might be other ways to close the invoice, but this is a separate issue from the bank reconciliation one.
the recommend method is to use payment tolerance, or user could manually modify some of the below fields as proper to close it