Commit cccff381 authored by dpawar's avatar dpawar

updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93495 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 08d21721
......@@ -174,17 +174,31 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
if(childNodeName.equalsIgnoreCase("quantity__resale"))
{
String qtyResale="",qtyInv="";
double qtyResalD=0.0;
try
{
qtyResale=genericUtility.getColumnValue("quantity__resale", dom);
qtyInv=genericUtility.getColumnValue("quantity__inv", dom);
qtyInv=qtyInv == null ? "0.0" : qtyInv;
System.out.println("quantity__resale---->>"+qtyResale);
System.out.println("qtyInv---->>"+qtyInv);
if(qtyResale !=null && qtyResale.trim().length() >0)
qtyResale=checkSpaceNull(qtyResale); //qtyResale == null ? "0.0" : qtyResale;
qtyResalD=Double.parseDouble(checkSpaceNull(qtyResale));
System.out.println("qtyInv---->>"+qtyInv+" qtyResaled after parsing :"+qtyResalD);
if (qtyResale == null || qtyResale.trim().length() == 0 || qtyResalD <= 0)
{
errCode = "VTPODQNN";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else
{
System.out.println("------IN ELSE");
double qtyInvD=0.0,qtyResaleD=0.0;
qtyInvD=Double.parseDouble(checkSpaceNull(qtyInv));
qtyResaleD=Double.parseDouble(qtyResale);
System.out.println("qtyInvD---->>"+qtyInvD+" qtyResaleD"+qtyResaleD);
System.out.println("qtyInvD---->> "+qtyInvD+" qtyResaleD : "+qtyResaleD);
if(qtyResaleD > qtyInvD)
{
//POD quantity can not be greater than invoice quantity
......@@ -194,6 +208,28 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
}
}
}
catch(Exception e)
{
System.out.println();
e.printStackTrace();
}
}
if(childNodeName.equalsIgnoreCase("rate__resale"))
{
String rateResale="";
double rateResaleD=0.0;
rateResale=genericUtility.getColumnValue("rate__resale", dom);
rateResale=rateResale == null ? "0.0" : rateResale;
rateResaleD=Double.parseDouble(checkSpaceNull(rateResale));
System.out.println("rateResaleD------->> "+rateResaleD);
if (rateResale == null || rateResale.trim().length() == 0 || rateResaleD <= 0)
{
errCode = "VTRSALENN";
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}
break;
......@@ -393,14 +429,17 @@ public class ProofOfDelivery extends ValidatorEJB implements ProofOfDeliveryLoca
}
else
{
System.out.println("------invoice id null-----");
//valueXmlString.append("<project_descr>").append("").append("</project_descr>");
valueXmlString.append("<site_code>").append("<![CDATA[]]>").append("</site_code>");
valueXmlString.append("<cust_code>").append("<![CDATA[]]>").append("</cust_code>");
valueXmlString.append("<amount>").append("<![CDATA[]]>").append("</amount>");
valueXmlString.append("<exch_rate>").append("<![CDATA[]]>").append("</exch_rate>");
valueXmlString.append("<curr_code>").append("<![]]>").append("</curr_code>");
valueXmlString.append("<site_descr>").append("<![CDATA[]]>").append("</site_descr>");
valueXmlString.append("<cust_name>").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<site_code>").append("").append("</site_code>");
valueXmlString.append("<cust_code>").append("").append("</cust_code>");
valueXmlString.append("<amount>").append("").append("</amount>");
valueXmlString.append("<exch_rate>").append("").append("</exch_rate>");
valueXmlString.append("<curr_code>").append("").append("</curr_code>");
valueXmlString.append("<site_descr>").append("").append("</site_descr>");
valueXmlString.append("<cust_name>").append("").append("</cust_name>");
valueXmlString.append("<prd_code>").append("").append("</prd_code>");
}
}
......
......@@ -101,8 +101,7 @@ public class ProofOfDeliveryConf extends ActionHandlerEJB implements ProofOfDeli
{
String invoiceId="",custCode="",siteCode="",currCode="",loginCode="";
double ExchRate=0.0,actualDBamount=0.0;
GenericUtility genericUtility=new GenericUtility();
loginCode=genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
loginCode=GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode");
System.out.println("Login Code ------->> "+loginCode);
sql="";
......
......@@ -59,17 +59,17 @@ public class ProofOfDeliveryDefault extends ActionHandlerEJB implements ProofOfD
private String getItems(Document dom,String objContext,String xtraParams) throws ITMException
{
ResultSet rs=null;
ResultSet rs=null,rs1=null;
Connection conn=null;
ConnDriver ConnDriver = new ConnDriver();
PreparedStatement pstmt=null;
PreparedStatement pstmt=null,pstmt1=null;
NodeList parentNodeList = null, childNodeList = null;
Set lineNoSet=new HashSet();
Node parentNode = null, childNode = null;
String retString="",sql="",invoiceID="",lotNo="",lotSl="",itemSerPorm="",itemCode="",itemCodeDesc="",locCode="";
int invLineNo=0;
double rate=0.0,quantity=0.0;
String errString="",childNodeName="",lineNo1="";
String errString="",childNodeName="",lineNo1="",despachID="";
int updCnt=0;
StringBuffer valueXmlBuff = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
GenericUtility genutility = GenericUtility.getInstance();
......@@ -96,12 +96,14 @@ public class ProofOfDeliveryDefault extends ActionHandlerEJB implements ProofOfD
childNode = childNodeList.item(j);
childNodeName = childNode.getNodeName();
System.out.println("ChildNodeName ------>> : "+childNodeName);
if ("item_code".equalsIgnoreCase(childNodeName))
if ("line_no".equalsIgnoreCase(childNodeName))
{
System.out.println("---------record exist---------------");
lineNo1 = childNode.getFirstChild() == null ? "" : childNode.getFirstChild().getNodeValue();
System.out.println("LineNoSet adding value itemCode--->>"+lineNo1);
if(lineNo1.length() > 0)
int line=Integer.parseInt(lineNo1);
System.out.println("Line number int :"+line);
if(line > 1)
{
System.out.println("returning value before appending data---------");
lineNoSet.add(lineNo1);
......@@ -117,7 +119,7 @@ public class ProofOfDeliveryDefault extends ActionHandlerEJB implements ProofOfD
if(objContext !=null)
{
sql="select rate,quantity,lot_no,lot_sl,item_ser__prom,item_code,inv_line_no from invoice_trace where invoice_id = ?";
sql="select rate,quantity,lot_no,lot_sl,item_ser__prom,item_code,inv_line_no,desp_id from invoice_trace where invoice_id = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, invoiceID);
rs=pstmt.executeQuery();
......@@ -132,7 +134,9 @@ public class ProofOfDeliveryDefault extends ActionHandlerEJB implements ProofOfD
itemSerPorm=rs.getString(5)==null ? "" :rs.getString(5);
itemCode=rs.getString(6)==null ? "" : rs.getString(6);
invLineNo=rs.getInt(7);
despachID=rs.getString(8)==null ? "" : rs.getString(8);
System.out.println("Line No in while ----->> "+lineNo);
System.out.println("despachID ------>> "+despachID);
if(!(lineNoSet.contains(lineNo1)))
{
System.out.println("lineNo Set condition true----------");
......@@ -147,11 +151,25 @@ public class ProofOfDeliveryDefault extends ActionHandlerEJB implements ProofOfD
valueXmlBuff.append("<item_ser__prom>").append("<![CDATA["+itemSerPorm+"]]>").append("</item_ser__prom>");
valueXmlBuff.append("<item_code>").append("<![CDATA["+itemCode+"]]>").append("</item_code>");
itemCodeDesc=getNameOrDescrForCode(conn, "item", "descr", "item_code", itemCode);
locCode=getNameOrDescrForCode(conn, "item", "loc_code", "item_code", itemCode);
System.out.println("---------EXECUTE query--------");
sql="select loc_code from despatchdet where desp_id = ? and item_code = ?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1,despachID);
pstmt1.setString(2,itemCode);
rs1 = pstmt1.executeQuery();
System.out.println("-----query executed-----");
if(rs1.next())
{
locCode = rs1.getString(1)==null ? "" :rs1.getString(1);
}
System.out.println("Location code -------->> : "+locCode);
valueXmlBuff.append("<descr>").append("<![CDATA["+itemCodeDesc+"]]>").append("</descr>");
valueXmlBuff.append("<loc_code>").append("<![CDATA["+locCode+"]]>").append("</loc_code>");
valueXmlBuff.append("</Detail>\r\n");
pstmt1.close();pstmt1=null;
rs1.close();rs1=null;
count++;
}
//select descr from item where item_code = ?
......@@ -228,6 +246,7 @@ public class ProofOfDeliveryDefault extends ActionHandlerEJB implements ProofOfD
}
private String getNameOrDescrForCode(Connection conn, String table_name, String descr_col_name,String whrCondCol, String whrCondVal)
{
String descr = null;
......
......@@ -83,7 +83,7 @@ public class ProofOfDeliveryReject extends ActionHandlerEJB implements ProofOfDe
return errString;
}
sql="";
loginCode=genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
loginCode=GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams,"loginEmpCode");
sql="update spl_sales_por_hdr set wf_status = ?, emp_code__aprv = ? where tran_id = ? ";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, "R");
......
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