<%@ 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" />
<style>
.insur_team {
	border-top:#CCC solid 10px;
	font-weight:bold;
}
</style>
<script language="javascript">
function submitEdit(){
	gi("operId").value="edit";
	gi("editForm").submit();	
}

function editCal(){
	gi("operId").value="editCal";
	gi("editForm").submit();	
}
function showCalVars(){
	iframeWindow("<s:url action='salaryMonthCalVars'/>?"+getFormParameters(gi("editForm"),"winID"),980,$(parent.window).height()-10,"查看计算过程");
}
</script>
</head>

<body>
<s:include value="../common/body.jsp" />
<s:form id="editForm" action="salaryMonthOperate" namespace="/salary"  onsubmit="return checkForm(this)">
  <table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
    <tr class="form_tr_min">
      <td width="157" align="right">工号：</td>
      <td width="128" align="left"><s:property value="monthSheet.emplInfo.emplNo"/></td>
      <td width="152" align="right">部门：</td>
      <td width="161" align="left"><s:property value="monthSheet.emplInfo.emplOrg.name"/></td>
    </tr>
    <tr class="form_tr_min">
      <td align="right">姓名：</td>
      <td align="left"><s:property value="monthSheet.emplInfo.name"/></td>
      <td align="right">月份：</td>
      <td align="left"><s:property value="monthSheet.salaryMonth"/></td>
    </tr>
    <tr class="form_tr_min">
      <td width="157" align="right">备注：</td>
      <td colspan="3" align="left"><s:textfield name="monthSheet.descr" cssStyle="width:350px;"/></td>
    </tr>
  </table>
  <table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line" style="margin-top:10px;">
    <s:set name="detSet" value="monthSheet.detSet"/>
    <cm:group var="detList" value="detSet" length="2"/>
    <s:iterator value="#attr.detList">
      <tr class="form_tr_min">
        <td width="171" align="right"><s:property value="top[0].accountItem.name"/>
          ：</td>
        <td width="139" align="left"><s:if test="salaryAccount.getDetByItem(top[0].accountItem.id).canEdit">
            <s:textfield name="customMap['%{top[0].accountItem.id}']" value="%{top[0].itemValue}" 
                	title="%{top[0].accountItem.name} 为必填项" cssStyle="width:100px;"/>
          </s:if>
          <s:else>
            <s:property value="top[0].itemValue"/>
          </s:else></td>
        <td width="157" align="right"><s:property value="top[1].accountItem.name"/>
          <s:if test="top[1]!=null">：</s:if></td>
        <td width="131" align="left"><s:if test="salaryAccount.getDetByItem(top[1].accountItem.id).canEdit">
            <s:textfield name="customMap['%{top[1].accountItem.id}']" value="%{top[1].itemValue}" 
                	title="%{top[1].accountItem.name} 为必填项" cssStyle="width:100px;"/>
          </s:if>
          <s:else>
            <s:property value="top[1].itemValue"/>
          </s:else></td>
      </tr>
    </s:iterator>
    <tr class="form_tr_min">
      <td align="right">社保合计（个人）：</td>
      <td align="left"><s:property value="monthSheet.compInsurTotal"/></td>
      <td align="right">社保合计（单位）：</td>
      <td align="left"><s:property value="monthSheet.emplInsurTotal"/></td>
    </tr>
  </table>
  <s:iterator value="monthSheet.insurPaySet">
    <table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line" style="margin-top:10px;">
      <tr class="form_tr_min row_a">
        <td width="171" align="right">社保缴纳月份：</td>
        <td width="139" align="left"><s:property value="insurMonth"/>
          <s:if test="insurMonthEnd!=null && insurMonthEnd.length()>0 "> 至
            <s:property value="insurMonthEnd"/>
          </s:if></td>
        <td width="158" align="right">社保缴纳类型：</td>
        <td width="130" align="left"><s:property value="payTimeType.codeName"/></td>
      </tr>
      <s:set name="baseSet" value="baseSet"/>
      <cm:group var="baseList" value="baseSet" length="2"/>
      <s:iterator value="#attr.baseList">
        <tr class="form_tr_min">
          <td align="right"><s:property value="top[0].accountItem.name"/>
            ：</td>
          <td align="left">
            <s:if test="top[0].insurPay.isNormal and salaryAccount.getDetByItem(top[0].accountItem.id).canEdit">
              <s:textfield name="customMap['%{top[0].accountItem.id}']" value="%{top[0].insurBase}" 
                            title="%{top[0].accountItem.name} 为必填项" cssStyle="width:100px;"/>
            </s:if>
            <s:else>
              <s:property value="top[0].insurBase"/>
            </s:else></td>
          <td align="right"><s:property value="top[1].accountItem.name"/>
            <s:if test="top[1]!=null">：</s:if></td>
          <td align="left"><s:if test="top[1].insurPay.isNormal and salaryAccount.getDetByItem(top[1].accountItem.id).canEdit">
              <s:textfield name="customMap['%{top[1].accountItem.id}']" value="%{top[1].insurBase}" 
                            title="%{top[1].accountItem.name} 为必填项" cssStyle="width:100px;"/>
            </s:if>
            <s:else>
              <s:property value="top[1].insurBase"/>
            </s:else></td>
        </tr>
      </s:iterator>
      <s:set name="detSet" value="detSet"/>
      <cm:group var="detList" value="detSet" length="2"/>
      <s:iterator value="#attr.detList">
        <tr class="form_tr_min">
          <td align="right"><s:property value="top[0].accountItem.name"/>
            ：</td>
          <td align="left"><s:if test="top[0].insurPay.isNormal and salaryAccount.getDetByItem(top[0].accountItem.id).canEdit">
              <s:textfield name="customMap['%{top[0].accountItem.id}']" value="%{top[0].payValue}" 
                            title="%{top[0].accountItem.name} 为必填项" cssStyle="width:100px;"/>
            </s:if>
            <s:else>
              <s:property value="top[0].payValue"/>
            </s:else></td>
          <td align="right"><s:property value="top[1].accountItem.name"/>
            <s:if test="top[1]!=null">：</s:if></td>
          <td align="left"><s:if test="top[1].insurPay.isNormal and salaryAccount.getDetByItem(top[1].accountItem.id).canEdit">
              <s:textfield name="customMap['%{top[1].accountItem.id}']" value="%{top[1].payValue}" 
                            title="%{top[1].accountItem.name} 为必填项" cssStyle="width:100px;"/>
            </s:if>
            <s:else>
              <s:property value="top[1].payValue"/>
            </s:else></td>
        </tr>
      </s:iterator>
    </table>
  </s:iterator>
  <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="40" colspan="4" align="center">
      <input type="button" onclick="editCal()" name="button" id="button" value="重新计算" />
      &nbsp;
      <input type="button" onclick="submitEdit()" name="button" id="button" value="提交修改" />
      &nbsp;
	  <input type="button" onclick="showCalVars()" name="button" id="button" value="查看计算过程" />
        <!-- back begin -->
        
        <input name="winID" type="hidden" value="${param.winID}" />
        <input type="button" onclick="iframeWindowClose('${param.winID}')" name="button" id="button" value="返 回" />
        
        <!-- back end -->
        
        <s:hidden name="monthSheet.id" />
        <s:hidden name="monthSheet.emplInfo.id" />
        <s:hidden id="operId" name="oper" /></td>
    </tr>
  </table>
</s:form>
</body>
</html>