月次レポート機能を実装し、経費の取り消し・復帰機能を追加。CSV取込画面にドラッグ&ドロップエリアを実装し、エラーメッセージ表示を追加。金額のカンマ区切り表示を全体に適用。faviconとapple-touch-iconを追加し、404エラーを回避。作業ログをdiary.mdに追記。

This commit is contained in:
president
2025-12-21 16:36:39 +09:00
parent d301ddcbfb
commit 7ae367cd66
17 changed files with 682 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
{% extends 'base.html' %}
{% load humanize %}
{% block title %}月次レポート{% endblock %}
@@ -8,20 +9,181 @@
<form method="get">
<label>
年月
<input type="month" name="target_month">
<input type="month" name="target_month" value="{{ target_month }}">
</label>
<button type="submit">表示</button>
</form>
{% if error_message %}
<p style="color: #b00020;">{{ error_message }}</p>
{% endif %}
<div>
<h3>合計</h3>
<p class="amount">{{ report.total_amount|intcomma }} 円</p>
</div>
<div>
<h3>店舗別合計</h3>
<p>集計結果をここに表示。</p>
<table>
<thead>
<tr>
<th>店舗</th>
<th>件数</th>
<th class="amount">金額</th>
</tr>
</thead>
<tbody>
{% for row in report.store_totals %}
<tr>
<td>{{ row.store__name|default:"未設定" }}</td>
<td>{{ row.count }}</td>
<td class="amount">{{ row.total|intcomma }}</td>
</tr>
{% empty %}
<tr>
<td colspan="3">対象データがありません。</td>
</tr>
{% endfor %}
</tbody>
</table>
{% for row in report.store_totals %}
<h4>{{ row.store__name|default:"未設定" }} の明細</h4>
<table>
<thead>
<tr>
<th>日付</th>
<th>利用先</th>
<th class="amount">金額</th>
<th>備考</th>
</tr>
</thead>
<tbody>
{% for detail in row.details %}
<tr>
<td>{{ detail.use_date }}</td>
<td>{{ detail.description }}</td>
<td class="amount">{{ detail.amount|intcomma }}</td>
<td>{{ detail.note }}</td>
</tr>
{% empty %}
<tr>
<td colspan="4">対象データがありません。</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
</div>
<div>
<h3>経費区分別合計</h3>
<p>集計結果をここに表示。</p>
<table>
<thead>
<tr>
<th>経費区分</th>
<th>件数</th>
<th class="amount">金額</th>
</tr>
</thead>
<tbody>
{% for row in report.category_totals %}
<tr>
<td>{{ row.expense_category__name|default:"未設定" }}</td>
<td>{{ row.count }}</td>
<td class="amount">{{ row.total|intcomma }}</td>
</tr>
{% empty %}
<tr>
<td colspan="3">対象データがありません。</td>
</tr>
{% endfor %}
</tbody>
</table>
{% for row in report.category_totals %}
<h4>{{ row.expense_category__name|default:"未設定" }} の明細</h4>
<table>
<thead>
<tr>
<th>日付</th>
<th>利用先</th>
<th class="amount">金額</th>
<th>備考</th>
</tr>
</thead>
<tbody>
{% for detail in row.details %}
<tr>
<td>{{ detail.use_date }}</td>
<td>{{ detail.description }}</td>
<td class="amount">{{ detail.amount|intcomma }}</td>
<td>{{ detail.note }}</td>
</tr>
{% empty %}
<tr>
<td colspan="4">対象データがありません。</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
</div>
<div>
<p>未分類件数の警告をここに表示。</p>
<h3>区分別合計</h3>
<table>
<thead>
<tr>
<th>区分</th>
<th>件数</th>
<th class="amount">金額</th>
</tr>
</thead>
<tbody>
{% for row in report.owner_totals %}
<tr>
<td>{{ row.owner_type }}</td>
<td>{{ row.count }}</td>
<td class="amount">{{ row.total|intcomma }}</td>
</tr>
{% empty %}
<tr>
<td colspan="3">対象データがありません。</td>
</tr>
{% endfor %}
</tbody>
</table>
{% for row in report.owner_totals %}
<h4>{{ row.owner_type }} の明細</h4>
<table>
<thead>
<tr>
<th>日付</th>
<th>利用先</th>
<th class="amount">金額</th>
<th>備考</th>
</tr>
</thead>
<tbody>
{% for detail in row.details %}
<tr>
<td>{{ detail.use_date }}</td>
<td>{{ detail.description }}</td>
<td class="amount">{{ detail.amount|intcomma }}</td>
<td>{{ detail.note }}</td>
</tr>
{% empty %}
<tr>
<td colspan="4">対象データがありません。</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
</div>
<div>
<h3>未分類件数</h3>
<ul>
<li>店舗未設定: {{ report.unclassified_counts.store_missing }}</li>
<li>経費区分未設定: {{ report.unclassified_counts.category_missing }}</li>
<li>区分未設定: {{ report.unclassified_counts.owner_pending }}</li>
<li>対象総件数: {{ report.unclassified_counts.total }}</li>
</ul>
</div>
</section>
{% endblock %}