Commit 29231617 authored by dpawar's avatar dpawar

added code for new changes


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94992 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 46e48f1c
......@@ -86,7 +86,7 @@ public String process(Document dom, Document dom2, String windowName, String xtr
ResultSet rs=null;
int cnt=0,lineNo=0,recordProcess=0,serCount=0;
boolean isRecordFound=false;
double quantityOld=0,rateOld=0;
double quantityOld=0,rateOld=0, newRate=0;
Set<String> itemSerSet=new HashSet<String>();
Map<String,String>detail2Map=new HashMap<String,String>();
String siteCode="",itemSerFrm="",itemSerTo="",itemCodeFrm="",itemCodeTo="",errorString="",errCode="",pricelist="";
......@@ -336,7 +336,7 @@ public String process(Document dom, Document dom2, String windowName, String xtr
}
headerXml=getHeaderXml(conn,siteCode,unqItemSer,priceList,reasonCode);
java.util.Date tranDate=new Date();
rs=pstmt.executeQuery();
while (rs.next()){
lineNo++;
......@@ -352,6 +352,12 @@ public String process(Document dom, Document dom2, String windowName, String xtr
accCodeInvOld=checkNull(rs.getString(8));
cctrCodeInvOld=checkNull(rs.getString(9));
cctrCodeInvOld = cctrCodeInvOld.length() == 0 ? " " : cctrCodeInvOld.trim();
newRate=getPriceListRate(priceList, tranDate,itemCode,lotNo, "", conn);
System.out.println("newRate--->>["+newRate+"] OldRate--->>["+rateOld+"]");
if(rateOld == newRate){
continue;
//VTPRLINE
}
detail2Map.put("site_code", siteCode);
detail2Map.put("price_list", priceList);
......@@ -365,7 +371,7 @@ public String process(Document dom, Document dom2, String windowName, String xtr
detail2Map.put("acct_code__inv", accCodeInvOld);
detail2Map.put("cctr_code__inv", cctrCodeInvOld);
detail2Xml=detail2Xml+getDetail2Xml(conn,detail2Map,lineNo);
detail2Xml=detail2Xml+getDetail2Xml(conn,detail2Map,lineNo,newRate);
detail2Map.clear();
}//end while
if ( rs != null ){
......@@ -376,7 +382,10 @@ public String process(Document dom, Document dom2, String windowName, String xtr
pstmt.close();
pstmt = null;
}
System.out.println("detail2xml length---->>["+detail2Xml.length()+"]");
//fgfgf
if (detail2Xml.length() > 0){
errorString =saveRecordStockRevAdj(conn,headerXml,detail2Xml,siteCode);
System.out.println("After Saving record errorString--->>["+errorString+"]");
if (errorString.indexOf("Success") > -1)
......@@ -405,10 +414,12 @@ public String process(Document dom, Document dom2, String windowName, String xtr
return errorString;
}
}else{
conn.rollback();
errCode = "VTDNFEV";// data not found
errorString = vdt.getErrorString("",errCode,userId);
return errorString;
}
} //end for loop of set
......@@ -420,8 +431,14 @@ public String process(Document dom, Document dom2, String windowName, String xtr
errCode = "VTPRCCSF";
errorString = vdt.getErrorString("",errCode,userId);
return errorString;
}else{
conn.rollback();
return errorString;
}
} //if end
}
......@@ -588,14 +605,14 @@ private String getHeaderXml(Connection conn,String siteCodeL,String unqItemSerL,
}
private String getDetail2Xml(Connection conn,Map<String,String>detail2MapL,int lineNo){
private String getDetail2Xml(Connection conn,Map<String,String>detail2MapL,int lineNo,double newRate){
System.out.println("detail Map---->>["+detail2MapL+"]");
StringBuffer detail2xml=new StringBuffer();
PreparedStatement pstmt1=null;
ResultSet rs1=null;
String dbTranID="",retString="" ,acctCctrCode="",acctCctrCodeInvRev="";
double oldRate=0,newRate=0,quantity=0,amountOld,amountNew=0,amountDiff=0;
double oldRate=0,quantity=0,amountOld,amountNew=0,amountDiff=0;
try{
oldRate=Double.parseDouble(detail2MapL.get("old_rate"));
quantity=Double.parseDouble(detail2MapL.get("old_quantity"));
......@@ -611,11 +628,10 @@ private String getDetail2Xml(Connection conn,Map<String,String>detail2MapL,int l
detail2xml.append("<quantity>").append("<![CDATA[").append(quantity).append("]]></quantity>\r\n");
detail2xml.append("<rate__old>").append("<![CDATA[").append(oldRate).append("]]></rate__old>\r\n");
java.util.Date tranDate=new Date();
newRate=getPriceListRate(detail2MapL.get("price_list"), tranDate, detail2MapL.get("item_code"), detail2MapL.get("lot_no"), "", conn);
System.out.println("PriceList rate------->>["+newRate+"]");
newRate = newRate == -1 ? 0 : newRate;
/*if(newRate <= 0 ){
......
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