Include pending purchases in get_all_loan_ids