Commit c3b8e5b0 authored by sgadve's avatar sgadve

Resolving the issue of the arrears deletion and attendance month business logic

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@207196 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d8082c5d
...@@ -29,3 +29,9 @@ update system_events set Comp_Name='ibase.webitm.ejb.adm.AttdMonIC',Comp_Type='J ...@@ -29,3 +29,9 @@ update system_events set Comp_Name='ibase.webitm.ejb.adm.AttdMonIC',Comp_Type='J
update system_events set Comp_Name='ibase.webitm.ejb.adm.AttdMonIC',Comp_Type='JB', Service_Code='prv_default_ejb' where Service_Code='prv_default_1' and Obj_Name='attd_mon'; update system_events set Comp_Name='ibase.webitm.ejb.adm.AttdMonIC',Comp_Type='JB', Service_Code='prv_default_ejb' where Service_Code='prv_default_1' and Obj_Name='attd_mon';
-------------Added by saiprasad G. for the attachment and resolving issue[START]
update transetup set REF_SER='ATD_MN' where TRAN_WINDOW='w_attd_mon';
update transetup set AUDIT_TRAIL_OPT='2' where tran_window='w_attd_mon';
-------------Added by saiprasad G. for the attachment and resolving issue[END]
...@@ -68,4 +68,12 @@ update system_events set comp_name='ibase.webitm.ejb.adm.adv.ArrearsDeletePrc',c ...@@ -68,4 +68,12 @@ update system_events set comp_name='ibase.webitm.ejb.adm.adv.ArrearsDeletePrc',c
update pophelp set Sql_Str='select RTRIM (fld_value) ProcessGroup,descr Description from gencodes where fld_name =''PROC_GROUP''' where Mod_Name='X' and Field_Name='PROC_GROUP'; update pophelp set Sql_Str='select RTRIM (fld_value) ProcessGroup,descr Description from gencodes where fld_name =''PROC_GROUP''' where Mod_Name='X' and Field_Name='PROC_GROUP';
----------Arrear deletion [END]--------------------------------------------------------- ----------Arrear deletion [END]---------------------------------------------------------
-----issueresolving sql[START]-------------------
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('NULLFRPRD ','Blank period From','Period From can not be blank','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('NULLTOPRD ','Blank period To','Period To can not be blank','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('NULLACPRD ','Blank period account','Period account can not be blank','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('VPF16DSG01','No row processed','No rows to process for given criteria','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('INVFRPRD ','Invalid from period code','Invalid period from entered','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('INVTOPRD ','Invalid to period code','Invalid period to entered','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) values ('INVACCPRD','Invalid Account period code','Invalid period Account entered','E','Y',null,null,null,sysdate,'BASE','BASE',null,null);
-----issueresolving sql[END]-------------------
...@@ -104,7 +104,7 @@ public class ArrearsDeleteIC extends ValidatorEJB ...@@ -104,7 +104,7 @@ public class ArrearsDeleteIC extends ValidatorEJB
prdCodeFr = E12GenericUtility.checkNull(genericUtility.getColumnValue("prd_code__fr", dom)); prdCodeFr = E12GenericUtility.checkNull(genericUtility.getColumnValue("prd_code__fr", dom));
if(E12GenericUtility.checkNull(prdCodeFr).length() <= 0) if(E12GenericUtility.checkNull(prdCodeFr).length() <= 0)
{ {
errCode = "VMPRD1"; errCode = "NULLFRPRD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
...@@ -112,9 +112,9 @@ public class ArrearsDeleteIC extends ValidatorEJB ...@@ -112,9 +112,9 @@ public class ArrearsDeleteIC extends ValidatorEJB
else else
{ {
columnCtr =getColumnValue("period", "code", prdCodeFr, conn); columnCtr =getColumnValue("period", "code", prdCodeFr, conn);
if(columnCtr==0) if(columnCtr == 0)
{ {
errCode = "VMPRD1"; errCode = "INVFRPRD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
...@@ -126,7 +126,7 @@ public class ArrearsDeleteIC extends ValidatorEJB ...@@ -126,7 +126,7 @@ public class ArrearsDeleteIC extends ValidatorEJB
prdCodeTo = E12GenericUtility.checkNull(genericUtility.getColumnValue("prd_code__to", dom)); prdCodeTo = E12GenericUtility.checkNull(genericUtility.getColumnValue("prd_code__to", dom));
if(E12GenericUtility.checkNull(prdCodeTo).length() <= 0) if(E12GenericUtility.checkNull(prdCodeTo).length() <= 0)
{ {
errCode = "VMPRD1"; errCode = "NULLTOPRD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
...@@ -135,9 +135,9 @@ public class ArrearsDeleteIC extends ValidatorEJB ...@@ -135,9 +135,9 @@ public class ArrearsDeleteIC extends ValidatorEJB
{ {
columnCtr =getColumnValue("period", "code", prdCodeTo , conn ); columnCtr =getColumnValue("period", "code", prdCodeTo , conn );
int prdCodeFrInt =0,prdCOdeToInt=0; int prdCodeFrInt =0,prdCOdeToInt=0;
if(columnCtr==0) if(columnCtr == 0)
{ {
errCode = "VMPRD1"; errCode = "INVTOPRD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
...@@ -146,12 +146,12 @@ public class ArrearsDeleteIC extends ValidatorEJB ...@@ -146,12 +146,12 @@ public class ArrearsDeleteIC extends ValidatorEJB
{ {
try try
{ {
if(prdCodeFr!=null) if(prdCodeFr != null)
{ {
prdCodeFrInt = Integer.parseInt(prdCodeFr); prdCodeFrInt = Integer.parseInt(prdCodeFr);
} }
if(prdCodeTo!=null) if(prdCodeTo != null)
{ {
prdCOdeToInt = Integer.parseInt(prdCodeTo); prdCOdeToInt = Integer.parseInt(prdCodeTo);
} }
...@@ -177,7 +177,7 @@ public class ArrearsDeleteIC extends ValidatorEJB ...@@ -177,7 +177,7 @@ public class ArrearsDeleteIC extends ValidatorEJB
System.out.println("Period Code From:"+prdCodeAcc); System.out.println("Period Code From:"+prdCodeAcc);
if(E12GenericUtility.checkNull(prdCodeAcc).length() <= 0) if(E12GenericUtility.checkNull(prdCodeAcc).length() <= 0)
{ {
errCode = "VMPRD1"; errCode = "NULLACPRD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
...@@ -187,7 +187,7 @@ public class ArrearsDeleteIC extends ValidatorEJB ...@@ -187,7 +187,7 @@ public class ArrearsDeleteIC extends ValidatorEJB
columnCtr = getColumnValue("period", "code", prdCodeAcc , conn ); columnCtr = getColumnValue("period", "code", prdCodeAcc , conn );
if(columnCtr==0) if(columnCtr==0)
{ {
errCode = "VMPRD1"; errCode = "INVACCPRD";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
break; break;
......
...@@ -86,8 +86,8 @@ public class AttdMonIC extends ValidatorEJB ...@@ -86,8 +86,8 @@ public class AttdMonIC extends ValidatorEJB
String empCode="", prdCode="",workSite="",propDays="",paidDays="",joinDateStr=""; String empCode="", prdCode="",workSite="",propDays="",paidDays="",joinDateStr="";
String dateJoin="",relDate="",status="",workDays="",woffDays="",lvesTaken="",reliveDateStr=""; String dateJoin="",relDate="",status="",workDays="",woffDays="",lvesTaken="",reliveDateStr="";
int workDay=0,woffDay=0,lveTaken=0; double workDay=0,woffDay=0,lveTaken=0;
Date frDate = null,frDatePeriod=null,toDate=null,joinDate = null,reliveDate=null; Date frDate = null,frDatePeriod=null,toDate=null,joinDate = null,reliveDate=null,joinDateDb=null;
double propDaysDbl =0,paidDaysDbl=0; double propDaysDbl =0,paidDaysDbl=0;
SimpleDateFormat sdfDB = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat sdfDB = new SimpleDateFormat(genericUtility.getDBDateFormat());
SimpleDateFormat sdfApplFormat = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdfApplFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
...@@ -247,7 +247,8 @@ public class AttdMonIC extends ValidatorEJB ...@@ -247,7 +247,8 @@ public class AttdMonIC extends ValidatorEJB
double day=0; double day=0;
Calendar calendar= Calendar.getInstance(); Calendar calendar= Calendar.getInstance();
calendar.setTime(joinDate); calendar.setTime(joinDate);
if(((joinDate.compareTo(frDatePeriod)>=0))&&(joinDate.compareTo(toDate)<=0)) if((((joinDate != null) && joinDate.compareTo(frDatePeriod) >= 0))
&& (joinDate.compareTo(toDate) <= 0))
{ {
day = calendar.get(Calendar.DAY_OF_MONTH); day = calendar.get(Calendar.DAY_OF_MONTH);
day = propDaysDbl-day+1; day = propDaysDbl-day+1;
...@@ -257,8 +258,8 @@ public class AttdMonIC extends ValidatorEJB ...@@ -257,8 +258,8 @@ public class AttdMonIC extends ValidatorEJB
break; break;
} }
} }
else if((reliveDate.compareTo(frDatePeriod)>=0)&&(reliveDate.compareTo(toDate)<=0) else if(((reliveDate != null) && reliveDate.compareTo(frDatePeriod) >= 0)
&& "S".equalsIgnoreCase(status)) && (reliveDate.compareTo(toDate) <= 0) && "S".equalsIgnoreCase(status))
{ {
calendar.setTime(reliveDate); calendar.setTime(reliveDate);
day = calendar.get(Calendar.DAY_OF_MONTH); day = calendar.get(Calendar.DAY_OF_MONTH);
...@@ -367,9 +368,9 @@ public class AttdMonIC extends ValidatorEJB ...@@ -367,9 +368,9 @@ public class AttdMonIC extends ValidatorEJB
errCode = genericUtility.getErrorString("work_days", "VTMONATD03", userId); errCode = genericUtility.getErrorString("work_days", "VTMONATD03", userId);
break; break;
} }
else if(workDays!=null) else if(workDays.length() > 0)
{ {
workDay = Integer.parseInt(workDays); workDay = Double.parseDouble(workDays);
if(workDay < 0) if(workDay < 0)
{ {
errCode = genericUtility.getErrorString("work_days", "VTMONATD04", userId); errCode = genericUtility.getErrorString("work_days", "VTMONATD04", userId);
...@@ -385,9 +386,9 @@ public class AttdMonIC extends ValidatorEJB ...@@ -385,9 +386,9 @@ public class AttdMonIC extends ValidatorEJB
errCode = genericUtility.getErrorString("woff_days", "VTMONATD05", userId); errCode = genericUtility.getErrorString("woff_days", "VTMONATD05", userId);
break; break;
} }
else if(woffDays!=null) else if(woffDays.length() > 0)
{ {
woffDay = Integer.parseInt(woffDays); woffDay = Double.parseDouble(woffDays);
if(woffDay < 0) if(woffDay < 0)
{ {
errCode = genericUtility.getErrorString("woff_days", "VTMONATD06", userId); errCode = genericUtility.getErrorString("woff_days", "VTMONATD06", userId);
...@@ -403,9 +404,9 @@ public class AttdMonIC extends ValidatorEJB ...@@ -403,9 +404,9 @@ public class AttdMonIC extends ValidatorEJB
errCode = genericUtility.getErrorString("lves_taken", "VTMONATD07", userId); errCode = genericUtility.getErrorString("lves_taken", "VTMONATD07", userId);
break; break;
} }
if(lvesTaken != null) if(lvesTaken.length() > 0)
{ {
lveTaken = Integer.parseInt(lvesTaken); lveTaken = Double.parseDouble(lvesTaken);
if(lveTaken < 0) if(lveTaken < 0)
{ {
errCode = genericUtility.getErrorString("lves_taken", "VTMONATD08", userId); errCode = genericUtility.getErrorString("lves_taken", "VTMONATD08", userId);
...@@ -599,16 +600,31 @@ public class AttdMonIC extends ValidatorEJB ...@@ -599,16 +600,31 @@ public class AttdMonIC extends ValidatorEJB
woffDays = E12GenericUtility.checkNull(genericUtility.getColumnValue("woff_days", dom)); woffDays = E12GenericUtility.checkNull(genericUtility.getColumnValue("woff_days", dom));
lvesTaken = E12GenericUtility.checkNull(genericUtility.getColumnValue("lves_taken", dom)); lvesTaken = E12GenericUtility.checkNull(genericUtility.getColumnValue("lves_taken", dom));
withHeld = E12GenericUtility.checkNull(genericUtility.getColumnValue("with_held", dom)); withHeld = E12GenericUtility.checkNull(genericUtility.getColumnValue("with_held", dom));
if(workDays!=null) if(workDays.length() <= 0)
{
workDayCnt = 0;
valueXmlString.append("<work_days><![CDATA[").append(workDayCnt).append("]]></work_days>");
}
else
{ {
workDayCnt = Double.parseDouble(workDays); workDayCnt = Double.parseDouble(workDays);
} }
if(woffDays!=null) if(woffDays.length() <= 0)
{
woffDaysCnt = 0;
valueXmlString.append("<woff_days><![CDATA[").append(woffDaysCnt).append("]]></woff_days>");
}
else
{ {
woffDaysCnt = Double.parseDouble(woffDays); woffDaysCnt = Double.parseDouble(woffDays);
workDayCnt =workDayCnt+woffDaysCnt; workDayCnt =workDayCnt+woffDaysCnt;
} }
if(lvesTaken!=null) if(lvesTaken.length() <= 0)
{
lvesTakenCnt = 0;
valueXmlString.append("<lves_taken><![CDATA[").append(woffDaysCnt).append("]]></lves_taken>");
}
else
{ {
lvesTakenCnt = Double.parseDouble(lvesTaken); lvesTakenCnt = Double.parseDouble(lvesTaken);
workDayCnt = workDayCnt+lvesTakenCnt; workDayCnt = workDayCnt+lvesTakenCnt;
......
...@@ -190,6 +190,10 @@ public class ArrearsDeletePrc extends ProcessEJB ...@@ -190,6 +190,10 @@ public class ArrearsDeletePrc extends ProcessEJB
{ {
errorString = genericUtility.getErrorString("", "PROCSUCC", userId); errorString = genericUtility.getErrorString("", "PROCSUCC", userId);
} }
else
{
errorString = genericUtility.getErrorString("", "VPF16DSG01", userId);
}
} }
catch(Exception e) catch(Exception e)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment