06/03 Optimize codes, move account action buttons to Accounts page

This commit is contained in:
2026-06-03 10:21:14 -04:00
parent daeea836d0
commit 395a2d9535
4 changed files with 132 additions and 135 deletions
+10 -1
View File
@@ -83,12 +83,21 @@ def index():
).group_by(Transaction.account_id).all()
monthly_charges = {row[0]: float(row[1]) for row in rows}
# Teller account mapping: pfm_account_id → TellerAccount
from app.models.teller_enrollment import TellerAccount
teller_accounts = TellerAccount.query.filter(
TellerAccount.pfm_account_id.in_([a.id for a in all_accounts]),
TellerAccount.is_active == True,
).all()
teller_map = {ta.pfm_account_id: ta for ta in teller_accounts}
return render_template('accounts/index.html',
accounts=accounts,
tab=tab,
bank_count=len(bank_accounts),
credit_count=len(credit_accounts),
monthly_charges=monthly_charges)
monthly_charges=monthly_charges,
teller_map=teller_map)
@accounts_bp.route('/new', methods=['GET', 'POST'])