修改
This commit is contained in:
@@ -916,7 +916,7 @@
|
||||
employee.employee_id
|
||||
})" style="padding: 5px 10px; font-size: 12px;">扶養家族追加</button></h3>
|
||||
${(() => {
|
||||
// 源泉税控除対象人数を計算(19歳以上または70歳以上)
|
||||
// 源泉税控除対象人数を計算(16歳以上)
|
||||
let koureiCount = 0;
|
||||
if (
|
||||
employee.dependents &&
|
||||
@@ -926,10 +926,11 @@
|
||||
const taxStatus = getTaxDeductionStatus(
|
||||
dep.birth_date
|
||||
);
|
||||
// 源泉税控除対象は19歳以上(一般扶養親族16-18歳は住民税のみなので除外)
|
||||
// 源泉税控除対象は16歳以上(一般扶養親族16-18歳、特定扶養親族19-22歳、老人扶養親族70歳以上)
|
||||
return (
|
||||
taxStatus?.isDeductible &&
|
||||
(taxStatus.type === "控除対象扶養親族" ||
|
||||
(taxStatus.type === "一般扶養親族" ||
|
||||
taxStatus.type === "控除対象扶養親族" ||
|
||||
taxStatus.type === "老人扶養親族")
|
||||
);
|
||||
}).length;
|
||||
@@ -939,7 +940,7 @@
|
||||
<div style="background: #f0f8ff; padding: 10px; border-radius: 5px; margin-bottom: 15px;">
|
||||
<strong style="color: #0066cc;">甲欄扶養親族人数(源泉税控除対象): ${koureiCount}人</strong>
|
||||
<small style="display: block; margin-top: 5px; color: #666;">
|
||||
※19歳以上の扶養親族が対象(16-18歳は住民税のみ対象のため含まれません)
|
||||
※16歳以上の扶養親族が対象(一般扶養親族16-18歳、特定扶養親族19-22歳、老人扶養親族70歳以上)
|
||||
</small>
|
||||
</div>
|
||||
`;
|
||||
@@ -962,7 +963,7 @@
|
||||
: ""
|
||||
}
|
||||
${
|
||||
taxStatus?.isDeductible
|
||||
taxStatus?.label
|
||||
? ` <span style="color:${taxStatus.color}; font-weight:bold;">[${taxStatus.label}]</span>`
|
||||
: ""
|
||||
}
|
||||
@@ -1004,7 +1005,8 @@
|
||||
);
|
||||
return (
|
||||
taxStatus?.isDeductible &&
|
||||
(taxStatus.type === "控除対象扶養親族" ||
|
||||
(taxStatus.type === "一般扶養親族" ||
|
||||
taxStatus.type === "控除対象扶養親族" ||
|
||||
taxStatus.type === "老人扶養親族")
|
||||
);
|
||||
}).length;
|
||||
@@ -1015,8 +1017,8 @@
|
||||
<strong>📋 源泉税控除の説明:</strong>
|
||||
<ul style="margin: 10px 0 0 20px; font-size: 13px; line-height: 1.6;">
|
||||
<li><strong style="color: purple;">老人扶養親族(70歳以上)</strong>: 源泉税・住民税の両方で控除対象</li>
|
||||
<li><strong style="color: green;">控除対象扶養親族(19歳以上)</strong>: 源泉税・住民税の両方で控除対象</li>
|
||||
<li><strong style="color: orange;">一般扶養親族(16-18歳)</strong>: 住民税のみ控除対象(源泉税では控除されません)</li>
|
||||
<li><strong style="color: green;">控除対象扶養親族(19歳以上23歳未満)</strong>: 源泉税・住民税の両方で控除対象</li>
|
||||
<li><strong style="color: orange;">一般扶養親族(16歳以上19歳未満)</strong>: 源泉税・住民税の両方で控除対象</li>
|
||||
<li><strong style="color: #999;">16歳未満</strong>: 控除対象外</li>
|
||||
</ul>
|
||||
<p style="margin: 10px 0 0 0; font-size: 12px; color: #666;">
|
||||
@@ -1253,6 +1255,11 @@
|
||||
<label>生年月日</label>
|
||||
<input type="date" name="birth_date" min="1900-01-01" max="2099-12-31" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>マイナンバーカード番号</label>
|
||||
<input type="text" name="mynumber" placeholder="例:123456789012" maxlength="12" />
|
||||
<small>12桁の数字(任意入力)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="is_spouse" value="true" />
|
||||
@@ -1304,6 +1311,7 @@
|
||||
name: formData.get("name"),
|
||||
relationship: formData.get("relationship"),
|
||||
birth_date: formData.get("birth_date") || null,
|
||||
mynumber: formData.get("mynumber") || null,
|
||||
is_spouse: formData.get("is_spouse") === "true",
|
||||
is_disabled: formData.get("is_disabled") === "true",
|
||||
income_amount: parseFloat(formData.get("income_amount")) || 0,
|
||||
@@ -1335,19 +1343,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
// その年の12月31日時点の年齢を計算
|
||||
function calculateAgeAtYearEnd(
|
||||
birthDate,
|
||||
targetYear = new Date().getFullYear()
|
||||
) {
|
||||
// 現在時点の満年齢を計算
|
||||
function calculateAgeAtYearEnd(birthDate) {
|
||||
if (!birthDate) return null;
|
||||
const today = new Date();
|
||||
const birth = new Date(birthDate);
|
||||
const yearEnd = new Date(targetYear, 11, 31); // 12月31日
|
||||
let age = yearEnd.getFullYear() - birth.getFullYear();
|
||||
const monthDiff = yearEnd.getMonth() - birth.getMonth();
|
||||
let age = today.getFullYear() - birth.getFullYear();
|
||||
const monthDiff = today.getMonth() - birth.getMonth();
|
||||
if (
|
||||
monthDiff < 0 ||
|
||||
(monthDiff === 0 && yearEnd.getDate() < birth.getDate())
|
||||
(monthDiff === 0 && today.getDate() < birth.getDate())
|
||||
) {
|
||||
age--;
|
||||
}
|
||||
@@ -1379,7 +1384,7 @@
|
||||
return {
|
||||
isDeductible: true,
|
||||
type: "一般扶養親族",
|
||||
label: "一般扶養親族(住民税のみ)",
|
||||
label: "一般扶養親族(源泉税・住民税)",
|
||||
color: "orange",
|
||||
age,
|
||||
};
|
||||
@@ -1387,7 +1392,7 @@
|
||||
return {
|
||||
isDeductible: false,
|
||||
type: null,
|
||||
label: null,
|
||||
label: "源泉税控除対象外",
|
||||
color: null,
|
||||
age,
|
||||
};
|
||||
@@ -1458,6 +1463,13 @@
|
||||
dependent.birth_date || ""
|
||||
}" min="1900-01-01" max="2099-12-31" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>マイナンバーカード番号</label>
|
||||
<input type="text" name="mynumber" value="${
|
||||
dependent.mynumber || ""
|
||||
}" placeholder="例:123456789012" maxlength="12" />
|
||||
<small>12桁の数字(任意入力)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input type="checkbox" name="is_spouse" value="true" ${
|
||||
@@ -1515,6 +1527,7 @@
|
||||
name: formData.get("name"),
|
||||
relationship: formData.get("relationship"),
|
||||
birth_date: formData.get("birth_date") || null,
|
||||
mynumber: formData.get("mynumber") || null,
|
||||
is_spouse: formData.get("is_spouse") === "true",
|
||||
is_disabled: formData.get("is_disabled") === "true",
|
||||
income_amount: parseFloat(formData.get("income_amount")) || 0,
|
||||
|
||||
Reference in New Issue
Block a user