fix: blank_employees/blank_all 模式跳过试用期工资覆盖

blank_employees 和 blank_all 模式下所有金额应为 0,但统一试用期
判定逻辑会把 probationSalary 覆盖到 baseSalary,导致有试用期合同
的员工基本工资不为 0。

修复:试用期判定仅对 copy_last / copy_batch / custom 模式执行,
blank_employees / blank_all 模式跳过。

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-16 15:20:05 +08:00
parent 2f1e339413
commit 94959522df
+4 -4
View File
@@ -409,11 +409,11 @@ router.post('/batches', async (req: AuthRequest, res: Response, next: NextFuncti
allowance = prevPayslip?.allowance || 0 allowance = prevPayslip?.allowance || 0
deduction = prevPayslip?.deduction || 0 deduction = prevPayslip?.deduction || 0
} }
// blank_employees 和 blank_all: 所有金额默认 0(不自动带出基本工资) // blank_employees 和 blank_all: 所有金额默认 0(不自动带出基本工资,不取试用期工资
// 统一试用期判定(所有模式适用,SEVERANCE 除外) // 统一试用期判定(仅 copy_last / copy_batch / custom 模式适用,SEVERANCE 除外)
// 试用期且 probationSalary > 0 → 覆盖 baseSalary 为试用期工资 // blank_employees / blank_all 模式下所有金额应为 0,不覆盖试用期工资
if (type !== 'SEVERANCE' && type !== 'TERMINATION') { if (type !== 'SEVERANCE' && type !== 'TERMINATION' && mode !== 'blank_employees' && mode !== 'blank_all') {
const batchMonthEnd = new Date(`${month}-28T23:59:59`) const batchMonthEnd = new Date(`${month}-28T23:59:59`)
const latestContract = emp.contracts?.[0] const latestContract = emp.contracts?.[0]
if (isInProbation(latestContract, batchMonthEnd) && latestContract?.probationSalary > 0) { if (isInProbation(latestContract, batchMonthEnd) && latestContract?.probationSalary > 0) {