import pandas as pd
from datetime import datetime
def check_overdue(tenants, due_date):
today = datetime.now().date()
overdue = []
for t in tenants:
if t['last_payment'] < due_date:
overdue.append(t)
return overdue
def collection_summary(tenants, total_due):
collected = sum(t['paid'] for t in tenants if t['status'] == 'Paid')
return {'collected': collected, 'outstanding': total_due - collected}
# Generate collection report