E-1 完了サマリー
実施内容 # 変更内容 ファイル 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 からダウンロードして確認できます。
This commit is contained in:
@@ -2,107 +2,84 @@
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>中山間地域直接支払申请书</title>
|
||||
<title>中山間地域等直接支払交付金({{ year }}年度)</title>
|
||||
<style>
|
||||
@page {
|
||||
size: A4 landscape;
|
||||
margin: 10mm;
|
||||
@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: 10pt;
|
||||
line-height: 1.5;
|
||||
font-size: 8pt;
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-size: 14pt;
|
||||
margin-bottom: 20pt;
|
||||
}
|
||||
h2 {
|
||||
font-size: 12pt;
|
||||
border-bottom: 1px solid #333;
|
||||
margin-top: 15pt;
|
||||
font-size: 13pt;
|
||||
margin: 0 0 8pt 0;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 10pt;
|
||||
}
|
||||
th, td {
|
||||
border: 1px solid #333;
|
||||
padding: 5pt;
|
||||
text-align: left;
|
||||
padding: 2pt 4pt;
|
||||
vertical-align: top;
|
||||
}
|
||||
th {
|
||||
background-color: #f0f0f0;
|
||||
font-size: 7pt;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.info-row {
|
||||
display: flex;
|
||||
margin-bottom: 5pt;
|
||||
td {
|
||||
font-size: 7.5pt;
|
||||
}
|
||||
.info-label {
|
||||
font-weight: bold;
|
||||
width: 100pt;
|
||||
.num {
|
||||
text-align: right;
|
||||
}
|
||||
.crop-table th {
|
||||
width: 30%;
|
||||
}
|
||||
.crop-table td {
|
||||
width: 70%;
|
||||
.empty {
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>中山間地域直接支払申请书 - {{ year }}年度</h1>
|
||||
|
||||
{% for item in data %}
|
||||
<h2>{{ item.chusankan.c_id }} - {{ item.chusankan.oaza }}{{ item.chusankan.aza }}</h2>
|
||||
|
||||
<div class="info-row">
|
||||
<span class="info-label">大字:</span>
|
||||
<span>{{ item.chusankan.oaza }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">字:</span>
|
||||
<span>{{ item.chusankan.aza }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">地番:</span>
|
||||
<span>{{ item.chusankan.chiban }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">面積:</span>
|
||||
<span>{{ item.chusankan.area }} ha</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">支払金額:</span>
|
||||
<span>{{ item.chusankan.payment_amount|default:"-" }} 円</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">関連圃場数:</span>
|
||||
<span>{{ item.field_count }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">作付面積合計:</span>
|
||||
<span>{{ item.total_area|floatformat:4 }} 反</span>
|
||||
</div>
|
||||
|
||||
{% if item.crops %}
|
||||
<table class="crop-table">
|
||||
<h1>中山間地域等直接支払交付金({{ year }}年度)</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>所在地</th>
|
||||
<th>植栽面積(m2)</th>
|
||||
<th>作付品目(元)</th>
|
||||
<th>協定管理者</th>
|
||||
<th>所有者</th>
|
||||
<th>作物</th>
|
||||
<th>品種</th>
|
||||
<th>圃場名称</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for crop in item.crops %}
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
<td>{{ crop.name }}</td>
|
||||
<td>{{ crop.variety }}</td>
|
||||
<td>{{ row.location }}</td>
|
||||
<td class="num">{{ row.planting_area|default:"—" }}</td>
|
||||
<td>{{ row.original_crop|default:"—" }}</td>
|
||||
<td>{{ row.manager|default:"—" }}</td>
|
||||
<td>{{ row.owner|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>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -2,95 +2,80 @@
|
||||
<html lang="ja">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>水稲共済申请书</title>
|
||||
<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: 10pt;
|
||||
line-height: 1.5;
|
||||
font-size: 9pt;
|
||||
line-height: 1.4;
|
||||
margin: 0;
|
||||
}
|
||||
h1 {
|
||||
text-align: center;
|
||||
font-size: 14pt;
|
||||
margin-bottom: 20pt;
|
||||
}
|
||||
h2 {
|
||||
font-size: 12pt;
|
||||
border-bottom: 1px solid #333;
|
||||
margin-top: 15pt;
|
||||
margin: 0 0 10pt 0;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 10pt;
|
||||
}
|
||||
th, td {
|
||||
border: 1px solid #333;
|
||||
padding: 5pt;
|
||||
text-align: left;
|
||||
padding: 3pt 5pt;
|
||||
vertical-align: top;
|
||||
}
|
||||
th {
|
||||
background-color: #f0f0f0;
|
||||
font-size: 8pt;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.info-row {
|
||||
display: flex;
|
||||
margin-bottom: 5pt;
|
||||
td {
|
||||
font-size: 8.5pt;
|
||||
}
|
||||
.info-label {
|
||||
font-weight: bold;
|
||||
width: 100pt;
|
||||
.num {
|
||||
text-align: right;
|
||||
}
|
||||
.crop-table th {
|
||||
width: 30%;
|
||||
}
|
||||
.crop-table td {
|
||||
width: 70%;
|
||||
.empty {
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>水稲共済申请书 - {{ year }}年度</h1>
|
||||
|
||||
{% for item in data %}
|
||||
<h2>{{ item.kyosai.k_num }} - {{ item.kyosai.kanji_name }}</h2>
|
||||
|
||||
<div class="info-row">
|
||||
<span class="info-label">住所:</span>
|
||||
<span>{{ item.kyosai.address }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">面積:</span>
|
||||
<span>{{ item.kyosai.area }} ha</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">関連圃場数:</span>
|
||||
<span>{{ item.field_count }}</span>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">作付面積合計:</span>
|
||||
<span>{{ item.total_area|floatformat:4 }} 反</span>
|
||||
</div>
|
||||
|
||||
{% if item.crops %}
|
||||
<table class="crop-table">
|
||||
<h1>水稲共済細目書({{ year }}年度)</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>作物</th>
|
||||
<th>漢字地名</th>
|
||||
<th>耕地-分筆</th>
|
||||
<th>本地面積(m2)</th>
|
||||
<th>作付品目</th>
|
||||
<th>品種</th>
|
||||
<th>圃場名称</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for crop in item.crops %}
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
<td>{{ crop.name }}</td>
|
||||
<td>{{ crop.variety }}</td>
|
||||
<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>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user