06/03 Optimize codes, fix Schwab Account sync error 2

This commit is contained in:
2026-06-03 13:37:10 -04:00
parent 56608ed220
commit c18c936a11
3 changed files with 166 additions and 14 deletions
+14 -2
View File
@@ -89,10 +89,22 @@ SCHWAB_REDIRECT_URI=https://pfm.ngodanguyen.tech/schwab/callback</pre>
</div>
<div class="d-flex align-items-center gap-2 flex-shrink-0 ms-2">
{% if sa.pfm_account %}
<!-- Sync balance + investment positions -->
<form method="POST" action="{{ url_for('schwab.sync_snapshot', schwab_account_id=sa.id) }}"
style="display:inline;">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-sm btn-outline-success" 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>
<!-- Sync transactions -->
<a href="{{ url_for('schwab.sync_preview_view', schwab_account_id=sa.id) }}"
class="btn btn-sm btn-outline-primary" style="font-size:11px;">
<i class="bi bi-cloud-download me-1"></i>Sync
class="btn btn-sm btn-outline-primary" style="font-size:11px;"
title="Import new transactions">
<i class="bi bi-cloud-download me-1"></i>Transactions
</a>
<!-- Reset sync cursor -->
<form method="POST" action="{{ url_for('schwab.full_resync', schwab_account_id=sa.id) }}"
style="display:inline;"
onsubmit="return confirm('Reset sync cursor for {{ sa.account_name }}?\nNext sync re-fetches 90 days. Duplicates are skipped.')">