Commit 17c3eec3 authored by steurwadkar's avatar steurwadkar

Changes made for Group scheme in Sales Order html wizard screen

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@179917 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d823cf67
...@@ -6144,7 +6144,7 @@ function closePopUpOfScheme() ...@@ -6144,7 +6144,7 @@ function closePopUpOfScheme()
//added by kaustubh on 25 dec 2017 start //added by kaustubh on 25 dec 2017 start
function setCheckedScheme(rowID) function setCheckedScheme(rowID, schemeCode)
{ {
var qtyTextBox = document.getElementById("Detail2."+rowID+".disQty"); var qtyTextBox = document.getElementById("Detail2."+rowID+".disQty");
qtyTextBox.readOnly = false; qtyTextBox.readOnly = false;
...@@ -6156,6 +6156,7 @@ function setCheckedScheme(rowID) ...@@ -6156,6 +6156,7 @@ function setCheckedScheme(rowID)
if(obj.checked) if(obj.checked)
{ {
obj.setAttribute('checked','checked'); obj.setAttribute('checked','checked');
calAmount(rowID, schemeCode);
} }
else else
{ {
...@@ -6242,9 +6243,75 @@ function setCheckedScheme(rowID) ...@@ -6242,9 +6243,75 @@ function setCheckedScheme(rowID)
if(isDataSel) if(isDataSel)
{ {
console.log("jsonArray", jsonArray); console.log("jsonArray", jsonArray);
var schemeTable = document.getElementById("schemeDetails");
var schemeRows = schemeTable.rows;
var schemeJsonObj = new Array();
var schemeJsonStr = "";
for(var i=1; i<schemeRows.length; i++)
{
var schemeCode = document.getElementById("Detail2."+i+".applicable_scheme").value;
var schemeQty = document.getElementById("Detail2."+i+".quantity").value;
if(schemeJsonStr.indexOf(schemeCode)==-1)
{
schemeJsonStr += '"'+schemeCode+'":"'+schemeQty+'",';
}
}
schemeJsonStr = schemeJsonStr.substring(0,schemeJsonStr.length-1);
schemeJsonStr = "{"+schemeJsonStr+"}";
var schemeJsonObj = JSON.parse(schemeJsonStr);
var schemeKeys = Object.keys(schemeJsonObj);
var errSchemeStr = "";
for(var i=0; i<schemeKeys.length; i++)
{
var eachSchemeCode = schemeKeys[i];
var eachSchemeQty = schemeJsonObj[eachSchemeCode];
var utilisedQty = 0;
var utilisedQtyArry = document.getElementsByName("quantity_"+eachSchemeCode);
for(var j=0; j<utilisedQtyArry.length; j++)
{
var eachQty = utilisedQtyArry[j].value;
var chkBox = document.getElementById("Detail2."+(j+1)+".selectbox");
if(chkBox.checked)
{
if(!isNaN(eachQty))
utilisedQty += parseFloat(eachQty);
}
}
if(utilisedQty<eachSchemeQty)
{
errSchemeStr += eachSchemeCode +",";
}
}
errSchemeStr = errSchemeStr.substring(0, errSchemeStr.length-1);
if(errSchemeStr.trim().length > 0)
{
errSchemeStr = "You have not taken full free quantity for scheme(s) " + errSchemeStr;
errSchemeStr += "\n Do you want to continue?";
var flag = confirm(errSchemeStr);
if(flag)
{
document.getElementById("EXISITING_COL_VALUES").value = schemeInfoStr document.getElementById("EXISITING_COL_VALUES").value = schemeInfoStr
addRow('Details',jsonArray); addRow('Details',jsonArray);
} }
}
else
{
document.getElementById("EXISITING_COL_VALUES").value = schemeInfoStr
addRow('Details',jsonArray);
}
}
else else
{ {
//alert("Please select atleast one item."); //alert("Please select atleast one item.");
...@@ -6439,9 +6506,13 @@ function setCheckedScheme(rowID) ...@@ -6439,9 +6506,13 @@ function setCheckedScheme(rowID)
for(var i=0; i<qtyTknElems.length;i++) for(var i=0; i<qtyTknElems.length;i++)
{ {
var eachQty = qtyTknElems[i].value;console.log("eachQty["+isNaN(eachQty)+"]"); var eachQty = qtyTknElems[i].value;console.log("eachQty["+isNaN(eachQty)+"]");
var chkBox = document.getElementById("Detail2."+(i+1)+".selectbox");
if(chkBox.checked)
{
if(!isNaN(eachQty)) if(!isNaN(eachQty))
totQtyTkn += parseFloat(eachQty); totQtyTkn += parseFloat(eachQty);
} }
}
console.log("totQtyTkn["+totQtyTkn+"] maxAllowFreeQty["+maxAllowFreeQty+"]"); console.log("totQtyTkn["+totQtyTkn+"] maxAllowFreeQty["+maxAllowFreeQty+"]");
console.log("totQtyTkn>maxAllowFreeQty["+totQtyTkn>maxAllowFreeQty+"]"); console.log("totQtyTkn>maxAllowFreeQty["+totQtyTkn>maxAllowFreeQty+"]");
...@@ -6449,6 +6520,7 @@ function setCheckedScheme(rowID) ...@@ -6449,6 +6520,7 @@ function setCheckedScheme(rowID)
if(totQtyTkn>maxAllowFreeQty){ if(totQtyTkn>maxAllowFreeQty){
alert("Maximum free quantity cannot be more than "+ maxAllowFreeQty + " as per scheme code "+schemeCode); alert("Maximum free quantity cannot be more than "+ maxAllowFreeQty + " as per scheme code "+schemeCode);
document.getElementById("Detail2."+rowNo+".disQty").value = "0"; document.getElementById("Detail2."+rowNo+".disQty").value = "0";
document.getElementById("Detail2."+rowNo+".selectbox").checked = false;
} }
} }
......
...@@ -36,6 +36,13 @@ input:focus{ ...@@ -36,6 +36,13 @@ input:focus{
outline: none; outline: none;
} }
.table-body>tr>td {
word-wrap: break-word;
}
.tableClass {
table-layout: fixed;
}
</style> </style>
<script> <script>
...@@ -63,23 +70,26 @@ input:focus{ ...@@ -63,23 +70,26 @@ input:focus{
<thead class="table-head"> <thead class="table-head">
<tr class = "trClass"> <tr class = "trClass">
<th class="tHeader" nowrap="true" style="width:50px;"> <th class="tHeader" nowrap="true" style="width:40px;">
</th> </th>
<th class="tHeader" nowrap="true" valign="bottom"> <th class="tHeader" nowrap="true" valign="bottom">
Scheme Code Scheme Code
</th> </th>
<th class="tHeader" nowrap="false" style="max-width:100px;" valign="bottom">
Scheme Description
</th>
<th class="tHeader" nowrap="true" valign="bottom"> <th class="tHeader" nowrap="true" valign="bottom">
Item Code Item Code
</th> </th>
<th class="tHeader" nowrap="true" valign="bottom"> <th class="tHeader" nowrap="false" style="max-width:100px;" valign="bottom">
Item Description Item Description
</th> </th>
<th class="tHeader" nowrap="true" valign="bottom" align="right"> <th class="tHeader" nowrap="true" valign="bottom" align="right">
Free Quantity Free Quantity
</th> </th>
<th class="tHeader" style="width:230px;" nowrap="true" valign="bottom" align="right"> <th class="tHeader" nowrap="true" valign="bottom" align="right">
Free Quantity taken Free Quantity taken
</th> </th>
...@@ -94,7 +104,7 @@ input:focus{ ...@@ -94,7 +104,7 @@ input:focus{
style="width:100%;border:none;text-align: right; outline:none" maxlength="10" /> --> style="width:100%;border:none;text-align: right; outline:none" maxlength="10" /> -->
<Input type='checkbox' class="editInputClass editInputCur messageCheckbox" value="{$domId}" name="Detail2.{normalize-space($domId)}.selectbox" <Input type='checkbox' class="editInputClass editInputCur messageCheckbox" value="{$domId}" name="Detail2.{normalize-space($domId)}.selectbox"
id="Detail2.{normalize-space($domId)}.selectbox" onclick="setCheckedScheme('{$domId}');" style="width:100%;border:none;text-align: right; outline:none" maxlength="10" /> id="Detail2.{normalize-space($domId)}.selectbox" onclick="setCheckedScheme('{$domId}', '{applicable_scheme}');" style="width:100%;border:none;text-align: right; outline:none" maxlength="10" />
</td> </td>
...@@ -105,6 +115,16 @@ input:focus{ ...@@ -105,6 +115,16 @@ input:focus{
style="width:100px;background-color: transparent;border: none;color:#666666;" tabindex="-1"/> style="width:100px;background-color: transparent;border: none;color:#666666;" tabindex="-1"/>
</td>
<td style="max-width:100px;color:#666666;">
<xsl:value-of select="scheme_descr"/>
<input type="hidden" maxlength="4" readOnly = "1"
value="{scheme_descr}" name="Detail2.{normalize-space($domId)}.scheme_descr" id="Detail2.{normalize-space($domId)}.scheme_descr"
style="width:100px;background-color: transparent;border: none;color:#666666;" tabindex="-1"/>
</td> </td>
<td nowrap="true"> <td nowrap="true">
...@@ -114,8 +134,9 @@ input:focus{ ...@@ -114,8 +134,9 @@ input:focus{
</td> </td>
<td nowrap="true"> <td style="max-width:100px;color:#666666;">
<input type="text" maxlength="4" readOnly = "1" <xsl:value-of select="item_descr"/>
<input type="hidden" maxlength="4" readOnly = "1"
value="{item_descr}" name="Detail2.{normalize-space($domId)}.item_descr" id="Detail2.{normalize-space($domId)}.item_descr" value="{item_descr}" name="Detail2.{normalize-space($domId)}.item_descr" id="Detail2.{normalize-space($domId)}.item_descr"
style="width:300px;background-color: transparent;border: none;color:#666666;" tabindex="-1"/> style="width:300px;background-color: transparent;border: none;color:#666666;" tabindex="-1"/>
</td> </td>
......
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