Commit 985c2952 authored by msharma's avatar msharma

Rounded value upto 3 decimal instead of 2 decimal


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100334 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c3cc798c
......@@ -3503,7 +3503,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rcpQtyList = GetRcpQtyCommon("R",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCodeLast,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
receiptLast=rcpQtyList.get(0);
//receiptRate=rcpQtyList.get(1);
rcpquantityRate=getRequiredDcml(rcpQtyList.get(1),2);
rcpquantityRate=getRequiredDcml(rcpQtyList.get(1),3);
//System.out.println("receiptRate@@@@@@@@@>>>>>>"+receiptRate);
//receiptAmount=receiptLast*receiptRate;
......@@ -3514,7 +3514,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rcpFreesLast=0.0;
rcpFreeQtyList = GetFreeQtyCommon("R",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCodeLast,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
rcpFreesLast=rcpFreeQtyList.get(0);
rcpFreesValue=getRequiredDcml(rcpFreeQtyList.get(1),2);
rcpFreesValue=getRequiredDcml(rcpFreeQtyList.get(1),3);
System.out.println("rcpFreesLast :"+rcpFreesLast);
//rcpFreesAmount=rcpFreesLast*receiptRate;
//System.out.println("rcpFreesAmount :"+rcpFreesAmount);
......@@ -3543,7 +3543,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
transitQtyList=null;
transitQtyList=GetRcpQtyCommon("T",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCodeLast,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
transitQty=transitQtyList.get(0);
transitQuantityRate=getRequiredDcml(rcpQtyList.get(1),2);
transitQuantityRate=getRequiredDcml(rcpQtyList.get(1),3);
System.out.println("transitQty quantity cal for avaible transcation id :"+transitQty);
System.out.println("receiptLast :"+receiptLast);
......@@ -3554,7 +3554,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
transitQtyFreesLast=0.0;
transitFreeQtyList=GetFreeQtyCommon("T",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCodeLast,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
transitQtyFreesLast=transitFreeQtyList.get(0);
transitFreeValue=getRequiredDcml(transitFreeQtyList.get(1),2);
transitFreeValue=getRequiredDcml(transitFreeQtyList.get(1),3);
System.out.println("transitQtyFreesLast :"+transitQtyFreesLast);
transitCharQty=0.0;
......@@ -3571,7 +3571,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
cmrcpQtyList = GetRcpQtyCM("R",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCodeLast,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
System.out.println("cmrcpQtyList>>>>>>>"+cmrcpQtyList+"iTEMcODE@@@@@@"+itemCode);
cmQuantity=cmrcpQtyList.get(0);
cmValue=getRequiredDcml(cmrcpQtyList.get(1),2);
cmValue=getRequiredDcml(cmrcpQtyList.get(1),3);
descrLast="";
......@@ -3601,6 +3601,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
returnTransitRepl=replQtyList.get(2);
billRetQtyBonus=replQtyList.get(3);
sretRate=replQtyList.get(4);
sretRate=getRequiredDcml(sretRate,3);
System.out.println("replQtyAll>>>>>>"+replQtyAll+">>>>>>"+itemCode);
sretQtyAllTot= billRetQty - replQtyAll -retFreeQtyAll ;
System.out.println("sretQtyAllTot @@@@@@@@@@@!!!!!!:"+sretQtyAllTot);
......@@ -3659,11 +3660,11 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<loc_type>").append("<![CDATA["+locTypeLast+"]]>").append("</loc_type>");
if(!Double.isNaN(rateLast))
{
valueXmlString.append("<rate>").append("<![CDATA["+getRequiredDecimal(rateLast,2)+"]]>").append("</rate>");
valueXmlString.append("<rate>").append("<![CDATA["+getRequiredDecimal(rateLast,3)+"]]>").append("</rate>");
}
if(!Double.isNaN(rateOrg))
{
valueXmlString.append("<rate__org>").append("<![CDATA["+getRequiredDecimal(rateOrg,2)+"]]>").append("</rate__org>");
valueXmlString.append("<rate__org>").append("<![CDATA["+getRequiredDecimal(rateOrg,3)+"]]>").append("</rate__org>");
}
//valueXmlString.append("<op_stock protect='1'>").append("<![CDATA["+(long)Math.round(opStockLast)+"]]>").append("</op_stock>");
if(isPreviusItem || "V".equalsIgnoreCase(editFlag))
......@@ -3706,8 +3707,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<chg_date>").append("<![CDATA["+sdf.format(currentDate)+"]]>").append("</chg_date>");
valueXmlString.append("<rate_old>").append("<![CDATA["+rateOld+"]]>").append("</rate_old>");
valueXmlString.append("<rate_org_old>").append("<![CDATA["+rateOrgOld+"]]>").append("</rate_org_old>");
valueXmlString.append("<rate_old>").append("<![CDATA["+getRequiredDecimal(rateOld,3)+"]]>").append("</rate_old>");
valueXmlString.append("<rate_org_old>").append("<![CDATA["+getRequiredDecimal(rateOrgOld,3)+"]]>").append("</rate_org_old>");
valueXmlString.append("<rcp_value>").append("<![CDATA["+getRequiredDecimal(rcpquantityRate,3)+"]]>").append("</rcp_value>");
valueXmlString.append("<repl_value>").append("<![CDATA["+getRequiredDecimal(returnReciptRepl*sretRate,3)+"]]>").append("</repl_value>");
valueXmlString.append("<cm_invoice>").append("<![CDATA["+getRequiredDecimal(cmQuantity,3)+"]]>").append("</cm_invoice>");
......@@ -3827,12 +3828,14 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rcpQtyList = GetRcpQtyCommon("R",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
rcpQtyAll=rcpQtyList.get(0);
rcpquantityRate=rcpQtyList.get(1);
rcpquantityRate=getRequiredDcml(rcpquantityRate,3);
rcpFreesAll=0.0;
rcpFreeQtyList=null;
rcpFreeQtyList = GetFreeQtyCommon("R",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
rcpFreesAll=rcpFreeQtyList.get(0);
rcpFreesValue=rcpFreeQtyList.get(1);
rcpFreesValue=getRequiredDcml(rcpFreesValue,3);
System.out.println("rcpFreesAll :"+rcpFreesAll);
//receiptRate = GetRateCommon(custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
......@@ -3856,6 +3859,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
returnTransitRepl=replQtyList.get(2);
billRetQtyBonus=replQtyList.get(3);
sretRate=replQtyList.get(4);
sretRate=getRequiredDcml(sretRate,3);
System.out.println("replQtyAll>>>>>>"+replQtyAll+">>>>>>"+itemCode+"Rate>>>>>"+sretRate);
sretQtyAllTot= billRetQty - replQtyAll -billRetQtyBonus ;
System.out.println("sretQtyAllTot @@@@@@@@@@@!!!!!!:"+sretQtyAllTot);
......@@ -3890,7 +3894,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
transitQtyList=null;
transitQtyList = GetRcpQtyCommon("T",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
transitQtyAll=transitQtyList.get(0);
transitQuantityRate=getRequiredDcml(rcpQtyList.get(1),2);
transitQuantityRate=getRequiredDcml(rcpQtyList.get(1),3);
//transitQtyRate=transitQtyList.get(1);
System.out.println("transitQtyAll@@@@@@@"+transitQtyAll+">>>>>>"+itemSerHd);
System.out.println("transitQtyRate@@@@@@@"+transitQtyRate);
......@@ -3901,7 +3905,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
transitFreeQtyList=null;
transitFreeQtyList = GetFreeQtyCommon("T",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
transitQtyFrees=transitFreeQtyList.get(0);
transitFreeValue=getRequiredDcml(transitFreeQtyList.get(1),2);
transitFreeValue=getRequiredDcml(transitFreeQtyList.get(1),3);
System.out.println("transitQtyFrees :"+transitQtyFrees);
transitCharQtyAll = 0.0;
......@@ -3912,7 +3916,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
cmrcpQtyList = GetRcpQtyCM("R",custCodeHd,orderType,itemSerHd,siteCodeHd,selectedInvList,transitInvList,itemCode,frmDateTstmp,toDateTstmp,prdFrmDateTstmp,prdtoDateTstmp,conn);
System.out.println("cmrcpQtyList>>>>>>>"+cmrcpQtyList+"iTEMcODE@@@@@@"+itemCode);
cmQuantity=cmrcpQtyList.get(0);
cmValue=getRequiredDcml(cmrcpQtyList.get(1),2);
cmValue=getRequiredDcml(cmrcpQtyList.get(1),3);
/*
rateAll=0.0;
......@@ -4071,15 +4075,16 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<formula_value>").append("<![CDATA["+itemMap.get("formulaValue@"+itemDomId).toString()+"]]>").append("</formula_value>");
valueXmlString.append("<free_value>").append("<![CDATA["+getRequiredDecimal(Double.parseDouble(itemMap.get("freeValue@"+itemDomId).toString()),3)+"]]>").append("</free_value>");
valueXmlString.append("<sret_vale>").append("<![CDATA["+getRequiredDecimal(Double.parseDouble(itemMap.get("sretValue@"+itemDomId).toString()),3)+"]]>").append("</sret_vale>");
valueXmlString.append("<pur_value>").append("<![CDATA["+(long)Math.round(Double.parseDouble(itemMap.get("rcpValue@"+itemDomId).toString()))+"]]>").append("</pur_value>");
valueXmlString.append("<pur_value>").append("<![CDATA["+getRequiredDecimal(Double.parseDouble(itemMap.get("rcpValue@"+itemDomId).toString()),3)+"]]>").append("</pur_value>");
//valueXmlString.append("<pur_value>").append("<![CDATA["+(long)Math.round(Double.parseDouble(itemMap.get("rcpValue@"+itemDomId).toString()))+"]]>").append("</pur_value>");
openingValue=getRequiredDcml((Double.parseDouble(itemMap.get("mopStk@"+itemDomId).toString()))*(Double.parseDouble(itemMap.get("oldRate@"+itemDomId).toString())),2);
openingValue=getRequiredDcml((Double.parseDouble(itemMap.get("mopStk@"+itemDomId).toString()))*(Double.parseDouble(itemMap.get("oldRate@"+itemDomId).toString())),3);
System.out.println("net secondary salesopeningValue>>>>>>"+openingValue);
salesValueCal=openingValue+Double.parseDouble(itemMap.get("rcpValue@"+itemDomId).toString())
+ Double.parseDouble(itemMap.get("replValue@"+itemDomId).toString())
- Double.parseDouble(itemMap.get("sretValue@"+itemDomId).toString());
valueXmlString.append("<op_value>").append("<![CDATA["+getRequiredDecimal(openingValue, 2)+"]]>").append("</op_value>");
valueXmlString.append("<sales_value>").append("<![CDATA["+ getRequiredDecimal(salesValueCal,2)+"]]>").append("</sales_value>");
valueXmlString.append("<op_value>").append("<![CDATA["+getRequiredDecimal(openingValue, 3)+"]]>").append("</op_value>");
valueXmlString.append("<sales_value>").append("<![CDATA["+ getRequiredDecimal(salesValueCal,3)+"]]>").append("</sales_value>");
valueXmlString.append("<cl_value>").append("<![CDATA[0]]>").append("</cl_value>");
......@@ -4100,11 +4105,12 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("repl value>>>>>>"+Double.parseDouble(itemMap.get("replValue@"+itemDomId).toString()));
System.out.println("free value>>>>>>"+Double.parseDouble(itemMap.get("freeValue@"+itemDomId).toString()));
System.out.println("sret value>>>>>>"+Double.parseDouble(itemMap.get("sretValue@"+itemDomId).toString()));
grosSalesValueCal= getRequiredDcml(Double.parseDouble(itemMap.get("mopStk@"+itemDomId).toString())*Double.parseDouble(itemMap.get("oldRateOrg@"+itemDomId).toString()),2)
grosSalesValueCal= getRequiredDcml(Double.parseDouble(itemMap.get("mopStk@"+itemDomId).toString())*Double.parseDouble(itemMap.get("oldRateOrg@"+itemDomId).toString()),3)
+Double.parseDouble(itemMap.get("rcpValue@"+itemDomId).toString())
+Double.parseDouble(itemMap.get("replValue@"+itemDomId).toString())
+Double.parseDouble(itemMap.get("freeValue@"+itemDomId).toString())
-Double.parseDouble(itemMap.get("sretValue@"+itemDomId).toString());
grosSalesValueCal= getRequiredDcml(grosSalesValueCal,3);
System.out.println("grosSalesValueCal>>>>"+grosSalesValueCal);
if(grossSecondaryQty>0)
......@@ -4116,7 +4122,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
grossSecondaryRateCal=0;
}
valueXmlString.append("<rate__org>").append("<![CDATA["+getRequiredDecimal(grossSecondaryRateCal, 2)+"]]>").append("</rate__org>");
valueXmlString.append("<rate__org>").append("<![CDATA["+getRequiredDecimal(grossSecondaryRateCal, 3)+"]]>").append("</rate__org>");
valueXmlString.append("<sales__org>").append("<![CDATA["+(long)Math.round(Double.parseDouble(itemMap.get("salesOrg@"+itemDomId).toString()))+"]]>").append("</sales__org>");
valueXmlString.append("</Detail3>");
......@@ -4317,6 +4323,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
formulaValue=formulaValue-formulaValue;
System.out.println("closing value>>>>"+closingValue);
}
closingValue=getRequiredDcml(closingValue,3);
}
rs.close();
rs = null;
......@@ -4344,6 +4351,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rateAll = discmn.pickRate(priceList,sysDate,itemCode1,conn);
System.out.println("rateAll>>>>>"+rateAll);
closingValue=closingValue+formulaValue*rateAll;
closingValue=getRequiredDcml(closingValue,3);
}
if(clStock>0)
......@@ -4353,6 +4361,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
closingRate=0.0;
}
closingRate=getRequiredDcml(closingRate,3);
System.out.println("closingRate@@@@@@@@@"+closingRate);
grossSecondaryQty=opStkDom+rcpQtmDom+rcpReplQtmDom+rcpFreeQtmDom-retQtyDom-clStock;
......@@ -4385,7 +4394,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("closingValue>>>>>>>"+closingValue);*/
//grossClosingValue=grossClosingRate*clStock;
netSecondarySalesValue=(opStkDom*rateOld)+rcpValue+replValue-retValue-closingValue;
netSecondarySalesValue=getRequiredDcml(netSecondarySalesValue,3);
System.out.println("netSecondarySalesValue>>>>>>>"+netSecondarySalesValue);
/*secondaryQty=opStkDom+rcpQtmDom+rcpReplQtmDom-retQtyDom-clStock;
System.out.println("secondaryQty>>>>"+secondaryQty);
......@@ -4393,6 +4402,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
System.out.println("netSecondaryRate>>>"+netSecondaryRate);*/
grossSecondarySalesValue=(opStkDom*rateOrgOld)+rcpValue+replValue+rcpFreeValue-retValue-closingValue;
grossSecondarySalesValue=getRequiredDcml(grossSecondarySalesValue,3);
System.out.println("rcpFreeValue>>>>"+rcpFreeValue);
System.out.println("grossSecondarySalesValue>>>>"+grossSecondarySalesValue);
System.out.println("grossSecondaryQty>>>>"+grossSecondaryQty);
......@@ -4405,6 +4415,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
grossSecondaryRate=0.0;
}
grossSecondaryRate=getRequiredDcml(grossSecondaryRate,3);
System.out.println("grossSecondaryRate>>>"+grossSecondaryRate);
//End by chandrashekar on 29-dec-2015
salesQtyCal = opStkDom + (rcpQtmDom + rcpReplQtmDom) - (retQtyDom + retQtyFreeDom) - clStock;
......@@ -4420,14 +4431,14 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
if(!Double.isNaN(closingRate))
{
/*valueXmlString.append("<rate>").append("<![CDATA[" + getRequiredDecimal(netSecondaryRate,2) + "]]>").append("</rate>");*/
valueXmlString.append("<rate>").append("<![CDATA[" + getRequiredDecimal(closingRate,2) + "]]>").append("</rate>");
valueXmlString.append("<rate>").append("<![CDATA[" + getRequiredDecimal(closingRate,3) + "]]>").append("</rate>");
}else
{
valueXmlString.append("<rate>").append("<![CDATA[0]]>").append("</rate>");
}
if(!Double.isNaN(grossSecondaryRate))
{
valueXmlString.append("<rate__org>").append("<![CDATA[" + getRequiredDecimal(grossSecondaryRate,2) + "]]>").append("</rate__org>");
valueXmlString.append("<rate__org>").append("<![CDATA[" + getRequiredDecimal(grossSecondaryRate,3) + "]]>").append("</rate__org>");
}else
{
valueXmlString.append("<rate__org>").append("<![CDATA[0]]>").append("</rate__org>");
......@@ -4442,15 +4453,15 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
if(!Double.isNaN(closingValue))
{
valueXmlString.append("<cl_value>").append("<![CDATA[" + getRequiredDcml(closingValue,2) + "]]>").append("</cl_value>");
valueXmlString.append("<cl_value>").append("<![CDATA[" + getRequiredDcml(closingValue,3) + "]]>").append("</cl_value>");
}
if(!Double.isNaN(netSecondarySalesValue))
{
valueXmlString.append("<sales_value>").append("<![CDATA[" + getRequiredDcml(netSecondarySalesValue,2) + "]]>").append("</sales_value>");
valueXmlString.append("<sales_value>").append("<![CDATA[" + getRequiredDcml(netSecondarySalesValue,3) + "]]>").append("</sales_value>");
}
if(!Double.isNaN(opStkDom*rateOld))
{
valueXmlString.append("<op_value>").append("<![CDATA[" + getRequiredDcml((opStkDom*rateOld),2) + "]]>").append("</op_value>");
valueXmlString.append("<op_value>").append("<![CDATA[" + getRequiredDcml((opStkDom*rateOld),3) + "]]>").append("</op_value>");
}
valueXmlString.append("</Detail3>\r\n");
......
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