{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block page_title %}{{ title }}{% endblock %} {% block extra_css %} #ocrDropZone { border: 2px dashed var(--border); border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: all .2s; background: #f8fafc; } #ocrDropZone.dragover { border-color: #3b82f6; background: #eff6ff; } #ocrDropZone.loading { border-color: #818cf8; background: #f5f3ff; } #ocrDropZone.success { border-color: #10b981; background: #f0fdf4; } #ocrDropZone.error { border-color: #ef4444; background: #fef2f2; } .ocr-field-highlight { animation: ocr-flash .6s ease; } @keyframes ocr-flash { 0%,100%{background:transparent} 50%{background:#d1fae5} } {% endblock %} {% block content %}
AI Receipt Scanner
Drop receipt image here or click to upload
JPG, PNG, GIF, WEBP · max 10MB · Powered by Groq vision
{{ form.hidden_tag() }} {{ form.transaction_type() }}
{{ form.description.label(class="form-label fw-medium", style="font-size:13px;") }} {{ form.description(class="form-control" + (" is-invalid" if form.description.errors else ""), placeholder="What was this for?", id="field_description") }} {% for e in form.description.errors %}
{{ e }}
{% endfor %}
{{ form.amount.label(class="form-label fw-medium", style="font-size:13px;") }}
{{ current_user.currency_symbol }} {{ form.amount(class="form-control" + (" is-invalid" if form.amount.errors else ""), placeholder="0.00", id="field_amount") }}
{% for e in form.amount.errors %}
{{ e }}
{% endfor %}
{{ form.date.label(class="form-label fw-medium", style="font-size:13px;") }} {{ form.date(class="form-control" + (" is-invalid" if form.date.errors else ""), id="field_date") }}
{{ form.account_id.label(class="form-label fw-medium", style="font-size:13px;") }} {{ form.account_id(class="form-select" + (" is-invalid" if form.account_id.errors else "")) }} {% for e in form.account_id.errors %}
{{ e }}
{% endfor %}
{{ form.category_id.label(class="form-label fw-medium", style="font-size:13px;") }} {{ form.category_id(class="form-select", id="field_category") }}
{{ form.notes.label(class="form-label fw-medium", style="font-size:13px;") }} {{ form.notes(class="form-control", rows=2, placeholder="Optional notes", id="field_notes") }}
Cancel
{# Receipt section — kept OUTSIDE #txnForm to avoid nested-form breakage #} {% if txn and txn.receipt %} {% elif txn %}
PNG, JPG, WEBP, PDF — max 10MB
{% endif %}
{% endblock %} {% block extra_js %} {% endblock %}