feat: 子ども・子育て支援金を給与・賞与計算に追加(令和8年4月以降)

This commit is contained in:
admin
2026-04-27 01:04:54 +09:00
parent 31a64d5b59
commit a646a81719
9 changed files with 3988 additions and 426 deletions

View File

@@ -432,12 +432,14 @@
<div id="tab-bonus" class="tab-content-calc">
<div class="filters">
<label>
対象年:
対象年:
<input
type="month"
id="filterBonusYearMonth"
style="width: 160px"
placeholder="YYYY-MM"
type="number"
id="filterBonusYear"
style="width: 90px"
value="2026"
min="2000"
max="2099"
/>
</label>
<button class="btn btn-primary" onclick="loadBonus()">検索</button>
@@ -1480,13 +1482,14 @@
now.getFullYear() + "-" + String(now.getMonth() + 1).padStart(2, "0");
const filterYearEl = document.getElementById("filterYear");
if (filterYearEl) filterYearEl.value = now.getFullYear();
document.getElementById("filterBonusYearMonth").value = ym;
const filterBonusYearEl = document.getElementById("filterBonusYear");
if (filterBonusYearEl) filterBonusYearEl.value = now.getFullYear();
loadPayrolls();
// =====================================================
// タブ切り替え機能
// =====================================================
let currentTab = "salary";
var currentTab = "salary";
function switchTab(tab) {
currentTab = tab;
@@ -1526,20 +1529,10 @@
// 賞与計算関連
// =====================================================
async function loadBonus() {
const ym = document.getElementById("filterBonusYearMonth").value;
let year = null;
let month = null;
if (ym) {
const parts = ym.split("-");
if (parts.length === 2) {
year = Number(parts[0]);
month = Number(parts[1]);
}
}
const year = document.getElementById("filterBonusYear").value;
const params = new URLSearchParams();
if (year) params.append("bonus_year", year);
if (month) params.append("bonus_month", month);
if (year) params.append("bonus_year", Number(year));
// employeeMapが空なら読み込む
if (!employeeMap || Object.keys(employeeMap).length === 0) {
@@ -2129,16 +2122,16 @@
<td class="value">¥${Number(salary.employment_insurance).toLocaleString()}</td>
</tr>
<tr>
<td class="label">子ども・子育て支援金</td>
<td class="value">¥${Number(salary.child_support || 0).toLocaleString()}</td>
<td class="label">所得税</td>
<td class="value">¥${Number(salary.income_tax).toLocaleString()}</td>
<td class="label">住民税</td>
<td class="value">¥${Number(salary.resident_tax).toLocaleString()}</td>
</tr>
<tr>
<td class="label">住民税</td>
<td class="value">¥${Number(salary.resident_tax).toLocaleString()}</td>
<td class="label">その他控除</td>
<td class="value">¥${Number(salary.other_deduction).toLocaleString()}</td>
<td class="label"></td>
<td class="value"></td>
</tr>
<tr class="total-row">
<td class="label">総控除額</td>
@@ -2215,10 +2208,16 @@
<td class="value">¥${Number(bonus.employment_insurance).toLocaleString()}</td>
</tr>
<tr>
<td class="label">子ども・子育て支援金</td>
<td class="value">¥${Number(bonus.child_support || 0).toLocaleString()}</td>
<td class="label">所得税</td>
<td class="value">¥${Number(bonus.income_tax).toLocaleString()}</td>
</tr>
<tr>
<td class="label">その他控除</td>
<td class="value">¥${Number(bonus.other_deduction).toLocaleString()}</td>
<td class="label"></td>
<td class="value"></td>
</tr>
<tr class="total-row">
<td class="label">総控除額</td>

View File

@@ -300,6 +300,9 @@
<option value="厚生年金">厚生年金</option>
<option value="雇用保険">雇用保険</option>
<option value="労災保険">労災保険</option>
<option value="子ども・子育て支援金">
子ども・子育て支援金
</option>
</select>
</div>
<div class="form-group">
@@ -795,6 +798,7 @@
const rates = {
healthNoCareRate: metadata.health_no_care_rate,
healthWithCareRate: metadata.health_with_care_rate,
childSupportRate: metadata.child_support_rate,
pensionRate: metadata.pension_rate,
};
@@ -885,26 +889,34 @@
<th rowspan="3">報酬月額 未満</th>
<th colspan="2">健康保険料(介護保険なし)</th>
<th colspan="2">健康保険料(介護保険あり)</th>
<th colspan="2">子ども・子育て支援金</th>
<th colspan="2">厚生年金保険料</th>
</tr>
<tr style="background-color: #f0f0f0;">
<th colspan="2" style="text-align: center; font-weight: bold; color: #007bff;">
${
rates.healthNoCareRate !== undefined
rates.healthNoCareRate != null
? rates.healthNoCareRate.toFixed(2) + "%"
: "-"
}
</th>
<th colspan="2" style="text-align: center; font-weight: bold; color: #007bff;">
${
rates.healthWithCareRate !== undefined
rates.healthWithCareRate != null
? rates.healthWithCareRate.toFixed(2) + "%"
: "-"
}
</th>
<th colspan="2" style="text-align: center; font-weight: bold; color: #007bff;">
${
rates.pensionRate !== undefined
rates.childSupportRate != null
? rates.childSupportRate.toFixed(4) + "%"
: "-"
}
</th>
<th colspan="2" style="text-align: center; font-weight: bold; color: #007bff;">
${
rates.pensionRate != null
? rates.pensionRate.toFixed(2) + "%"
: "-"
}
@@ -917,6 +929,8 @@
<th>折半額</th>
<th>全額</th>
<th>折半額</th>
<th>全額</th>
<th>折半額</th>
</tr>
</thead>
`;
@@ -924,13 +938,16 @@
<tbody>
${adjustedData
.map((row) => {
// 保険料を2で割って折半額を計算
// 全額を2で割って折半額を計算
const healthNoCareHalf = (
parseFloat(row.health_insurance_no_care) / 2
).toFixed(2);
const healthWithCareHalf = (
parseFloat(row.health_insurance_with_care) / 2
).toFixed(2);
const childSupportHalf = (
parseFloat(row.child_support ?? 0) / 2
).toFixed(2);
const pensionHalf = (
parseFloat(row.pension_insurance) / 2
).toFixed(2);
@@ -949,6 +966,8 @@
row.health_insurance_with_care ?? 0,
).toLocaleString()}</td>
<td>${Number(healthWithCareHalf ?? 0).toLocaleString()}</td>
<td>${Number(row.child_support ?? 0).toLocaleString()}</td>
<td>${Number(childSupportHalf).toLocaleString()}</td>
<td>${Number(
row.pension_insurance ?? 0,
).toLocaleString()}</td>