From 94959522df752b8e2eec6e5ffb39529f484d2e6b Mon Sep 17 00:00:00 2001 From: selfrelease Date: Sun, 16 Aug 2026 15:20:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20blank=5Femployees/blank=5Fall=20?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E8=B7=B3=E8=BF=87=E8=AF=95=E7=94=A8=E6=9C=9F?= =?UTF-8?q?=E5=B7=A5=E8=B5=84=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- backend/src/routes/payroll2.routes.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/routes/payroll2.routes.ts b/backend/src/routes/payroll2.routes.ts index b2b9c25..ead5c76 100644 --- a/backend/src/routes/payroll2.routes.ts +++ b/backend/src/routes/payroll2.routes.ts @@ -409,11 +409,11 @@ router.post('/batches', async (req: AuthRequest, res: Response, next: NextFuncti allowance = prevPayslip?.allowance || 0 deduction = prevPayslip?.deduction || 0 } - // blank_employees 和 blank_all: 所有金额默认 0(不自动带出基本工资) + // blank_employees 和 blank_all: 所有金额默认 0(不自动带出基本工资,不取试用期工资) - // 统一试用期判定(所有模式适用,SEVERANCE 除外) - // 试用期且 probationSalary > 0 → 覆盖 baseSalary 为试用期工资 - if (type !== 'SEVERANCE' && type !== 'TERMINATION') { + // 统一试用期判定(仅 copy_last / copy_batch / custom 模式适用,SEVERANCE 除外) + // blank_employees / blank_all 模式下所有金额应为 0,不覆盖试用期工资 + if (type !== 'SEVERANCE' && type !== 'TERMINATION' && mode !== 'blank_employees' && mode !== 'blank_all') { const batchMonthEnd = new Date(`${month}-28T23:59:59`) const latestContract = emp.contracts?.[0] if (isInProbation(latestContract, batchMonthEnd) && latestContract?.probationSalary > 0) {