<?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>
	
<script type="text/javascript" src="/ibase/webitm/js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="/ibase/webitm/js/prodWiz_Common.js"></script>
<script type="text/javascript" src="/ibase/webitm/js/prodWiz_Popup.js"></script>
<script type="text/javascript" src="/ibase/webitm/js/porderWiz_Popup.js"></script>
<link rel="stylesheet" href="/ibase/webitm/css/DD/default.css" type="text/css" />
<link id="userThemeLink" type="text/css" rel="stylesheet" href=""/>
<link href="/ibase/webitm/css/DD/ProductWizard.css" rel="stylesheet"/>

<link href="/ibase/webitm/css/DD/jquery-ui-1.10.4.custom.min.css" rel="stylesheet"/>
<script type="text/javascript" src="/ibase/webitm/js/jquery-ui-1.10.4.custom.min.js"></script>

<script>
<![CDATA[
	$(function() 
	{	
		for(var i=0;i<=100;i++)
		{
			$( "#dlv_date"+i+"" ).datepicker({ minDate: 0, changeMonth: true, changeYear: true, dateFormat : "dd/mm/y"});
		}   
	});
]]>
</script>

<body> 
	<form name="porderWizFormIII" id="porderFormIII" METHOD="post" ACTION="/ibase/ITMWizardHandlerServlet">
		
		<!--	<div id="header" style="width:100%;height:100px">
						<div id="headingText">Purchase Wizard Details</div>
			</div>-->
			<div class="mainPage-Container" style="height:100%;overflow:scroll;">	
			
					
					<table class="tableClass" id="Details" border="0" cellspacing="1" cellpadding="1">
							<thead class="table-head" style="text-align:center;position:relative">
								<tr>
									<th class="thClass" nowrap="true" style="width:20px">
										
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:90px">
										<strong>Item Parent</strong>
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:90px">
										<strong>Item SKU Code</strong>
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:200px">
										<strong>Description</strong>
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:75px">
										<strong>Quantity</strong>
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:75px">
										<strong>Unit Cost</strong>
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:75px">
										<strong>Amount</strong>
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:75px">
										<strong>Order Date</strong>
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:88px">
										<strong>Delivery Date</strong>
									</th>
									<th class="thClass" nowrap="true" valign="bottom" style="width:94px">
										<strong>Supplier Code</strong>
									</th>
									
										
								</tr>
							</thead>
							<!--<tr>
								<td>.</td>
							</tr>-->		
							<tbody class='table-body fadeInDown'>
							<xsl:for-each select="//Detail3">
									<xsl:variable name="dbID"><xsl:value-of select="@domID"/></xsl:variable>
									<xsl:variable name="quantity"><xsl:value-of select="quantity"/></xsl:variable>
									<xsl:variable name="item_code"><xsl:value-of select="item_code"/></xsl:variable>
									<xsl:variable name="item_parnt"><xsl:value-of select="item_parnt"/></xsl:variable>
									<xsl:variable name="descr"><xsl:value-of select="descr"/></xsl:variable>
									<xsl:variable name="supp_code"><xsl:value-of select="supp_code"/></xsl:variable>
									<xsl:variable name="ord_date"><xsl:value-of select="ord_date"/></xsl:variable>
									<xsl:variable name="dept_code"><xsl:value-of select="dept_code"/></xsl:variable>
									<xsl:variable name="rate"><xsl:value-of select="rate"/></xsl:variable>
									<xsl:variable name="item_ser"><xsl:value-of select="item_ser"/></xsl:variable>
									<xsl:variable name="unit"><xsl:value-of select="unit"/></xsl:variable>
									<xsl:variable name="rate"><xsl:value-of select="rate"/></xsl:variable>
									<xsl:variable name="dlv_date"><xsl:value-of select="dlv_date"/></xsl:variable>
									<xsl:variable name="unit__std"><xsl:value-of select="unit__std"/></xsl:variable>
									<xsl:variable name="unit__rate"><xsl:value-of select="unit__rate"/></xsl:variable>
									<xsl:variable name="discount"><xsl:value-of select="discount"/></xsl:variable>
									<xsl:variable name="tax_amt"><xsl:value-of select="tax_amt"/></xsl:variable>
									<xsl:variable name="dlv_qty"><xsl:value-of select="dlv_qty"/></xsl:variable>
									<xsl:variable name="dlv_date"><xsl:value-of select="dlv_date"/></xsl:variable>
									<xsl:variable name="pack_code"><xsl:value-of select="pack_code"/></xsl:variable>
									<xsl:variable name="rate__clg"><xsl:value-of select="rate__clg"/></xsl:variable>
									<xsl:variable name="std_rate"><xsl:value-of select="std_rate"/></xsl:variable>
									<xsl:variable name="conv__qty_stduom"><xsl:value-of select="conv__qty_stduom"/></xsl:variable>
									<xsl:variable name="req_date"><xsl:value-of select="req_date"/></xsl:variable>
									<xsl:variable name="loc_code"><xsl:value-of select="loc_code"/></xsl:variable>
									<xsl:variable name="acct_code__dr"><xsl:value-of select="acct_code__dr"/></xsl:variable>
									<xsl:variable name="cctr_code__dr"><xsl:value-of select="cctr_code__dr"/></xsl:variable>
									<xsl:variable name="acct_code__cr"><xsl:value-of select="acct_code__cr"/></xsl:variable>
									<xsl:variable name="cctr_code__cr"><xsl:value-of select="cctr_code__cr"/></xsl:variable>
									<xsl:variable name="operation"><xsl:value-of select="operation"/></xsl:variable>
									<xsl:variable name="git_qty"><xsl:value-of select="git_qty"/></xsl:variable>
									<xsl:variable name="adj_qty"><xsl:value-of select="adj_qty"/></xsl:variable>
									<xsl:variable name="quantity__fc"><xsl:value-of select="quantity__fc"/></xsl:variable>
									<xsl:variable name="tot_amt"><xsl:value-of select="tot_amt"/></xsl:variable>
									<xsl:variable name="chkbox"><xsl:value-of select="@selected"/></xsl:variable>
										
									<tr style="text-align:center">
										<!--<td style="width:20px">
											<input  type="checkbox" name="Detail3.{normalize-space($dbID)}.selectbox" id="Detail3.{normalize-space($dbID)}.selectbox" checked='true' value="true" onClick="setChecked(this)"/>
										</td>-->
										<td>
											<xsl:choose>
												<xsl:when test="$chkbox ='Y'">
													<input  type="checkbox" name="Detail3.{normalize-space($dbID)}.selectbox" id="Detail3.{normalize-space($dbID)}.selectbox" checked='true' value="true" onClick="setChecked(this)"/>
												</xsl:when>	
												<xsl:otherwise>
													<input  type="checkbox" name="Detail3.{normalize-space($dbID)}.selectbox" id="Detail3.{normalize-space($dbID)}.selectbox" value="false" onClick="setChecked(this)"/>
												</xsl:otherwise>
											</xsl:choose>	
										</td>
										<td style="width:90px">
											<xsl:value-of select="item_parnt" />
										</td>
										<td style="width:100px">
											<xsl:value-of select="item_code" />
										</td>
										<td style="width:200px">
											<xsl:value-of select="descr"/>
										</td>
										<td style="width:75px">
										<input type="text" class="editInputClass" value="{$quantity}" name="Detail3.{normalize-space($dbID)}.quantity" 
										onkeypress='return isNumberKey(event)' id="Detail3.{normalize-space($dbID)}.quantity" maxlength="4" style="text-align: right;width:70px;" onkeyup="changeAmount({$dbID})"/>
										</td>
										<td style="width:75px">
											<!--<xsl:value-of select="rate"/>-->
											<input type="text" class="editInputClass" value="{$rate}" name="Detail3.{normalize-space($dbID)}.rate" 
										onkeypress='return isNumberKey(event)' id="Detail3.{normalize-space($dbID)}.rate" maxlength="4" style="text-align: right;width:70px;" onkeyup="changeAmount({$dbID})"/>
										</td>
										<td style="width:75px">
											<!--<input type="text" class="editDisplayClass" ISCHANGED="false" readOnly = "1"  value="{$tot_amt}" 
											id="Detail3.{normalize-space($dbID)}.tot_amt" style="text-align: right;width: 75px;" />-->
											
											<input type="text" class="editDisplayClass" value="{$tot_amt}" name="Detail3.{normalize-space($dbID)}.tot_amt" 
											id="Detail3.{normalize-space($dbID)}.tot_amt" ISCHANGED="false" readOnly = "1" style="text-align: right;width: 75px;"/>
										</td>
										
										
										<td style="width:75px">
											<xsl:value-of select="ord_date"/>
										</td>
										<td>
											<input type="hidden" class="editDisplayClass" value="{dlv_date}" name="Detail3.{normalize-space($dbID)}.dlv_date" 
											id="Detail3.{normalize-space($dbID)}.dlv_date" style="width: 100px;"/>
											<!-- <xsl:value-of select="dlv_date"/>-->
											<input type="text" id="dlv_date{normalize-space($dbID)}" value="{dlv_date}" 
											class="editInputClass" maxlength="0" ISCHANGED="false" readOnly = "1" style="width: 70px" onchange="dlvChange({$dbID})" />
										</td>
										<td>
											<xsl:value-of select="supp_code"/>
										</td>
										
										
										<input type="hidden" class="editInputClass" value="{$item_code}" name="Detail3.{normalize-space($dbID)}.item_code" 
												id="Detail3.{normalize-space($dbID)}.item_code" maxlength="10"/>
										
										<input type="hidden" class="editInputClass" value="{$item_parnt}" name="Detail3.{normalize-space($dbID)}.item_parnt" 
												id="Detail3.{normalize-space($dbID)}.item_parnt" maxlength="10"/>
												
										<input type="hidden" class="editInputClass" value="{$rate}" name="Detail3.{normalize-space($dbID)}.rate" 
												id="Detail3.{normalize-space($dbID)}.rate" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$descr}" name="Detail3.{normalize-space($dbID)}.descr" 
												id="Detail3.{normalize-space($dbID)}.descr" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$supp_code}" name="Detail3.{normalize-space($dbID)}.supp_code" 
												id="Detail3.{normalize-space($dbID)}.supp_code" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$ord_date}" name="Detail3.{normalize-space($dbID)}.ord_date" 
												id="Detail3.{normalize-space($dbID)}.ord_date" maxlength="10"/>		
										<input type="hidden" class="editInputClass" value="{$unit}" name="Detail3.{normalize-space($dbID)}.unit" 
												id="Detail3.{normalize-space($dbID)}.unit" maxlength="10"/>
										
										
										<input type="hidden" class="editInputClass" value="{$unit__std}" name="Detail3.{normalize-space($dbID)}.unit__std" 
												id="Detail3.{normalize-space($dbID)}.unit__std" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$unit__rate}" name="Detail3.{normalize-space($dbID)}.unit__rate" 
												id="Detail3.{normalize-space($dbID)}.unit__rate" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$discount}" name="Detail3.{normalize-space($dbID)}.discount" 
												id="Detail3.{normalize-space($dbID)}.discount" maxlength="10"/>	
										<input type="hidden" class="editInputClass" value="{$tax_amt}" name="Detail3.{normalize-space($dbID)}.tax_amt" 
												id="Detail3.{normalize-space($dbID)}.tax_amt" maxlength="10"/>
										
										<input type="hidden" class="editInputClass" value="{$dlv_qty}" name="Detail3.{normalize-space($dbID)}.dlv_qty" 
												id="Detail3.{normalize-space($dbID)}.dlv_qty" maxlength="10"/>
										
										<input type="hidden" class="editInputClass" value="{$pack_code}" name="Detail3.{normalize-space($dbID)}.pack_code" 
												id="Detail3.{normalize-space($dbID)}.pack_code" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$rate__clg}" name="Detail3.{normalize-space($dbID)}.rate__clg" 
												id="Detail3.{normalize-space($dbID)}.rate__clg" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$std_rate}" name="Detail3.{normalize-space($dbID)}.std_rate" 
												id="Detail3.{normalize-space($dbID)}.std_rate" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$conv__qty_stduom}" name="Detail3.{normalize-space($dbID)}.conv__qty_stduom" 
												id="Detail3.{normalize-space($dbID)}.conv__qty_stduom" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$req_date}" name="Detail3.{normalize-space($dbID)}.req_date" 
												id="Detail3.{normalize-space($dbID)}.req_date" maxlength="10"/>	
										<input type="hidden" class="editInputClass" value="{$loc_code}" name="Detail3.{normalize-space($dbID)}.loc_code" 
												id="Detail3.{normalize-space($dbID)}.loc_code" maxlength="10"/>	
										<input type="hidden" class="editInputClass" value="{$acct_code__dr}" name="Detail3.{normalize-space($dbID)}.acct_code__dr" 
												id="Detail3.{normalize-space($dbID)}.acct_code__dr" maxlength="10"/>	
										<input type="hidden" class="editInputClass" value="{$cctr_code__dr}" name="Detail3.{normalize-space($dbID)}.cctr_code__dr" 
												id="Detail3.{normalize-space($dbID)}.cctr_code__dr" maxlength="10"/>	
										<input type="hidden" class="editInputClass" value="{$acct_code__cr}" name="Detail3.{normalize-space($dbID)}.acct_code__cr" 
												id="Detail3.{normalize-space($dbID)}.acct_code__cr" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$cctr_code__cr}" name="Detail3.{normalize-space($dbID)}.cctr_code__cr" 
												id="Detail3.{normalize-space($dbID)}.cctr_code__cr" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$operation}" name="Detail3.{normalize-space($dbID)}.operation" 
												id="Detail3.{normalize-space($dbID)}.operation" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="git_qty" name="Detail3.{normalize-space($dbID)}.git_qty" 
												id="Detail3.{normalize-space($dbID)}.git_qty" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$adj_qty}" name="Detail3.{normalize-space($dbID)}.adj_qty" 
												id="Detail3.{normalize-space($dbID)}.adj_qty" maxlength="10"/>
										<input type="hidden" class="editInputClass" value="{$quantity__fc}" name="Detail3.{normalize-space($dbID)}.quantity__fc" 
												id="Detail3.{normalize-space($dbID)}.quantity__fc" maxlength="10"/>																																																							
									</tr>
								</xsl:for-each>
							</tbody>
					</table>	
					
					<table>
						<tr>
							<td colspan="2">
								<input type="hidden" value="3" name="FORM_NO" ID="FORM_NO" />
								<input type="hidden"  value="porderWiz" name="OBJ_NAME" />
								<input type="hidden"  value="" name="action" id="action" />
								<input type="hidden" value="2:MP" name="formType" id="formType" />
								<!-- <textarea name="PRE_FORM_VAL" ID="PRE_FORM_VAL" style="display:none;"></textarea> -->
								<input type="submit" style="cursor:hand" class="button" value="Previous" title='Previous' 
										onclick="javascript:setActionVal('previous')"/>
					
								<input type="submit" style="cursor:hand" class="button" value="Finish" title='Finish' 
								onclick="javascript:setActionVal('finish');javascript:return checkRate()"/>
							</td>
				        </tr>
				    </table>
				    
				    <table id="errorActivityTable" class="tableClass" border="0" cellSpacing="2" cellPadding="1" width="98%">
						<xsl:for-each select="//error">
							<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>
							<xsl:variable name="trace"><xsl:value-of select="trace"/></xsl:variable>
								
							<tr>
								<xsl:if test="position() = 1">
									<td class="td_leftAlign" nowrap="true" valign="bottom" width="20%">
										Message : <xsl:value-of select="message"/>
									</td>
									<td class="td_leftAlign" nowrap="true" valign="bottom" width="40%">
										Description : <xsl:value-of select="description"/>
									</td>
									<td class="td_leftAlign" nowrap="true" valign="bottom" width="40%">
										Trace : <xsl:value-of select="trace"/>
									</td>
								</xsl:if>
								<xsl:if test="$type = 'W'">
									<td class="td_leftAlign" nowrap="true" valign="bottom" width="20%">
										Override Warnings :
										<input  type="checkbox"  name="forceSave"  value="false" onClick="setChecked(this)"/>
									</td>
								</xsl:if>
							</tr>
							<tr>
							</tr>
						</xsl:for-each>
					</table>
					
		</div>		 
	</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

