@model Com._9pm2.ClientWeb.Models.EmployeeSalaryList
@{
    ViewBag.Title = "已发工资";
}
 
<script>

</script>
<style>
    .ui-datepicker-calendar {
        display: none;
    }
    .ui-datepicker-prev, .ui-datepicker-next {
        height: 38px !important;        
    }
    .ui-datepicker .ui-datepicker-prev .ui-icon, .ui-datepicker .ui-datepicker-next .ui-icon {
        width: 16px;
        height: 16px;
    }
</style>

<form method="post" action="/HR/PayrollHistory">
    <div class="divSearch">
        <div>
            
            @Html.TextBox("sEmployeeName", null, new { maxlength = "50", placeholder = "员工姓名" })&nbsp;         

            @Html.TextBox("sMonthSn", null, new { maxlength = "50", @class = "text-date-month", placeholder = "月份" })
            <button class="btn btn-default" id="btnSearch">搜索</button>          
        </div>
    </div>
</form>

<div class="error-msg"></div>

<div class="list" style="overflow:auto">
    <table id="tSalary" style="min-width:1200px" >
        <thead>
            <tr>
                <th>员工姓名</th>
                <th>实发工资</th>
                <th>基本工资</th>
                <th>津贴</th>
                <th>扣款</th>                
                <th>代扣个税</th>
                <th>养老保险</th>
                <th>医疗保险</th>
                <th>生育保险</th>
                <th>工伤保险</th>
                <th>失业保险</th>
                <th>公积金</th>
                <th>绩效</th>
                <th>调整</th>                
                
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.Salaries)
            {
                <tr>
                    <td>@item.EmployeeName</td>
                    <td>@item.NetPay</td>
                    <td>@item.BaseSalary</td>
                    <td>
                        @foreach (var s in item.Allowance)
                        {
                            <div>@(s.AllowanceName + ":" + s.AllowanceAmount)</div>
                        }
                    </td>
                    <td>
                        @foreach (var s in item.Deducts)
                        {
                            <div>@(s.DeductName + ":" + s.DeductAmount)</div>

                        }
                    </td>
                    <td>@item.IncomeTax</td>
                    <td>
                        @{
                            var s1 = item.Insurances.FirstOrDefault(m => m.InsuranceType == (int)Com._9pm2.ClientWeb.Common.SalaryInsuranceType.养老保险);
                            if (s1 != null)
                            {
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("个人：" + s1.InsuranceAmountP)</div>
                                }
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("公司：" + s1.InsuranceAmountC)</div>

                                }
                            }
                        }
                    </td>

                    <td>
                        @{
                            s1 = item.Insurances.FirstOrDefault(m => m.InsuranceType == (int)Com._9pm2.ClientWeb.Common.SalaryInsuranceType.医疗保险);
                            if (s1 != null)
                            {
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("个人：" + s1.InsuranceAmountP)</div>

                                }
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("公司：" + s1.InsuranceAmountC)</div>

                                }
                            }
                        }
                    </td>

                    <td>
                        @{
                            s1 = item.Insurances.FirstOrDefault(m => m.InsuranceType == (int)Com._9pm2.ClientWeb.Common.SalaryInsuranceType.生育保险);
                            if (s1 != null)
                            {
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("个人：" + s1.InsuranceAmountP)</div>

                                }
                                if (s1.InsuranceAmountC > 0)
                                {
                                    <div>@("公司：" + s1.InsuranceAmountC)</div>

                                }
                            }
                        }
                    </td>

                    <td>
                        @{
                            s1 = item.Insurances.FirstOrDefault(m => m.InsuranceType == (int)Com._9pm2.ClientWeb.Common.SalaryInsuranceType.工伤保险);
                            if (s1 != null)
                            {
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("个人：" + s1.InsuranceAmountP)</div>

                                }
                                if (s1.InsuranceAmountC > 0)
                                {
                                    <div>@("公司：" + s1.InsuranceAmountC)</div>

                                }
                            }
                        }
                    </td>

                    <td>
                        @{
                            s1 = item.Insurances.FirstOrDefault(m => m.InsuranceType == (int)Com._9pm2.ClientWeb.Common.SalaryInsuranceType.失业保险);
                            if (s1 != null)
                            {
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("个人：" + s1.InsuranceAmountP)</div>

                                }
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("公司：" + s1.InsuranceAmountC)</div>

                                }
                            }
                        }
                    </td>

                    <td>
                        @{
                            s1 = item.Insurances.FirstOrDefault(m => m.InsuranceType == (int)Com._9pm2.ClientWeb.Common.SalaryInsuranceType.公积金);
                            if (s1 != null)
                            {
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("个人：" + s1.InsuranceAmountP)</div>

                                }
                                if (s1.InsuranceAmountP > 0)
                                {
                                    <div>@("公司：" + s1.InsuranceAmountC)</div>

                                }
                            }
                        }
                    </td>

                    <td>@item.PerformanceAmount</td>
                    <td>
                        @if (item.PerformanceAmount > 0)
                        {
                            @item.PerformanceAmount
                        }
                    </td>
                    <td>
                        @if (item.AdustAmount > 0)
                        {
                            @(item.AdjustName + ":" + item.AdustAmount)
                        }
                    </td>
                   
                </tr>
                            }
        </tbody>
    </table>
    @Html.Pager("PayrollHistory", "HR", Model.RouterDirectory, Model.PagerConfig, "pagerDiv", "pagerDiv", 8, true, false, true, true, false)
</div>
 

 