From ce1670d171e94ff99435a7e406951557d0e48e5c Mon Sep 17 00:00:00 2001 From: selfrelease Date: Sun, 16 Aug 2026 13:20:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=80=E6=9C=89=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E7=BB=9F=E4=B8=80=E8=AF=95=E7=94=A8=E6=9C=9F?= =?UTF-8?q?=E5=B7=A5=E8=B5=84=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前只有copy_last模式有试用期判定,copy_batch和blank_employees模式 未判定试用期,试用期员工baseSalary错误填为转正工资。 修复: 在所有模式赋值后统一加试用期覆盖逻辑(SEVERANCE/TERMINATION除外), 试用期且probationSalary>0时强制覆盖baseSalary为试用期工资。 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/src/routes/payroll2.routes.ts b/backend/src/routes/payroll2.routes.ts index 9821d40..78d7956 100644 --- a/backend/src/routes/payroll2.routes.ts +++ b/backend/src/routes/payroll2.routes.ts @@ -377,6 +377,16 @@ router.post('/batches', async (req: AuthRequest, res: Response, next: NextFuncti try { baseSalary = Number(decrypt(emp.monthlySalary)) || 0 } catch { baseSalary = Number(emp.monthlySalary) || 0 } } + // 统一试用期判定(所有模式适用,SEVERANCE 除外) + // 试用期且 probationSalary > 0 → 覆盖 baseSalary 为试用期工资 + if (type !== 'SEVERANCE' && type !== 'TERMINATION') { + const batchMonthEnd = new Date(`${month}-28T23:59:59`) + const latestContract = emp.contracts?.[0] + if (isInProbation(latestContract, batchMonthEnd) && latestContract?.probationSalary > 0) { + baseSalary = latestContract.probationSalary + } + } + // SEVERANCE 批次:从离职记录读取补偿金作为应发金额,不走工资/社保/个税计算 let severanceAmount = 0 let severanceBreakdown: any = null