06/01 Fix Save Income/Expense buttons don't work
This commit is contained in:
@@ -102,9 +102,17 @@
|
||||
{{ form.notes(class="form-control", rows=2, placeholder="Optional notes", id="field_notes") }}
|
||||
</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 %}
|
||||
<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 style="font-size:13px;">
|
||||
<i class="bi bi-paperclip me-1 text-muted"></i>
|
||||
@@ -126,7 +134,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% elif txn %}
|
||||
<div class="mb-3">
|
||||
<div class="mt-3">
|
||||
<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) }}"
|
||||
enctype="multipart/form-data" id="receiptUploadForm">
|
||||
@@ -141,14 +149,6 @@
|
||||
</form>
|
||||
</div>
|
||||
{% 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>
|
||||
|
||||
Reference in New Issue
Block a user