<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:decimal-format NaN="0"/>

<xsl:template match="/">

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body >
<script type="text/javascript" src="/ibase/webitm/js/ITMWizardCalendar.js"></script>

<script>
<![CDATA[
	var calendertop = 100;
	var calenderleft = 200;
	var selectedObj = null;
	var global_date_format ="dd/MM/yy";
	var global_date_type= "date";
	var fieldName;
	var objCur = "";
	var preObj="";
	
		
		function gotFocus(obj)
		{	 
			
		   var str="";		
		   var srv=obj.getAttribute("SRVCALLONCHANGE");
		   var name=obj.getAttribute("name");		
			
			if(srv =="true")
			{				
				document.getElementById(name+"__img").style.visibility="visible";
			}
			
			document.getElementById("Detail1..sundry_type_fr").select();
					
		}
		function gotBlur(obj)
		{
		
		  preObj = obj;
		  var blur=obj.getAttribute("name");
		
		  
		     document.getElementById(blur+"__img").style.visibility="hidden";		  
		  
		}

	function assignDate( date )
	{
	document.getElementById( selectedObj ).value = date;
	document.getElementById( selectedObj ).focus();
	}

	function checkBlank()
	{
		var fromTranDate = document.getElementById( "Detail1..from_tran_date" ).value;
		var toTranDate = document.getElementById( "Detail1..to_tran_date" ).value;
		var siteCodeFr = document.getElementById( "Detail1..site_code_fr" ).value;
		var siteCodeTo = document.getElementById( "Detail1..site_code_to" ).value;
		var sundryTypeFr = document.getElementById( "Detail1..sundry_type_fr" ).value;
		var sundryTypeTo = document.getElementById( "Detail1..sundry_type_to" ).value;
		var sundryCodeFr = document.getElementById( "Detail1..sundry_code_fr" ).value;
		var sundryCodeTo = document.getElementById( "Detail1..sundry_code_to" ).value;		
		
		
		if (fromTranDate.length <= 0)
		{
			alert("Please enter from Date");
			return false;
		} else if (toTranDate.length <= 0)
		{
			alert("Please enter to Date");
			return false;
		} else if (siteCodeFr.length <= 0)
		{
			alert("Please enter from Site Code");
			return false;
		} else if (siteCodeTo.length <= 0)
		{
			alert("Please enter to Site Code");
			return false;
		} else if (sundryTypeFr.length <= 0)
		{
			alert("Please enter from Sundry Type");
			return false;
		} else if (sundryTypeTo.length <= 0)
		{
			alert("Please enter to Sundry Type");
			return false;
		} else if (sundryCodeFr.length <= 0)
		{
			alert("Please enter from Sundry Code");
			return false;
		} else if (sundryCodeTo.length <= 0)
		{
			alert("Please enter to Sundry Code");
			return false;
		} else {
			return true;
		}
	}
	
	function setSundryCode(value)
	{		
		document.getElementById("Detail1.."+fieldName).value = value;
	}

	function callPopUpJSP( value )
	{	
		fieldName = value;
		var url = '/ibase/webitm/jsp/PopUp.jsp?OBJ_NAME=intercomp_reconcile&FIELDNAME='+fieldName;
		var win = window.open( url, '_blank', 'toolbar=no,status=yes,resizable=no,scrollbars=yes,left=200,top=100,width=500,height=406' );
	}
	function callSundryPopUpJSP( value , type)
	{
		fieldName = value;
		var sundryCodeType=document.getElementById( "Detail1.."+type ).value;	
		alert("Type-- "+sundryCodeType)	;
		fieldName = value;
		var url = '/ibase/webitm/jsp/Reconcilepophelp.jsp?OBJ_NAME=intercomp_reconcile&SUNDRYTYPE='+sundryCodeType;
		var win = window.open( url, '_blank', 'toolbar=no,status=yes,resizable=no,scrollbars=yes,left=200,top=100,width=500,height=406' );
	}
	function assignValue(text){
	    document.getElementById('Detail1..'+fieldName).value = text;
	}
]]>

</script>

<style type="text/css">

.tableClass
{margin-left:10px;margin-top:20px}

.header_td
{border:inset 0;background:#FFCCCC;font-family:verdana;font-size:11pt;text-align:center}

.input_editable
{border:inset 2;color:#102132;background:#D7E5F9;text-align:left;font-family:verdana;font-size:9pt}

.td_leftAlign
{background:#D7E5F9;text-align:left;font-family:verdana;font-size:9pt}


</style>

<form name = "Wizard_activity" METHOD="POST" ACTION="/ibase/ITMWizardHandlerServlet" onSubmit="javascript:return checkBlank();return validateActivity('1');">

 
	
	<table id="activityTable" class="tableClass" border="0" cellSpacing="2" cellPadding="1">
		<tr>
			<td class="header_td" colspan="4">
				<strong>Inter Company Reconciliation </strong>
			</td>
		</tr>
		
		
		<xsl:for-each select="//Detail1">
			<xsl:variable name="from_tran_date"><xsl:value-of select="from_tran_date"/></xsl:variable>
			<xsl:variable name="to_tran_date"><xsl:value-of select="to_tran_date"/></xsl:variable>
			<xsl:variable name="site_code_fr"><xsl:value-of select="site_code_fr"/></xsl:variable>
			<xsl:variable name="site_code_to"><xsl:value-of select="site_code_to"/></xsl:variable>
			<xsl:variable name="site_code_to"><xsl:value-of select="site_code_to"/></xsl:variable>
			
			<xsl:variable name="sundry_type_fr"><xsl:value-of select="sundry_type_fr"/></xsl:variable>
			<xsl:variable name="sundry_type_to"><xsl:value-of select="sundry_type_to"/></xsl:variable>
			<xsl:variable name="sundry_code_fr"><xsl:value-of select="sundry_code_fr"/></xsl:variable>
			<xsl:variable name="sundry_code_to"><xsl:value-of select="sundry_code_to"/></xsl:variable>
			<xsl:variable name="dbID"><xsl:value-of select="@domID"/></xsl:variable>
			
			
			<tr>
				<td class="td_leftAlign" nowrap="true">
					<strong>Period From :</strong>
				</td>
				<td class="td_leftAlign">
				<!--	<input type="text" class="input_editable" size="15" value="{$date_from}" name="Detail1.{normalize-space($dbID)}.event_date" id="Detail1.{normalize-space($dbID)}.event_date" maxlength="8"  ISCHANGED="false" onblur="checkDate(this)"/> ( DD/MM/YY )-->
                    <input type="text" class="input_editable" size="15" value="{$from_tran_date}" name="Detail1.{normalize-space($dbID)}.from_tran_date" id="Detail1.{normalize-space($dbID)}.from_tran_date" maxlength="8"  ISCHANGED="false" /> ( DD/MM/YY )
					<img src="/ibase/webitm/images/Standard/e12_pophelp_16.jpg" onClick="selectedObj = 'Detail1.{normalize-space($dbID)}.from_tran_date'; javascript:show_calendar('Detail1.{normalize-space($dbID)}.from_tran_date','','','DD/MM/YY');"/>
				</td>
				<td class="td_leftAlign" nowrap="true">
					<strong>Period To :</strong>
				</td>
				<td class="td_leftAlign">
                    <input type="text" class="input_editable" size="15" value="{$to_tran_date}" name="Detail1.{normalize-space($dbID)}.to_tran_date" id="Detail1.{normalize-space($dbID)}.to_tran_date" maxlength="8"  ISCHANGED="false" /> ( DD/MM/YY )
					<img src="/ibase/webitm/images/Standard/e12_pophelp_16.jpg" onClick="selectedObj = 'Detail1.{normalize-space($dbID)}.to_tran_date'; javascript:show_calendar('Detail1.{normalize-space($dbID)}.to_tran_date','','','DD/MM/YY');"/>
				</td>
			</tr>
			
			<tr>
				<td class="td_leftAlign" nowrap="true">
					<strong>Site Code From :</strong>
				</td>
				<td class="td_leftAlign">
					<input type="text" class="input_editable" size="15" value="{$site_code_fr}" name="Detail1.{normalize-space($dbID)}.site_code_fr" id="Detail1.{normalize-space($dbID)}.site_code_fr" maxlength="05" ISCHANGED="false"/>
					<a href="javascript:callPopUpJSP( 'site_code_fr' );"> <img src="/ibase/webitm/images/Standard/e12_pophelp_16.jpg" border="0"/> </a>
					
				</td>
				
				<td class="td_leftAlign" nowrap="true">
					<strong>Site Code To :</strong>
				</td>
				<td class="td_leftAlign">
					<input type="text" class="input_editable" size="15" value="{$site_code_to}" name="Detail1.{normalize-space($dbID)}.site_code_to" id="Detail1.{normalize-space($dbID)}.site_code_to" maxlength="05" ISCHANGED="false"/>
					<a href="javascript:callPopUpJSP( 'site_code_to' );"> <img src="/ibase/webitm/images/Standard/e12_pophelp_16.jpg" border="0"/> </a>
				</td>
			</tr>
			<!-- Added by Dadaso pawar [Start]-->
			
			<tr>
				<td class="td_leftAlign" nowrap="true">
					<strong>Sundry Type From :</strong>
				</td>
				<td class="td_leftAlign">
					<!-- input type="text" class="input_editable" size="15" value="{$sundry_type_fr}" name="Detail1.{normalize-space($dbID)}.sundry_type_fr" id="Detail1.{normalize-space($dbID)}.sundry_type_fr" maxlength="05" ISCHANGED="false"  />
					<a href="javascript:callPopUpJSP( 'sundry_type_fr' );"> <img src="/ibase/webitm/images/Standard/e12_pophelp_16.jpg"  id="sundry_type_fr__img" border="0"/> </a -->
				<select class="td_leftAlign" value="{$sundry_type_fr}" name="Detail1.{normalize-space($dbID)}.sundry_type_fr" id="Detail1.{normalize-space($dbID)}.sundry_type_fr" maxlength="05" ISCHANGED="false">
				  <option disabled="disabled" selected="selected"></option>
				  <option value="customer">Customer</option>
				   <option value="employee" >Employee</option>
				   <option value="supplier">Supplier</option>
				   <option value="tax_authority">Tax Authority</option>
				   <option value="loan_party">Loan Party</option>				 
				   <option value="transporter">Transporter</option>
				   <option value="sales_pers">Sales Person</option>
				   <option value="strg_customer">Strategic Customer</option>
				</select>
				</td>
				
				<td class="td_leftAlign" nowrap="true">
					<strong>Sundry Type To :</strong>
				</td>
				<td class="td_leftAlign">
					<!-- input type="text" class="input_editable" size="15" value="{$sundry_type_to}" name="Detail1.{normalize-space($dbID)}.sundry_type_to" id="Detail1.{normalize-space($dbID)}.sundry_type_to" maxlength="05" ISCHANGED="false" />
					<a href="javascript:callPopUpJSP( 'sundry_type_to' );"> <img src="/ibase/webitm/images/Standard/e12_pophelp_16.jpg"  id="sundry_type_to__img" border="0"/> </a -->
				<select class="td_leftAlign" value="{$sundry_type_to}" name="Detail1.{normalize-space($dbID)}.sundry_type_to" id="Detail1.{normalize-space($dbID)}.sundry_type_to" maxlength="05" ISCHANGED="false">
				   <option disabled="disabled" selected="selected"></option>
				   <option value="customer">Customer</option>
				   <option value="employee" >Employee</option>
				   <option value="supplier">Supplier</option>
				   <option value="tax_authority">Tax Authority</option>
				   <option value="loan_party">Loan Party</option>				 
				   <option value="transporter">Transporter</option>
				   <option value="sales_pers">Sales Person</option>
				   <option value="strg_customer">Strategic Customer</option>
				</select>
				</td>
			</tr>
			<tr>
				<td class="td_leftAlign" nowrap="true">
					<strong>Sundry Code From:</strong>
				</td>
				<td class="td_leftAlign">
					<input type="text" class="input_editable" size="15" value="{$sundry_code_fr}" name="Detail1.{normalize-space($dbID)}.sundry_code_fr" id="Detail1.{normalize-space($dbID)}.sundry_code_fr" maxlength="10" ISCHANGED="false"/>
					<a href="javascript:callSundryPopUpJSP( 'sundry_code_fr' ,'sundry_type_fr');"> <img src="/ibase/webitm/images/Standard/e12_pophelp_16.jpg"  border="0"/> </a> 
					
				</td>
				<td class="td_leftAlign" nowrap="true">
					<strong>Sundry Code To:</strong>
				</td>
				<td class="td_leftAlign">
					<input type="text" class="input_editable" size="15" value="{$sundry_code_to}" name="Detail1.{normalize-space($dbID)}.sundry_code_to" id="Detail1.{normalize-space($dbID)}.sundry_code_to" maxlength="10" ISCHANGED="false" />
					<a href="javascript:callSundryPopUpJSP( 'sundry_code_to' ,'sundry_type_to');"> <img src="/ibase/webitm/images/Standard/e12_pophelp_16.jpg" border="0"/> </a>
				</td>			
			
			</tr>
			
			<!-- Added by Dadaso pawar [End]-->
			
		</xsl:for-each>
		<tr>
		<td colspan="2">
			<input  type="hidden" value="1" name="FORM_NO" ID="FORM_NO" />
			<input  type="hidden"  value="intercomp_reconcile" name="OBJ_NAME" />
			<input  type="hidden"  value="" name="action" id="action" />
			
                <input type="submit" style="cursor:hand"  value="Next" name = "Next" id = "Next" title=''  onclick="return setActionVal('Next')"/>  
		</td>
               </tr>
	</table>
	<table id="errorActivityTable" class="tableClass" border="0" cellSpacing="2" cellPadding="1">
			
			<xsl:for-each select="//error">
			    			    
				<xsl:if test="position() = 1">
					<tr>	
						<td class="td_leftAlign" nowrap="true" valign="bottom">
							Message :
						</td>
						<td class="td_leftAlign" nowrap="true" valign="bottom">
							Description :
						</td>
					</tr>
				</xsl:if>
				<xsl:variable name="message"><xsl:value-of select="message"/></xsl:variable>
				<xsl:variable name="description"><xsl:value-of select="description"/></xsl:variable>
				<xsl:variable name="type"><xsl:value-of select="type"/></xsl:variable>
				<xsl:variable name="dbID"><xsl:value-of select="@domId"/></xsl:variable>  
				<xsl:variable name="column_name"><xsl:value-of select="@column_name"/></xsl:variable> 
				<tr>
					<td class="td_leftAlign" nowrap="true">
						<xsl:value-of select="message"/>
					</td>
					<td class="td_leftAlign" nowrap="true">
						<xsl:value-of select="description"/>
					</td>
				</tr>
			</xsl:for-each>
			<xsl:for-each select="//error">
				<xsl:variable name="type"><xsl:value-of select="type"/></xsl:variable>
				<xsl:if test="position() = 1">
					<xsl:if test="$type = 'W'">
					<tr>
						<td class="td_leftAlign" nowrap="true" valign="bottom">
							Override Warnings :
						</td>
						<td class="td_leftAlign" nowrap="true" valign="bottom">
							<input  type="checkbox"  name="forceSave"  value="false" onClick="setChecked(this)"/>
						</td>
					</tr>
					</xsl:if>
				</xsl:if>	
			</xsl:for-each>
			
	</table>
</form>
</body>

</html>
</xsl:template>
</xsl:stylesheet>
