<?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;

	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;
		
		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 {
			return true;
		}
	}
	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 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="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>
		</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 = "ActNext" id = "ActNext" 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>