Commit 1ae04e8a authored by kdabholkar's avatar kdabholkar

Commited new Changes of Sales Order Wizard suggested by danish Sir

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174857 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d663a972
......@@ -5,6 +5,7 @@ var parserNew;
var oldVal;
var hideDivOnLoad = "0";
var sorttable = "";
//var isResetFromOther =false;
var maxId = 0;
var selectedCode = new Array();
......@@ -892,6 +893,7 @@ var sorttable = "";
else
{
//alert("Hii");
document.getElementById("reset").style.display = "none";
document.getElementById("next").style.display = "none";
document.getElementById("previous").style.display = "none";
document.getElementById("AddButton").style.display = "none";
......@@ -1662,29 +1664,84 @@ var sorttable = "";
);
}
//function calQuantity(id,cols,row,qt,fld,t)
function calQuantity(id,cols,row,qt,fld,t,rate)
//Added by Kaustubh on 28 Nov 2017 Start
function getColumnSum(tab,col)
{
//alert("inside column");
// alert("tab"+tab);
// alert("col"+col);
//var getChild = document.getElementById("itemDtl"+tab+"");
//alert("len"+getChild);
//alert(("[coltotname='tab.'+tab+'.fld.'+col+'']'));
//alert(document.querySelectorAll("[coltotname = 'tab."+tab+".fld."+col+"']"));
var tot = 0 ;
var colID = document.querySelectorAll("[coltotname = 'tab."+tab+".colWiseTot."+col+"']")
for(var i = 0; i < colID.length; i++)
{
var colValue=0;
if(colID[i].value == undefined ||colID[i].value == "" || colID[i].value == null)
{
colValue=0;
}
else
{
colValue = (parseInt(colID[i].value));
}
tot = tot + colValue;
// alert("value::"+colID[i].value);
// alert("tot"+tot);
document.getElementById("tab."+tab+".colWiseTotAmt."+col+"").value = tot;
}
}
// Added by kaustubh on 28 Nov 2017 end
function calQuantity(id,cols,row,qt,fld,t,rate)
{
//alert("id"+id);
// alert("id"+id);
// alert("cols"+cols);
//alert("row"+row);
// alert("row"+row);
// alert("fld"+fld);
// alert("qt"+qt);
// alert("t"+t);
//alert("rate"+rate);
var temp = "";
var final = 0;
var final1 = 0;
var first = fld - qt;
first = first +1;
//alert("first"+first);
//alert("rate"+rate);
//alert("qt"+qt);
var firstId="Detail2."+first+".quantity";
var cnt = row * cols;
cnt = (first-1) + cnt;
//alert(cnt);
//start by kaustubh
var cnt1 = (row * cols);
var newcnt=(cnt1-1);
// end kaustubh
var remainder = parseInt(qt) % cols;
var quot = parseInt(qt) / cols;
//alert("quot"+quot);
if(remainder == 0)
{
......@@ -1697,26 +1754,26 @@ var sorttable = "";
quot = quot+1;
//alert('Row='+quot);
}
//var loop = (cols*(quot-1)+1);
var loop = first+(cols*(quot-1));
//alert("loop"+loop);
var counter = loop+(cols-1);
//alert("counter"+counter);
//alert("rate"+rate);
var counter1 = loop+(newcnt);
var finalPrice = 0;
var rate1 = 0;
var no= 0;
var temp =0;
//alert("rate"+rate);
for(var f=loop;f<=counter;f++)
//alert("counter1"+counter1);
//for(var f=first;f<=counter1;f++)
for(var f=loop;f<=counter;f++)
{
if(document.getElementById("Detail2."+f+".quantity") == undefined ||document.getElementById("Detail2."+f+".quantity").value == "" || document.getElementById("Detail2."+f+".quantity").value == null)
{
......@@ -1725,22 +1782,34 @@ var sorttable = "";
}
else
{
//alert("f"+f);
//alert("rate"+rate);
final = final + parseFloat(document.getElementById("Detail2."+f+".quantity").value);
//finalPrice = parseFloat(finalPrice) + ( parseFloat(document.getElementById("Detail2."+f+".quantity").value) * parseFloat(rate));
finalPrice = parseFloat(finalPrice) + ( parseFloat(document.getElementById("Detail2."+f+".quantity").value) * parseFloat(document.getElementById("Detail2."+f+".rate").value) );
finalPrice = parseFloat(finalPrice) + ( parseFloat(document.getElementById("Detail2."+f+".quantity").value) * parseFloat(document.getElementById("Detail2."+f+".rate").value) );
console.log("finalPrice1::",finalPrice);
}
}
}
for(var k=first;k<=counter1;k++)
{
if(document.getElementById("Detail2."+k+".quantity") == undefined ||document.getElementById("Detail2."+k+".quantity").value == "" || document.getElementById("Detail2."+k+".quantity").value == null)
{
console.log("inside break");
continue;
}
else
{
//alert("K"+k);
final1 = parseFloat(final1) + ( parseFloat(document.getElementById("Detail2."+k+".quantity").value) * parseFloat(document.getElementById("Detail2."+k+".rate").value) );
console.log("finalPriceNew1::",final1);
}
}
/* final1=final1+final;
console.log("final1"+final1); */
document.getElementById("tab."+t+".fld."+quot+"").value = final;
var qty = 0;
......@@ -1762,10 +1831,12 @@ var sorttable = "";
var currCode = document.getElementById("curr_code").value;
//document.getElementById("rate"+t+"").innerHTML = " pieces at "+ currCode +" "+ finalPrice.toFixed(3) +" (Excluding Tax)";
document.getElementById("rate"+t+"").innerHTML = " pieces at "+ currCode +" "+ finalPrice.toFixed(2) +" (Excluding Tax)";
document.getElementById("rate"+t+"").innerHTML = " pieces at "+ currCode +" "+ final1.toFixed(2) +" ";
}
//Changed by samadhan on 03/02/2015 for fixed matxix table header Start
var flag=false;
......@@ -2487,7 +2558,7 @@ var sorttable = "";
var x = xmldoc.getElementsByTagName("tr");
var sett = xmldoc.getElementsByTagName("SET");
var xlen = sett.length-2;
var xlen = sett.length-3;
var xrows = x.length;
//var tranType=document.getElementById("pord_type").value;
......@@ -2596,7 +2667,7 @@ var sorttable = "";
{
if (tranType == "T")
{
tr = tr + "<td class='td_leftAlign' nowrap='true'>"+ y[j].childNodes[0].nodeValue +"</td>";
tr = tr + "<td class='td_leftAlign' nowrap='true'>"+ y[j].childNodes[0].nodeValue +"</td>";
}
else
......@@ -2612,7 +2683,8 @@ var sorttable = "";
{
if (y[j].childNodes[0].nodeValue == '0' && tranType == "T")
{
tr = tr + "<td align = 'right' nowrap='true'><input type='text' id='tab."+t+".fld."+fx+"' title='tab."+t+".fld."+fx+"' maxlength='0' ISCHANGED='false' readOnly = '1' style='width:75px; text-align: right;background-color: transparent;border: none; color:#555 !important;'/></td>";
tr = tr + "<td align = 'right' class='hideQuantity' nowrap='true'><input type='text' id='tab."+t+".fld."+fx+"' title='tab."+t+".fld."+fx+"' maxlength='0' ISCHANGED='false' readOnly = '1' style='width:75px; text-align: right;background-color: transparent;border: none; color:#555 !important;'/></td>";
fx++;
}
......@@ -2644,13 +2716,13 @@ var sorttable = "";
if (itemQtys[1] == "" || itemQtys[1] == "undefined" || itemQtys[1] == null || itemQtys[1] == "0" )
{
qtytr = +qtytr + 0;
tr = tr + "<td class='editTdClass' onclick='gotoChildTextbox(this);' nowrap='true'><input type='text' onchange='calQuantity(this.id,"+xlen+","+xrows+","+qt+","+fld+","+t+","+rate+"); sendInfo(this.id);' id='Detail2."+fld+".quantity' name='Detail2."+fld+".quantity' title='"+details[4]+"' onkeypress='return isQuantity(event)' maxlength='10' ISCHANGED='true' class='editInputClass editInputCur' style='width:100%;border:none;text-align: right; outline:none' value='' onfocus='setActiveTD(this);' /></td>";
tr = tr + "<td class='editTdClass' onclick='gotoChildTextbox(this);' nowrap='true'><input type='text' onchange='calQuantity(this.id,"+xlen+","+xrows+","+qt+","+fld+","+t+","+rate+"); sendInfo(this.id); getColumnSum("+t+","+j+");' colTotName='tab."+t+".colWiseTot."+j+"' id='Detail2."+fld+".quantity' name='Detail2."+fld+".quantity' title='"+details[4]+"' onkeypress='return isQuantity(event)' maxlength='10' ISCHANGED='true' class='editInputClass editInputCur' style='width:100%;border:none;text-align: right; outline:none' value='' onfocus='setActiveTD(this);' /></td>";
console.log("new row check"+tr);
}
else
{
qtytr = +qtytr + +itemQtys[1];
tr = tr + "<td class='editTdClass' onclick='gotoChildTextbox(this);' nowrap='true'><input type='text' onchange='calQuantity(this.id,"+xlen+","+xrows+","+qt+","+fld+","+t+","+rate+"); sendInfo(this.id);' id='Detail2."+fld+".quantity' name='Detail2."+fld+".quantity' title='"+details[4]+"' onkeypress='return isQuantity(event)' maxlength='10' ISCHANGED='true' class='editInputClass editInputCur' style='width:100%;border:none;text-align: right; outline:none' value='"+itemQtys[1]+"' onfocus='setActiveTD(this);' /></td>";
tr = tr + "<td class='editTdClass' onclick='gotoChildTextbox(this);' nowrap='true'><input type='text' onchange='calQuantity(this.id,"+xlen+","+xrows+","+qt+","+fld+","+t+","+rate+"); sendInfo(this.id) ; getColumnSum("+t+","+j+");' colTotName='tab."+t+".colWiseTot."+j+"' id='Detail2."+fld+".quantity' name='Detail2."+fld+".quantity' title='"+details[4]+"' onkeypress='return isQuantity(event)' maxlength='10' ISCHANGED='true' class='editInputClass editInputCur' style='width:100%;border:none;text-align: right; outline:none' value='"+itemQtys[1]+"' onfocus='setActiveTD(this);' /></td>";
}
......@@ -2691,7 +2763,19 @@ var sorttable = "";
}
var totTD="";
var colno = 3;
for(var m=0;m<xlen;m++)
{
// totTD = totTD + "<td class='td_leftAlign' nowrap='true'><input type='text' ISCHANGED='false' id='Detail2."+colno+".totQuantity' name='Detail2."+colno+".totQuantity' maxlength='10' ISCHANGED='true' style='width:100%;border:none;text-align: right; outline:none' value='' /></td>"
totTD = totTD + "<td class='td_leftAlign' nowrap='true'><input type='text' ISCHANGED='false' id='tab."+t+".colWiseTotAmt."+colno+"' name='Detail2."+colno+".totQuantity' readonly='1' maxlength='10' ISCHANGED='false' style='width:100%;border:none;text-align: right; outline:none' value='' /></td>"
colno++;
}
tr = tr + "<input type='hidden' value='"+temp+"' id='dlv_date_temp"+t+"' name='dlv_date"+t+"' class='editInputClass' style='width: 60px;text-align: right;'/>";
tr =tr + "<tr class='trClass' style='text-align: center;'><td colspan='2'>Total Quantity</td>"+totTD+" </tr>" ;
var x=document.getElementById("tabs").value;
var y=document.getElementById("active").value;
......@@ -2701,7 +2785,7 @@ var sorttable = "";
function xmlToJson(xml) {
/* function xmlToJson(xml) {
// Create the return object
var obj = {};
......@@ -2742,6 +2826,8 @@ var sorttable = "";
}
return obj;
}
*/
/*
......@@ -2866,9 +2952,13 @@ var sorttable = "";
alignHead = "left";
}*/
var alignHead = "left";
var classValue = "";
if(pSet[k].childNodes[0].nodeValue == "Quantity")
{
alignHead = "right";
continue;
classVlaue = "hideQuantity";
}
//Changed by Santosh on 04-11-2017 End
//To align table headr name to right and left [END]
......@@ -2886,7 +2976,7 @@ var sorttable = "";
{
rateStr = ""+itemParentRate;
}
pSetVal = pSetVal + "<th class='tHeader' align = '"+alignHead+"'>"+pSet[k].childNodes[0].nodeValue +"</th>";
pSetVal = pSetVal + "<th class='tHeader' align = '"+alignHead+"'>"+pSet[k].childNodes[0].nodeValue +"</th>";
}
else
{
......@@ -2965,8 +3055,11 @@ var sorttable = "";
document.getElementById("main"+t).innerHTML= descr;
document.getElementById("pieces"+t).innerHTML= totalQty;
document.getElementById("sum"+t).innerHTML = totalQty;
document.getElementById("rate"+t).innerHTML= " piece(s) @ "+ currCode +" "+ finalPrice +" (excluding tax)";
//changes by kaustubh on 23 nov 2017 Start
// document.getElementById("rate"+t).innerHTML= " piece(s) @ "+ currCode +" "+ finalPrice +" (excluding tax)";
document.getElementById("rate"+t).innerHTML= " piece(s) @ "+ currCode +" "+ finalPrice +" ";
//changes by kaustubh on 23 nov 2017 End
//var itemParentRateTag = xmldoc.getElementsByTagName("item_parent_rate");
//var itemParentRate = itemParentRateTag[0].childNodes[0].nodeValue;
document.getElementById("item_parent_rate"+t).innerHTML = itemParentRate;
......@@ -3904,8 +3997,8 @@ var sorttable = "";
}
var divLen = 0;
divLen = divArray[i];
divLen = divLen * 10;
divLen = divLen * 15;
data += '<span class="myClass'+i+'">' + item[i] + '</span>';
$('.myClass'+i).css('padding', '0 4px');
$('.myClass'+i).css('float', 'left');
......@@ -3945,7 +4038,7 @@ var sorttable = "";
}
var divLen = 0;
divLen = divArray[i];
divLen = divLen * 10;
divLen = divLen * 15;
data += '<span class="myClass'+i+'">' + item[i] + '</span>';
$('.myClass'+i).css('padding', '0 4px');
......@@ -4331,13 +4424,16 @@ function getSidePanel(x)
"<img src='' id = 'cloths"+x+"' height='40' width='40' style='float: left;border-radius: 90%;visibility:hidden;margin-left: -20px;' onmouseover='openImage(this,"+x+")' ></img>"+
"</td>"+
"<td style='width:98%;'>"+
"<table style = 'font-size:14px'>"+
"<table style = 'font-size:14px; width:95%';>"+
"<tr>"+
"<td><label id='main"+x+"' style='background-color: transparent;'></label></td>"+
"<td align = 'right' >"+
"<label id = 'pieces"+x+"'></label><label id = 'rate"+x+"'></label>"+
"</td>"+
"<input type='hidden' id='display' value='0' />"+
"</tr>"+
"<tr>"+
"<td><label id = 'pieces"+x+"'></label><label id = 'rate"+x+"'></label></td>"+
// "<td align = 'right' ><label id = 'pieces"+x+"'></label><label id = 'rate"+x+"'></label></td>"+
"</tr>"+
"</table>"+
"</td>"+
......@@ -4377,12 +4473,14 @@ function getSidePanel(x)
"</div>"+
"</div>"+
"</td>" +
"<td align='right' width = '10%'>"+
"<td align='right' width = '10%' style=visibility:hidden;>"+
"In Stock :"+
"</td>"+
"<td width = '10%'>" +
"<label id = 'item_parent_totalQuantity"+x+"'></label>"+
"<label style=visibility:hidden; id = 'item_parent_totalQuantity"+x+"'></label>"+
"<input type='hidden' id='totalquantity"+x+"' class='editDisplayClass' maxlength='0' ISCHANGED='false' readOnly = '1' style='width: 400px'/>"+
"</td>";
......@@ -4411,7 +4509,8 @@ function getSidePanel(x)
"</td>"+
"<td align = 'right' width = '20%'>"+
"Despatch Date: <input type='text' class='input_editable' size='8' value='' name='dspdate"+x+"' id='dspdate"+x+"' onkeydown = 'return false;' maxlength='8' placeholder = 'DD/MM/YY' onchange=\"javascript:setDespDate('"+x+"');\" /> "+
// "Despatch Date: <input type='text' class='input_editable' size='8' value='' name='dspdate"+x+"' id='dspdate"+x+"' onkeydown = 'return false;' maxlength='8' placeholder = 'DD/MM/YY' onchange=\"javascript:setDespDate('"+x+"');\" /> "+
"Despatch Date: <input type='text' class='input_editable' size='8' value='' name='dspdate"+x+"' id='dspdate"+x+"' maxlength='8' placeholder = 'DD/MM/YY' onkeydown=\"javascript:setDate('dspdate"+x+"');\" /> "+
"<img border='0' src='/ibase/webitm/images/calender.png' style = 'margin-bottom:-5px;margin-left:-1px;cursor: hand;' id='dspdate"+x+"' name='dspdate"+x+"' onClick=\"javascript:setDate('dspdate"+x+"');\" /> "+
"</td>"+
"<tr>"+
......@@ -4420,9 +4519,11 @@ function getSidePanel(x)
"</table>"+
"</div>"+
"<input type='hidden' id = 'deleteAccordian"+x+"' />"+
"<div class = 'totalQuantity' align = 'right'>" +
"<div class = 'totalQuantity' style=visibility:hidden; align = 'right'>" +
"<b>Total Quantity: </b><span id = 'sum"+x+"'></span>" +
"</div>"
"</div>";
return a;
......@@ -4644,17 +4745,107 @@ function setActiveTD(curTextObj)
curTextParent.id = "activeGreenTD";
}
/*
function myFunction(event) {
var x = event.which || event.keyCode;
if (x == 97) {
alert ("You pressed the Escape key!");
resetHeader();
}
// Adddedb By Kaustubh on 29 Nov 2017 Start
function getFom2Tables()
{
//alert("inside getForm2table");
var x = document.getElementsByClassName("headertableClass");
var totalLength = x.length;
//alert("x"+totalLength);
for (var i=0;i<totalLength;i++)
{
var rowss = x[i].rows;
var rowsLength = x[i].rows.length;
var closLength =rowss[i].cells.length;
var finalTot = new Array(closLength);
for(var r=1;r< rowsLength-1;r++)
{
var cell = rowss[r].cells;
//alert("cell"+cell);
var closLength =rowss[r].cells.length;
//alert("rowscells::"+x[i].rows[r].cells);
for(var c=3;c<closLength;c++)
{
// alert("colValue"+x[i].rows[r].cells[c].value);
//finalTot = finalTot[].push(cell[c].firstChild.value) ;
var cellVal = 0;
if(cell[c].firstChild.value == undefined ||cell[c].firstChild.value == "" || cell[c].firstChild.value == null)
{
// alert("inside cell");
cellVal = 0;
}
else
{
cellVal = (parseInt(cell[c].firstChild.value));
}
//else
//{
//console.log("value"+c+":"+(parseInt(cell[c].firstChild.value)));
finalTot[c] = (isNaN(finalTot[c])?0:finalTot[c]) + cellVal;
//console.log("finalTot[cc]"+finalTot[c]);
//}
//alert("cellVlaue"+cell[c].firstChild.value);
// alert("id"+cell[c].firstChild.id) ;
}
}
var lastRow = rowss[ rowsLength - 1 ].cells;
var celllength = rowss[ rowsLength - 1 ].cells.length;
for (var l=1;l< celllength;l++)
{
//alert("lastRowLength"+lastRow[l].firstChild.value);
//alert(finalTot[l]);
if(finalTot[l] == undefined)
{
///alert("inside if"+finalTot[l]);
finalTot[l] = 0;
}
lastRow[l].firstChild.value = finalTot[l+2];
}
}
}
function createXMLString1(objName)
{
localStorage.setItem('isResetFromOther','true');
var url = "/ibase/webitm/jsp/E12WizardPage.jsp?OBJ_NAME="+objName;
window.location.href = url;
//document.getElementById("reset").value.click;
//var resetOp = document.getElementById("reset1");
//alert("resetOp::"+resetOp);
//resetOp.click();
//setTimeout(function(){alert("after 1s");
//window.location.href = url;
//},1000);
}
// Adddedb By Kaustubh on 29 Nov 2017 End
/*
function myFunction1()
{
document.getElementById("sorderWizFormII").reset();
}
*/
/*
function myFunction1(event) {
var x = event.which || event.keyCode;
alert(x);
......@@ -4662,4 +4853,4 @@ function myFunction1(event) {
alert ("You pressed the Escape key1!");
// resetHeader();
}
}*/
}*/
\ 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