Commit f45f4e64 authored by mnair's avatar mnair

Validation for realized quantity and dispatch quantity mismatch

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174047 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fefd5518
......@@ -69,6 +69,12 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
String userId = "";
String sql = "";
String errorType = "";
double quantityReal=0;
String unit;
String unitStd;
String itemCodeOrd;
String quantity;
String convQtyStduom;
int cnt = 0;
int ctr = 0;
int childNodeListLength=0;
......@@ -78,6 +84,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
Node childNode = null;
ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>();
ArrayList quantityRealList=new ArrayList();
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
......@@ -2649,12 +2657,36 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
if (childNodeName.equalsIgnoreCase("quantity_real"))
{
lc_qty_real = Double.parseDouble(checkDoubleNull(genericUtility.getColumnValue("quantity_real", dom)));
//changes by mayur on 22/11/17----start
unit = checkNull(genericUtility.getColumnValue("unit", dom));
unitStd = checkNull(genericUtility.getColumnValue("unit__std", dom));
itemCodeOrd = checkNull(genericUtility.getColumnValue("item_code", dom));
quantity = checkNull(genericUtility.getColumnValue("quantity", dom));
convQtyStduom = checkNull(genericUtility.getColumnValue("conv__qty_stduom", dom));
ArrayList quantityRealList=new ArrayList();
quantityRealList = distCommon.convQtyFactor(unit, unitStd,itemCodeOrd, Double.parseDouble(quantity),Double.parseDouble(convQtyStduom), conn);
quantityReal = Double.parseDouble( quantityRealList.get(1)== null ?"0": quantityRealList.get(1).toString() );
System.out.println("quantityReal["+quantityReal+"]");
//changes by mayur on 22/11/17----end
lc_desp_qty = Double.parseDouble(checkDoubleNull(genericUtility.getColumnValue("quantity__stduom", dom)));
lc_conv = Double.parseDouble(checkDoubleNull(genericUtility.getColumnValue("conv__qty_stduom", dom)));
lc_qty_real = lc_qty_real * lc_conv;
if( lc_qty_real != lc_desp_qty )
System.out.println("Realized Quantity["+quantityReal+"]");
System.out.println("Despatch Quantity["+lc_desp_qty+"]");
System.out.println("Conversion Quantity["+lc_conv+"]");
//quantityReal =(quantityReal * lc_conv);
System.out.println("Realized Quantity"+quantityReal);
System.out.println("Despatch Quantity"+lc_desp_qty);
System.out.println("Conversion Quantity"+lc_conv);
if( quantityReal != lc_desp_qty )
{
errCode = "VTIRQ";
errList.add(errCode);
......@@ -3155,7 +3187,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
String lineNoSord="",reStr="",custItemRef="",SOalloc="",itemCodeOrd="",expLev="",unit="",lotSl="",lotNo="",unitStd="",packInstr="",noArt="";
String nature="",lineType="",itemcodeFree="",partNo="";
String siteCodeDet ="",taxClass="",taxChap="",taxEnv="",itemCode="",packCode="",loc="",listType="",itemRef="",applyPrice="",priceVar="",_priceVar="";
double discount=0,rateStduom=0,rateClg=0,quantity=0,qtyAlloc=0,convQtyStduom=0,ordQty=0,quantityStduom=0,packQty=0,rate=0,totRate=0;
double discount=0,rateStduom=0,rateClg=0,quantity=0,qtyAlloc=0,convQtyStduom=0,ordQty=0,quantityStduom=0,quantityReal=0,packQty=0,rate=0,totRate=0;
int pos=0;
double diffRate=0,itemRate=0,discAmt=0,effCost=0,offRate=0,bbRate=0;
......@@ -3182,6 +3214,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
ArrayList mNumList = new ArrayList();
ArrayList getNoArtList = new ArrayList();
ArrayList quantityStduomList = new ArrayList();
ArrayList quantityRealList = new ArrayList();
String lrDateStr="";
......@@ -4412,6 +4445,16 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
valueXmlString.append("<quantity__stduom>").append("<![CDATA["+quantityStduom+"]]>").append("</quantity__stduom>");
setNodeValue(dom, "quantity__stduom", quantityStduom);
// changes by mayur on 22/11/17----start
quantityRealList = distCommon.convQtyFactor(unit, unitStd, itemCodeOrd, quantity,convQtyStduom, conn);
quantityReal = Double.parseDouble( quantityRealList.get(1)== null ?"0": quantityRealList.get(1).toString() );
System.out.println("@@@@@4084 quantityReal["+quantityReal+"]");
valueXmlString.append("<quantity_real>").append("<![CDATA["+quantityReal+"]]>").append("</quantity_real>");
setNodeValue(dom, "quantity_real", quantityReal);
// changes by mayur on 22/11/17----end*/
String noArticle = checkNull(genericUtility.getColumnValue("no_art", dom));
if( ( ! isnull(noArticle)) && lenTrim(noArticle) > 0 && Double.parseDouble(noArticle) > 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