Files
Personal-Finance-Management/app/templates/utilities/pay.html
T

77 lines
3.4 KiB
HTML

{% extends "base.html" %}
{% block title %}Pay Bill{% endblock %}
{% block page_title %}Mark Bill Paid{% endblock %}
{% block topbar_actions %}
<a href="{{ url_for('utilities.provider_detail', id=bill.provider_id) }}" class="btn btn-sm btn-outline-secondary" style="font-size:12px;">← {{ bill.provider.name }}</a>
{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-12 col-md-8 col-lg-5">
<!-- Bill summary -->
<div class="pcard mb-3" style="border-left:4px solid {{ bill.provider.color }};">
<div class="d-flex align-items-center gap-3">
<div style="width:42px;height:42px;border-radius:10px;background:{{ bill.provider.color }}22;color:{{ bill.provider.color }};display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0;">
<i class="bi {{ bill.provider.icon }}"></i>
</div>
<div class="flex-grow-1">
<div style="font-size:14px;font-weight:600;">{{ bill.provider.name }}</div>
<div style="font-size:12px;color:var(--muted);">{{ bill.period_label }}</div>
</div>
<div class="text-end">
<div class="mono fw-bold" style="font-size:20px;">{{ bill.amount | currency }}</div>
{% if bill.due_date %}
<div style="font-size:11px;color:var(--muted);">Due {{ bill.due_date.strftime('%b %d, %Y') }}</div>
{% endif %}
</div>
</div>
{% if bill.usage %}
<div class="d-flex justify-content-between mt-3 pt-3" style="border-top:1px solid var(--border);font-size:12px;">
<span class="text-muted">Usage</span>
<span class="mono">{{ '%.1f' | format(bill.usage | float) }} {{ bill.usage_unit or '' }}
{% if bill.rate_per_unit %}· {{ current_user.currency_symbol }}{{ '%.4f' | format(bill.rate_per_unit) }} per {{ bill.usage_unit or 'unit' }}{% endif %}
</span>
</div>
{% endif %}
</div>
<div class="pcard">
<p class="text-muted" style="font-size:12px;">
This records an expense transaction for the bill amount and links the two together.
If the payment already came in through a bank sync,
<a href="{{ url_for('utilities.bill_link', id=bill.id) }}">link the existing transaction</a> instead to avoid a duplicate.
</p>
<form method="POST" novalidate>
{{ form.hidden_tag() }}
<div class="mb-3">
{{ 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 %}<div class="invalid-feedback">{{ e }}</div>{% endfor %}
</div>
<div class="row g-3 mb-4">
<div class="col-7">
{{ form.category_id.label(class="form-label fw-medium", style="font-size:13px;") }}
{{ form.category_id(class="form-select") }}
</div>
<div class="col-5">
{{ form.paid_date.label(class="form-label fw-medium", style="font-size:13px;") }}
{{ form.paid_date(class="form-control") }}
</div>
</div>
<div class="d-flex gap-2">
{{ form.submit(class="btn btn-primary") }}
<a href="{{ url_for('utilities.provider_detail', id=bill.provider_id) }}" class="btn btn-outline-secondary">Cancel</a>
</div>
</form>
</div>
</div>
</div>
{% endblock %}