06/03 Optimize codes, move account action buttons to Accounts page
This commit is contained in:
+10
-1
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user