feat: 最低工资保护 + 社保/最低工资递延补扣机制
新增功能: 1. SocialYearStandard / SocialInsuranceConfig 增加 minWage 字段 2. BatchEntry 增加递延扣款字段(deferredSocialEmp/HousingEmp/MinWage) 3. calcBatchEntry 增加最低工资保护逻辑: - 实发 < 最低工资时,优先递延社保 → 递延公积金 → 递延最低工资补齐 - 递延金额记录到 BatchEntry,次月创建批次时自动补扣 4. prePayrollCheck 增加最低工资检查(第 11/12 项) 5. 前端社保配置增加最低工资输入框 6. 前端 BatchTab 质量门禁增加最低工资/递延扣款提示 处理场景: - 入职当月工资不足扣社保个人部分 → 递延到次月补扣 - 实发低于最低工资 → 补齐到最低工资,差额递延次月扣 - 次月创建批次时自动读取上月递延金额并补扣 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -47,6 +47,7 @@ export default function SocialInsurance() {
|
||||
injuryOrg: 0.2, maternityOrg: 0.8,
|
||||
baseMin: 6326, baseMax: 33891,
|
||||
medicalBaseMin: 0, medicalBaseMax: 0,
|
||||
minWage: 0,
|
||||
extraInsurances: [],
|
||||
})
|
||||
const [newHousingVersion, setNewHousingVersion] = useState<any>({
|
||||
@@ -520,6 +521,9 @@ export default function SocialInsurance() {
|
||||
<div className="flex justify-between border-b pb-1.5"><span className="text-gray-500">失业(企业/个人)</span><span className="font-medium">{activeConfig.unemploymentOrg}% / {activeConfig.unemploymentEmp}%</span></div>
|
||||
<div className="flex justify-between border-b pb-1.5"><span className="text-gray-500">工伤(企业)</span><span className="font-medium">{activeConfig.injuryOrg}%</span></div>
|
||||
<div className="flex justify-between border-b pb-1.5"><span className="text-gray-500">生育(企业)</span><span className="font-medium">{activeConfig.maternityOrg}%</span></div>
|
||||
{activeConfig.minWage > 0 && (
|
||||
<div className="flex justify-between border-b pb-1.5"><span className="text-gray-500">最低工资标准</span><span className="font-medium text-primary">¥{fmt(activeConfig.minWage)}</span></div>
|
||||
)}
|
||||
{Array.isArray(activeConfig.extraInsurances) && activeConfig.extraInsurances.map((ins: any, idx: number) => (
|
||||
<div key={idx} className="flex justify-between border-b pb-1.5">
|
||||
<span className="text-gray-500">{ins.name}(企业/个人)</span>
|
||||
@@ -723,6 +727,15 @@ export default function SocialInsurance() {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{!isHousing && (
|
||||
<div className="grid md:grid-cols-3 gap-3">
|
||||
<div>
|
||||
<Label>最低工资标准</Label>
|
||||
<Input type="number" value={activeNewVersion.minWage} onChange={(e) => activeSetNewVersion({ ...activeNewVersion, minWage: Number(e.target.value) })} placeholder="如 2420" />
|
||||
<p className="text-xs text-gray-400 mt-1">当地月最低工资标准,填 0 不检查。实发低于此值时触发保护(递延扣款)</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{isHousing ? (
|
||||
<>
|
||||
<div className="grid md:grid-cols-3 gap-3">
|
||||
|
||||
@@ -964,6 +964,21 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void
|
||||
请检查社保/公积金基数是否过大,导致实发工资 ≤ 0 的记录需修正后再归档。
|
||||
</InlineAlert>
|
||||
)}
|
||||
{batch.entries.some((e: any) => e.minWage > 0 && e.netPay < e.minWage && (e.minWageApplied || 0) === 0) && (
|
||||
<InlineAlert type="error" title="存在实发低于最低工资的员工">
|
||||
部分员工实发工资低于当地最低工资标准 ¥{Math.min(...batch.entries.filter((e: any) => e.minWage > 0 && e.netPay < e.minWage).map((e: any) => e.minWage))},请检查社保基数或在社保配置中设置最低工资标准。
|
||||
</InlineAlert>
|
||||
)}
|
||||
{batch.entries.some((e: any) => (e.minWageApplied || 0) > 0) && (
|
||||
<InlineAlert type="warning" title="最低工资保护已触发">
|
||||
{batch.entries.filter((e: any) => (e.minWageApplied || 0) > 0).length} 名员工已补齐到最低工资标准,递延扣款(社保/公积金/补齐差额)将在次月工资中补扣。
|
||||
</InlineAlert>
|
||||
)}
|
||||
{batch.entries.some((e: any) => (e.prevDeferredSocialEmp || 0) + (e.prevDeferredHousingEmp || 0) + (e.prevDeferredMinWage || 0) > 0) && (
|
||||
<InlineAlert type="warning" title="本月补扣上月递延">
|
||||
{batch.entries.filter((e: any) => (e.prevDeferredSocialEmp || 0) + (e.prevDeferredHousingEmp || 0) + (e.prevDeferredMinWage || 0) > 0).length} 名员工本月补扣了上月递延的社保/公积金/最低工资补齐差额。
|
||||
</InlineAlert>
|
||||
)}
|
||||
{batch.entries.some((e: any) => e.baseSalary === 0 && e.bonus === 0 && e.totalPay === 0) && (
|
||||
<InlineAlert type="warning" title="存在全零记录">
|
||||
部分员工所有金额为 0,请确认是否需要填写或移除这些人员。
|
||||
|
||||
Reference in New Issue
Block a user