06/03 Optimize codes, fix Schwab Account

This commit is contained in:
2026-06-03 13:45:16 -04:00
parent c18c936a11
commit 2735559ff5
4 changed files with 56 additions and 8 deletions
+29 -1
View File
@@ -26,6 +26,7 @@
<div class="row g-3">
{% for acct in accounts %}
{% set ta = teller_map.get(acct.id) %}
{% set sa = schwab_map.get(acct.id) %}
<div class="col-12 col-md-6 col-xl-4">
<div class="pcard" style="border-left: 4px solid {{ acct.color }};">
@@ -41,6 +42,9 @@
{% if ta %}
<span style="font-size:10px;background:#dbeafe;color:#1e40af;border-radius:4px;padding:1px 5px;margin-left:4px;vertical-align:middle;">Teller</span>
{% endif %}
{% if sa %}
<span style="font-size:10px;background:#d1fae5;color:#065f46;border-radius:4px;padding:1px 5px;margin-left:4px;vertical-align:middle;">Schwab</span>
{% endif %}
</div>
<div style="font-size:11px;color:var(--muted);">{{ acct.account_type | replace('_',' ') | title }}</div>
</div>
@@ -119,7 +123,7 @@
</div>
{% endif %}
<!-- Teller action buttons (only for accounts linked to Teller) -->
<!-- Teller action buttons -->
{% if ta %}
<div class="d-flex gap-2 mt-2 pt-2" style="border-top:1px solid var(--border);">
<button id="refbtn-{{ acct.id }}"
@@ -150,6 +154,30 @@
{% endif %}
{% endif %}
<!-- Schwab action buttons -->
{% if sa %}
<div class="d-flex gap-2 mt-2 pt-2" style="border-top:1px solid var(--border);">
<form method="POST" action="{{ url_for('schwab.sync_snapshot', schwab_account_id=sa.id) }}" style="flex:1;">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="next" value="{{ url_for('accounts.index', tab=tab) }}">
<button type="submit" class="btn btn-sm btn-outline-success w-100" style="font-size:11px;"
title="Pull live balance and investment positions from Schwab">
<i class="bi bi-arrow-clockwise me-1"></i>Balance &amp; Positions
</button>
</form>
<a href="{{ url_for('schwab.sync_preview_view', schwab_account_id=sa.id) }}"
class="btn btn-sm btn-outline-primary flex-fill" style="font-size:11px;"
title="Import new transactions from Schwab">
<i class="bi bi-cloud-download me-1"></i>Transactions
</a>
</div>
{% if sa.last_sync_date %}
<div style="font-size:10px;color:var(--muted);margin-top:4px;text-align:right;">
Last synced {{ sa.last_sync_date.strftime('%b %d') }}
</div>
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}