Commit 5046c5cc authored by awarekar's avatar awarekar

Sales Budget Cust Wizard related changes

- Created Pre save component .
- Function to Save only edited details and function to Disable buttons
- display item description at bottom
- and display related changes (set width of item , height of div )

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@198819 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6d9dc438
package ibase.webitm.ejb.fin;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
public class SalesBudgetCustPreSaveWizEJB extends ValidatorEJB
{
E12GenericUtility genericUtility = new E12GenericUtility();
public String preSave() throws RemoteException,ITMException
{
return "";
}
public String preSave(String xmlString, String editFlag, String xtraParams, Connection conn)throws RemoteException,ITMException
{
System.out.println(" preSave called 2 ==> "+xmlString);
String errString = "";
Document dom = null;
try
{
if (xmlString != null && xmlString.trim().length() > 0)
{
dom = genericUtility.parseString(xmlString);
errString = executepreSave( dom, editFlag, xtraParams, conn );
}
}
catch(Exception e)
{
System.out.println("Exception :ShipmentPrs :" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return errString;
}
public String executepreSave( Document dom, String editFlag, String xtraParams, Connection conn ) throws RemoteException, ITMException, SQLException
{
System.out.println("executepreSave method called \t editFlag is ["+editFlag+"]");
String errString = "";
NodeList parentNodeList = null;
Node parentNode = null;
String updateFlag="";
int parentNodeListLength=0 ,cnt =0,cnt2=0;
boolean isLocCon = false;
boolean isError = false;
String sql="",sql2="",sql3="",custCode="", posCode="", itemSer = "", acctPrd="", tranId = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
if (conn == null || conn.isClosed())
{
conn = getConnection();
isLocCon = true;
}
parentNodeList = dom.getElementsByTagName("Detail1");
parentNodeListLength = parentNodeList.getLength();
custCode = checkNull(genericUtility.getColumnValue("cust_code",dom));
posCode = checkNull(genericUtility.getColumnValue("pos_code",dom));
itemSer = checkNull(genericUtility.getColumnValue("item_ser",dom));
acctPrd = checkNull(genericUtility.getColumnValue("acct_prd",dom));
sql ="SELECT * FROM SALES_BUDGET_CUST WHERE CUST_CODE =? and POS_CODE = ? and ITEM_SER = ? and ACCT_PRD = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, custCode);
pstmt.setString(2, posCode);
pstmt.setString(3, itemSer);
pstmt.setString(4, acctPrd);
rs = pstmt.executeQuery();
while (rs.next())
{
tranId = checkNull(rs.getString("TRAN_ID"));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println("x==> tranIds :"+tranId);
if ( tranId != null )
{
sql2 = "DELETE FROM SALES_BUDGET_CUST WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql2);
pstmt.setString(1, tranId);
cnt =pstmt.executeUpdate();
if( cnt > 0)
{
System.out.println("x==> DELETE of SALES_BUDGET_CUST success ["+cnt+"]");
}
pstmt.close();
pstmt = null;
sql3 = "DELETE FROM SALES_BUDGET_CUST_DET WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql3);
pstmt.setString(1, tranId);
cnt =pstmt.executeUpdate();
if( cnt2 > 0)
{
System.out.println("x==> DELETE of SALES_BUDGET_CUST_DET success ["+cnt2+"]");
}
pstmt.close();
pstmt = null;
}
else
{
System.out.println("x==> TranID in NULL !");
}
}
catch(Exception e)
{
System.out.println("The Exception occurs in CostallocPrs :"+e);
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
System.out.println("Inside finally CostCtrAllocPosEJB isError["+isError+"] connStatus["+isLocCon+"]");
if(isLocCon)
{
if(isError)
{
System.out.println("Inside rollbacking....");
conn.rollback();
}
else
{
System.out.println("Inside committing....");
conn.commit();
}
if (conn != null )
{
conn.close();
}
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
return errString;
}
private String checkNull( String input )
{
return E12GenericUtility.checkNull( input );
}
}
......@@ -404,7 +404,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
String childNodeName = null,custCode="",posCode="",custName="",posD="",posDescr="",itmDes="",priceDesc="";
int childNodeListLength=0;
int ctr=0,count=1;
String chgTerm="",siteCode="",currDate="",userId="",itemCode="",itemUnit="",rate="",nullVar="",itemDescr="";
String chgTerm="",siteCode="",currDate="",userId="",itemCode="",itemUnit="",rate="",nullVar="",itemDescr="",itemInfo="";
ArrayList<String> acctPrdlist=new ArrayList<String>();
try
{
......@@ -662,7 +662,16 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
itemCode = rs.getString("ITEM_CODE");
itemDescr = rs.getString("SH_DESCR");
itemUnit = rs.getString("UNIT");
System.out.println("ITEM_CODE"+itemCode+" item_desc" + itemDescr);
if (itemDescr == null )
{
itemInfo = itemCode;
}
else
{
itemInfo = itemDescr+" ("+itemCode+")";
}
System.out.println("ITEM_CODE"+itemCode+" item_desc" + itemDescr+ "and Last itemInfo="+itemInfo);
String sql5 = "SELECT RATE FROM PRICELIST WHERE ITEM_CODE = ?";
pstmt2 = conn.prepareStatement( sql5 );
......@@ -684,7 +693,7 @@ public class SalesBudgetCustWizEJB extends ValidatorEJB
valueXmlString.append("<attribute selected=\"Y\" updateFlag=\"E\" status=\"O\" pkNames=\"\"/>\r\n");
valueXmlString.append("<prd_code><![CDATA[" + acctPrdlist.get(i) + "]]></prd_code>");
valueXmlString.append("<item_code><![CDATA[" + itemCode + "]]></item_code>");
valueXmlString.append("<item_descr><![CDATA[" + itemDescr + "]]></item_descr>");
valueXmlString.append("<item_descr><![CDATA[" + itemInfo + "]]></item_descr>");
valueXmlString.append("<item_ser><![CDATA[" + itemSer + "]]></item_ser>");
valueXmlString.append("<quantity><![CDATA[" + initialQnty + "]]></quantity>");
valueXmlString.append("<unit><![CDATA[" + itemUnit + "]]></unit>");
......
......@@ -134,7 +134,7 @@ border: 1px solid #E7E7E7 !important;
<TABLE border="0" width="99%" height="2%" class="header_td" cellpadding="0" cellspacing="0" style="background-color: #f7f8fa;">
<TR>
<TD class="header_main" nowrap="true" align="left" valign="middle" style="padding-left: 10px;font-size:16px;" width="2%" >
<TD class="header_main" nowrap="true" align="left" valign="middle" style="padding-left: 10px;font-size:18px;" width="2%" >
Salses Budget
</TD>
......@@ -233,7 +233,7 @@ border: 1px solid #E7E7E7 !important;
<tr width ="100%">
<td class="td_rightAlign" nowrap="true" width = "1%">
<strong>Customer code: </strong>
<strong>Customer Code : </strong>
</td>
<td class="td_leftAlign" >
<input type="text" value="{$cust_code}" class="input_editable" name="Detail1.{normalize-space($dbID)}.cust_code" id="Detail1.{normalize-space($dbID)}.cust_code" placeholder="Enter Customer code" maxlength="10" onchange="callItemChange('{normalize-space($dbID)}', 'cust_code');" ISCHANGED="false"/>
......@@ -245,7 +245,7 @@ border: 1px solid #E7E7E7 !important;
<tr width ="100%">
<td class="td_rightAlign" nowrap="true" width = "1%" >
<strong>POS code*: </strong>
<strong>Position Code* : </strong>
</td>
<td class="td_leftAlign" >
<input type="text" class="input_editable" value="{$pos_code}" name="Detail1.{normalize-space($dbID)}.pos_code" id="Detail1.{normalize-space($dbID)}.pos_code" placeholder="Enter POS code" maxlength="10" onchange="callItemChange('{normalize-space($dbID)}', 'pos_code');" ISCHANGED="false"/>
......@@ -257,7 +257,7 @@ border: 1px solid #E7E7E7 !important;
<tr width ="100%">
<td class="td_rightAlign" nowrap="true" width = "1%" >
<strong>Item series*: </strong>
<strong>Item Series* : </strong>
</td>
<td class="td_leftAlign" >
<input type="text" class="input_editable" value="{$item_ser}" name="Detail1.{normalize-space($dbID)}.item_ser" id="Detail1.{normalize-space($dbID)}.item_ser" placeholder="Enter Item series" maxlength="5" onchange="callItemChange('{normalize-space($dbID)}', 'item_ser');" ISCHANGED="false"/>
......@@ -269,10 +269,10 @@ border: 1px solid #E7E7E7 !important;
<tr width ="100%">
<td class="td_rightAlign" nowrap="true" width = "1%" >
<strong>Price List*: </strong>
<strong>Price List* : </strong>
</td>
<td class="td_leftAlign" >
<input type="text" value="{$price_list}" class="input_editable" name="Detail1.{normalize-space($dbID)}.price_list" id="Detail1.{normalize-space($dbID)}.price_list" placeholder="Enter Price List" maxlength="200" onchange="callItemChange('{normalize-space($dbID)}', 'price_list');" ISCHANGED="false" />
<input type="text" value="{$price_list}" class="input_editable" name="Detail1.{normalize-space($dbID)}.price_list" id="Detail1.{normalize-space($dbID)}.price_list" placeholder="Enter Price List" maxlength="5" onchange="callItemChange('{normalize-space($dbID)}', 'price_list');" ISCHANGED="false" />
<a href="javascript:callPriceList( '{normalize-space($dbID)}','{normalize-space($price_list)}' );"> <img src="/ibase/webitm/images/pophelp.png" border="0"/> </a>
<input type="text" value="{$prc_descr}" class="input_editable" name="Detail1.{normalize-space($dbID)}.prc_descr" id="Detail1.{normalize-space($dbID)}.prc_descr" maxlength="5" style="width:300px" ISCHANGED="false" readonly="true" />
</td>
......@@ -281,7 +281,7 @@ border: 1px solid #E7E7E7 !important;
<tr width ="100%">
<td class="td_rightAlign" nowrap="true" width = "1%" >
<strong>Account Period*:</strong>
<strong>Account Period* :</strong>
</td>
<td class="td_leftAlign" >
<input type="text" class="input_editable" value="{$acct_prd}" name="Detail1.{normalize-space($dbID)}.acct_prd" id="Detail1.{normalize-space($dbID)}.acct_prd" placeholder="Enter Period" maxlength="6" ISCHANGED="false"/>
......@@ -325,7 +325,7 @@ border: 1px solid #E7E7E7 !important;
<tr width ="100%">
<td class="td_rightAlign" nowrap="true" width = "1%">
<strong>Remarks: </strong>
<strong>Remarks : </strong>
</td>
<td class="td_leftAlign" >
<input type="text" value="{$remarks}" class="input_editable" name="Detail1.{normalize-space($dbID)}.remarks" id="Detail1.{normalize-space($dbID)}.remarks" maxlength="200" style="width:450px" ISCHANGED="false" />
......
......@@ -3,7 +3,8 @@
<xsl:output method="html"/>
<xsl:decimal-format NaN="0"/>
<xsl:key name="item_code" match="//Detail2/item_code/text()" use="." />
<!--<xsl:key name="item_code" match="//Detail2/item_code/text()" use="." /> -->
<xsl:key name="item_descr" match="//Detail2/item_descr/text()" use="." />
<xsl:template match="/">
......@@ -137,13 +138,12 @@ border: 1px solid #E7E7E7 !important;
</style>
<link type="text/css" rel="stylesheet" href="/ibase/webitm/xsl/Standard/WIZARD/css/htmlWizard.css"/>
<form name = "Wizard_activity" METHOD="POST" ACTION="/ibase/ITMWizardHandlerServlet" style="background-color: #f7f8fa;" onSubmit="javascript:disableButtons(1);">
<form name = "Wizard_activity" METHOD="POST" ACTION="/ibase/ITMWizardHandlerServlet" style="background-color: #f7f8fa;" onSubmit="disableButtons()">
<!-- changed by rahul barve on 6-apr-2015 [Start]-->
<TABLE border="0" width="99%" height="2%" class="header_td" cellpadding="0" cellspacing="0" style="background-color: #f7f8fa;">
<TR>
<TD class="header_main" nowrap="true" align="left" valign="middle" style="padding-left: 10px;font-size:16px;" width="2%" >
<TD class="header_main" nowrap="true" align="left" valign="middle" style="padding-left: 10px;font-size:18px;" width="2%" >
Salses Budget
</TD>
......@@ -204,19 +204,19 @@ border: 1px solid #E7E7E7 !important;
</xsl:for-each>
</table>
<table id="activityTable" Class="editDisplayColumnClass" cellSpacing="0" width="100%" cellPadding="5">
<div id="dataDiv" class="editDisplayColumnClass" style="overflow: auto;" >
<table id="activityTable" cellSpacing="0" width="100%" cellPadding="5">
<tr width ="100%">
<td class="td_leftAlign" nowrap="true" width = "1%">
<strong>Item Code</strong>
<strong>Item </strong>
</td>
<!-- <xsl:for-each select="/items/item/products/product/text()[generate-id() = generate-id(key('product',.)[1])]"> -->
<xsl:for-each select="//Detail2/item_code/text()[generate-id()= generate-id(key('item_code',.)[1])]">
<xsl:for-each select="//Detail2/item_descr/text()[generate-id()= generate-id(key('item_descr',.)[1])]">
<xsl:variable name="parent_item_code"><xsl:value-of select="."/></xsl:variable>
<xsl:variable name="parent_item_descr"><xsl:value-of select="."/></xsl:variable>
<xsl:variable name="position" select="position() - 1"/>
<xsl:for-each select="//Detail2">
......@@ -229,10 +229,11 @@ border: 1px solid #E7E7E7 !important;
<xsl:variable name="item_ser"><xsl:value-of select="item_ser"/></xsl:variable>
<xsl:variable name="item_code"><xsl:value-of select="item_code"/></xsl:variable>
<xsl:variable name="net_amt"><xsl:value-of select="net_amt"/></xsl:variable>
<xsl:variable name="item_descr"><xsl:value-of select="item_descr"/></xsl:variable>
<xsl:if test="$parent_item_code = $item_code and $position = 1">
<xsl:if test="$parent_item_descr = $item_descr and $position = 1">
<td class="td_leftAlign" style="text-align:center" >
<xsl:value-of select="prd_code"/>
<xsl:value-of select="prd_code"/>
</td>
</xsl:if>
</xsl:for-each>
......@@ -240,12 +241,12 @@ border: 1px solid #E7E7E7 !important;
</xsl:for-each>
</tr>
<xsl:for-each select="//Detail2/item_code/text()[generate-id()= generate-id(key('item_code',.)[1])]">
<xsl:for-each select="//Detail2/item_descr/text()[generate-id()= generate-id(key('item_descr',.)[1])]">
<xsl:variable name="parent_item_code"><xsl:value-of select="."/></xsl:variable>
<xsl:variable name="parent_item_descr"><xsl:value-of select="."/></xsl:variable>
<tr width ="100%">
<td class="td_leftAlign" nowrap="true" style="width:100px">
<strong><xsl:value-of select="$parent_item_code"/></strong>
<td class="td_leftAlign" nowrap="true" style="max-width: 333px;">
<strong><xsl:value-of select="$parent_item_descr"/></strong>
</td>
<xsl:for-each select="//Detail2">
......@@ -259,21 +260,34 @@ border: 1px solid #E7E7E7 !important;
<xsl:variable name="item_code"><xsl:value-of select="item_code"/></xsl:variable>
<xsl:variable name="rate"><xsl:value-of select="rate"/></xsl:variable>
<xsl:variable name="net_amt"><xsl:value-of select="net_amt"/></xsl:variable>
<xsl:variable name="item_descr"><xsl:value-of select="item_descr"/></xsl:variable>
<xsl:variable name="zeroQuantity"><xsl:value-of select="0"/></xsl:variable>
<xsl:if test="$parent_item_code = $item_code">
<xsl:if test="$parent_item_descr = $item_descr">
<td class="td_leftAlign" style="width:70px;text-align:center" >
<input type="checkbox" name="Detail2.{normalize-space($dbID)}.selectbox" id="Detail2.{normalize-space($dbID)}.selectbox" checked = 'Y' value="true" style="display:none;" />
<input type="number" value="{$quantity}" class="input_editable" name="Detail2.{normalize-space($dbID)}.quantity" id="Detail2.{normalize-space($dbID)}.quantity" style="width:60px;text-align:right" ISCHANGED="false" onchange="setNetAmount( '{normalize-space($dbID)}' );" />
<xsl:choose>
<xsl:when test="$quantity = $zeroQuantity">
<input type="checkbox" name="Detail2.{normalize-space($dbID)}.selectbox" id="Detail2.{normalize-space($dbID)}.selectbox" checked = 'N' value="false" style="display:none;" />
</xsl:when>
<xsl:otherwise>
<input type="checkbox" name="Detail2.{normalize-space($dbID)}.selectbox" id="Detail2.{normalize-space($dbID)}.selectbox" checked = 'Y' value="true" style="display:none;" />
</xsl:otherwise>
</xsl:choose>
<input type="number" value="{$quantity}" class="input_editable" name="Detail2.{normalize-space($dbID)}.quantity" id="Detail2.{normalize-space($dbID)}.quantity" style="width:60px;text-align:right" maxlength="6" ISCHANGED="false" onfocus="displayItemRate('{normalize-space($dbID)}');" onchange="setNetAmount( '{normalize-space($dbID)}' );" />
<input type="hidden" value="{$unit}" name="Detail2.{normalize-space($dbID)}.unit" id="Detail2.{normalize-space($dbID)}.unit" ISCHANGED="false"/>
<input type="hidden" value="{$rate}" name="Detail2.{normalize-space($dbID)}.rate" id="Detail2.{normalize-space($dbID)}.rate" ISCHANGED="false" readonly="true" />
<input type="hidden" value="{$net_amt}" name="Detail2.{normalize-space($dbID)}.net_amt" id="Detail2.{normalize-space($dbID)}.net_amt" ISCHANGED="false" readonly="true" />
<input type="hidden" value="{$item_descr}" name="Detail2.{normalize-space($dbID)}.item_descr" id="Detail2.{normalize-space($dbID)}.item_descr" ISCHANGED="false" readonly="true" />
<!--<input type="hidden" value="{$tran_id}" name="Detail2.{normalize-space($dbID)}.tran_id" id="Detail2.{normalize-space($dbID)}.tran_id" ISCHANGED="false"/>-->
<input type="hidden" value="{$prd_code}" name="Detail2.{normalize-space($dbID)}.prd_code" id="Detail2.{normalize-space($dbID)}.prd_code" ISCHANGED="false"/>
<input type="hidden" value="{$item_code}" name="Detail2.{normalize-space($dbID)}.item_code" id="Detail2.{normalize-space($dbID)}.item_code" ISCHANGED="false"/>
<input type="hidden" value="{$item_ser}" name="Detail2.{normalize-space($dbID)}.item_ser" id="Detail2.{normalize-space($dbID)}.item_ser" ISCHANGED="false"/>
<input type="hidden" value="{$line_no}" name="Detail2.{normalize-space($dbID)}.line_no" id="Detail2.{normalize-space($dbID)}.line_no" ISCHANGED="false"/>
<input type="hidden" value="{$line_no}" name="Detail2.{normalize-space($dbID)}.line_no" id="Detail2.{normalize-space($dbID)}.line_no" ISCHANGED="false"/>
</td>
</xsl:if>
</xsl:for-each>
......@@ -282,104 +296,21 @@ border: 1px solid #E7E7E7 !important;
</xsl:for-each>
<!-- <xsl:for-each select="/Detail2/prd_code/text()[generate-id()= generate-id(key('prd_code',.)[1])]">
<li>
<xsl:variable name="compare1"><xsl:value-of select="."/></xsl:variable>
<xsl:for-each select="//Detail2">
<xsl:variable name="dbID"><xsl:value-of select="@domID"/></xsl:variable>
<xsl:variable name="tran_id"><xsl:value-of select="tran_id"/></xsl:variable>
<xsl:variable name="line_no"><xsl:value-of select="line_no"/></xsl:variable>
<xsl:variable name="quantity"><xsl:value-of select="quantity"/></xsl:variable>
<xsl:variable name="unit"><xsl:value-of select="unit"/></xsl:variable>
<xsl:variable name="prd_code"><xsl:value-of select="prd_code"/></xsl:variable>
<xsl:variable name="item_ser"><xsl:value-of select="item_ser"/></xsl:variable>
<xsl:variable name="item_code"><xsl:value-of select="item_code"/></xsl:variable>
<tr width ="100%">
<td class="td_leftAlign" >
<input type="text" value="{$compare1}" class="input_editable" name="Detail2.{normalize-space($dbID)}.compare1" id="Detail2.{normalize-space($dbID)}.compare1" ISCHANGED="false" readonly="true" />
</td>
</tr>
</li>
</xsl:for-each> -->
<!--<xsl:for-each select="//Detail2">
<xsl:variable name="dbID"><xsl:value-of select="@domID"/></xsl:variable>
<xsl:variable name="tran_id"><xsl:value-of select="tran_id"/></xsl:variable>
<xsl:variable name="line_no"><xsl:value-of select="line_no"/></xsl:variable>
<xsl:variable name="quantity"><xsl:value-of select="quantity"/></xsl:variable>
<xsl:variable name="unit"><xsl:value-of select="unit"/></xsl:variable>
<xsl:variable name="prd_code"><xsl:value-of select="prd_code"/></xsl:variable>
<xsl:variable name="item_ser"><xsl:value-of select="item_ser"/></xsl:variable>
<xsl:variable name="item_code"><xsl:value-of select="item_code"/></xsl:variable>
<xsl:choose>
<xsl:when test="$item_code = $compare1">
Equal...
</xsl:when>
<xsl:otherwise>
<tr width ="100%">
<td class="td_leftAlign" >
<input type="text" value="{$item_code}" class="input_editable" name="Detail2.{normalize-space($dbID)}.item_code" id="Detail2.{normalize-space($dbID)}.item_code" ISCHANGED="false" readonly="true" />
</td>
</tr>
<xsl:variable name="compare1" select="item_code"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:for-each select="//prd_code">
<tr width ="100%">
<td class="td_rightAlign" nowrap="true" width = "1%">
<strong> Account Period </strong>
</td>
<td class="td_leftAlign" >
<input type="text" value="{$prd_code}" class="input_editable" name="Detail2.{normalize-space($dbID)}.prd_code" id="Detail2.{normalize-space($dbID)}.prd_code" ISCHANGED="false" readonly="true" />
</td>
</tr> -->
<!--<tr width ="100%">
<td class="td_leftAlign" >
<input type="text" value="{$prd_code}" class="input_editable" name="Detail2.{normalize-space($dbID)}.prd_code" id="Detail2.{normalize-space($dbID)}.prd_code" ISCHANGED="false" readonly="true" />
</td>
</tr>
<tr width ="100%">
<td class="td_leftAlign" >
<input type="text" value="{$item_code}" class="input_editable" name="Detail2.{normalize-space($dbID)}.item_code" id="Detail2.{normalize-space($dbID)}.item_code" ISCHANGED="false" readonly="true" />
</td>
<td class="td_leftAlign" >
<input type="text" value="{$prd_code}" class="input_editable" name="Detail2.{normalize-space($dbID)}.prd_code" id="Detail2.{normalize-space($dbID)}.prd_code" ISCHANGED="false" readonly="true" />
</td>
</tr>
</xsl:for-each>-->
</table>
</div>
<table>
<tr width ="100%">
<td colspan="2">
<input type="hidden" value="2" name="FORM_NO" ID="FORM_NO" />
<input type="hidden" value="sales_budget_cust_wiz" name="OBJ_NAME" />
<input type="hidden" value="" name="action" id="action" />
<input type="button" style="cursor:hand" CLASS="button" value="Cancel" name = "ActNext" id = "ActNext" title='' onclick="window.location.href='/ibase/webitm/jsp/E12WizardPage.jsp?OBJ_NAME=sales_budget_cust_wiz&amp;FORM_NO=1'"/>
<input type="button" style="cursor:hand" CLASS="button" value="Cancel" name = "ActNext" id = "ActPrevious" title='' onclick="window.location.href='/ibase/webitm/jsp/E12WizardPage.jsp?OBJ_NAME=sales_budget_cust_wiz&amp;FORM_NO=1'"/>
<input type="submit" style="cursor:hand" CLASS="button" value="Finish" name = "ActNext" id = "ActNext" title='' onclick="setActionVal('finish')"/>
</td>
<TD class="header_main" nowrap="true" align="right" valign="middle" style="padding-left: 10px;font-size:16px;" width="20%" >
<span id="Label_item_code_disp" style="font-size:15px;color: black;"></span><span id="item_code_disp" style="font-size:13px;color: grey;"></span>&#160;&#160;&#160;
<span id="Label_rate_disp" style="font-size:15px;color: black;"></span><span id="rate_disp" style="font-size:13px;color: grey;"></span>
</TD>
</tr>
</table>
......
......@@ -123,6 +123,66 @@ function displayPrdActivity( prdCode, prdDescr )
}
}
////////////////////////////////////////////////////// Display Rate in Div ////////////////////////////////////////////////////
function displayItemRate( dbId )
{
console.log("In displayItemRate");
var itamInfo = "";
var itemLabel = "Item: ";
var rateLabel = "Rate: ";
//var itemCode = document.getElementById("Detail2."+dbId+".item_code").value;
var itemDesc = document.getElementById("Detail2."+dbId+".item_descr").value;
if(itemDesc == null || itemDesc.length ==0 || itemDesc == "null")
{
console.log("In if"+itemDesc);
itamInfo = itemCode;
}
else
{
console.log("In else"+itemDesc);
//itamInfo = itemCode+" ( "+itemDesc+" )";
itamInfo = itemDesc;
}
var ItemRate = document.getElementById("Detail2."+dbId+".rate").value;
document.getElementById("Label_item_code_disp").innerHTML = itemLabel;
document.getElementById("Label_rate_disp").innerHTML = rateLabel;
document.getElementById("item_code_disp").innerHTML = itamInfo;
document.getElementById("rate_disp").innerHTML = ItemRate;
}
////////////////////////////////////////////////// Set height to Div ///////////////////////////////////////////////////////////
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function')
{
window.onload = func;
}
else
{
window.onload = function()
{
if (oldonload)
{
oldonload();
}
func();
}
}
}
addLoadEvent(setDivHeight);
function setDivHeight()
{
console.log("ameylll");
document.getElementById("dataDiv").style.height = (window.innerHeight - 140 ) + "px";
}
//////////////////////////////////////////////////////NET AMOUNT ////////////////////////////////////////////////////
......@@ -209,19 +269,17 @@ function doHideMsg(str)
document.getElementById(str).style.display = 'none';
}
function disableButtons(formNo)
function disableButtons()
{
if (formNo == 1)
{
//console.log("disable button form 1 called");
document.Wizard_activity.ActNext.disabled = true;
}
else if (formNo == 2)
{
//console.log("disable button form 1 called");
document.Wizard_Travel.Cancel.disabled = true;
document.Wizard_Travel.Finish.disabled = true;
}
console.log("disable button form 2 called");
if(document.getElementById("ActPrevious") != null && document.getElementById("ActPrevious") != 'undefined')
{
document.getElementById("ActPrevious").disabled = true;
}
if(document.getElementById("ActNext") != null && document.getElementById("ActNext") != 'undefined')
{
document.getElementById("ActNext").disabled = true;
}
}
function setNetAmount( dbId )
......@@ -238,8 +296,19 @@ function setNetAmount( dbId )
alert("Quantity can't be Negative! Please enter valid Quantity");
document.getElementById("Detail2."+dbId+".quantity").focus();
}
else if ( qty == 0)
{
//alert("Quantity equals 0");
document.getElementById("Detail2."+dbId+".selectbox").checked = false;
document.getElementById("Detail2."+dbId+".selectbox").value = "false";
document.getElementById("Detail2."+dbId+".selectbox").setAttribute('checked','N');
}
else
{
document.getElementById("Detail2."+dbId+".selectbox").checked = true;
document.getElementById("Detail2."+dbId+".selectbox").value = "true";
document.getElementById("Detail2."+dbId+".selectbox").setAttribute('checked','Y');
obj1 = document.getElementById("Detail2."+dbId+".rate");
var rate = trims(obj1.value);
var amt = qty * rate ;
......
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