Commit 6cd05b95 authored by caluka's avatar caluka

Secondary Sales transaction and submit in one screen


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99348 ce508802-f39f-4f6c-b175-0d175dae99d5
parent caeba3b7
......@@ -45,12 +45,8 @@ import com.berryworks.edireader.EDIAbstractReader;
public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,CustStockGWTICRemote //implements SessionBean
{
GenericUtility genericUtility = GenericUtility.getInstance();
//E12GenericUtility e12GenericUtility = new E12GenericUtility();
UtilMethods utilMethod = new UtilMethods();
ibase.webitm.ejb.dis.DistCommon dist = new ibase.webitm.ejb.dis.DistCommon();
//String allXmlDataStr1="";
//String allXmlDataStr2="";
java.sql.Timestamp prdFrmDateTstmp =null;
java.sql.Timestamp prdtoDateTstmp =null;
......@@ -67,14 +63,12 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
try
{
//System.out.println("xmlString:-" + xmlString );
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
errString = wfValData(dom,dom1,dom2,objContext,editFlag,xtraParams);
}
catch(Exception e)
{
//System.out.println("Exception : SOrderFormEJB : wfValData(String xmlString) : ==>\n"+e.getMessage());
throw new ITMException( e );
}
return (errString);
......@@ -90,8 +84,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
Document dom2 = null;
try
{
/*allXmlDataStr1=xmlString1;
allXmlDataStr2=xmlString2;*/
dom = parseString(xmlString);
dom1 = parseString(xmlString1);
......@@ -104,7 +96,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
catch(Exception e)
{
//System.out.println("Exception : SOrderFormEJB : wfValData(String xmlString) : ==>\n"+e.getMessage());
throw new ITMException( e );
}
return (errString);
......@@ -124,9 +115,9 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
String siteCode = "",custCode="",userId="",sql="",tranId="",errCode="",errorType="",errString="",itemSer="",stmtDateStr="";
String custType="",custType1="";
String fromDateStr ="",toDateStr="",custTypeDom="";
String loginSiteCode="",periodStatus="";
String loginSiteCode="",periodStatus="",editSatus="";
int ctr = 0,currentFormNo=0,cnt=0,countCustRef=0,refSerCnt=0,childNodeListLength=0,invCnt=0,clStockInteger=0;
int custstockCnt=0;
int custstockCnt=0,custstockCnt1=0;
double clStock=0.0,opStockDom=0.0,purRcpDom=0.0;
double opStock=0.0,purRcpQty=0.0,secSales=0.0,purcRetQty=0.0,priSales=0.0,netAmt=0.0;
Date frmdate = null,todate = null;
......@@ -172,7 +163,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
parentNodeList = dom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
//valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
System.out.println("wfValData : case 1 called!!!!");
for (ctr = 0; ctr < childNodeListLength; ctr++)
......@@ -193,25 +183,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
else if(custCode != null && custCode.trim().length() > 0 )
{
/*sql = "select count(*) from sprs_stockist where cust_code=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode.trim());
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
if (cnt == 0)
{
errCode = "VTINVCUST";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;*/
sql = "select count(*) from customer where cust_code=? ";
pstmt = conn.prepareStatement(sql);
......@@ -334,33 +305,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt.close();
pstmt = null;
//
/* if(custCode != null && itemSer != null && orderType != null)
{
sql = "select count(*) from invoice where cust_code=? and ITEM_SER =? and INV_TYPE=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode.trim());
pstmt.setString(2,itemSer.trim());
pstmt.setString(3,orderType.trim());
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
if (cnt == 0)
{
System.out.println("Error :data not founf for invoice ");
errCode = "VTINVDATA";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}*/
}
}
......@@ -399,10 +343,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
}
//End added by chandra shekar on 26-10-2015
if(childNodeName.equalsIgnoreCase("period"))
if(childNodeName.equalsIgnoreCase("prd_code"))
{
System.out.println("period called!!!!");
period = this.genericUtility.getColumnValue("period", dom);
period = this.genericUtility.getColumnValue("prd_code", dom);
System.out.println("period :"+period);
orderType = this.genericUtility.getColumnValue("order_type", dom);
System.out.println("orderType :"+orderType);
......@@ -410,6 +354,12 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("custCode :"+custCode);
itemSer = this.genericUtility.getColumnValue("item_ser", dom);
System.out.println("itemSer :"+itemSer);
tranId = this.genericUtility.getColumnValue("tran_id", dom);
System.out.println("tranId@@@@@@@"+tranId);
editSatus = this.genericUtility.getColumnValue("edit_status", dom);
System.out.println("editSatus@@@@@@@"+editSatus);
System.out.println("itemSer :"+itemSer);
if(period == null)
{
errCode = "VMNULLPRD";
......@@ -476,78 +426,34 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
errFields.add(childNodeName.toLowerCase());
}
}
/*sql = "select count(*) from period where code=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,period.trim());
rs = pstmt.executeQuery();
if (rs.next())
{
cnt = rs.getInt(1);
}
if (cnt == 0)
{
System.out.println("Error :Period not exist in period master ");
errCode = "VMINVPRD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
sql = "Select count(1) from period_stat where prd_code = ? "
+ " AND site_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, period.trim());
pstmt.setString(2, loginSiteCode.trim());
rs = pstmt.executeQuery();
if (rs.next()) {
cnt = rs.getInt(1);
System.out.println("Count for prdCode>>>>>>>>>>"+cnt);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if (cnt > 0)
if("A".equalsIgnoreCase(editSatus))
{
sql = "Select stat_sal from period_stat where prd_code = ? and site_code = ? ";
sql = "select count(*) from cust_stock where " +
" cust_code=? and from_date=? and to_date =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, period.trim());
pstmt.setString(2, loginSiteCode.trim());
pstmt.setString(1,custCode);
pstmt.setTimestamp(2,FromDate);
pstmt.setTimestamp(3,ToDate);
rs = pstmt.executeQuery();
if (rs.next())
{
periodStatus = rs.getString(1);
System.out.println("periodStatus sal>>>>>>>"+periodStatus);
custstockCnt1 = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if("N".equalsIgnoreCase(periodStatus))
if (custstockCnt1 > 0)
{
System.out.println("Error :Period status is N ");
errCode = "VMINVPRD1";
System.out.println("Error :cust_stock already exist in same period ");
errCode = "VMINVPRDCU";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else
{
errCode = "VMSTATSND";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}*/
}
}
if(childNodeName.equalsIgnoreCase("stmt_date"))
......@@ -578,14 +484,12 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
}
//valueXmlString.append("</Detail1>");
break;
/*
case 2:
parentNodeList = dom.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
//valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
System.out.println("wfValData : case 2 called!!!!");
for (ctr = 0; ctr < childNodeListLength; ctr++)
......@@ -608,13 +512,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
itemSer = this.genericUtility.getColumnValue("item_ser", dom1);
/* String orderType1 = this.genericUtility.getColumnValue("order_type", dom2);
System.out.println("orderType :"+orderType1);
String custCode1 = this.genericUtility.getColumnValue("cust_code", dom2);
System.out.println("custCode :"+custCode1);
String itemSer1 = this.genericUtility.getColumnValue("item_ser", dom2);
System.out.println("itemSer1 :"+itemSer1);*/
if(fromDateStr != null)
{
FromDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
......@@ -624,29 +521,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
ToDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(toDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
/*if(stmtDateStr != null)
{
stmtDateTmstp = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(stmtDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}
if(stmtDateStr == null)
{
System.out.println("Error :Statement date should not be blank!!! ");
errCode = "VTEMPSTDT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
System.out.println("stmtDateTmstp :"+stmtDateTmstp);
System.out.println("currentDate :"+currentDate);
if(currentDate.before(stmtDateTmstp))
{
System.out.println("stmtDateTmstp < currentDate : "+stmtDateTmstp+" < "+currentDate);
errCode = "VTINVEFFDT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*/
tranId = checkNull(this.genericUtility.getColumnValue("tran_id",dom));
System.out.println("tranId :"+tranId);
......@@ -708,47 +582,12 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
break;
case 3:
/*parentNodeList = dom.getElementsByTagName("Detail3");
System.out.println("parentNodeList :"+parentNodeList);
parentNode = parentNodeList.item(0);
System.out.println("parentNode :"+parentNode);
childNodeList = parentNode.getChildNodes();
//valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
System.out.println("wfValData : case 3 called!!!!");
System.out.println("childNodeListLength :"+childNodeListLength);
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equalsIgnoreCase("invoice_id"))
{
invoiceId = this.genericUtility.getColumnValue("invoice_id", dom);
System.out.println("invoiceId :"+invoiceId);
if(invoiceId == null)
{
System.out.println("Error : No data found in invoice details");
errCode = "VTEMTINV";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}//cust code
break;*/
}
}*/
//valueXmlString.append("</Detail1>");
//NodeList parentNodeList = null;
//NodeList childNodeList = null;
//int childNodeListLength = 0;
parentNodeList = dom2.getElementsByTagName("Detail3");
case 2:
parentNodeList = dom2.getElementsByTagName("Detail2");
parentNodeListLength = parentNodeList.getLength();
System.out.println("parentNodeListLength Detail3:::::::::"+parentNodeListLength);
System.out.println("parentNodeListLength Detail2:::::::::"+parentNodeListLength);
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++)
{
......@@ -769,13 +608,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
invoiceId = childNode1.getFirstChild().getNodeValue();
}
System.out.println("invoiceId :"+invoiceId);
/*if(invoiceId.trim().length() == 0)
{
System.out.println("Error : No data found in invoice details");
errCode = "VTEMTINV";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}*///change done by chandrashekar on 27-10-2015
}
......@@ -786,113 +618,16 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
break;
case 4:
/* parentNodeList = dom.getElementsByTagName("Detail4");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
//valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
System.out.println("wfValData : case 4 called!!!!");
for (ctr = 0; ctr < childNodeListLength; ctr++)
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName :"+childNodeName);
if (childNodeName.equalsIgnoreCase("item_code"))
{
itemCode = this.genericUtility.getColumnValue("item_code", dom);
System.out.println("itemCode :"+itemCode);
if(itemCode == null:SA)
{
System.out.println("Error : No data found in item details!!");
errCode = "VTEMTITM";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
if (childNodeName.equalsIgnoreCase("cl_stock"))
{
System.out.println("opStockDom!!! :"+this.genericUtility.getColumnValue("op_stock", dom));
System.out.println("purRcpDom!!!! :"+this.genericUtility.getColumnValue("pur_rcp", dom));
System.out.println("purRcpDom!!!! :"+this.genericUtility.getColumnValue("pur_rcp", dom1));
System.out.println("purRcpDom!!!! :"+this.genericUtility.getColumnValue("pur_rcp", dom2));
if(this.genericUtility.getColumnValue("op_stock", dom) != null)
{
opStockDom = Double.parseDouble(this.genericUtility.getColumnValue("op_stock", dom)) ;
}
else
{:SA
opStockDom=0.0;
}
if(this.genericUtility.getColumnValue("pur_rcp", dom2) != null)
{
purRcpDom = Double.parseDouble(this.genericUtility.getColumnValue("pur_rcp", dom2));
}else
{
purRcpDom =0.0;
}
if(!(isNumeric(this.genericUtility.getColumnValue("cl_stock", dom))))
{
errCode = "VTCLSTVLD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
System.out.println("Closing Stock not valid");
}
else
{
clStock=doublevalue(this.genericUtility.getColumnValue("cl_stock", dom));
}
if(clStock < 0)
{
errCode = "VTCLSTVLD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
System.out.println("Closing Stock should not be negetive valid");
}
System.out.println("opStockDom :"+opStockDom);
System.out.println("purRcpDom :"+purRcpDom);
System.out.println(opStockDom + purRcpDom);
if(opStockDom + purRcpDom < clStock)
{
errCode = "VTCLSTVLD";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}*/
//valueXmlString.append("</Detail1>");
//int childNodeListLength = 0;
parentNodeList = dom2.getElementsByTagName("Detail4");
parentNodeList = dom2.getElementsByTagName("Detail3");
parentNodeListLength = parentNodeList.getLength();
System.out.println("parentNodeListLength Detail4:::::::::"+parentNodeListLength);
System.out.println("parentNodeListLength Detail3:::::::::"+parentNodeListLength);
for (int selectedRow = 0; selectedRow < parentNodeListLength; selectedRow++)
//System.out.println("parentNodeListLength>>>>>"+parentNodeListLength);
//for (int selectedRow = parentNodeListLength ; selectedRow >= 0; selectedRow--)M
{
parentNode1 = parentNodeList.item(selectedRow);
childNodeList = parentNode1.getChildNodes();
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeListLength::: "+ childNodeListLength+"\n");
//for (int childRow = parentNodeListLength ; childRow >= 0; childRow--)
for (int childRow = 0; childRow < childNodeListLength; childRow++)
{
childNode1 = childNodeList.item(childRow);
......@@ -940,7 +675,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("itemCode>>>>>>"+itemCode);
if(isClStockInt == false)
{
//errItemList.add(itemCode);
errCode = "VTCLSINT";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
......@@ -1189,7 +923,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
return "";
}
//public String itemChanged(String xmlString , String currentColumn, String formNo, String domID) throws RemoteException,ITMException
public String itemChanged(String xmlString, String xmlString1, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom = null;
......@@ -1202,16 +935,11 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("xmlString itemChanged: " + xmlString);
dom1 = parseString(xmlString1);
System.out.println("xmlString1 itemChanged :" + xmlString1);
// if (xmlString2.trim().length() > 0 )
// {
// dom2 = parseString(xmlString2);
// }
valueXmlString = itemChanged(dom,dom1,dom2,objContext,currentColumn,editFlag,xtraParams);
}
catch(Exception e)
{
e.printStackTrace();
//System.out.println("Exception : [SOrderFormEJB][itemChanged(String,String)] :==>\n"+e.getMessage());
throw new ITMException( e );
}
return valueXmlString;
......@@ -1228,7 +956,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("xmlString itemChanged::" + xmlString);
dom1 = parseString(xmlString1);
System.out.println("xmlString1 itemChanged::" + xmlString1);
//allXmlDataStr1=xmlString1;
if (xmlString2.trim().length() > 0 )
{
dom2 = parseString(xmlString2);
......@@ -1240,7 +967,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
catch(Exception e)
{
//System.out.println("Exception : [SOrderFormEJB][itemChanged(String,String)] :==>\n"+e.getMessage());
throw new ITMException(e);
}
......@@ -1310,6 +1036,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
Date RelativeDate=null;
Date nextMonthDate=null;
Date toDate1=null,fromDate1=null;
Date tranDateEdit=null;
Timestamp dbRelativeDate=null;
Timestamp dbNextMonthDate=null;
Timestamp dbSysDate= null;
......@@ -1365,7 +1092,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
currentFormNo = Integer.parseInt(objContext);
valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n<Header>\r\n<editFlag>");
valueXmlString.append(editFlag).append("</editFlag>\r\n</Header>\r\n");
System.out.println("nCustStockGWTIC : itemChanged[currentFormNo] IS : "+currentFormNo);
System.out.println("CustStockGWTIC : itemChanged[currentFormNo] IS : "+currentFormNo);
switch (currentFormNo)
{
......@@ -1378,7 +1105,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("value of Sales Person :"+spCode);
// Added By Chandrashekar - Suggested by Prajyot - Start
String sqlFirstDefData = " SELECT CS.CUST_CODE CUST_CODE, C.CUST_NAME CUST_NAME, C.CUST_TYPE CUST_TYPE, C.ORDER_TYPE ORDER_TYPE, CS.SITE_CODE SITE_CODE," +
" CS.FROM_DATE FROM_DATE, CS.TO_DATE TO_DATE, CS.ITEM_SER ITEM_SER, CS.STMT_DATE STMT_DATE, CS.PRD_CODE PRD_CODE " +
" CS.FROM_DATE FROM_DATE, CS.TO_DATE TO_DATE, CS.ITEM_SER ITEM_SER, CS.STMT_DATE STMT_DATE, CS.PRD_CODE PRD_CODE,CS.TRAN_DATE TRAN_DATE,CS.TRAN_ID__LAST TRAN_ID__LAST,C.STAN_CODE STAN_CODE " +
" FROM CUST_STOCK CS , CUSTOMER C " +
" WHERE CS.CUST_CODE = C.CUST_CODE AND CS.TRAN_ID = ? " ;
editFlag = (editFlag != null) ? editFlag : genericUtility.getColumnValue("editFlag", dom1);
......@@ -1403,18 +1130,91 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
fromDate1 = rs.getDate("FROM_DATE");
toDate1 = rs.getDate("TO_DATE");
tranDateEdit = rs.getDate("TRAN_DATE");
fromDateStr = sdt.format(fromDate1.getTime());
toDateStr = sdt.format(toDate1.getTime());
stmtDateStr = genericUtility.getValidDateString(rs.getDate("STMT_DATE"), genericUtility.getApplDateFormat());
System.out.println("fromDateStr>>>>"+fromDateStr);
System.out.println("toDateStr>>>>"+toDateStr);
System.out.println("tranDateEdit>>>>"+tranDateEdit);
System.out.println("print@@@@@@@@"+sdf.format(tranDateEdit).toString());
sql= " select FR_DATE,TO_DATE from period_tbl where "
+ "prd_code = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("PRD_CODE"));
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
FromDate = rs1.getTimestamp("FR_DATE");
ToDate = rs1.getTimestamp("TO_DATE");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
sql= " select descr from itemser where item_ser = ?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("ITEM_SER") );
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
itemSerName=checkNull(rs1.getString("descr"));
System.out.println("itemSerName edit :"+itemSerName);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
sql = "select descr from sordertype where order_type =? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("ORDER_TYPE") );
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
orderTypeName = checkNull(rs1.getString("descr"));
System.out.println("orderTypeName edit :" + orderTypeName);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
//Change by chandra shekar on 26-10-2015
if(rs.getString("CUST_TYPE") != null && rs.getString("CUST_TYPE").trim().length()>0)
{
sql = "select descr from gencodes where mod_name='W_CUST_STOCK_GWT' and fld_name='CUST_TYPE' AND fld_value=?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("CUST_TYPE"));
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
custTypeDescr = checkNull(rs1.getString("descr"));
System.out.println("custTypeDescr edit :" + custTypeDescr);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
}
sql = "select descr from station where stan_code= ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, rs.getString("STAN_CODE"));
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
stanDescr = checkNull(rs1.getString("descr"));
System.out.println("stanDescr edit :" + stanDescr);
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
custNameStation=rs.getString("CUST_NAME")+"-"+stanDescr;
/*
valueXmlString.append("<cust_code>").append("<![CDATA["+ rs.getString("CUST_CODE") +"]]>").append("</cust_code>");
valueXmlString.append("<cust_name>").append("<![CDATA["+ rs.getString("CUST_NAME") +"]]>").append("</cust_name>");
valueXmlString.append("<item_ser protect='1'>").append("<![CDATA["+ rs.getString("ITEM_SER") +"]]>").append("</item_ser>");
//valueXmlString.append("<itemser_descr>").append("<![CDATA["+stanCode+"]]>").append("</itemser_descr>");
valueXmlString.append("<cust_type>").append("<![CDATA["+ rs.getString("CUST_TYPE") +"]]>").append("</cust_type>");
//valueXmlString.append("<cust_type__descr>").append("<![CDATA["+stanCode+"]]>").append("</cust_type__descr>");
valueXmlString.append("<period>").append("<![CDATA["+ rs.getString("PRD_CODE") +"]]>").append("</period>");
valueXmlString.append("<stmt_date>").append("<![CDATA["+ stmtDateStr +"]]>").append("</stmt_date>");
valueXmlString.append("<period_status>").append("<![CDATA[]]>").append("</period_status>");
......@@ -1429,7 +1229,35 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<editFlag>").append("<![CDATA["+editFlag +"]]>").append("</editFlag>");
valueXmlString.append("<prv_tran_id>").append("<![CDATA["+tranId +"]]>").append("</prv_tran_id>");
valueXmlString.append("<startForm>").append("<![CDATA["+startForm +"]]>").append("</startForm>");
//valueXmlString.append("<sordertype_descr>").append("<![CDATA["+stanCode+"]]>").append("</sordertype_descr>");
*/
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n");
valueXmlString.append("<tran_id>").append("<![CDATA["+tranId+"]]>").append("</tran_id>");
valueXmlString.append("<tran_date>").append("<![CDATA["+sdf.format(tranDateEdit).toString()+"]]>").append("</tran_date>");
valueXmlString.append("<cust_code protect='1'>").append("<![CDATA["+ rs.getString("CUST_CODE") +"]]>").append("</cust_code>");
valueXmlString.append("<cust_name protect='1'>").append("<![CDATA["+ custNameStation +"]]>").append("</cust_name>");
valueXmlString.append("<item_ser protect='1'>").append("<![CDATA["+ rs.getString("ITEM_SER") +"]]>").append("</item_ser>");
valueXmlString.append("<order_type protect='1'>").append("<![CDATA["+ rs.getString("ORDER_TYPE") +"]]>").append("</order_type>");
valueXmlString.append("<from_date protect='1'>").append("<![CDATA["+sdf.format(FromDate).toString()+"]]>").append("</from_date>");
valueXmlString.append("<to_date protect='1'>").append("<![CDATA["+sdf.format(ToDate).toString()+"]]>").append("</to_date>");
valueXmlString.append("<itemser_descr protect='1'>").append("<![CDATA["+itemSerName+"]]>").append("</itemser_descr>");
valueXmlString.append("<site_code>").append("<![CDATA["+ rs.getString("SITE_CODE") +"]]>").append("</site_code>");
valueXmlString.append("<tran_id__last>").append("<![CDATA["+ rs.getString("TRAN_ID__LAST") +"]]>").append("</tran_id__last>");
valueXmlString.append("<sordertype_descr protect='1'>").append("<![CDATA["+orderTypeName+"]]>").append("</sordertype_descr>");
valueXmlString.append("<stmt_date protect='1'>").append("<![CDATA[" + stmtDateStr + "]]>").append("</stmt_date>");
valueXmlString.append("<status>").append("<![CDATA[O]]>").append("</status>");
valueXmlString.append("<prd_code protect='1'>").append("<![CDATA["+ rs.getString("PRD_CODE") +"]]>").append("</prd_code>");
valueXmlString.append("<chg_user>").append("<![CDATA["+chgUser+"]]>").append("</chg_user>");
valueXmlString.append("<chg_term>").append("<![CDATA["+chgTerm+"]]>").append("</chg_term>");
valueXmlString.append("<chg_date>").append("<![CDATA["+sdf.format(currentDate)+"]]>").append("</chg_date>");
valueXmlString.append("<missing_inserted>").append("<![CDATA[Y]]>").append("</missing_inserted>");
valueXmlString.append("<cust_type protect='1'>").append("<![CDATA["+ rs.getString("CUST_TYPE") +"]]>").append("</cust_type>");
valueXmlString.append("<cust_type__descr protect='1'>").append("<![CDATA["+custTypeDescr+"]]>").append("</cust_type__descr>");
valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>");
valueXmlString.append("<edit_status>").append("<![CDATA["+editFlag +"]]>").append("</edit_status>");
valueXmlString.append("<prv_tran_id>").append("<![CDATA["+tranId +"]]>").append("</prv_tran_id>");
valueXmlString.append("<startForm>").append("<![CDATA["+startForm +"]]>").append("</startForm>");
}
rs.close();
rs = null;
......@@ -1440,7 +1268,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
// Added By Chandrashekar - Suggested by Prajyot - End
else
{
System.out.println("************************ADD mode @@@@@@@@@@@@@@@@@@@@@22");
loginSite = checkNull(genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginSiteCode" ));
System.out.println("loginSite :"+loginSite);
......@@ -1453,94 +1281,26 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
if (rs.next())
{
itemSer = checkNull(rs.getString("item_ser"));
System.out.println("itemser :" + itemSer);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
/*sql = "SELECT pos_code FROM employee WHERE emp_code= ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, spCode);
rs = pstmt.executeQuery();
if (rs.next())
{
posCode = checkNull(rs.getString("pos_code"));
System.out.println("posCode :" + posCode);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select pool_code from org_structure where emp_code= ? and table_no=? and pos_code =? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, spCode);
pstmt.setString(2, itemSer);
pstmt.setString(3, posCode);
rs = pstmt.executeQuery();
if (rs.next())
{
poolCode = checkNull(rs.getString("pool_code"));
System.out.println("poolCode :" + poolCode);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select stan_code from hierarchy where level_code= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, poolCode);
rs = pstmt.executeQuery();
if (rs.next())
{
stanCode = checkNull(rs.getString("stan_code"));
System.out.println("stanCode :" + stanCode);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("currentDate>>>>>"+currentDate);
RelativeDate=utlmethd.AddMonths(currentDate, -1);
System.out.println("RelativeDate>>>>>>>>"+RelativeDate);
SimpleDateFormat sdf1= new SimpleDateFormat(genericUtility.getDBDateFormat());
dbRelativeDate = java.sql.Timestamp.valueOf(sdf1.format(RelativeDate)+" 00:00:00.0");
System.out.println("dbRelativeDate>>>>>>>>"+dbRelativeDate);
sql = "select code from period where ? between fr_date and to_date";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, dbRelativeDate);
rs = pstmt.executeQuery();
if (rs.next())
{
period = rs.getString("code");
System.out.println("itemser :" + itemSer);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("period>>>>>"+period);
dbNextMonthDate = java.sql.Timestamp.valueOf(sdf1.format(currentDate)+" 00:00:00.0");
sql = "select fr_date,to_date from period where ? between fr_date and to_date";
pstmt = null;
sql= " select descr from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1, dbNextMonthDate);
pstmt.setString(1, itemSer);
rs = pstmt.executeQuery();
if (rs.next())
if(rs.next())
{
fromDate1 = rs.getDate("fr_date");
toDate1 = rs.getDate("to_date");
itemSerName=checkNull(rs.getString("descr"));
System.out.println("itemSerName :"+itemSerName);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;*/
//End added by chandrashekar on 26-10-2015
pstmt = null;
//Start Added by chandrshekar on 17-nov-2015
sql = "SELECT fr_date,prd_code FROM period_tbl WHERE prd_tblno" +
......@@ -1598,10 +1358,23 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("fromDateStr>>>>"+fromDateStr);
System.out.println("toDateStr>>>>"+toDateStr);
//End Start Added by chandrshekar on 17-nov-2015
sql= " select FR_DATE,TO_DATE from period_tbl where "
+ "prd_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, period);
rs = pstmt.executeQuery();
if(rs.next())
{
FromDate = rs.getTimestamp("FR_DATE");
ToDate = rs.getTimestamp("TO_DATE");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<Detail1 domID='1' objContext='1'>");
/*valueXmlString.append("<Detail1 domID='1' objContext='1'>");
valueXmlString.append("<sale_per>").append("<![CDATA["+spCode+"]]>").append("</sale_per>");
valueXmlString.append("<tran_date>").append("<![CDATA[]]>").append("</tran_date>");
valueXmlString.append("<item_ser protect='1'>").append("<![CDATA[]]>").append("</item_ser>");
......@@ -1617,11 +1390,42 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<editFlag>").append("<![CDATA["+editFlag +"]]>").append("</editFlag>");
valueXmlString.append("<prv_tran_id>").append("<![CDATA["+tranId +"]]>").append("</prv_tran_id>");
valueXmlString.append("<startForm>").append("<![CDATA["+startForm +"]]>").append("</startForm>");
//valueXmlString.append("<stmt_date>").append("<![CDATA["+sysDate+"]]>").append("</stmt_date>");
valueXmlString.append("</Detail1>");*/
//valueXmlString.append("<from_date>").append("<![CDATA["+sdf.format(frmDate1).toString()+"]]>").append("</from_date>");
//valueXmlString.append("<to_date>").append("<![CDATA["+sdf.format(toDate).toString()+"]]>").append("</to_date>");
valueXmlString.append("</Detail1>");
valueXmlString.append("<Detail1 domID='1' objContext=\"1\" selected=\"N\">\r\n");
valueXmlString.append("<attribute selected=\"N\" updateFlag=\"A\" status=\"N\" pkNames=\"\" />\r\n");
valueXmlString.append("<tran_id protect='1'><![CDATA[]]></tran_id>");
valueXmlString.append("<tran_date>").append("<![CDATA[" + sdf.format(currentDate).toString() + "]]>").append("</tran_date>");
valueXmlString.append("<cust_code>").append("<![CDATA[" + custCode + "]]>").append("</cust_code>");
valueXmlString.append("<cust_name protect='1'>").append("<![CDATA[" + custName + "]]>").append("</cust_name>");
valueXmlString.append("<item_ser protect='1'>").append("<![CDATA[" + itemSer + "]]>").append("</item_ser>");
valueXmlString.append("<order_type protect='1'>").append("<![CDATA[" + orderType + "]]>").append("</order_type>");
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[" + sdf.format(FromDate).toString() + "]]>").append("</from_date>");
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[" + sdf.format(ToDate).toString() + "]]>").append("</to_date>");
valueXmlString.append("<itemser_descr protect='1'>").append("<![CDATA[" + itemSerName + "]]>").append("</itemser_descr>");
valueXmlString.append("<site_code>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>");
valueXmlString.append("<tran_id__last>").append("<![CDATA[" + tranIdLast + "]]>").append("</tran_id__last>");
valueXmlString.append("<sordertype_descr protect='1'>").append("<![CDATA[" + orderTypeName + "]]>").append("</sordertype_descr>");
valueXmlString.append("<stmt_date>").append("<![CDATA[" + stmtDateStr + "]]>").append("</stmt_date>");
valueXmlString.append("<status>").append("<![CDATA[O]]>").append("</status>");
valueXmlString.append("<prd_code>").append("<![CDATA[" + period + "]]>").append("</prd_code>");
valueXmlString.append("<chg_user>").append("<![CDATA[" + chgUser + "]]>").append("</chg_user>");
valueXmlString.append("<chg_term>").append("<![CDATA[" + chgTerm + "]]>").append("</chg_term>");
valueXmlString.append("<chg_date>").append("<![CDATA[" + sdf.format(currentDate) + "]]>").append("</chg_date>");
valueXmlString.append("<missing_inserted>").append("<![CDATA[Y]]>").append("</missing_inserted>");
valueXmlString.append("<cust_type protect='1'>").append("<![CDATA[" + custType + "]]>").append("</cust_type>");
valueXmlString.append("<cust_type__descr protect='1'>").append("<![CDATA[" + custTypeDescr + "]]>").append("</cust_type__descr>");
valueXmlString.append("<confirmed>").append("<![CDATA[N]]>").append("</confirmed>");
valueXmlString.append("<itemser_descr protect='1'>").append("<![CDATA["+itemSerName+"]]>").append("</itemser_descr>");
valueXmlString.append("<sale_per>").append("<![CDATA["+spCode+"]]>").append("</sale_per>");
valueXmlString.append("<pophelp_frmdt>").append("<![CDATA["+fromDateStr+"]]>").append("</pophelp_frmdt>");
valueXmlString.append("<pophelp_todt>").append("<![CDATA["+toDateStr+"]]>").append("</pophelp_todt>");
valueXmlString.append("<edit_status>").append("<![CDATA["+editFlag +"]]>").append("</edit_status>");
valueXmlString.append("<prv_tran_id>").append("<![CDATA["+tranId +"]]>").append("</prv_tran_id>");
valueXmlString.append("<startForm>").append("<![CDATA["+startForm +"]]>").append("</startForm>");
valueXmlString.append("</Detail1>\r\n");
}
}
......@@ -1747,6 +1551,23 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt.close();
pstmt = null;
custNameStation=custName+"-"+stanDescr;
sql = " SELECT max(tran_id) as oldTranId FROM CUST_STOCK WHERE CUST_CODE = ? " +
" AND ITEM_SER = ? and order_type=? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, itemSer);
pstmt.setString(3, orderType);
rs = pstmt.executeQuery();
if (rs.next())
{
tranIdLast = checkNull(rs.getString("oldTranId"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("tranIdLast (case 1):" + tranIdLast);
//Change by chandra shekar on 26-10-2015
valueXmlString.append("<Detail1 domID='1' objContext='1'>");
......@@ -1760,76 +1581,21 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<cust_type protect='1'>").append("<![CDATA["+custType+"]]>").append("</cust_type>");
valueXmlString.append("<cust_type__descr protect='1'>").append("<![CDATA["+custTypeDescr+"]]>").append("</cust_type__descr>");
valueXmlString.append("<stmt_date>").append("<![CDATA["+stmtDateStr+"]]>").append("</stmt_date>");
valueXmlString.append("<tran_id__last>").append("<![CDATA[" + tranIdLast + "]]>").append("</tran_id__last>");
valueXmlString.append("</Detail1>");
}
/*if(currentColumn.trim().equals("order_type"))
{
orderType = checkNull(genericUtility.getColumnValue("order_type",dom));
System.out.println("orderType :"+orderType);
sql= "select descr from sordertype where order_type =? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, orderType);
rs = pstmt.executeQuery();
if(rs.next())
{
orderTypeName=checkNull(rs.getString("descr"));
System.out.println("orderTypeName :"+orderTypeName);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<Detail1 domID='1' objContext='1'>");
//valueXmlString.append("<tran_id>").append("<![CDATA[]]>").append("</tran_id>");
valueXmlString.append("<order_type>").append("<![CDATA["+orderType+"]]>").append("</order_type>");
valueXmlString.append("<sordertype_descr protect='1'>").append("<![CDATA["+orderTypeName+"]]>").append("</sordertype_descr>");
valueXmlString.append("</Detail1>");
}*/
/*if(currentColumn.trim().equals("item_ser"))
{
itemSer = checkNull(genericUtility.getColumnValue("item_ser",dom));
System.out.println("itemSer :"+itemSer);
sql= " select descr from itemser where item_ser = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemSer);
rs = pstmt.executeQuery();
if(rs.next())
{
itemSerName=checkNull(rs.getString("descr"));
System.out.println("itemSerName :"+itemSerName);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<Detail1 domID='1' objContext='1'>");
valueXmlString.append("<item_ser protect='1'>").append("<![CDATA["+itemSer+"]]>").append("</item_ser>");
valueXmlString.append("<itemser_descr protect='1'>").append("<![CDATA["+itemSerName+"]]>").append("</itemser_descr>");
valueXmlString.append("</Detail1>");
}*/
if(currentColumn.trim().equals("period"))
if(currentColumn.trim().equals("prd_code"))
{
period = checkNull(genericUtility.getColumnValue("period",dom));
period = checkNull(genericUtility.getColumnValue("prd_code",dom));
System.out.println("period>>>>> :"+period);
sql = "select prd_code,fr_date,to_date from period_tbl where prd_code= ? " ;
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, period);
rs = pstmt.executeQuery();
if (rs.next())
{
//period = rs.getString("prd_code");
fromDate1 = rs.getDate("fr_date");
toDate1 = rs.getDate("to_date");
}
......@@ -1847,17 +1613,35 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
toDateStr = sdt.format(toDate1.getTime());
}
sql= " select FR_DATE,TO_DATE from period_tbl where "
+ "prd_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, period);
rs = pstmt.executeQuery();
if(rs.next())
{
FromDate = rs.getTimestamp("FR_DATE");
ToDate = rs.getTimestamp("TO_DATE");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<Detail1 domID='1' objContext='1'>");
valueXmlString.append("<period>").append("<![CDATA["+period+"]]>").append("</period>");
valueXmlString.append("<from_date>").append("<![CDATA["+fromDateStr+"]]>").append("</from_date>");
valueXmlString.append("<to_date>").append("<![CDATA["+toDateStr+"]]>").append("</to_date>");
valueXmlString.append("<prd_code>").append("<![CDATA["+period+"]]>").append("</prd_code>");
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[" + sdf.format(FromDate).toString() + "]]>").append("</from_date>");
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[" + sdf.format(ToDate).toString() + "]]>").append("</to_date>");
valueXmlString.append("<pophelp_frmdt>").append("<![CDATA["+fromDateStr+"]]>").append("</pophelp_frmdt>");
valueXmlString.append("<pophelp_todt>").append("<![CDATA["+toDateStr+"]]>").append("</pophelp_todt>");
valueXmlString.append("</Detail1>");
}
System.out.println("valueXmlString from case 1 :"+valueXmlString);
break;
case 2:
/*case 2:
if(currentColumn.trim().equals("itm_default"))
{
......@@ -1875,22 +1659,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
custTypeDescr = checkNull(genericUtility.getColumnValue("cust_type__descr",dom1));
stmtDateStr = checkNull(genericUtility.getColumnValue("stmt_date",dom1));
/*fromDateStr = genericUtility.getColumnValue("from_date", dom1);
System.out.println("fromdate CASE2:"+fromDateStr);
toDateStr= genericUtility.getColumnValue("to_date", dom1);
System.out.println("todate CASE 2:"+toDateStr);
if(fromDateStr != null)
{
System.out.println("DB DATE FORMAT>>>>"+genericUtility.getDBDateFormat());
FromDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("FromDate case 2:"+FromDate);
}
if(todate != null)
{
ToDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(toDateStr, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
}*/
System.out.println("ToDate case 2 :"+ToDate);
sql= " select FR_DATE,TO_DATE from period_tbl where "
......@@ -1911,40 +1679,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("FromDate :"+FromDate);
System.out.println("ToDate :"+ToDate);
/*varValue = (-1) * 1;
System.out.println("changed varValue = .. " + varValue);
System.out.println("FromDate ::::"+FromDate);
if(FromDate !=null)
{
prvToDt = utilMethod.RelativeDate(FromDate,varValue);
}*/
/*
prvToDt = getPreviousDate(FromDate,conn);
System.out.println("prvToDt :"+prvToDt);
sql= " SELECT TRAN_ID FROM CUST_STOCK WHERE CUST_CODE = ? " +
" AND ITEM_SER = ? and order_type=? and to_date = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, itemSer);
pstmt.setString(3, orderType);
pstmt.setTimestamp(4, prvToDt);
rs = pstmt.executeQuery();
if(rs.next())
{
tranIdLast=checkNull(rs.getString("TRAN_ID"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("tranIdLast (case 2):"+tranIdLast);*/
sql= " SELECT tran_id,tran_id__last FROM CUST_STOCK WHERE CUST_CODE = ? AND status ='O' " +
" AND ITEM_SER = ? and order_type=? and from_date =? and to_date = ?";
pstmt = conn.prepareStatement(sql);
......@@ -1964,7 +1698,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt.close();
pstmt = null;
System.out.println("tranIdNew (case 2):"+tranIdNew);
// tranIdNew="";
if(tranIdNew.trim().length() > 0)
{
......@@ -1973,7 +1706,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<Detail2 domID='1' objContext=\"2\" selected=\"Y\">\r\n");
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\" />\r\n");
//valueXmlString.append("<tran_id protect='1'><![CDATA["+ tranIdNew+"]]></tran_id>");
valueXmlString.append("<tran_id>").append("<![CDATA["+tranIdNew+"]]>").append("</tran_id>");
valueXmlString.append("<tran_date>").append("<![CDATA["+sdf.format(currentDate).toString()+"]]>").append("</tran_date>");
valueXmlString.append("<cust_code protect='1'>").append("<![CDATA["+custCode+"]]>").append("</cust_code>");
......@@ -1982,12 +1714,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<order_type protect='1'>").append("<![CDATA["+orderType+"]]>").append("</order_type>");
valueXmlString.append("<from_date protect='1'>").append("<![CDATA["+sdf.format(FromDate).toString()+"]]>").append("</from_date>");
valueXmlString.append("<to_date protect='1'>").append("<![CDATA["+sdf.format(ToDate).toString()+"]]>").append("</to_date>");
//valueXmlString.append("<stmt_date protect='0'>").append("<![CDATA["+sdf.format(stmtDate).toString()+"]]>").append("</stmt_date>");
valueXmlString.append("<itemser_descr protect='1'>").append("<![CDATA["+itemSerName+"]]>").append("</itemser_descr>");
valueXmlString.append("<site_code>").append("<![CDATA["+siteCode+"]]>").append("</site_code>");
valueXmlString.append("<tran_id__last>").append("<![CDATA["+tranIdLast+"]]>").append("</tran_id__last>");
valueXmlString.append("<sordertype_descr protect='1'>").append("<![CDATA["+orderTypeName+"]]>").append("</sordertype_descr>");
//valueXmlString.append("<stmt_date>").append("<![CDATA["+sdf.format(currentDate)+"]]>").append("</stmt_date>");
valueXmlString.append("<stmt_date>").append("<![CDATA[" + stmtDateStr + "]]>").append("</stmt_date>");
valueXmlString.append("<status>").append("<![CDATA[O]]>").append("</status>");
valueXmlString.append("<prd_code>").append("<![CDATA["+periodDt+"]]>").append("</prd_code>");
......@@ -2032,12 +1762,10 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<order_type protect='1'>").append("<![CDATA[" + orderType + "]]>").append("</order_type>");
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[" + sdf.format(FromDate).toString() + "]]>").append("</from_date>");
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[" + sdf.format(ToDate).toString() + "]]>").append("</to_date>");
// valueXmlString.append("<stmt_date protect='0'>").append("<![CDATA["+sdf.format(stmtDate).toString()+"]]>").append("</stmt_date>");
valueXmlString.append("<itemser_descr protect='1'>").append("<![CDATA[" + itemSerName + "]]>").append("</itemser_descr>");
valueXmlString.append("<site_code>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>");
valueXmlString.append("<tran_id__last>").append("<![CDATA[" + tranIdLast + "]]>").append("</tran_id__last>");
valueXmlString.append("<sordertype_descr protect='1'>").append("<![CDATA[" + orderTypeName + "]]>").append("</sordertype_descr>");
//valueXmlString.append("<stmt_date>").append("<![CDATA[" + sdf.format(currentDate) + "]]>").append("</stmt_date>");
valueXmlString.append("<stmt_date>").append("<![CDATA[" + stmtDateStr + "]]>").append("</stmt_date>");
valueXmlString.append("<status>").append("<![CDATA[O]]>").append("</status>");
valueXmlString.append("<prd_code>").append("<![CDATA[" + periodDt + "]]>").append("</prd_code>");
......@@ -2055,23 +1783,23 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
System.out.println("valueXmlString from case 2 :"+valueXmlString);
break;
break;*/
case 3:
System.out.println("itemChanged : case 3 called!!!");
case 2:
System.out.println("itemChanged : case 2 called!!!");
if(currentColumn.trim().equals("itm_default"))
{
System.out.println("itm_default called for case 3");
tranIdLast = checkNull(genericUtility.getColumnValue("tran_id__last",dom2));
System.out.println("itm_default called for case 2");
tranIdLast = checkNull(genericUtility.getColumnValue("tran_id__last",dom1));
System.out.println("tranIdLast2(case 3) :"+tranIdLast);
tranIdNew = checkNull(genericUtility.getColumnValue("tran_id",dom2));
tranIdNew = checkNull(genericUtility.getColumnValue("tran_id",dom1));
System.out.println("tranIdNew(case 3) :"+tranIdNew);
custCode = genericUtility.getColumnValue("cust_code", dom1);
System.out.println("custCode(case 3) :"+custCode);
fromdate = genericUtility.getColumnValue("from_date", dom2);
fromdate = genericUtility.getColumnValue("from_date", dom1);
System.out.println("fromdate@@@@@@@@@@@ :"+fromdate);
todate= genericUtility.getColumnValue("to_date", dom2);
todate= genericUtility.getColumnValue("to_date", dom1);
System.out.println("todate (case 3):"+todate);
itemSer = genericUtility.getColumnValue("item_ser", dom1);
System.out.println("itemSer (case 3):"+itemSer);
......@@ -2079,15 +1807,15 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("siteCodeHd (case 3):"+siteCodeHd);
orderType = genericUtility.getColumnValue("order_type", dom1);
System.out.println("orderType (case 3):"+orderType);
//start added by chandrashekar on 16-nov-2015
period = genericUtility.getColumnValue("period", dom1);
period = genericUtility.getColumnValue("prd_code", dom1);
System.out.println("period (case 3):"+period);
editFlag = (editFlag != null) ? editFlag : genericUtility.getColumnValue("editFlag", dom1);
editFlag = (editFlag != null) ? editFlag : genericUtility.getColumnValue("edit_status", dom1);
System.out.println("editFlag>>>>"+editFlag);
fromDateStr = genericUtility.getColumnValue("from_date", dom2);
fromDateStr = genericUtility.getColumnValue("from_date", dom1);
System.out.println("fromdate CASE2:"+fromDateStr);
toDateStr= genericUtility.getColumnValue("to_date", dom2);
toDateStr= genericUtility.getColumnValue("to_date", dom1);
System.out.println("todate CASE 2:"+toDateStr);
if(fromDateStr != null)
{
......@@ -2099,33 +1827,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
/*System.out.println("FromDate &&&&&case3 :"+FromDate);
System.out.println("ToDate &&&&&&&&&case 3:"+ToDate);
sql= " select FR_DATE,TO_DATE from period where "
+ "code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, period);
rs = pstmt.executeQuery();
if(rs.next())
{
FromDate = rs.getTimestamp("FR_DATE");
ToDate = rs.getTimestamp("TO_DATE");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;*/
System.out.println("FromDate case3 :"+FromDate);
System.out.println("ToDate case 3:"+ToDate);
//End start added by chandrashekar on 16-nov-2015
//FromDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
//System.out.println("FromDate :"+FromDate);
//ToDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(todate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
//System.out.println("ToDate :"+ToDate);
sql= " SELECT TRAN_ID FROM CUST_STOCK WHERE CUST_CODE = ? AND status ='O' " +
" AND ITEM_SER = ? and order_type=? and from_date =? and to_date = ?";
......@@ -2159,14 +1862,12 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
invDate=rs.getDate("invoice_date");
invoiceId=checkNull(rs.getString("invoice_id"));
dlvFlag=checkNull(rs.getString("dlv_flg"));
//lrDate = rs.getDate("invoice_date");
netAmt = rs.getDouble("net_amt");
domID2 = domID2 +1 ;
System.out.println("invoiceId (case 3):"+invoiceId);
invList.add(invoiceId);
invMap.put(invoiceId,dlvFlag);
// invMap.put(invoiceId,String.valueOf(netAmt));
//if(!(dlvFlag.equalsIgnoreCase("Y"))) commented by chandrashekar on 27-10-2015
{
sql= "select LR_NO ,LR_DATE,TRAN_CODE from invoice where invoice_id= ?";
......@@ -2221,15 +1922,12 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt1.close();
pstmt1 = null;
// if(!(dlvFlag.equalsIgnoreCase("Y")))
// {
valueXmlString.append("<Detail3 dbID='' domID='"+invCnt+"' objName=\"cust_stock_gwt\" objContext=\"3\">");
valueXmlString.append("<Detail2 dbID='' domID='"+invCnt+"' objName=\"cust_stock_gwt\" objContext=\"2\">");
valueXmlString.append("<attribute pkNames=\"\" selected=\"Y\" updateFlag=\"E\" status=\"O\" />");
valueXmlString.append("<tran_id>").append("<![CDATA["+tranIdNew+"]]>").append("</tran_id>");
valueXmlString.append("<invoice_id>").append("<![CDATA["+invoiceId+"]]>").append("</invoice_id>");
valueXmlString.append("<invoice_date>").append("<![CDATA["+sdf.format(invDate)+"]]>").append("</invoice_date>");
//valueXmlString.append("<lr_date>").append("<![CDATA["+invsiteCodeMap.get("lrDate@"+invDomid)+"]]>").append("</lr_date>");
if("V".equalsIgnoreCase(editFlag))
{
valueXmlString.append("<dlv_flg protect='1'>").append("<![CDATA["+dlvFlag+"]]>").append("</dlv_flg>");
......@@ -2237,8 +1935,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
valueXmlString.append("<dlv_flg>").append("<![CDATA["+dlvFlag+"]]>").append("</dlv_flg>");
}
//valueXmlString.append("<dlv_flg>").append("<![CDATA["+invMap.get(invoiceId)+"]]>").append("</dlv_flg>");
//valueXmlString.append("<net_amt>").append("<![CDATA["+(long)Math.round(netAmt)+"]]>").append("</net_amt>");
valueXmlString.append("<net_amt>").append("<![CDATA["+netAmt+"]]>").append("</net_amt>");
valueXmlString.append("<lr_no>").append("<![CDATA["+lrNo+"]]>").append("</lr_no>");
......@@ -2260,7 +1956,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
valueXmlString.append("<invoice_flag>").append("<![CDATA[INVOICE]]>").append("</invoice_flag>");
}
valueXmlString.append("</Detail3>");
valueXmlString.append("</Detail2>");
}
......@@ -2281,49 +1977,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
tranId = genericUtility.getColumnValueFromNode("tran_id",detail1Node);
System.out.println("tranId form 2 :"+tranId);
//ToDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(todate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("ToDate : "+ToDate);
//if(fromdate != null)
//{
// FromDate = java.sql.Timestamp.valueOf(genericUtility.getValidDateString(fromdate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
//}
System.out.println("FromDate : "+FromDate);
/*
varValueStr = dist.getDisparams("999999","SSD_TRANSIT_DAYS",conn);
System.out.println("varValue.." + varValueStr);
if( varValueStr.equalsIgnoreCase("NULLFOUND") )
{
System.out.println("varValue is NULLFOUND" + varValueStr);
}
else
{
varValue = Integer.parseInt(varValueStr);
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
System.out.println("varValue = .. " + varValue);
varValue = (-1) * varValue;
System.out.println("changed varValue for to date>>>>>>>>>>>>>>>> = .. " + varValue);
compDate = utilMethod.RelativeDate(ToDate,varValue);
System.out.println("compDate >>>>>>"+compDate);
varValue = (-1) * 1;
System.out.println("changed varValue>>>>>>>>>>>>>>>> = .. " + varValue);
if(FromDate !=null)
{
prdFrom = utilMethod.RelativeDate(FromDate,varValue);
}
*/
prdFrom = getPreviousDate(FromDate,conn);
System.out.println("prdFrom :"+prdFrom);
......@@ -2454,14 +2109,12 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
stockDlvFlg="N";
dlvFlgCnt=0;
// sql= "select dlv_flg from cust_stock_inv where invoice_id=? ";
sql= "select count(*) as count from cust_stock_inv where invoice_id=? and dlv_flg='Y' ";
pstmt2 = conn.prepareStatement(sql);
pstmt2.setString(1, invoiceId);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
//stockDlvFlg = checkNull(rs2.getString("dlv_flg"));
dlvFlgCnt=rs2.getInt("count");
}
rs2.close();
......@@ -2470,7 +2123,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt2 = null;
System.out.println("dlvFlgCnt ####"+dlvFlgCnt);
//if(!(stockDlvFlg.equalsIgnoreCase("Y")))
if(dlvFlgCnt == 0)
{
System.out.println("previous domID3 value :"+domID3);
......@@ -2520,7 +2172,6 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("Invoice Id : "+invMap.get("invoiceId@"+invDomid));
System.out.println("net Amt :"+invMap.get("netAmt@"+invDomid));
System.out.println("delivert flag of invoice id :"+invMap.get("invoiceId@"+invDomid)+" is : "+invMap.get(invMap.get("invoiceId@"+invDomid)));
//delivery flag of Y should not be included
if(!(invList.contains(invMap.get("invoiceId@"+invDomid))))
{
invCnt++;
......@@ -2539,12 +2190,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt1.close();
pstmt1 = null;
valueXmlString.append("<Detail3 dbID='' domID='"+invCnt+"' objName=\"cust_stock_gwt\" objContext=\"3\">");
// valueXmlString.append("<attribute pkNames=\"\" selected=\"N\" updateFlag=\"A\" status=\"N\" />");
//
valueXmlString.append("<Detail2 dbID='' domID='"+invCnt+"' objName=\"cust_stock_gwt\" objContext=\"2\">");
valueXmlString.append("<attribute pkNames=\"\" selected=\"Y\" updateFlag=\"A\" status=\"N\" />");
//valueXmlString.append("<dlv_flg>").append("<![CDATA[N]]>").append("</dlv_flg>");
valueXmlString.append("<tran_id>").append("<![CDATA["+tranIdNew+"]]>").append("</tran_id>");
valueXmlString.append("<invoice_id>").append("<![CDATA["+invMap.get("invoiceId@"+invDomid)+"]]>").append("</invoice_id>");
valueXmlString.append("<invoice_date>").append("<![CDATA["+invMap.get("invDate@"+invDomid)+"]]>").append("</invoice_date>");
......@@ -2556,12 +2203,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
valueXmlString.append("<dlv_flg>").append("<![CDATA[Y]]>").append("</dlv_flg>");
}
//valueXmlString.append("<dlv_flg>").append("<![CDATA[Y]]>").append("</dlv_flg>");
//valueXmlString.append("<dlv_flg>").append("<![CDATA["+invMap.get("dlvFlag@"+invDomid)+"]]>").append("</dlv_flg>");
//valueXmlString.append("<net_amt>").append("<![CDATA["+(long)Math.round(Double.parseDouble(invMap.get("netAmt@"+invDomid).toString())) +"]]>").append("</net_amt>");
valueXmlString.append("<net_amt>").append("<![CDATA["+invMap.get("netAmt@"+invDomid).toString() +"]]>").append("</net_amt>");
valueXmlString.append("<lr_no>").append("<![CDATA["+invMap.get("lrNo@"+invDomid)+"]]>").append("</lr_no>");
valueXmlString.append("<tran_code>").append("<![CDATA["+invMap.get("tranCode@"+invDomid)+"]]>").append("</tran_code>");
valueXmlString.append("<tran_name>").append("<![CDATA["+invMap.get("tranName@"+invDomid)+"]]>").append("</tran_name>");
......@@ -2574,7 +2216,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
valueXmlString.append("</Detail3>");
valueXmlString.append("</Detail2>");
}
}//end of for loop
......@@ -2586,8 +2228,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
break;
case 4:
System.out.println("itemChanged : case 4 called!!!@@@@@@@@@");
case 3:
System.out.println("itemChanged : case 3 called!!!@@@@@@@@@");
Node detailNode3 = dom.getElementsByTagName((new StringBuilder("Detail")).append(currentFormNo).toString()).item(0);
if(currentColumn.trim().equals("itm_default"))
{
......@@ -2599,9 +2241,9 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
Node childNode1 = null;
int childNodeListLength1;
int parentNodeListLength1 = 0;
NodeList parentNodeList3 = dom2.getElementsByTagName("Detail3");
NodeList parentNodeList3 = dom2.getElementsByTagName("Detail2");
int parentNodeListLength3 = parentNodeList3.getLength();
System.out.println("parentNodeListLength3 Detail4:::::::::"+parentNodeListLength3);
System.out.println("parentNodeListLength3 Detail3:::::::::"+parentNodeListLength3);
for (int selectedRow = 0; selectedRow < parentNodeListLength3; selectedRow++)
{
......@@ -2696,34 +2338,36 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
/*------------------------------------------------------*/
System.out.println("itm_default called for case 4");
tranIdLast = checkNull(genericUtility.getColumnValue("tran_id__last",dom2));
System.out.println("itm_default called for case 3");
tranIdLast = checkNull(genericUtility.getColumnValue("tran_id__last",dom1));
System.out.println("tranIdLast :"+tranIdLast);
tranIdNew = checkNull(genericUtility.getColumnValue("tran_id",dom2));
tranIdNew = checkNull(genericUtility.getColumnValue("tran_id",dom1));
System.out.println("tranIdNew :"+tranIdNew);
Node detail2Node = dom2.getElementsByTagName("Detail1").item(0);
custCodeHd = genericUtility.getColumnValue("cust_code", dom2);
custCodeHd = genericUtility.getColumnValue("cust_code", dom1);
System.out.println("custCodeHd (case 4):"+custCodeHd);
itemSerHd = genericUtility.getColumnValueFromNode("item_ser",detail2Node);
System.out.println("itemSerHd (case 4) :"+itemSerHd);
siteCodeHd = genericUtility.getColumnValue("site_code", dom2);
siteCodeHd = genericUtility.getColumnValue("site_code", dom1);
System.out.println("siteCodeHd (case 4) :"+siteCodeHd);
tranIdLastHd = genericUtility.getColumnValue("tran_id__last", dom2);
tranIdLastHd = genericUtility.getColumnValue("tran_id__last", dom1);
System.out.println("mTranIdLast (case 4) :"+tranIdLastHd);
orderType = genericUtility.getColumnValue("order_type", dom2);
orderType = genericUtility.getColumnValue("order_type", dom1);
System.out.println("orderType (case 4) :"+orderType);
tranDateHd = genericUtility.getColumnValue("tran_date",dom2);
tranDateHd = genericUtility.getColumnValue("tran_date",dom1);
System.out.println("tranDateHd (case 4) :"+tranDateHd);
fromdate = genericUtility.getColumnValue("from_date",dom2);
fromdate = genericUtility.getColumnValue("from_date",dom1);
System.out.println("fromdate (case 4) :"+fromdate);
todate = genericUtility.getColumnValue("to_date",dom2);
todate = genericUtility.getColumnValue("to_date",dom1);
System.out.println("todate (case 4):"+todate);
editFlag = (editFlag != null) ? editFlag : genericUtility.getColumnValue("editFlag", dom1);
System.out.println("editFlag case 4>>>>"+editFlag);
editFlag = (editFlag != null) ? editFlag : genericUtility.getColumnValue("edit_status", dom1);
System.out.println("editFlag case 3>>>>"+editFlag);
/*---calculate previous month from input value period,start------------------------------*/
......@@ -2992,7 +2636,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
if(receiptLast >= 0)
{
valueXmlString.append( "<Detail4 dbID='' domID='"+itmDetCnt+"' objContext='"+currentFormNo+"' selected='N'>\r\n" );
valueXmlString.append( "<Detail3 dbID='' domID='"+itmDetCnt+"' objContext='"+currentFormNo+"' selected='N'>\r\n" );
if(tranIdNew.length() > 0)
{
valueXmlString.append("<attribute pkNames=\"\" selected=\"Y\" updateFlag=\"E\" status=\"O\" />");
......@@ -3069,7 +2713,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<sret_vale>").append("<![CDATA["+billRetQty*sretRate+"]]>").append("</sret_vale>");
valueXmlString.append("</Detail4>");
valueXmlString.append("</Detail3>");
}
......@@ -3327,7 +2971,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
lineNoCustSt = lineNoCustSt + 1;
valueXmlString.append( "<Detail4 dbID='' domID='"+itmDetCnt+"' objContext='"+currentFormNo+"' selected='N'>\r\n" );
valueXmlString.append( "<Detail3 dbID='' domID='"+itmDetCnt+"' objContext='"+currentFormNo+"' selected='N'>\r\n" );
/* if(tranIdLast.trim().length() == 0 && tranIdNew.trim().length() > 0 )
{
......@@ -3394,7 +3038,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<free_value>").append("<![CDATA["+itemMap.get("freeValue@"+itemDomId).toString()+"]]>").append("</free_value>");
valueXmlString.append("<sret_vale>").append("<![CDATA["+itemMap.get("sretValue@"+itemDomId).toString()+"]]>").append("</sret_vale>");
valueXmlString.append("<rate__org>").append("<![CDATA[0]]>").append("</rate__org>");
valueXmlString.append("</Detail4>");
valueXmlString.append("</Detail3>");
}
}
......@@ -3546,7 +3190,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("salesQtyCal :" + salesQtyCal);
valueXmlString.append("<Detail4>\r\n");
valueXmlString.append("<Detail3>\r\n");
if(!Double.isNaN(salesQtyCal))
{
valueXmlString.append("<sales>").append("<![CDATA[" + (long) Math.round(salesQtyCal) + "]]>").append("</sales>");
......@@ -3559,11 +3203,11 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
valueXmlString.append("<rate__org>").append("<![CDATA[" + getRequiredDecimal(grossSecondaryRate,2) + "]]>").append("</rate__org>");
}
valueXmlString.append("</Detail4>\r\n");
valueXmlString.append("</Detail3>\r\n");
}else
{
valueXmlString.append("<Detail4>\r\n");
valueXmlString.append("<Detail3>\r\n");
valueXmlString.append("<sales>").append("<![CDATA[" + (long) Math.round(secondarySales) + "]]>").append("</sales>");
if(!clStockInp.matches(pattern))
{
......@@ -3572,7 +3216,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
valueXmlString.append("<cl_stock>").append("<![CDATA[" + clStockInp + "]]>").append("</cl_stock>");
}
valueXmlString.append("</Detail4>\r\n");
valueXmlString.append("</Detail3>\r\n");
}
}
......
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