<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="cm" uri="/commons-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>薪资统计查询</title>
<link href="../resources/style/base.css" rel="stylesheet" type="text/css"/>
<s:include value="../common/head.jsp" />
<script language="javascript" src="../code/vm/ExtCodeJs.htm"></script>
<script language="javascript" src="../resources/js/calendar/calendar.js"></script>
<script language="javascript" src="../resources/js/jquery/jquery.tableSort.js"></script>
<script type="text/javascript">
function monthDetail(id){
	iframeWindow("<s:url action='salaryMonthDetail'/>?monthSheet.id="+id,650,550,"工资条明细");
}
function exportData(){
	var url="<s:url action='salaryMonthTotalExport'/>?"+getFormParameters(gi("queryForm"));
	window.open(url);
}

</script>
<style>
#total_row th{
	text-align:right;
}
</style>
</head>

<body>
<div class="body_list">
  <s:include value="../common/body.jsp" />
  <s:form action="salaryMonthTotal" id="queryForm" onsubmit="return checkForm(this)">
  	<s:hidden name="orderBy" />
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
      <tr class="form_title">
        <td colspan="7">查询条件</td>
      </tr>
      <tr class="form_item">
        <td width="28%">
		<span class="required">•</span>统计类型：<s:select cssStyle="width:120px;" name="totalType.id" title="统计类型 为必填项" 
				list="#request.SysCodeFinder.find('SALARY_MONTH_TOTAL_TYPE')" headerKey="" headerValue="" 
				listKey="id" listValue="codeName"/></td>
        <td width="24%">部门：
          <s:textfield name="monthSheet.emplInfo.emplOrg.name" readonly="true" onClick="codeTree('emplOrgTree',gi('eimpOrgId'),this)" cssStyle="width:100px;" cssClass="find_input"/>
          <s:hidden name="monthSheet.emplInfo.emplOrg.id" id="eimpOrgId"/></td>
        <td width="29%">
        月份：
          <s:textfield name="beginMonth" readonly="true" onClick="showCalendar('yyyyMM',this,false)" cssClass="date_input" cssStyle="width:65px;"/>
          至
          <s:textfield name="endMonth" readonly="true" onClick="showCalendar('yyyyMM',this,false)" cssClass="date_input" cssStyle="width:65px;"/>        </td>
        <td width="19%" align="center"><input name="q" value="查 询" onclick="query()" type="button" />
        &nbsp;
        <input name="q" value="导 出" onclick="exportData()" type="button" />        </td>
      </tr>
    </table>
	
	<s:if test="monthSheetList!=null && monthSheetList.size()>0">
    <table id="dataTable" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line" 
		style="margin-top:15px;">
      <tr class="list_title">
        <th width="16%">统计类型</th>
        <th width="13%" class="orderBy2" onclick="sortTable('dataTable',1)">工资总额</th>
        <th width="15%" class="orderBy2" onclick="sortTable('dataTable',2)">税前收入</td>
        <th width="12%" class="orderBy2" onclick="sortTable('dataTable',3)">所得税</th>
        <th width="14%" class="orderBy2" onclick="sortTable('dataTable',4)">税后收入</th>
        <th width="15%" class="orderBy2" onclick="sortTable('dataTable',5)">社保合计
        （个人）</th>
        <th width="15%" class="orderBy2" onclick="sortTable('dataTable',6)">社保合计
        （单位）</th>
      </tr>
      <s:iterator value="monthSheetList" status="st">
        <s:set name="row_cls" value=""/>
        <s:if test="#st.Even">
          <s:set name="row_cls" value="%{'row_a'}"/>
        </s:if>
		<s:if test="#st.index!=(monthSheetList.size()-1)">
        <tr class="list_data <s:property value='#row_cls'/>">
          <td>
          <s:property value="descr"/> </td>
          <td class="right"><s:property value="salaryBase"/></td>
          <td class="right"><s:property value="taxBefore"/></td>
          <td class="right"><s:property value="salaryTax"/></td>
          <td class="right"><s:property value="taxAfter"/></td>
          <td class="right"><s:property value="emplInsurTotal"/></td>
          <td class="right"><s:property value="compInsurTotal"/></td>
        </tr>
		</s:if>
      </s:iterator>
	  
	  <s:set name="totalRow" value="monthSheetList.get(monthSheetList.size()-1)"/>
	    <tr class="list_title" id="total_row">
          <th style="text-align:center;">合 计</td>
          <th><s:property value="#totalRow.salaryBase"/></td>
          <th><s:property value="#totalRow.taxBefore"/></td>
          <th><s:property value="#totalRow.salaryTax"/></td>
          <th><s:property value="#totalRow.taxAfter"/></td>
          <th><s:property value="#totalRow.emplInsurTotal"/></td>
          <th><s:property value="#totalRow.compInsurTotal"/></td>
        </tr>
    </table>
	</s:if>
	
  </s:form>
</div>
</body>
</html>