Commit a145341d authored by chavanp's avatar chavanp

change the format of stock help screen


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@43344 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2bc1b46f
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<% System.out.println(" *****stockButton.jsp***** "); %>
<%@page import = "java.util.*"%>
<%@page import ="ibase.webitm.utility.*"%>
<%@page import = "ibase.webitm.ejb.dis.*"%>
<%@page import = "java.sql.*"%>
<%@page import = "java.text.DecimalFormat"%>
<%@page import = "ibase.webitm.utility.GenericUtility"%>
<jsp:useBean id="stkHlpBn" scope="session" class="ibase.webitm.ejb.dis.StockHelpBean"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="/ibase/webitm/css/StockFeedView.css" rel="stylesheet" type="text/css" />
<TITLE>Stock Help</TITLE>
<script type="text/javascript">
function callValidate()
{
var siteCd = document.form1.site_code.value;
var itemCd = document.form1.item_code.value;
if( siteCd == "" )
{
alert("Please enter Site Code.");
document.form1.site_code.focus();
return false;
}
if( itemCd == "" )
{
alert("Please enter Item Code.");
document.form1.item_code.focus();
return false;
}
}
function CloseWindow()
{
var win=window.open("about:blank","_self");
win.close();
}
</script>
</head>
<body>
<%
GenericUtility genericUtility = GenericUtility.getInstance();
DecimalFormat df = new DecimalFormat( "##.000" );
if(request.getParameter("form") == null || (request.getParameter("form").equals("2")))
{
%>
<FORM name = "form1" action = "StockFeedView.jsp?form=2" method = "Post">
<%
String saleOrder = request.getParameter("PK_VALUES");
System.out.println("dsfsfsf"+saleOrder);
String siteCode = request.getParameter("site_code");
String itemCode = request.getParameter("item_code");
String retImgPath="";
System.out.println("siteCode of bean ==>"+siteCode+" itemCode of bean ==>"+itemCode);
String itemDescr = "";
if (siteCode == null)
{
siteCode = request.getParameter("SITE_CODE") == null ? "" : request.getParameter("SITE_CODE");
}
if (itemCode == null)
{
itemCode = request.getParameter("ITEM_CODE") == null ? "" : request.getParameter("ITEM_CODE");
}
System.out.println("siteCode [" + siteCode + "]");
System.out.println("itemCode [" + itemCode + "]");
itemDescr = stkHlpBn.getItemDescr(itemCode);
retImgPath = stkHlpBn.getImagePath(itemCode);
System.out.println("itemDescr [" + itemDescr + "]");
System.out.println("retImgPath [" + retImgPath + "]");
String param = null;
String paramvalue = null;
Enumeration enum1 = request.getParameterNames();
while( enum1.hasMoreElements() )
{
param = (String)enum1.nextElement();
paramvalue = request.getParameter(param);
System.out.println("param ["+param+"] paramvalue ["+paramvalue+"]");
}
String paramList[];
if ( paramvalue.indexOf("~") != -1 )
{
paramList = paramvalue.split("~");
if (siteCode == null || siteCode.trim().length() ==0 )
{
siteCode = paramList[0];
}
if (itemCode == null || itemCode.trim().length() ==0 )
{
itemCode = paramList[1];
}
}
else
{
siteCode = paramvalue;
}
System.out.println("siteCode 2[" + siteCode + "]");
System.out.println("itemCode 2[" + itemCode + "]");
itemDescr = stkHlpBn.getItemDescr(itemCode);
System.out.println("itemDescr 2 [" + itemDescr + "]");
%>
<DIV class="header" >
<DIV CLASS="hcontainent">
<DIV class="labels">
<DIV class="l1">Site Code:</DIV>
<DIV class="l1">Item Code:</DIV>
</DIV>
<DIV class="text">
<DIV class="t1">
<input type = "text" class ="editInputClass" name = "site_code" size = "10" value = "<%= siteCode %>" onChange = "javascript: this.value = this.value.toUpperCase();"/></DIV>
<div class="t1">
<input type = "text" class ="editInputClass" name = "item_code" size = "10" value = "<%= itemCode %>" onChange = "javascript: this.value = this.value.toUpperCase();"/></DIV>
</DIV>
</DIV>
<DIV class="button"><input type = "submit" CLASS="galaxyButton" VALUE = "View" onClick = "return callValidate();" /></DIV>
</DIV>
</FORM>
<%
}
if((request.getParameter("form") != null ) && (request.getParameter("form").equals("2")))
{
%>
<Form name = "form2" action = "StockFeedView.jsp" method = "POST">
<%
String siteCodeReq = request.getParameter("site_code");
String itemCodeReq = request.getParameter("item_code");
System.out.println("siteCodeReq of bean ==>"+siteCodeReq+" itemCodeReq of bean ==>"+itemCodeReq);
stkHlpBn.setSiteCode( siteCodeReq.toUpperCase() );
stkHlpBn.setItemCode( itemCodeReq.toUpperCase() );
String itemDescr = stkHlpBn.getItemDescr(itemCodeReq);
String retImgPath = stkHlpBn.getImagePath(itemCodeReq);
System.out.println("retImgPath from bean ==>["+retImgPath+"]");
char itemDescrChar = itemDescr.charAt(0);
String mapKey = "", keyIndex = "", prevKeyIndex = "", unit ="",lotNo="",locCode="",available="", allocQty="",quantity="";
double totQuant = 0, totAllocQuant = 0, totHoldQuant = 0;
double prevTotQuant = 0, prevTotAllocQuant = 0, prevTotHoldQuant = 0;
double totNetQuant = 0, grndTotQty = 0, grndTotAllocQuant = 0;
double grndTotHoldQuant = 0, grndTotAvailQuant = 0;
java.sql.Timestamp retestDateTs = null, expDateTs = null;
ArrayList stockHelpList = stkHlpBn.getDetails();
for(int i=0;i<stockHelpList.size();i++)
{
stkHlpBn = ( ibase.webitm.ejb.dis.StockHelpBean)(stockHelpList.get(i));
/* unit = stkHlpBn.unit;
lotNo= stkHlpBn.lotNo;
locCode= stkHlpBn.locCode;
available=stkHlpBn.available;
allocQty= stkHlpBn.allocQty;
quantity=stkHlpBn.quantity;
for(Iterator it = (stkHlpBn.beanLotQuantMap).keySet().iterator(); it.hasNext(); )
{
} */
grndTotAvailQuant += Double.parseDouble(stkHlpBn.netAvailable);
grndTotAllocQuant += Double.parseDouble(stkHlpBn.allocQty);
grndTotHoldQuant += Double.parseDouble(stkHlpBn.holdQuant);
}
for(int i=0;i<stockHelpList.size();i++)
{
stkHlpBn = ( ibase.webitm.ejb.dis.StockHelpBean)(stockHelpList.get(i));
unit = stkHlpBn.unit;
lotNo= stkHlpBn.lotNo;
locCode= stkHlpBn.locCode;
available=stkHlpBn.available;
allocQty= stkHlpBn.allocQty;
quantity=stkHlpBn.quantity;
for(Iterator it = (stkHlpBn.beanLotQuantMap).keySet().iterator(); it.hasNext(); )
{
mapKey = (String)it.next();
keyIndex = mapKey.substring(3, mapKey.length());
if(mapKey.equals("LWQ"+keyIndex))
totQuant = ((Double)(stkHlpBn.beanLotQuantMap).get(mapKey)).doubleValue();
else if(mapKey.equals("LAQ"+keyIndex))
totAllocQuant = ((Double)(stkHlpBn.beanLotQuantMap).get(mapKey)).doubleValue();
else
totHoldQuant = ((Double)(stkHlpBn.beanLotQuantMap).get(mapKey)).doubleValue();
}
if( i == 0 )
{
%>
<DIV CLASS="itemStockSumryDiv">
<DIV class="itemCodeImgDiv">
<%
if( retImgPath==null || retImgPath=="")
{
%>
<div class="dynamicImgDiv"><%=itemDescrChar %></div>
<%
}
else
{
%>
<IMG SRC="<%=retImgPath %>" />
<%
}
%>
</DIV>
<DIV class="ItemStockDetailDiv1">
<DIV><%=itemDescr %></DIV>
<DIV>(<%=itemCodeReq %>)</DIV>
</DIV>
<DIV class="ItemStockDetailDiv2">
<DIV class="Stockinformation"><%=grndTotAvailQuant %> <%=unit %></DIV>
<DIV class="Stockinformation">available</DIV>
</DIV>
<DIV class="ItemStockDetailDiv3">
<DIV class="Stockinformation"><%=grndTotAllocQuant %> <%=unit %></DIV>
<DIV class="Stockinformation">allocated</DIV>
</DIV>
<DIV class="ItemStockDetailDiv4">
<DIV class="Stockinformation"><%=grndTotHoldQuant %> <%=unit %></DIV>
<DIV class="Stockinformation">quarantined</DIV>
</DIV>
</DIV>
</DIV>
<%
}
%>
<div class="stockdtl">
<DIV class="StockDetailDiv1" >
<DIV class="StockQantity"><%=lotNo %></DIV>
<DIV class="StockQantity" >@ <%=locCode %></DIV>
</DIV>
<DIV class="StockDetailDiv2" >
<DIV class="StockAvailable" > <%=quantity %> <%=unit %></DIV>
<DIV class="StockAvailable" >available</DIV>
</DIV>
<DIV class="StockDetailDiv3" ">
<DIV class="StockAllocation" > <%=allocQty %> <%=unit %></DIV>
<DIV class="StockAllocation" >allocated</DIV>
</DIV>
<DIV class="StockDetailDiv4">
<DIV class="StockExpireDate">Expiry Date</DIV>
<DIV class="StockExpireDate">
<%
if(expDateTs==null)
{
%>
N/A
<%
}
else
{
out.print(expDateTs);
}
%>
</DIV>
</DIV>
</DIV>
</div>
<%
}
%>
<BR/><BR/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!-- <input type = "button" VALUE = "Back" onClick = "history.back()"/> -->
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</Form>
<%}%>
</body>
</html>
\ No newline at end of file
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