diff --git a/cost-model.js b/cost-model.js index e7a9c9d..bd32b4a 100644 --- a/cost-model.js +++ b/cost-model.js @@ -85,13 +85,14 @@ export function boundMonths(months, hireDate, leaveDate, year) { return out; } -export function toCostPerson(person, salary, override = {}, { year } = {}) { +export function toCostPerson(person, salary, override = {}, { year, fullYearDefault = false } = {}) { const saved = normalizeOverride(override); const months = boundMonths({ h1Start: has(saved, 'h1Start') ? saved.h1Start : 1, h1End: has(saved, 'h1End') ? saved.h1End : 6, - h2Start: has(saved, 'h2Start') ? saved.h2Start : '', - h2End: has(saved, 'h2End') ? saved.h2End : '', + // 2028 起預設全年(再依 HR 到職/離職限縮);2027 維持原本的預設(H2 留空)。 + h2Start: has(saved, 'h2Start') ? saved.h2Start : (fullYearDefault ? 7 : ''), + h2End: has(saved, 'h2End') ? saved.h2End : (fullYearDefault ? 12 : ''), }, person.hireDate, person.leaveDate, year); const place = placement(person, saved); const salaryType = salary?.salaryType === 'hourly' ? 'hourly' : 'monthly';