実施内容 # 変更内容 ファイル 1 OfficialChusankanField に 11 フィールド追加(17列化) models.py 2 中山間インポート: 17 列すべて読み込み対応 views.py 3 共済インポート: 面積カラム名不一致バグ修正 + a→m2 変換(×100) views.py 4 シリアライザに 11 フィールド追加 serializers.py 5 共済 PDF: A4 縦、表形式、@page 設定、ページ番号、中国語除去 kyosai_template.html 6 中山間 PDF: A4 横、表形式、@page 設定、ページ番号、中国語除去 chusankan_template.html 7 PDF 生成ロジック: フラットテーブル、null 安全、prefetch_related reports/views.py 8 既存データ再インポート(共済面積修正 + 中山間 17 列埋め) — 9 Playwright E2E テスト 11 件全 PASS verify-fixes.spec.ts 追加発見・修正したバグ 共済 ODS の 本地面積 (m2) カラム名にスペースが含まれ、インポート時に面積が全件 0 になっていた 面積の単位がアール(a)であることが判明。m2 への変換 (×100) を追加 PDF は http://localhost:3000/reports からダウンロードして確認できます。
82 lines
2.2 KiB
HTML
82 lines
2.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ja">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>水稲共済細目書({{ year }}年度)</title>
|
|
<style>
|
|
@page {
|
|
size: A4 portrait;
|
|
margin: 15mm;
|
|
@bottom-center {
|
|
content: counter(page) " / " counter(pages);
|
|
font-size: 8pt;
|
|
color: #666;
|
|
}
|
|
}
|
|
body {
|
|
font-family: "Noto Sans CJK JP", "Hiragino Kaku Gothic ProN", sans-serif;
|
|
font-size: 9pt;
|
|
line-height: 1.4;
|
|
margin: 0;
|
|
}
|
|
h1 {
|
|
text-align: center;
|
|
font-size: 14pt;
|
|
margin: 0 0 10pt 0;
|
|
}
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
th, td {
|
|
border: 1px solid #333;
|
|
padding: 3pt 5pt;
|
|
vertical-align: top;
|
|
}
|
|
th {
|
|
background-color: #f0f0f0;
|
|
font-size: 8pt;
|
|
text-align: center;
|
|
white-space: nowrap;
|
|
}
|
|
td {
|
|
font-size: 8.5pt;
|
|
}
|
|
.num {
|
|
text-align: right;
|
|
}
|
|
.empty {
|
|
color: #999;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>水稲共済細目書({{ year }}年度)</h1>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>漢字地名</th>
|
|
<th>耕地-分筆</th>
|
|
<th>本地面積(m2)</th>
|
|
<th>作付品目</th>
|
|
<th>品種</th>
|
|
<th>圃場名称</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for row in rows %}
|
|
<tr>
|
|
<td>{{ row.kanji_name }}</td>
|
|
<td>{{ row.k_s_num }}</td>
|
|
<td class="num">{{ row.area|default:"—" }}</td>
|
|
<td>{% if row.crop %}{{ row.crop }}{% else %}<span class="empty">—</span>{% endif %}</td>
|
|
<td>{% if row.variety %}{{ row.variety }}{% else %}<span class="empty">—</span>{% endif %}</td>
|
|
<td>{% if row.field_name %}{{ row.field_name }}{% else %}<span class="empty">—</span>{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</body>
|
|
</html>
|