Commit 1ce13e81 authored by prahate's avatar prahate

Changes done for Charge back replacement.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194133 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 47f6b927
......@@ -335,7 +335,8 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
// errString = itmDBAccessEJB.getErrorString("emp_code", "VMECODENULL", userId);
// break;
// return errString;
errList.add("VMECODENULL");
//errList.add("VMECODENULL");
errList.add("VMEMPCD");
errFields.add(childNodeName.toLowerCase());
} else
{
......@@ -781,6 +782,78 @@ public class ChargeBackLoc extends ValidatorEJB implements ChargeBackLocLocal, C
}
}
}// END FOR OF CASE2
//Added by Saiprasad G. [When the settle_mth change in edit case] START
settlemth=genericUtility.getColumnValue("settle_mth", dom2,"1");
System.out.println("settlemth in case2 p : "+settlemth);
parentNodeList1 = null;
parentNodeList1 = dom2.getElementsByTagName("Detail2");
parentNode = null;
childNodeList = null;
childNodeListLength = 0;
childNode = null;
childNodeName = "";
System.out.println("All the object are done null case2 : "+childNodeList);
//boolean isUpdated = false;
parentNodeListPOCLen = 0;
parentNodeListPOCLen = parentNodeList1.getLength();
System.out.println("parentNodeListPOCLen case2: "+ parentNodeListPOCLen);
for ( int rowCnt=0; rowCnt < parentNodeListPOCLen; rowCnt++ )
{
parentNode = parentNodeList1.item(rowCnt);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName : "+childNodeName);
if(childNodeName.equalsIgnoreCase("attribute"))
{
String updateNodeValue = childNode.getAttributes().getNamedItem("updateFlag").getFirstChild().getNodeValue();
System.out.println("updateNodeValue case2: "+updateNodeValue);
if((settlemth.equalsIgnoreCase("V") || settlemth.equalsIgnoreCase("Q"))&&(! "D".equalsIgnoreCase(updateNodeValue)))
{
errList.add("VMNVSECOND");
errFields.add(childNodeName.toLowerCase());
}
}
}
}
parentNodeList2 = null;
parentNodeList2 = dom2.getElementsByTagName("Detail3");
parentNode = null;
childNodeList = null;
childNodeListLength = 0;
childNode = null;
childNodeName = "";
System.out.println("All the object are done null Detail3: "+childNodeList);
parentNodeListPOCLen1 = 0;
parentNodeListPOCLen1 = parentNodeList2.getLength();
System.out.println("parentNodeListPOCLen1 : "+ parentNodeListPOCLen1);
for ( int rowCnt=0; rowCnt < parentNodeListPOCLen1; rowCnt++ )
{
parentNode = parentNodeList2.item(rowCnt);
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for(ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName : "+childNodeName);
if(childNodeName.equalsIgnoreCase("attribute"))
{
String updateNodeValue2 = childNode.getAttributes().getNamedItem("updateFlag").getFirstChild().getNodeValue();
System.out.println("updateNodeValue Detail3 : "+updateNodeValue2);
if((settlemth.equalsIgnoreCase("C")) && (! "D".equalsIgnoreCase(updateNodeValue2)))
{
errList.add("VMINVTHIRD");
errFields.add(childNodeName.toLowerCase());
}
}
}
}
//Added by Saiprasad G. [When the settle_mth change in edit case] END
break;
//Added by saiprasad on 22-Nov-18 for replacement form.
case 3:
......
......@@ -773,28 +773,38 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
// & "quantity replacement" in charge back then data inserted into scheme
// balance table]
// For the charge_back
int updatedCount = 0;
System.out.println("tranId::[" + tranID + "]");
chargeBakSql = "SELECT CUST_CODE, SETTLE_MTH FROM CHARGE_BACK WHERE TRAN_ID=?";
System.out.println(chargeBakSql);
pstmt = conn.prepareStatement(chargeBakSql);
pstmt.setString(1, tranID);
rs = pstmt.executeQuery();
if (rs.next()) {
custCode1 = rs.getString("CUST_CODE");
PreparedStatement preparedStatement = null, preparedStatement1 = null;
ResultSet resultSet = null;
preparedStatement = conn.prepareStatement(chargeBakSql);
preparedStatement.setString(1, tranID);
resultSet = preparedStatement.executeQuery();
if (resultSet.next()) {
custCode1 = resultSet.getString("CUST_CODE");
System.out.println("customer code1::[" + custCode1 + "]");
settleMethod = rs.getString("SETTLE_MTH");
settleMethod = resultSet.getString("SETTLE_MTH");
System.out.println("Settle method1::[" + settleMethod + "]");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(resultSet != null)
{
resultSet.close();
resultSet = null;
}
if(preparedStatement != null)
{
preparedStatement.close();
preparedStatement = null;
}
// For the charge_back_repl
secondarySchSql = "SELECT ITEM_CODE__REPL,FREE_QTY,FREE_VALUE,OFFER FROM CHARGE_BACK_REPL WHERE TRAN_ID=?";
System.out.println(secondarySchSql);
pstmt = conn.prepareStatement(secondarySchSql);
pstmt.setString(1, tranID);
rs = pstmt.executeQuery();
preparedStatement1 = conn.prepareStatement(secondarySchSql);
preparedStatement1.setString(1, tranID);
rs = preparedStatement1.executeQuery();
while (rs.next())
{
itemCodeRepl = E12GenericUtility.checkNull(rs.getString("ITEM_CODE__REPL"));
......@@ -874,32 +884,37 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
pstmt.setTimestamp(12, effFrom1);
pstmt.setString(13, termId);
pstmt.setString(14, "A");
int i = pstmt.executeUpdate();
System.out.println("Data inserted:" + i);
if (i > 0)
updatedCount = pstmt.executeUpdate();
System.out.println("Data inserted:..." + updatedCount);
if (updatedCount > 0)
{
conn.commit();
}
else
{
conn.rollback();
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
else if(settleMethod.equalsIgnoreCase("C"))
{
}
}
if(rs != null)
{
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(preparedStatement1 != null)
{
preparedStatement1.close();
preparedStatement1 = null;
}
//Added by Saiprasad G. END
returnString = itmDBAccessEJB.getErrorString("","TRANCONFSC",userId,"",conn);
returnString = itmDBAccessEJB.getErrorString("","TRANCONFSC",userId);
}
else
......@@ -918,7 +933,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
}
catch(Exception e)
{
System.out.println("ChrgBckLocConfEJB..."+e.getMessage());
System.out.println("ChrgBckLocConfEJB..."+e);
e.printStackTrace();
try
{
......@@ -926,7 +941,7 @@ public class ChrgBckLocConf extends ActionHandlerEJB implements ChrgBckLocConfLo
}
catch(Exception e1)
{
System.out.println("ChrgBckLocConfEJB..."+e1.getMessage());
System.out.println("ChrgBckLocConfEJB..."+e1);
e1.printStackTrace();
}
}
......
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