116 lines
5.6 KiB
HTML
116 lines
5.6 KiB
HTML
|
|
{% extends "base.html" %}
|
|||
|
|
{% from 'macros/sortable.html' import sort_th %}
|
|||
|
|
{% block title %}账户流水 - {{ account.student.name if account.student else '' }}{% endblock %}
|
|||
|
|
{% block content %}
|
|||
|
|
<div class="page-toolbar">
|
|||
|
|
<div>
|
|||
|
|
<h4 class="page-title">
|
|||
|
|
<i class="bi bi-person-lines-fill"></i>
|
|||
|
|
{% if account.student %}<a href="{{ url_for('student_detail', id=account.student.id) }}">{{ account.student.name }}</a>{% else %}学员{% endif %}
|
|||
|
|
<span class="badge bg-secondary ms-2">{{ account.course.course_code or account.course.name if account.course else '' }}</span>
|
|||
|
|
</h4>
|
|||
|
|
<p class="page-sub text-muted">Excel 课时表流水 · 最新月份 {{ current.period or '—' }}</p>
|
|||
|
|
</div>
|
|||
|
|
<a href="{{ url_for('keshibiao_balances') }}" class="btn btn-neo-secondary"><i class="bi bi-arrow-left"></i> 返回余额表</a>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="row g-3 mb-4">
|
|||
|
|
<div class="col-md-3">
|
|||
|
|
<div class="neo-surface p-3 text-center">
|
|||
|
|
<p class="text-muted small mb-1">正课剩余</p>
|
|||
|
|
<p class="fs-4 fw-bold mb-0">{{ fmt_hours(current.end_lessons) }}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-md-3">
|
|||
|
|
<div class="neo-surface p-3 text-center">
|
|||
|
|
<p class="text-muted small mb-1">赠课剩余</p>
|
|||
|
|
<p class="fs-4 fw-bold mb-0">{{ fmt_hours(current.end_gift_lessons) }}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-md-3">
|
|||
|
|
<div class="neo-surface p-3 text-center">
|
|||
|
|
<p class="text-muted small mb-1">账户余额</p>
|
|||
|
|
<p class="fs-4 fw-bold text-success mb-0">{{ fmt_money(current.end_balance) }}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-md-3">
|
|||
|
|
<div class="neo-surface p-3 text-center">
|
|||
|
|
<p class="text-muted small mb-1">单价 / 节</p>
|
|||
|
|
<p class="fs-4 fw-bold mb-0">{{ fmt_price(current.unit_price) }}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="neo-surface p-4 mb-4">
|
|||
|
|
<h6 class="fw-bold mb-3">月度快照(月初 → 月末)</h6>
|
|||
|
|
<div class="table-responsive">
|
|||
|
|
<table class="table table-sm table-bordered align-middle">
|
|||
|
|
<thead class="table-light">
|
|||
|
|
<tr>
|
|||
|
|
<th>{{ sort_th('keshibiao_account', 'period', '月份', sort, order, account_params, '') }}</th>
|
|||
|
|
<th>{{ sort_th('keshibiao_account', 'unit_price', '单价/节', sort, order, account_params) }}</th>
|
|||
|
|
<th>月初正/赠/余额</th>
|
|||
|
|
<th>新签</th>
|
|||
|
|
<th>续费</th>
|
|||
|
|
<th>{{ sort_th('keshibiao_account', 'consumed', '消课/金额', sort, order, account_params, title='按本月消课节数排序') }}</th>
|
|||
|
|
<th>退费/账号费</th>
|
|||
|
|
<th>{{ sort_th('keshibiao_account', 'end_balance', '月末正/赠/总/余额', sort, order, account_params, title='按月末账户余额排序') }}</th>
|
|||
|
|
<th>备注</th>
|
|||
|
|
</tr>
|
|||
|
|
</thead>
|
|||
|
|
<tbody>
|
|||
|
|
{% for s in snapshots %}
|
|||
|
|
<tr>
|
|||
|
|
<td><strong>{{ s.period_label }}</strong></td>
|
|||
|
|
<td>{{ fmt_price(s.unit_price) }}</td>
|
|||
|
|
<td>
|
|||
|
|
{{ fmt_hours(s.prev_lessons) }} / {{ fmt_hours(s.prev_gift_lessons) }}<br>
|
|||
|
|
<small class="text-muted">{{ fmt_money(s.prev_balance) }}</small>
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
{% if s.new_signup_amount %}{{ fmt_money(s.new_signup_amount) }} +{{ fmt_hours(s.new_signup_lessons) }}节{% else %}-{% endif %}
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
{% if s.renewal_amount %}{{ fmt_money(s.renewal_amount) }} +{{ fmt_hours(s.renewal_lessons) }}节{% else %}-{% endif %}
|
|||
|
|
</td>
|
|||
|
|
<td>{{ fmt_hours(s.consumed_lessons) }}节<br><small>{{ fmt_money(s.consumed_amount) }}</small></td>
|
|||
|
|
<td>
|
|||
|
|
退{{ fmt_hours(s.refund_lessons) }}节<br>{{ fmt_money(s.refund_amount) }}<br>
|
|||
|
|
账号费 {{ fmt_money(s.account_fee) }}
|
|||
|
|
</td>
|
|||
|
|
<td>
|
|||
|
|
{{ fmt_hours(s.end_lessons) }} / {{ fmt_hours(s.end_gift_lessons) }} / {{ fmt_hours(s.end_total_lessons) }}<br>
|
|||
|
|
<strong class="text-success">{{ fmt_money(s.end_balance) }}</strong>
|
|||
|
|
</td>
|
|||
|
|
<td class="small">{{ s.notes or '-' }}</td>
|
|||
|
|
</tr>
|
|||
|
|
{% else %}
|
|||
|
|
<tr><td colspan="9" class="text-center text-muted">暂无快照</td></tr>
|
|||
|
|
{% endfor %}
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="neo-surface p-4">
|
|||
|
|
<h6 class="fw-bold mb-3"><i class="bi bi-calendar-event"></i> 上课记录(Excel 解析)</h6>
|
|||
|
|
<div class="table-responsive">
|
|||
|
|
<table class="table table-sm table-hover">
|
|||
|
|
<thead><tr><th>日期</th><th>课时</th><th>原始文本</th><th>归属月</th></tr></thead>
|
|||
|
|
<tbody>
|
|||
|
|
{% for r in class_records %}
|
|||
|
|
<tr>
|
|||
|
|
<td>{{ r.class_date }}</td>
|
|||
|
|
<td>{{ r.lessons_consumed }}</td>
|
|||
|
|
<td>{{ r.raw_text or '-' }}</td>
|
|||
|
|
<td>{{ r.year }}-{{ '%02d'|format(r.month) }}</td>
|
|||
|
|
</tr>
|
|||
|
|
{% else %}
|
|||
|
|
<tr><td colspan="4" class="text-center text-muted">暂无上课记录</td></tr>
|
|||
|
|
{% endfor %}
|
|||
|
|
</tbody>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
{% endblock %}
|