Commit 58f94639 authored by caluka's avatar caluka

Gross quantity display in item detal screen


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@99466 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cb8582d4
......@@ -1064,7 +1064,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
double rcpFreesValue=0.0,transitFreeValue=0.0,rateOrg=0.0;
double grossClosingRate=0.0,grossClosingValue=0.0;
double invQtystdm=0.0,invRatestdm=0.0;
double quantityStd=0.0,rateStd=0.0;
double quantityStd=0.0,rateStd=0.0,salesOrg=0.0;
int netValue=0,decimalNumber=0;
int lineNoCustSt=0,currentFormNo = 0,varValue=0,domID3=0,sreturnCnt=0;
int lineNoItmCnt=0,itemResLen=0,itemPos=0,itmDetCnt=0,domID2=0;
......@@ -1382,6 +1382,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
pstmt.close();
pstmt = null;
if(fromDatetmstmp != null)
{
previousDay= utlmethd.RelativeDate(fromDatetmstmp, -1);
sql = "select prd_code,fr_date,to_date from period_tbl " +
......@@ -1434,6 +1436,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
rs = null;
pstmt.close();
pstmt = null;
}
/*valueXmlString.append("<Detail1 domID='1' objContext='1'>");
valueXmlString.append("<sale_per>").append("<![CDATA["+spCode+"]]>").append("</sale_per>");
......@@ -1462,8 +1465,20 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<cust_name protect='1'>").append("<![CDATA[" + custName + "]]>").append("</cust_name>");
valueXmlString.append("<item_ser protect='1'>").append("<![CDATA[" + itemSer + "]]>").append("</item_ser>");
valueXmlString.append("<order_type protect='1'>").append("<![CDATA[" + orderType + "]]>").append("</order_type>");
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[" + sdf.format(FromDate).toString() + "]]>").append("</from_date>");
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[" + sdf.format(ToDate).toString() + "]]>").append("</to_date>");
if(FromDate !=null)
{
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[" + sdf.format(FromDate).toString() + "]]>").append("</from_date>");
}else
{
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[]]>").append("</from_date>");
}
if(ToDate !=null)
{
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[" + sdf.format(ToDate).toString() + "]]>").append("</to_date>");
}else
{
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[]]>").append("</to_date>");
}
valueXmlString.append("<itemser_descr protect='1'>").append("<![CDATA[" + itemSerName + "]]>").append("</itemser_descr>");
valueXmlString.append("<site_code>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>");
valueXmlString.append("<tran_id__last>").append("<![CDATA[" + tranIdLast + "]]>").append("</tran_id__last>");
......@@ -1692,9 +1707,24 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<Detail1 domID='1' objContext='1'>");
valueXmlString.append("<prd_code>").append("<![CDATA["+period+"]]>").append("</prd_code>");
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[" + sdf.format(FromDate).toString() + "]]>").append("</from_date>");
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[" + sdf.format(ToDate).toString() + "]]>").append("</to_date>");
if(FromDate !=null && ToDate != null)
{
valueXmlString.append("<prd_code>").append("<![CDATA["+period+"]]>").append("</prd_code>");
}
if(FromDate != null)
{
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[" + sdf.format(FromDate).toString() + "]]>").append("</from_date>");
}else
{
valueXmlString.append("<from_date protect='1'>").append("<![CDATA[]]>").append("</from_date>");
}
if(ToDate != null)
{
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[" + sdf.format(ToDate).toString() + "]]>").append("</to_date>");
}else
{
valueXmlString.append("<to_date protect='1'>").append("<![CDATA[]]>").append("</to_date>");
}
valueXmlString.append("<pophelp_frmdt>").append("<![CDATA["+fromDateStr+"]]>").append("</pophelp_frmdt>");
valueXmlString.append("<pophelp_todt>").append("<![CDATA["+toDateStr+"]]>").append("</pophelp_todt>");
valueXmlString.append("</Detail1>");
......@@ -2584,7 +2614,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
"custdet.rate,custdet.line_no,custdet.transit_qty,custdet.item_ser ," +
"custdet.purc_rcp__repl ,custdet.purc_rcp__free,custdet.purc_ret__repl," +
"custdet.purc_ret__free,custdet.transit_qty__repl,custdet.transit_qty__free ," +
"custdet.loc_type from cust_stock_det custdet,item item " +
"custdet.loc_type, custdet.sales__org from cust_stock_det custdet,item item " +
"where custdet.item_code=item.item_code " +
" and tran_id=? order by item.descr ";
pstmt = conn.prepareStatement(sql);
......@@ -2605,6 +2635,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
opStockLast=rs.getDouble("op_stock");
rateLast=rs.getDouble("rate");
rateOrg=rs.getDouble("rate__org");
salesOrg=rs.getDouble("sales__org");
System.out.println("itemCodeLast (case 4):"+itemCodeLast);
......@@ -2765,6 +2796,9 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
salesLast=opStockLast+(receiptLast)+returnReciptRepl-billRetQty-clStockNew;
System.out.println("SECONDARY SALES EDIT MODE>>>>>"+salesLast);
salesOrg=opStockLast+(receiptLast)+returnReciptRepl+rcpFreesLast-billRetQty-clStockNew;
System.out.println("salesOrg>>>>>"+salesOrg);
if(receiptLast >= 0)
{
......@@ -2844,6 +2878,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<free_value>").append("<![CDATA["+rcpFreesValue+"]]>").append("</free_value>");
valueXmlString.append("<sret_vale>").append("<![CDATA["+billRetQty*sretRate+"]]>").append("</sret_vale>");
valueXmlString.append("<sales__org>").append("<![CDATA["+(long)Math.round(salesOrg)+"]]>").append("</sales__org>");
valueXmlString.append("</Detail3>");
......@@ -3035,6 +3071,9 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
salesQty=0;
salesQty=opStkItem+(rcpQtyAll)+replQtyAll-billRetQty;
System.out.println("salesQty AFTER>>>>"+salesQty);
salesOrg=0;
salesOrg=opStkItem+(rcpQtyAll)+replQtyAll+rcpFreesAll-billRetQty;
System.out.println("salesOrg>>>>"+salesOrg);
itemMap.put("itemCode@"+lineNoItmCnt, itemCode);
itemMap.put("mItemSer@"+lineNoItmCnt, itemSerDet);
......@@ -3070,6 +3109,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
itemMap.put("freeValue@"+lineNoItmCnt, String.valueOf(rcpFreesValue));
itemMap.put("sretValue@"+lineNoItmCnt, String.valueOf(billRetQty*sretRate));
itemMap.put("salesOrg@"+lineNoItmCnt, String.valueOf(salesOrg));
}//end of IF
......@@ -3170,6 +3211,8 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
valueXmlString.append("<free_value>").append("<![CDATA["+itemMap.get("freeValue@"+itemDomId).toString()+"]]>").append("</free_value>");
valueXmlString.append("<sret_vale>").append("<![CDATA["+itemMap.get("sretValue@"+itemDomId).toString()+"]]>").append("</sret_vale>");
valueXmlString.append("<rate__org>").append("<![CDATA[0]]>").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>");
}
......@@ -3291,6 +3334,7 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
formulaValue=clStock-cmQuantity1;
}
thirdMonthDay= utlmethd.AddMonths(prdtoDateTmstmp, -3);
sql = "SELECT fr_date FROM period_tbl WHERE ? between fr_date and to_date";
pstmt = conn.prepareStatement(sql);
......@@ -3362,6 +3406,9 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
}
closingRate=closingValue/clStock;
System.out.println("closingRate@@@@@@@@@"+closingRate);
grossSecondaryQty=opStkDom+rcpQtmDom+rcpReplQtmDom+rcpFreeQtmDom-retQtyDom-clStock;
System.out.println("grossSecondaryQty>>>>>>"+grossSecondaryQty);
//End Added by chandrashekar on 08-dec-2015
/*
formulaValue=0;
......@@ -3417,11 +3464,18 @@ public class CustStockGWTIC extends ValidatorEJB implements CustStockGWTICLocal,
{
/*valueXmlString.append("<rate>").append("<![CDATA[" + getRequiredDecimal(netSecondaryRate,2) + "]]>").append("</rate>");*/
valueXmlString.append("<rate>").append("<![CDATA[" + getRequiredDecimal(closingRate,2) + "]]>").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>");
}*/
if(!Double.isNaN(grossSecondaryQty))
{
valueXmlString.append("<sales__org>").append("<![CDATA[" + (long) Math.round(grossSecondaryQty) + "]]>").append("</sales__org>");
}
valueXmlString.append("</Detail3>\r\n");
}else
......
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