Commit 8435a4a5 authored by dpawar's avatar dpawar

line no trace make editable and item change


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96000 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 62cf3e6b
......@@ -845,8 +845,8 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
System.out.println("@@@@@@@ itemChanged called");
StringBuffer valueXmlString = new StringBuffer();
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
PreparedStatement pstmt = null,pstmt1=null;
ResultSet rs = null,rs1=null;
GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
int currentFormNo =0;
......@@ -998,7 +998,115 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail2>");
int childListLength = childNodeList.getLength();
int childListLength = childNodeList.getLength();
if (currentColumn.trim().equals("itm_default"))
{
String invID="";
System.out.println("itm_default item chnage called details 2................");
invID = checkNull(genericUtility.getColumnValue("invoice_id",dom1));
valueXmlString.append("<inv_id>").append("<![CDATA["+invID+"]]>").append("</inv_id>");
}
if (currentColumn.trim().equals("line_no__trace"))
{
String lineNoTrace="";
String despachID="",approveRate="";
String sql1="",invoiceID1="",lotNo="",lotSl="",itemSerPorm="",itemCode="",itemCodeDesc="",locCode="";
int invLineNo=0;
double rate=0.0,quantity=0.0,discount=0.0,pendQty=0;
HashMap<String,String> domDetail=new HashMap<String,String>();
System.out.println("line_no__trace item change........");
lineNoTrace=checkNull(genericUtility.getColumnValue("line_no__trace",dom));
invoiceID1 = checkNull(genericUtility.getColumnValue("invoice_id",dom1));
String id1=checkNull(genericUtility.getColumnValue("inv_id",dom));
System.out.println("line no trace----->["+lineNoTrace+"]");
System.out.println("invoiceID----->["+invoiceID1+"]");
System.out.println("id1----->["+id1+"]");
if(lineNoTrace.length() > 0 && invoiceID1.length() > 0){
sql1="select rate,quantity,lot_no,lot_sl,item_ser__prom,item_code,inv_line_no,desp_id,discount " +
"from invoice_trace where invoice_id = ? and inv_line_no = ?";
pstmt=conn.prepareStatement(sql1);
pstmt.setString(1, invoiceID1);
pstmt.setString(2, lineNoTrace);
rs=pstmt.executeQuery();
if(rs.next()){
rate=rs.getDouble(1);
quantity=rs.getDouble(2);
lotNo=checkNull(rs.getString(3));
lotSl=checkNull(rs.getString(4));
itemSerPorm=checkNull(rs.getString(5));
itemCode=checkNull(rs.getString(6));
invLineNo=rs.getInt(7);
despachID=checkNull(rs.getString(8));
discount=rs.getDouble(9);
}
if(rs!=null){
rs.close();
rs=null;
}
if(pstmt!=null){
pstmt.close();
pstmt=null;
}
System.out.println("despachID ------>> "+despachID);
System.out.println("discount ------>> "+discount);
if(discount > 0){
rate=rate - (rate * discount/100);
System.out.println("New rate after discount------>> "+rate+"]");
}
valueXmlString.append("<rate__inv>").append("<![CDATA["+rate+"]]>").append("</rate__inv>");
approveRate=ProofOfDeliveryDefault.getInstance().getApprovedRate(conn,itemCode,rate);
System.out.println("approveRate final ------>> "+approveRate);
valueXmlString.append("<aprv_rate>").append("<![CDATA["+approveRate+"]]>").append("</aprv_rate>");
valueXmlString.append("<quantity__inv>").append("<![CDATA["+quantity+"]]>").append("</quantity__inv>");
valueXmlString.append("<lot_no>").append("<![CDATA["+lotNo+"]]>").append("</lot_no>");
valueXmlString.append("<lot_sl>").append("<![CDATA["+lotSl+"]]>").append("</lot_sl>");
valueXmlString.append("<item_ser__prom>").append("<![CDATA["+itemSerPorm+"]]>").append("</item_ser__prom>");
valueXmlString.append("<item_code>").append("<![CDATA["+itemCode+"]]>").append("</item_code>");
itemCodeDesc=getNameOrDescrForCode(conn, "item", "descr", "item_code", itemCode);
System.out.println("---------EXECUTE query12--------");
sql1="select loc_code from despatchdet where desp_id = ? and item_code = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1,despachID);
pstmt1.setString(2,itemCode);
rs1 = pstmt1.executeQuery();
System.out.println("-----query executed12345-----");
if(rs1.next())
{
locCode = checkNull(rs1.getString(1));
}
if(rs1!=null){
rs1.close();
rs1=null;
}
if(pstmt1!=null){
pstmt1.close();
pstmt1=null;
}
System.out.println("Location code -------->> : "+locCode);
valueXmlString.append("<descr>").append("<![CDATA["+itemCodeDesc+"]]>").append("</descr>");
valueXmlString.append("<loc_code>").append("<![CDATA["+locCode+"]]>").append("</loc_code>");
domDetail.put("quantity__inv", String.valueOf(quantity));
domDetail.put("lot_no", lotNo==null ? null :lotNo.trim());
domDetail.put("lot_sl", lotSl==null ? null :lotSl.trim());
domDetail.put("invoice_id", invoiceID1);
domDetail.put("line_no__trace", String.valueOf(invLineNo));
domDetail.put("item_code", itemCode==null ? "" :itemCode.trim());
domDetail.put("loc_code", locCode);
pendQty=(ProofOfDeliveryDefault.getInstance()).getPendingQty(conn, domDetail);
System.out.println("Pending quantity----->>["+pendQty+"]");
valueXmlString.append("<pend_qty>").append("<![CDATA["+pendQty+"]]>").append("</pend_qty>");
valueXmlString.append("<pend_temp>").append("<![CDATA["+pendQty+"]]>").append("</pend_temp>");
}
} //end line no trace
if (currentColumn.trim().equals("quantity__resale"))
{
System.out.println("-------item chnage quantity__resale-------------");
......@@ -1147,8 +1255,8 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
}
}
}
valueXmlString.append("</Detail2>");
}// end switch
valueXmlString.append("</Root>");
......
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