Commit 77c36c23 authored by manohar's avatar manohar

In case of multiple line with same loc_code,mfg_date, etc OR short excess...

In case of multiple line with same loc_code,mfg_date, etc OR short excess received rounding of .001 difference between qc_order and stock taken care off


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93728 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bb254cd9
......@@ -3425,6 +3425,9 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtInsert.setString(4, siteCode);
pstmtInsert.setString(5, itemCode);
pstmtInsert.setString(6, null);
qty = getUnroundDecimal(qty,3);
pstmtInsert.setDouble(7, qty);
double qtypass = qty - qtySample;
//pstmtInsert.setDouble(8, qty - qtySample);
......@@ -3664,6 +3667,7 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
pstmtInsert.setString(4, siteCode);
pstmtInsert.setString(5, itemCode);
pstmtInsert.setString(6, null);
qty = getUnroundDecimal(qty,3);
pstmtInsert.setDouble(7, qty);
pstmtInsert.setDouble(8, qty - qtySample);
pstmtInsert.setDouble(9, 0);
......@@ -6902,5 +6906,25 @@ public class PoRcpConf extends ActionHandlerEJB implements PoRcpConfLocal, PoRcp
}
return retString;
}
public double getUnroundDecimal(double actVal, int prec)
{
String fmtStr = "############0";
String strValue = null;
double retVal = 0;
if (prec > 0)
{
fmtStr = fmtStr + "." + "000000000".substring(0, prec + 1);
}
System.out.println("fmtStr value [" + fmtStr + "]");
DecimalFormat decFormat = new DecimalFormat(fmtStr);
strValue = decFormat.format(actVal);
System.out.println(" actVal [" + actVal + "] integer [" + strValue.substring(0,strValue.indexOf(".") +1) + "]");
System.out.println("decimal [" + strValue.substring(strValue.indexOf(".") + 1, strValue.indexOf(".") + prec + 1) + "]");
retVal = Double.parseDouble( strValue.substring(0,strValue.indexOf(".") +1) + strValue.substring(strValue.indexOf(".") + 1, strValue.indexOf(".") + prec + 1));
System.out.println("rounded value [" + retVal + "]");
return retVal;
}
}
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