06/01 Fix Save Income/Expense buttons don't work

This commit is contained in:
2026-06-01 13:30:37 -04:00
parent e9d4a18d3c
commit 3d0ebc92c6
+11 -11
View File
@@ -102,9 +102,17 @@
{{ form.notes(class="form-control", rows=2, placeholder="Optional notes", id="field_notes") }} {{ form.notes(class="form-control", rows=2, placeholder="Optional notes", id="field_notes") }}
</div> </div>
<!-- Receipt section (edit mode only) --> <div class="d-flex gap-2">
<button type="submit" class="btn {% if txn_type=='income' %}btn-success{% else %}btn-danger{% endif %}">
Save {{ txn_type | title }}
</button>
<a href="{{ url_for('transactions.index', tab=txn_type) }}" class="btn btn-outline-secondary">Cancel</a>
</div>
</form>
{# Receipt section — kept OUTSIDE #txnForm to avoid nested-form breakage #}
{% if txn and txn.receipt %} {% if txn and txn.receipt %}
<div class="mb-3 p-3" style="background:#f8fafc;border-radius:8px;"> <div class="mt-3 p-3" style="background:#f8fafc;border-radius:8px;">
<div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center">
<div style="font-size:13px;"> <div style="font-size:13px;">
<i class="bi bi-paperclip me-1 text-muted"></i> <i class="bi bi-paperclip me-1 text-muted"></i>
@@ -126,7 +134,7 @@
</div> </div>
</div> </div>
{% elif txn %} {% elif txn %}
<div class="mb-3"> <div class="mt-3">
<label class="form-label fw-medium" style="font-size:13px;">Receipt</label> <label class="form-label fw-medium" style="font-size:13px;">Receipt</label>
<form method="POST" action="{{ url_for('settings.upload_receipt', txn_id=txn.id) }}" <form method="POST" action="{{ url_for('settings.upload_receipt', txn_id=txn.id) }}"
enctype="multipart/form-data" id="receiptUploadForm"> enctype="multipart/form-data" id="receiptUploadForm">
@@ -141,14 +149,6 @@
</form> </form>
</div> </div>
{% endif %} {% endif %}
<div class="d-flex gap-2">
<button type="submit" class="btn {% if txn_type=='income' %}btn-success{% else %}btn-danger{% endif %}">
Save {{ txn_type | title }}
</button>
<a href="{{ url_for('transactions.index', tab=txn_type) }}" class="btn btn-outline-secondary">Cancel</a>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>