Commit 5e1989fb authored by piyush's avatar piyush

Changes in Employee LEave confirmation component


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106620 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c23d4c06
...@@ -1985,16 +1985,43 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal, ...@@ -1985,16 +1985,43 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
} }
} }
} }
else }
else
{
sql = "SELECT PAYABLE FROM LEAVES WHERE LVE_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, prevLveCode);
resultSet = pstmt.executeQuery();
while(resultSet.next())
{ {
sql = "SELECT PAYABLE FROM LEAVES WHERE LVE_CODE = ?"; payable = resultSet.getString("PAYABLE");
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(payable.equals("Y"))
{
canCombine = "N";
canCombine1 = "N";
sql = "SELECT (CASE WHEN CAN_COMBINE IS NULL THEN 'N' ELSE CAN_COMBINE END ) AS CAN_COMBINE FROM LVETABLE WHERE LVE_CODE = ? AND LVE_TBLNO = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, prevLveCode);
pstmt.setString(1, lveCode);
pstmt.setString(2, lveTblno);
resultSet = pstmt.executeQuery(); resultSet = pstmt.executeQuery();
while(resultSet.next()) while(resultSet.next())
{ {
payable = resultSet.getString("PAYABLE"); canCombine = resultSet.getString("CAN_COMBINE");
} }
if(resultSet != null) if(resultSet != null)
{ {
...@@ -2006,76 +2033,49 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal, ...@@ -2006,76 +2033,49 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(payable.equals("Y"))
{
canCombine = "N";
canCombine1 = "N";
sql = "SELECT (CASE WHEN CAN_COMBINE IS NULL THEN 'N' ELSE CAN_COMBINE END ) AS CAN_COMBINE FROM LVETABLE WHERE LVE_CODE = ? AND LVE_TBLNO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lveCode); sql = "SELECT (CASE WHEN CAN_COMBINE IS NULL THEN 'N' ELSE CAN_COMBINE END ) AS CAN_COMBINEFROM LVETABLE WHERE LVE_CODE = ? AND LVE_TBLNO = ?";
pstmt.setString(2, lveTblno); pstmt = conn.prepareStatement(sql);
resultSet = pstmt.executeQuery();
while(resultSet.next())
{
canCombine = resultSet.getString("CAN_COMBINE");
}
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
sql = "SELECT (CASE WHEN CAN_COMBINE IS NULL THEN 'N' ELSE CAN_COMBINE END ) AS CAN_COMBINEFROM LVETABLE WHERE LVE_CODE = ? AND LVE_TBLNO = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, prevLveCode); pstmt.setString(1, prevLveCode);
pstmt.setString(2, lveTblno); pstmt.setString(2, lveTblno);
resultSet = pstmt.executeQuery(); resultSet = pstmt.executeQuery();
while(resultSet.next()) while(resultSet.next())
{ {
canCombine1 = resultSet.getString("CAN_COMBINE"); canCombine1 = resultSet.getString("CAN_COMBINE");
} }
if(resultSet != null) if(resultSet != null)
{ {
resultSet.close(); resultSet.close();
resultSet = null; resultSet = null;
} }
if(pstmt != null) if(pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if (canCombine == null || canCombine.trim().length() == 0) if (canCombine == null || canCombine.trim().length() == 0)
{ {
canCombine = "N"; canCombine = "N";
} }
if (canCombine1 == null || canCombine1.trim().length() == 0) if (canCombine1 == null || canCombine1.trim().length() == 0)
{ {
canCombine1 = "N"; canCombine1 = "N";
} }
if(canCombine.equalsIgnoreCase("N") && canCombine1.equalsIgnoreCase("N") && if(canCombine.equalsIgnoreCase("N") && canCombine1.equalsIgnoreCase("N") &&
((sysUtilMethods.DaysAfter(lvedtTo, frDate1) > 0 && lveEnd.equalsIgnoreCase("E") && nextLveStart.equalsIgnoreCase("B")) || ((sysUtilMethods.DaysAfter(lvedtTo, frDate1) > 0 && lveEnd.equalsIgnoreCase("E") && nextLveStart.equalsIgnoreCase("B")) ||
(sysUtilMethods.DaysAfter(lvedtTo, frDate1) == 0))) (sysUtilMethods.DaysAfter(lvedtTo, frDate1) == 0)))
{
errCode = "";
this.errList.add("VTLVE20");
this.fldList.add("");
String errType = getErrorType("VTLVE20" , conn);
if ("E".equalsIgnoreCase(errType))
{ {
errCode = ""; isError = true;
this.errList.add("VTLVE20"); break;
this.fldList.add("");
String errType = getErrorType("VTLVE20" , conn);
if ("E".equalsIgnoreCase(errType))
{
isError = true;
break;
}
} }
} }
} }
...@@ -3199,7 +3199,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal, ...@@ -3199,7 +3199,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
//$$$$$$$$$$$$$$$$$$$$$$$$$ Start $$$$$$$$$$$$$$$$$$$$$$// //$$$$$$$$$$$$$$$$$$$$$$$$$ Start $$$$$$$$$$$$$$$$$$$$$$//
boolean allowUpdateNegLeave = (boolean) this.lveRuleList.get("allow_update_negative_leave"); //boolean allowUpdateNegLeave = (boolean) this.lveRuleList.get("allow_update_negative_leave");
boolean allowUpdateNegLeave = (Boolean)this.lveRuleList.get("allow_update_negative_leave");
/*if istr_lve_rule_list.allow_update_negative_leave = true and museflag = "C" then /*if istr_lve_rule_list.allow_update_negative_leave = true and museflag = "C" then
*/ */
...@@ -3358,7 +3359,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal, ...@@ -3358,7 +3359,8 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
else if(nextBal > 0) else if(nextBal > 0)
{ {
allowUpdateNegLeave = (boolean) this.lveRuleList.get("allow_update_negative_leave"); //allowUpdateNegLeave = (boolean) this.lveRuleList.get("allow_update_negative_leave");
allowUpdateNegLeave = (Boolean)this.lveRuleList.get("allow_update_negative_leave");
//if istr_lve_rule_list.allow_update_negative_leave = true and museFlag = "C" then //if istr_lve_rule_list.allow_update_negative_leave = true and museFlag = "C" then
if(allowUpdateNegLeave == true && museFlag.equalsIgnoreCase("C")) if(allowUpdateNegLeave == true && museFlag.equalsIgnoreCase("C"))
{ {
...@@ -4394,7 +4396,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal, ...@@ -4394,7 +4396,7 @@ public class EmpLeaveConf extends ActionHandlerEJB implements EmpLeaveConfLocal,
fe.printStackTrace(); fe.printStackTrace();
} }
} }
if (isError) if (!isError)
{ {
errCode = ""; errCode = "";
} }
......
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