Commit b9a2d6ae authored by steurwadkar's avatar steurwadkar

Wavegen Wizard changes Check-in by Santosh


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104100 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3fe9b85b
...@@ -584,7 +584,7 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W ...@@ -584,7 +584,7 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W
allocQty = Double.parseDouble(saleOrderLineDom.getElementsByTagName("qty_alloc").item(0).getTextContent()); allocQty = Double.parseDouble(saleOrderLineDom.getElementsByTagName("qty_alloc").item(0).getTextContent());
manualAllocQty = Double.parseDouble(saleOrderLineDom.getElementsByTagName("manual_allocqty").item(0).getTextContent()); manualAllocQty = Double.parseDouble(saleOrderLineDom.getElementsByTagName("manual_allocqty").item(0).getTextContent());
totalQty += Double.parseDouble(saleOrderLineDom.getElementsByTagName("quantity").item(0).getTextContent()); totalQty += Double.parseDouble(saleOrderLineDom.getElementsByTagName("pending_quantity").item(0).getTextContent());
if(allocQty > 0 || manualAllocQty > 0) if(allocQty > 0 || manualAllocQty > 0)
{ {
allocatedLineItem += 1; allocatedLineItem += 1;
...@@ -732,9 +732,16 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W ...@@ -732,9 +732,16 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W
} }
} }
else if(balStockQty <= 0) else if(balStockQty <= 0)
{
if(allocQty<pendQty)
{ {
colorCode="red"; colorCode="red";
} }
else if(allocQty == pendQty)
{
colorCode="green";
}
}
} }
else if("Ship Available".equalsIgnoreCase(shipType)) else if("Ship Available".equalsIgnoreCase(shipType))
{ {
...@@ -761,9 +768,16 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W ...@@ -761,9 +768,16 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W
} }
} }
else if(balStockQty <= 0) else if(balStockQty <= 0)
{
if(allocQty<pendQty)
{ {
colorCode="red"; colorCode="red";
} }
else if(allocQty == pendQty)
{
colorCode="green";
}
}
} }
} }
catch(Exception e) catch(Exception e)
...@@ -777,7 +791,7 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W ...@@ -777,7 +791,7 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W
public String getImagePath(String lineItemStr) throws ITMException public String getImagePath(String lineItemStr) throws ITMException
{ {
String retImgPath = "", itemCode = "", itemRefSer = "", docId = "",itemDescr = ""; String retImgPath = "", itemParnt = "", itemCode = "", itemRefSer = "", docId = "",itemDescr = "", docType = "";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String sql = ""; String sql = "";
...@@ -786,9 +800,26 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W ...@@ -786,9 +800,26 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W
try try
{ {
conn = getConnection(); conn = getConnection();
itemCode = getValue(lineItemStr, "item_code"); itemCode = getValue(lineItemStr, "item_code").trim();
itemDescr = removeSpecialChar(getValue(lineItemStr, "item_descr")); itemDescr = removeSpecialChar(getValue(lineItemStr, "item_descr"));
sql = " SELECT ITEM_PARNT FROM ITEM WHERE ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
itemParnt = checkNullAndTrim(rs.getString("ITEM_PARNT"));
}
if(rs != null)
{
rs.close();rs = null;
}
if(pstmt != null)
{
pstmt.close();pstmt = null;
}
sql = " SELECT REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = 'w_item'"; sql = " SELECT REF_SER FROM TRANSETUP WHERE TRAN_WINDOW = 'w_item'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -805,25 +836,26 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W ...@@ -805,25 +836,26 @@ public class WavegenWizEJB extends ValidatorEJB implements WavegenWizEJBLocal, W
pstmt.close();pstmt = null; pstmt.close();pstmt = null;
} }
sql = " SELECT DOC_CONTENTS.DOC_ID FROM DOC_CONTENTS, DOC_TRANSACTION_LINK, USERS " sql = " SELECT DOC_CONTENTS.DOC_ID,DOC_CONTENTS.DOC_TYPE FROM DOC_CONTENTS, DOC_TRANSACTION_LINK, USERS "
+ " WHERE DOC_TRANSACTION_LINK.DOC_ID = DOC_CONTENTS.DOC_ID AND USERS.CODE = DOC_CONTENTS.ADD_USER " + " WHERE DOC_TRANSACTION_LINK.DOC_ID = DOC_CONTENTS.DOC_ID AND USERS.CODE = DOC_CONTENTS.ADD_USER "
+ " AND REF_SER = ? AND REF_ID = ? ORDER BY DOC_CONTENTS.DOC_ID "; + " AND REF_SER = ? AND (REF_ID = ? OR REF_ID = ?) ORDER BY DOC_CONTENTS.DOC_ID ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemRefSer); pstmt.setString(1, itemRefSer);
pstmt.setString(2, itemCode); pstmt.setString(2, itemCode);
pstmt.setString(3, itemParnt);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
docId = checkNullAndTrim(rs.getString("DOC_ID")); docId = checkNullAndTrim(rs.getString("DOC_ID"));
retImgPath = "/ibase/WebITMDocumentHandlerServlet?OBJ_NAME=item&REF_ID="+itemCode+"&ACTION=GET_DOCUMENT&CLIENT=WEB1&DOC_ID="+docId+"&DOC_TYPE=jpg"; docType= checkNullAndTrim(rs.getString("DOC_TYPE"));
retImgPath = "/ibase/WebITMDocumentHandlerServlet?OBJ_NAME=item&REF_ID="+itemCode.trim()+"&ACTION=GET_DOCUMENT&CLIENT=WEB1&DOC_ID="+docId+"&DOC_TYPE="+docType+"";
} }
else else
{ {
retImgPath = getCustomImagePath(itemCode.trim(),itemDescr,"itemcode"); retImgPath = getCustomImagePath(itemCode.trim(),itemDescr,"itemcode");
} }
} }
catch(Exception e) catch(Exception e)
{ {
......
...@@ -667,7 +667,7 @@ function expandCollapse() ...@@ -667,7 +667,7 @@ function expandCollapse()
for (i = 0; i < acc.length; i++) for (i = 0; i < acc.length; i++)
{ {
if(acc[i].className == "accordion active" || acc[i].className == "accordion accordionSO active" && acc[i].attributes.expanded.value == "true") if(acc[i].attributes.expanded.value == "true")
{ {
acc[i].attributes.expanded.value = "false"; acc[i].attributes.expanded.value = "false";
acc[i].classList.toggle("active"); acc[i].classList.toggle("active");
...@@ -675,10 +675,46 @@ function expandCollapse() ...@@ -675,10 +675,46 @@ function expandCollapse()
} }
} }
} }
}
function selectAllRows()
{
var selectAllElems = $("input[name='selectAll']");
if(document.getElementById("selectAllRow").value == "Select All")
{
document.getElementById("selectAllRow").value = "Deselect All";
for(var i=0; i<selectAllElems.length;i++)
{
var eachSelectAll = selectAllElems[i];
var eachSelectAllTblId = eachSelectAll.attributes.tableId.value;
var eachSelectAllCustId = eachSelectAll.attributes.custId.value;
document.getElementById("selectAll"+eachSelectAllTblId).checked = true;
checkAll(eachSelectAllCustId, "details"+eachSelectAllTblId, eachSelectAllTblId);
}
var acc = document.getElementsByClassName("accordion"); var acc = document.getElementsByClassName("accordion");
var i; var expAttributes = $("button[expanded='true']");
var expCnt = expAttributes.length;
if(expCnt != acc.length)
{
expandCollapse();
}
}
else
{
document.getElementById("selectAllRow").value = "Select All";
for(var i=0; i<selectAllElems.length;i++)
{
var eachSelectAll = selectAllElems[i];
var eachSelectAllTblId = eachSelectAll.attributes.tableId.value;
var eachSelectAllCustId = eachSelectAll.attributes.custId.value;
document.getElementById("selectAll"+eachSelectAllTblId).checked = false;
checkAll(eachSelectAllCustId, "details"+eachSelectAllTblId, eachSelectAllTblId);
}
}
} }
function form2Previous() function form2Previous()
...@@ -725,6 +761,10 @@ function checkAll(custId, tableId, tableNo) ...@@ -725,6 +761,10 @@ function checkAll(custId, tableId, tableNo)
if(document.getElementById("selectAll"+tableNo).checked) if(document.getElementById("selectAll"+tableNo).checked)
{ {
for(var i=1;i<norow;i++) for(var i=1;i<norow;i++)
{
if(tableObj.rows[i].cells[13].childNodes != undefined)
{
if(tableObj.rows[i].cells[13].childNodes.item(1).style.backgroundColor == "green")
{ {
if(tableObj.rows[i].cells[0].childNodes != undefined) if(tableObj.rows[i].cells[0].childNodes != undefined)
{ {
...@@ -733,6 +773,8 @@ function checkAll(custId, tableId, tableNo) ...@@ -733,6 +773,8 @@ function checkAll(custId, tableId, tableNo)
tableObj.rows[i].cells[0].childNodes.item(0).setAttribute('checked','checked'); tableObj.rows[i].cells[0].childNodes.item(0).setAttribute('checked','checked');
} }
} }
}
}
document.getElementById("selectAll"+tableNo).setAttribute('checked','checked'); document.getElementById("selectAll"+tableNo).setAttribute('checked','checked');
} }
...@@ -768,7 +810,7 @@ function updateDisplaySummary(custId,tableId,tableNo) ...@@ -768,7 +810,7 @@ function updateDisplaySummary(custId,tableId,tableNo)
{ {
if(curTablObj.rows[j].cells[0].childNodes != undefined) if(curTablObj.rows[j].cells[0].childNodes != undefined)
{ {
custTotalQty += parseInt(curTablObj.rows[j].cells[16].childNodes.item(0).data); custTotalQty += parseInt(curTablObj.rows[j].cells[11].childNodes.item(0).data);
if(curTablObj.rows[j].cells[0].childNodes.item(0).checked==true) if(curTablObj.rows[j].cells[0].childNodes.item(0).checked==true)
{ {
custTotalAllocQty += parseInt(curTablObj.rows[j].cells[13].childNodes.item(0).value); custTotalAllocQty += parseInt(curTablObj.rows[j].cells[13].childNodes.item(0).value);
...@@ -811,7 +853,7 @@ function updateDisplaySummary(custId,tableId,tableNo) ...@@ -811,7 +853,7 @@ function updateDisplaySummary(custId,tableId,tableNo)
{ {
if(tableObj.rows[i].cells[0].childNodes != undefined) if(tableObj.rows[i].cells[0].childNodes != undefined)
{ {
totalQty += parseInt(tableObj.rows[i].cells[16].childNodes.item(0).data); totalQty += parseInt(tableObj.rows[i].cells[11].childNodes.item(0).data);
if(tableObj.rows[i].cells[0].childNodes.item(0).checked==true) if(tableObj.rows[i].cells[0].childNodes.item(0).checked==true)
{ {
totalAllocQty += parseInt(tableObj.rows[i].cells[13].childNodes.item(0).value); totalAllocQty += parseInt(tableObj.rows[i].cells[13].childNodes.item(0).value);
...@@ -829,7 +871,7 @@ function updateDisplaySummary(custId,tableId,tableNo) ...@@ -829,7 +871,7 @@ function updateDisplaySummary(custId,tableId,tableNo)
if(soPercentage == 0) if(soPercentage == 0)
{ {
var prevSoPerc = document.getElementById("prevSoPerc"+custId).value; var prevSoPerc = document.getElementById("prevSoPerc"+tableNo).value;
document.getElementById("soPercText"+tableNo).innerHTML = prevSoPerc+"%"; document.getElementById("soPercText"+tableNo).innerHTML = prevSoPerc+"%";
soPecrObj.className = "c100 small"; soPecrObj.className = "c100 small";
soPecrObj.classList.add("p"+prevSoPerc); soPecrObj.classList.add("p"+prevSoPerc);
...@@ -1034,11 +1076,3 @@ function getImgPath(retVal) ...@@ -1034,11 +1076,3 @@ function getImgPath(retVal)
document.getElementById("sideImagePanel").appendChild(imgElement); document.getElementById("sideImagePanel").appendChild(imgElement);
} }
window.onclick = function (event)
{
if(!event.target.matches(".imagePanelSrc") && !event.target.matches(".itemImg"))
{
document.getElementById("sideImagePanel").style.display="none";
}
}
...@@ -88,6 +88,14 @@ ...@@ -88,6 +88,14 @@
e.preventDefault(); e.preventDefault();
} }
}); });
window.onclick = function (event)
{
if(!event.target.matches(".imagePanelSrc") && !event.target.matches(".itemImg"))
{
document.getElementById("sideImagePanel").style.display="none";
}
}
]]> ]]>
</script> </script>
...@@ -96,6 +104,7 @@ ...@@ -96,6 +104,7 @@
&#160;&#160;<img src="/ibase/images/menuImages/web/wavegeneration.png" onerror="this.src='/ibase/images/menuImages/errMenu.png'" style="position: absolute; margin-left: -20px; height: 20px; width: 20px;"/> &#160;&#160;<img src="/ibase/images/menuImages/web/wavegeneration.png" onerror="this.src='/ibase/images/menuImages/errMenu.png'" style="position: absolute; margin-left: -20px; height: 20px; width: 20px;"/>
&#160;Wave Generation &#160;Wave Generation
<input type="button" Value="Expand All" class="button" id="accorAct" onclick="expandCollapse();" style="float: right;margin-right:2px;"/> <input type="button" Value="Expand All" class="button" id="accorAct" onclick="expandCollapse();" style="float: right;margin-right:2px;"/>
<input type="button" Value="Select All" class="button" id="selectAllRow" onclick="selectAllRows();" style="float: right;margin-right:2px;"/>
</div><br/><br/> </div><br/><br/>
<div id="innerDiv" style="overflow-y:hidden;overflow-x:auto;max-height:80%;width:100%;position:absolute;z-index:5;"> <div id="innerDiv" style="overflow-y:hidden;overflow-x:auto;max-height:80%;width:100%;position:absolute;z-index:5;">
...@@ -263,9 +272,9 @@ ...@@ -263,9 +272,9 @@
<div class="panel" id="custPanel{$custDbID}"> <div class="panel" id="custPanel{$custDbID}">
<xsl:for-each select="saleOrders/saleOrder"> <xsl:for-each select="saleOrders/saleOrder">
<xsl:variable name="soDbID"><xsl:value-of select="@domID"/></xsl:variable> <xsl:variable name="soDbID"><xsl:value-of select="@domID"/></xsl:variable>
<button class="accordion accordionSO" type="button" expanded="false">
<xsl:variable name="soAllocPerc"><xsl:value-of select="alloc_perc"/></xsl:variable> <xsl:variable name="soAllocPerc"><xsl:value-of select="alloc_perc"/></xsl:variable>
<input type="hidden" id="prevSoPerc{$soDbID}" value="{$soAllocPerc}"/> <input type="hidden" id="prevSoPerc{$soDbID}" value="{$soAllocPerc}"/>
<button class="accordion accordionSO" type="button" expanded="false">
<div id="soPercClass{$soDbID}" class="c100 small p{$soAllocPerc}" style="margin-left:10px !important;"> <div id="soPercClass{$soDbID}" class="c100 small p{$soAllocPerc}" style="margin-left:10px !important;">
<span id="soPercText{$soDbID}" class="percText"><xsl:value-of select="alloc_perc"/>%</span> <span id="soPercText{$soDbID}" class="percText"><xsl:value-of select="alloc_perc"/>%</span>
<div class="slice"> <div class="slice">
...@@ -286,7 +295,7 @@ ...@@ -286,7 +295,7 @@
<table id ="details{$soDbID}" class="tableClass"> <table id ="details{$soDbID}" class="tableClass">
<thead class="table-head"> <thead class="table-head">
<tr> <tr>
<th nowrap="true" style="border-left:0px solid black !important;" ><Input id='selectAll{$soDbID}' type='checkbox' name='selectAll' onClick="checkAll('{$custDbID}','details{$soDbID}','{$soDbID}')"/></th> <th nowrap="true" style="border-left:0px solid black !important;" ><Input id='selectAll{$soDbID}' type='checkbox' name='selectAll' custId='{$custDbID}' tableId='{$soDbID}' onClick="checkAll('{$custDbID}','details{$soDbID}','{$soDbID}')"/></th>
<th nowrap="true" style="display:none;">Customer Code</th> <th nowrap="true" style="display:none;">Customer Code</th>
<th nowrap="true" style="display:none;">Customer Name</th> <th nowrap="true" style="display:none;">Customer Name</th>
<th nowrap="true" style="display:none;">Customer Code Delivery</th> <th nowrap="true" style="display:none;">Customer Code Delivery</th>
...@@ -522,7 +531,7 @@ ...@@ -522,7 +531,7 @@
<input type="hidden" value="1:MP" name="formType" id="formType" /> <input type="hidden" value="1:MP" name="formType" id="formType" />
<input type="hidden" value="finish" name="action" id="action" /> <input type="hidden" value="finish" name="action" id="action" />
<input type="button" style="margin-left:2px;" value="Previous" class="button" title="back" id="back" onclick="form2Previous();"/> <input type="button" style="margin-left:2px;" value="Previous" class="button" title="back" id="back" onclick="form2Previous();"/>
<input type="submit" style="margin-leftt:8px;" value="Finish" class="button" title="finish" id="finish" onclick="return validateSubmit();" /> <input type="submit" style="margin-left:2px;" value="Finish" class="button" title="finish" id="finish" onclick="return validateSubmit();" />
</div> </div>
</div> </div>
......
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