feat: 补充公积金支持(员工级别可选)

上海等城市存在补充公积金账户,同一企业内高管可能有但普通员工
没有。新增员工级别补充公积金账户关联:

- Employee 表加 supplementaryHousingAccountId 字段
- BatchEntry 表加 supplementaryHousingEmp/Org 字段
- 薪资计算 calcBatchEntry 支持补充公积金(额外算一笔,纳入
  个税扣除、最低工资保护递延逻辑)
- 新增员工弹窗加补充公积金账户选择器(可选,仅显示
  accountType=SUPPLEMENTARY 的公积金账户)
- 员工档案编辑支持补充公积金账户

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
selfrelease
2026-08-17 10:20:59 +08:00
parent 1e7932c36c
commit 16f38f3c36
7 changed files with 82 additions and 14 deletions
+6
View File
@@ -263,6 +263,8 @@ model Employee {
socialInsEndMonth String? // 当前社保截止年月(便捷字段,null=在保)
housingFundStartMonth String? // 当前公积金开始年月(便捷字段)
housingFundEndMonth String? // 当前公积金截止年月(便捷字段)
supplementaryHousingAccountId String? // 补充公积金账户(可选,高管才有)
supplementaryHousingAccount SocialAccount? @relation("EmpSupplementaryHousingAccount", fields: [supplementaryHousingAccountId], references: [id], onDelete: SetNull)
specialDeduction Float @default(0) // 专项附加扣除(子女教育、赡养老人等,员工portal端填报)
city String? // 员工社保参保城市
birthDate DateTime? // 出生日期(从身份证号提取)
@@ -489,6 +491,8 @@ model SocialAccount {
// 部门关联(员工通过部门继承账户)
deptSocialAccounts Department[] @relation("DeptSocialAccount")
deptHousingAccounts Department[] @relation("DeptHousingAccount")
// 员工补充公积金关联
empSupplementaryHousing Employee[] @relation("EmpSupplementaryHousingAccount")
@@unique([orgId, type, name])
@@index([orgId, type, city])
@@ -908,6 +912,8 @@ model BatchEntry {
socialOrg Float @default(0)
housingEmp Float @default(0)
housingOrg Float @default(0)
supplementaryHousingEmp Float @default(0) // 补充公积金个人部分
supplementaryHousingOrg Float @default(0) // 补充公积金单位部分
tax Float @default(0)
totalPay Float @default(0) // 应发合计
netPay Float @default(0) // 实发工资