PRR_PayrollReconcileOP.jsp 10.2 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="com.csc.library.entry.*,com.csc.library.utilities.*,com.csc.library.session.*,com.csc.library.components.*" %>
<%@page contentType="text/html; charset=UTF-8"%>
<jsp:useBean id="ASR002" scope="page" class="com.csc.library.system.Task"/>
<%
ASR002.setChannel(request ,response);
ReportEntry screen=null;
screen=(ReportEntry)ASR002.process("ReportEntry",request.getParameter("__screen"));
UProfile uf=screen.getUProfile();
CscCalendar cs=new CscCalendar();

CscCalendar cDate = new CscCalendar();
String monthtxt="";
String cdate ="";
String month="";
String year ="";
String language = uf.get("lang");
// int dayS=1,dayE=1;
String getScreen = request.getParameter("__screen");
cdate=(cDate.getEngYYYY())+"-"+(Integer.parseInt(cDate.getMM())+1)+"-"+"01";
month = (Integer.parseInt(cDate.getMM())+1 )+"";
year = cDate.getEngYYYY()+"";
//cDate.incMonth(1);
monthtxt = cDate.getEngLongMonth().toUpperCase();
%>
<html ng-app="myHR">
<head>
<title>ReportOption PayrollReconcile</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<link href="../CSS/bootstrap.css" rel="stylesheet"  type="text/css">
<link href="../CSS/bootstrap_csc_backend.css" rel="stylesheet"  type="text/css">

<script language='javascript' src='../JS/SCREEN.js'></script>
<SCRIPT TYPE='text/JavaScript' SRC='../TA/JS/TA_SCREEN.js'></SCRIPT>
<script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
<script type='text/javascript' src="../JS/bootstrap.js"></script>
<script src="../JS/VIEWCALENDAR.js"></script>
<script src="../JS/angular-1.3.15/angular.js"></script>
<script type="text/javascript" src="../JS/ANGULAR/SCREEN_ANGULAR.js"></script>
<script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script>

<!-- Call DWR -->
<script type='text/javascript' src='/hr/dwr/interface/CalculateReconcile.js'></script>
<script type='text/javascript' src='/hr/dwr/engine.js'></script>
<script type='text/javascript' src='/hr/dwr/util.js'></script>

<script language="JavaScript" type="text/JavaScript">

$(document).ready(function(){
  $('select[name=__prgcode]').on("change",function(){
    getInitial();
  });
});

function getInitial(){
  with(document.cscform){
    var payrollGroup = $('select[name=__prgcode]').find(":selected").val();
    var lang = "<%=screen.getUProfile().get("lang")%>";
    CalculateReconcile.getAllFormulainPayrollGroup(payrollGroup,lang,function(data){
      DWRUtil.setValue("__getformula",data);
    });
  }
}

function back(){
  with(document.cscform){
    var getformula = __getformula.value;
    var reconcileid = __reconcileid.value;
    var flag = __flag.value;
    for(z=0;z<elements.length;z++){
      if(elements[z].type.indexOf("select")>-1){
        setParent(elements[z].name,elements[z].options[elements[z].selectedIndex].value);
      }else {
        if(elements[z].type.indexOf("radio")>-1){
          if (elements[z].checked)  {
            setParent(elements[z].name, elements[z].value);
          }
        }else {
          setParent(elements[z].name,elements[z].value);
        }
      }
    }
  }
  with(window.opener.document.cscform){
    //var prgcode = $('select[name=__prgcode]').find(":selected").val();
    var filterheal = "reconcileid = '' and employeeid in (select employeeid from memployee)";
    var getScreen = "<%=getScreen%>";
    var flagfilter = "";
    if(reconcileid != ""){
      if(getScreen == "PRR_PayrollReconcile_FormB"){
        /*filterheal = "employeeid in (select employeeid from tpayrollreconciliation1 where reconcileid = '"+reconcileid+"' and formulaid in ("+getformula+") and status not in ('B'))";
        __fixfiltermemployee.value = filterheal;
        filterheal = "reconcileid = '"+reconcileid+"' and formulaid in ("+getformula+") and status not in ('B')";
        __fixfiltertpayrollreconciliation1.value = filterheal;*/

        if(flag !== ""){
          flagfilter = "and status in ('"+flag+"')";
        }

        var dbtype = '<%=screen.getUProfile().getDbType()%>';
        if(dbtype === "PGSQL" || dbtype === "ORACLE"){
          __fixfiltertpayrollreconciliation1.value = "reconcileid = '"+reconcileid+"' and employeeid in (select employeeid from tpayrollreconciliation1 where base64decoder(difference_amount) != '0.0' and formulaid in ("+getformula+")) and employeeid in (select employeeid from memployee) and status not in ('B') "+flagfilter+" ";
        } else {
          __fixfiltertpayrollreconciliation1.value = "reconcileid = '"+reconcileid+"' and employeeid in (select employeeid from tpayrollreconciliation1 where dbo.Base64decoder(difference_amount) != '0.0' and formulaid in ("+getformula+")) and employeeid in (select employeeid from memployee) and status not in ('B') "+flagfilter+" ";
        }

      }else{
        filterheal = "reconcileid = '"+reconcileid+"' and employeeid in (select employeeid from memployee)";
        __fixfiltertpayrollreconciliation1.value = filterheal;
      }
    }else{
      __fixfiltertpayrollreconciliation1.value = filterheal;
    }
  }
  window.close();
}

function setParent(inputName,inputValue){
  with(window.opener.document.cscform){
    for(var  z=0;z<elements.length;z++){
      if(elements[z].name==inputName){
        if(elements[z].name=="__language"){
          for(var k=0;k<__language.length;k++){
            if(__language.options[k].value==inputValue){
              __language.options[k].selected=true;
            }
          }
        }else{
          elements[z].value=inputValue;
        }
      }
    }
  }
}

function goHelp(helpName,inputName){
  with(document.cscform){
    var helpReturn;
    //var fixcon=__fixCon.value;
    //__fixCon.value="";
    if (inputName=="__reconcileid") {
      //__fixCon.value="";
      __reconcileid.value ="";
      helpReturn="__reconcileid:reconcileid";
      linkHelp_Return(helpName,helpReturn);
      //__fixCon.value=fixcon;
    }
  }
}

function linkHelp_Return(help,input){
  with(document.cscform){
    var param="PRU084.jsp?__helpName="+help+"&__helpReturn="+input+"&__pageCall="+__screen.value+"&__checkVerify=off";
    window.open(param,"Help","left=150,top=150,width=600,height=400,toolbar=no,status=yes,scrollbars=yes,resizable=yes");
  }
}

function getYYYYMMDD(dd, dDate){
  var splitdate = dd.split("-");
  var size = splitdate.length;
  var result = dd;
  var msg = "Date is not in a valid format.";
  //if(document.cscform.__language.value == "tha") msg = "รูปแบบวันที่ไม่ถูกต้อง";
  if(size == 3){
    result = "";
    if(splitdate[0].length == 4 && splitdate[1].length == 2 && splitdate[2].length == 2){
      return splitdate[0]+"-"+splitdate[1]+"-"+dDate;
    }else{
      return splitdate[2]+"-"+splitdate[1]+"-"+dDate;
    }
    result = result.substring(1,result.length);
  }else{
    alert(msg);
  }
  alert(result);
  return result;
}

//-->
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="getInitial()">
<form name="cscform" method="post" >
<input type="hidden" name="__cmd" value="">
<input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>">
<input type="hidden" name="__dateformat" value ="DD-MM-YYYY">
<input type="hidden" name="__calendar">
<input type="hidden" name="__getformula">
  <div align="center">
    <table  cellpadding="0"  cellspacing="0">
      <tr >
        <td  class="header"> PayrollReconcile,
		  <script language="javascript">swapLang('Report Option');</script>&nbsp;</td>
      </tr>
      <tr >
        <td  colspan="2">
          <div align="center">
            <table  cellpadding="0" cellspacing="0" >

              <TR>

              <tr >
                <td height="13" colspan="2" class="blankspace"></td>
              </tr>
			  <%=screen.getTagComponent("columnlabel") %>
        <tr>
          <td class="columnlabel" width="45%" swlang code="SW011657">Reconcile ID</td>
          <td class="columnobject1" width="55%"><!-- Reconcile ID -->
            <input type="Text" name="__reconcileid" size="10" maxlength="10" value="" onkeypress="chkSpecialKey(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Reconcile Code" onmousemver="toolTip('Reconcile Code')" onmouseout="toolTip()">&nbsp;
              <a href="javascript:goHelp('TPAYROLLRECONCILIATION0HELP','__reconcileid');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__reconcileid_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)">
                <img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__reconcileid_image" width="20" height="20" border="0" align="absmiddle">
                </a>
              </td>
            </tr>
            <tr <%if(getScreen.equalsIgnoreCase("PRR_PayrollReconcile")){%>style="display:none"<%}%>>
            <td align="right"><%=language.equals("tha")?"สถานะ":"Flag"%>&nbsp;</td>
            <td>
              <select name="__flag">
                <option value=""><%=language.equals("tha")?"ทั้งหมด":"All"%></option>
                <option value="D"><%=language.equals("tha")?"แตกต่าง":"Difference"%></option>
                <option value="R"><%=language.equals("tha")?"ลาออก":"Resigned"%></option>
                <option value="N"><%=language.equals("tha")?"พนักงานเข้าใหม่":"New Employee"%></option>
                <option value="S"><%=language.equals("tha")?"หยุดจ่าย":"Stop Payment"%></option>
              </tr>
              <tr>
                <td  class="buttonline" colspan="7"><div align="center">
                  <button type="button" class="btn btn-primary width100" swlang code="SW013169" onClick="back();">OK</button>&nbsp;
                  <button type="button" class="btn btn-primary width100" swlang code="SW012132" onClick="window.close();">BACK</button>
                </div>
                </td>
              </tr>
                <tr >
                  <td colspan="2" class="blankspace"></td>
                </tr>
              </table>
            </div></td>
          </tr>
          <tr bordercolor="0069B3">
            <td  class="bottom"></td>
          </tr>
        </table>
      </div>
      <INPUT TYPE="hidden" NAME="__screen" VALUE="<%=request.getParameter("__screen")%>">
    </form>
  </body>
</html>