<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@page contentType="text/html; charset=UTF-8"%> <%@ page import="com.csc.library.entry.*" %> <%@ page import="com.csc.library.session.*,com.csc.library.utilities.*" %> <jsp:useBean id="PRU129" scope="page" class="com.csc.library.system.Task" /> <html> <% PRU129.setChannel(request ,response); ProcessEntry screen=(ProcessEntry)PRU129.process("ProcessEntry","PEndYear"); screen.process(); UProfile up = screen.getUProfile(); String periodMonth = ""; String year = ""; boolean canClose=false; DbInquiry period = new InitialInquiry(up).getDbInquiry("Mperiod","","", true); String period_close= "0"; while(period.next()){ period_close = period.getString("period_close"); } if(period_close.equals("1")) {//can close year process period.setFilter("period_close=1"); period.setOrderBy("end_date desc"); period.refresh(); if(period.next()){ periodMonth = period.getString("end_date"); year = new CscCalendar(periodMonth).getEngYYYY(); } canClose = true; }else{ //can not close year process period.setFilter("period_close=0"); period.setOrderBy("end_date asc"); period.refresh(); if(period.next()){ periodMonth = period.getString("end_date"); year = new CscCalendar(periodMonth).getEngYYYY(); } canClose = false; } %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="../CSS/TISCO.css" rel="stylesheet" type="text/css"> <script type='text/javascript' src='../JS/SCREEN.js'></script> <script language='javascript'>setLang('<%=screen.getUProfile().get("lang")%>');</script> <script language="javascript">getTitleName();</script> <script language="javascript"> <!-- function process(year,canClose) { var con = eval(year); if(con=='' || con == null){ alert('Can not process cause:Year is Empty'); }else if(canClose == false){ alert('Can not process cause:All of period is not close'); }else{ with(document.cscform){ if(__condition$year.value !=""){ bCon=confirm("Confirm Process"); if (bCon==true) { __cmd .value = "save"; submit(); } } } } } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body leftmargin="0" topmargin="0" onLoad="MM_preloadImages('IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif')"> <div id="toolTipLayer" style="position: absolute; visibility: hidden"></div> <script language="javascript">initToolTips();</script> <div class="centered"> <form name="cscform" method="post" action="" <!----------BEGIN CSC INITIAL ZONE ------------------------> <%=screen.InitialVariable()%> <!----------END CSC INITIAL ZONE --------------------------> <input type="hidden" name="__screen" value="PRU129"> <input type="hidden" name="__fixCon" value="companyid='<%=screen.getUProfile().get("companyid")%>'"> <input type="hidden" name="__tname" value="ระบบเงินเดือน"> <input type="hidden" name="__ename" value="Payroll"> <input type="hidden" name="__cmd" value=""> <input type="hidden" name="__help" value=""> <input type="hidden" name="__user" value="<%=screen.getUProfile().getUserId()%>"> <input type="hidden" name="__companyid" value='<%=screen.getUProfile().get("companyid")%>'> <input type="hidden" name="__name" value="Process End Year"> <input type="hidden" name="__ptype" value="PR4"> <input type="hidden" name="__prclass" value="PEndYear"> <input type="hidden" name="__language" value="<%=screen.getUProfile().get("lang")%>"> <div align="center"> <table width="640" cellpadding="0" cellspacing="0"> <tr> <td colspan="7" class="header">PRU129, <script language="javascript">swapLang('Year End Process');</script> </td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0 " id="rsTable" name="rsTable" cols=7 class="row1"> <tr> <td colspan="2" class="blankspace"></td> </tr> <tr> <td width="177"> <div align="right"><script language="javascript">swapLang('Year');</script> </div> </td> <td width="457"><input name="__condition$year" type="text" size="10" maxlength="10" readonly="yes" value="<%=year%>"></td> </tr> <tr> <td> <div align="right"><script language="javascript">swapLang('Current of Month');</script> </div> </td> <td><input name="__condition$cur_month" type="text" size="10" maxlength="10" readonly="yess" value="<%=new CscCalendar(periodMonth).getDDMMYYYY()%>"></td> </tr> <tr> <td colspan="2" class="blankspace"></td> </tr> <tr> <td colspan="2" class="buttonline"> <div align="center"><a href="javascript:process('<%=year%>',<%=canClose%>);"><img src="IMAGES/BUTTON/PROCESS.gif" border="0"></a></div> </td> </tr> <tr> <td colspan="3" class="blankspace"></td> </tr> </table> </td> </tr> <tr> <td class="bottom"></td> </tr> </table> </center> </div> <!----------BEGIN CSC ENDING ZONE ------------------------> <%=screen.endJSP()%> <!----------END CSC ENDING ZONE --------------------------> </form> </body> </html>