<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- font-family: Microsoft YaHei, sans-serif; -->
    <style>        @page {
        size: A5 landscape;
        margin: 15px;
    }
    body {
        margin: 0;
        font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
    }
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10px;
    }
    th, td {
        text-align: center;
        padding: 5px;
        border: 1px solid black;
    }
    .border {
        border: 1px solid black !important;
    }
    .header {
        background-color: #f2f2f2;
        /*font-weight: bold;*/
    }
    .total-row {
        font-weight: bold;
        background-color: lightgray;
        text-align: center;
    }
    /* 用于模拟13列布局 */
    .col-1 { width: calc(100% / 13); }
    </style>
</head>
<body>
<table>
    <!-- 第一行 -->
    <tr class="header border col-12" >
        <td align="center" valign="middle"bgcolor="#c0c0c0" colspan="13">工资单</td>
    </tr>

    <!-- 第二行 -->
    <tr class="header border">
        <td class="col-4" colspan="4" align="left" valign="middle"> ${financialSalaryDetail.companyName}</td>
        <td class="col-4" colspan="4" align="center" valign="middle">
            <div style="display: inline;">${financialSalaryDetail.year}年 第</div><div style="display: inline;">${financialSalaryDetail.month}期</div>   </td>
        <td class="col-4" colspan="5" align="right" valign="middle">单位：元</td>
    </tr>

    <!-- 第三行 -->
    <tr class="header border">
        <td class="col-1" align="center" valign="middle">员工姓名</td>
        <td class="col-1" align="center" valign="middle">身份证号</td>
        <td class="col-1" align="center" valign="middle">应发工资</td>
        <td class="col-1" align="center" valign="middle">实发工资</td>
        <td class="col-1" align="center" valign="middle">奖金及其他</td>
        <td class="col-1" align="center" valign="middle">养老保险</td>
        <td class="col-1" align="center" valign="middle">医疗保险</td>
        <td class="col-1" align="center" valign="middle">失业险</td>
        <td class="col-1" align="center" valign="middle">大病险</td>
        <td class="col-1" align="center" valign="middle">公积金</td>
        <td class="col-1" align="center" valign="middle">个税</td>
        <td class="col-1" align="center" valign="middle">其他扣款</td>
        <td class="col-1" align="center" valign="middle">备注</td>
    </tr>

    <!-- 动态数据行 -->
    <#list financialSalaryDetail.details  as item>
    <tr class="border">
        <td class="col-1" align="center">${ item.employeeName }</td>
        <td class="col-1" align="center">${ item.idCode }</td>
        <td class="col-1" align="center">${ item.planSalary }</td>
        <td class="col-1" align="center">${ item.actuallySalary }</td>
        <td class="col-1" align="center">${ item.bonusAmount }</td>
        <td class="col-1" align="center">${ item.endowmentInsurance }</td>
        <td class="col-1" align="center">${ item.medicalInsurance }</td>
        <td class="col-1" align="center">${ item.unemploymentBenefit }</td>
        <td class="col-1" align="center">${ item.seriousIllnessInsurance }</td>
        <td class="col-1" align="center">${ item.housingFund }</td>
        <td class="col-1" align="center">${ item.individualIncomeTax }</td>
        <td class="col-1" align="center">${ item.otherCut }</td>
        <td class="col-1" align="center">${ item.remark }</td>
    </tr>
    </#list>
<!--     合计行-->
    <tr class="total-row border">
        <td class="col-1" align="center" colspan="1">合计</td>
        <td class="col-1" align="center" colspan="1"></td>
        <!-- 这里根据实际计算结果填充 -->
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.planSalary}</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.actuallySalary }</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.bonusAmount }</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.endowmentInsurance }</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.medicalInsurance}</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.unemploymentBenefit }</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.seriousIllnessInsurance}</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.housingFund }</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.individualIncomeTax}</td>
        <td class="col-1" align="center" colspan="1">${ financialSalaryDetail.otherCut }</td>
        <td class="col-1" align="center" colspan="1"></td>
        <!-- ... 类似地填充剩余单元格 -->
    </tr>
</table>
</body>
</html>