{include file="header.dwt"}
      <div id="list" class="f_l">
	  <script type="text/JavaScript">
		<!--
		function chk_data()
		{
		  if(edit_form.tbLabor.value==""){
			 alert("Labor must be filled!");
			 edit_form.tbLabor.focus();
		  }else if(edit_form.tbDayCount.value==""){
			 alert("Day Count must be filled!");
			 edit_form.tbDayCount.focus();
		  }else if(edit_form.tbDayCharge.value==""){
			 alert("Day Charge must be filled!");
			 edit_form.tbDayCharge.focus();
		  }else if(edit_form.OverFinanceFrom.value!=""){
			 alert("What`s the reason must be filled!");
			 edit_form.tbMemo.focus();
		  }else{
			 return true;
		  }	 
		  return false;
		}
		//-->
		</script>
	  <TABLE width="100%" border="1" cellPadding="4" cellSpacing="1" bordercolor="#5272A9">
	  <form name="edit_form" method="post" action="finance.php?act=update" id="edit_form" onsubmit="return chk_data()">
		  <TBODY>
            <TR align=middle>
              <TD width="100%" class="tb_title"><div align="center">Finance Details<input name="id" type="hidden" id="id" size="6" value="{$detail.tbSN}"></div></TD>
            </TR>
            <TR align=middle>
              <TD>
	  
				<table width="100%"  border="0" cellpadding="1" cellspacing="1">
                  <tr>
                    <td width="20%"><div align="right"><strong> Inspection Date：</strong></div></td>
                    <td width="20%"><div align="left">{$detail.tbInspectionDate}</div></td>
                    <td width="25%"><div align="right"><strong>Client ：</strong></div></td>
                    <td width="35%"><div align="left">{$detail.client}</div></td>
                  </tr>
                  <tr>
                    
                    <td><div align="right"><strong>Factory Booking NO.：</strong></div></td>
                    <td><div align="left">{$detail.tbFactoryBookNO}</div></td>
					<td><div align="right"><strong> Factory：</strong></div></td>
                    <td> <div align="left">{$detail.tbNickName}</div></td>
                  </tr>
                  <tr>
                    <td><div align="right"><strong>CY PO NO. ： </strong></div></td>
                    <td> <div align="left">{$detail.tbPONumber}</div></td><td><div align="right"><strong>Inspectors：</strong></div></td>
                    <td> <div align="left"><font class="f_red">{$detail.tbPM}</font> {$detail.tbTeam}
					</div></td>
                  </tr>
                  <tr>
                    <td width="19%"><div align="right"><strong>Products：</strong></div></td>
                    <td colspan="3">
					
					
					  <table width="100%"  border="0" align="center">
				  <!--{foreach from=$rep_summary item=con}-->
					  <!--{if substr_count($con.tbModelNO,'&')}--> 
								  <!--{section name=loop loop=substr_count($con.tbModelNO,'&')+1 start='0'}-->
								  <TR align="middle" onMouseOver="this.style.backgroundColor='#E1FFDF'" onMouseOut="this.style.backgroundColor='#ffffff'">
									<TD width="15%"><div align="left" class="font_blue">{$con.tbProductName}</div></TD>
									<TD width="15%"><div align="left">
									<!--{if $models=explode('&',$con.tbModelNO)}-->
	<!--{if $models[$smarty.section.loop.index]}-->{$models[$smarty.section.loop.index]}<!--{else}--><!--{/if}-->
									 <!--{else}-->
									 {$con.tbModelNO}
								    <!--{/if}--></div></TD>
									<TD width="70%"><div align="left">
									<!--{if $ShipQty = explode('&',$con.tbShippingQty)}-->
	<!--{if $ShipQty[$smarty.section.loop.index] neq ''}-->{$ShipQty[$smarty.section.loop.index]}<!--{else}--><!--{/if}-->
									<!--{else}-->
									{$con.tbShippingQty}
									<!--{/if}--></div></TD>
								  </TR>	
								  <!--{/section}-->
								 
					  
					  <!--{else}-->
								  <TR align="middle" onMouseOver="this.style.backgroundColor='#E1FFDF'" onMouseOut="this.style.backgroundColor='#ffffff'">
									<TD><div align="left" class="font_blue">{$con.tbProductName}</div></TD>
									<TD><div align="left">{$con.tbModelNO}</div></TD>
									<TD><div align="left">{$con.tbShippingQty}</div></TD>
								  </TR>	
					  <!--{/if}-->
				  <!--{/foreach}-->
                </table>

					
					
					</td>
                  </tr>
	<!--{if $detail.tbCheckone eq 'Final Pre-Shipment Inspection' || $detail.tbCheckone eq 'B Stock Inspection' || $detail.tbCheckone eq 'In-Process Inspection'}-->
				  <tr bgcolor="#E1FFDF"><td width="19%"><div align="right"><strong>Charge From：</strong></div></td>
				  <td colspan="3"><div align="left"><strong>{$detail.client}</strong></div></td></tr>
				  <tr>
                    <td><div align="right"><strong>Labor：</strong></div></td>
                    <td><div align="left">
                      {$detail.tbLabor}
                    </div></td>
					 <td><div align="right"><strong>Day Count：</strong></div></td>
                    <td><div align="left">                      {$detail.tbDayCount}
                    </div></td>
                  </tr>
                  <tr>
                    <td><div align="right"><strong>Per Hour Charge ：</strong></div></td>
                    <td><div align="left">
          {$detail.tbHourCharge} {$detail.tbCurrent}</div></td>
					<td><div align="right"><strong>Per Day Charge：</strong></div></td>
                    <td><div align="left">
          {$detail.tbDayCharge} {$detail.tbCurrent}</div></td> 
                  </tr>
	<!--{else}-->
				  
				  <tr bgcolor="#E1FFDF"><td width="19%"><div align="right"><strong>Charge From：</strong></div></td>
				  <td colspan="3"><div align="left"><font color="red">{$detail.tbNickName} </font></div></td></tr>
				  <tr>
                    <td><div align="right"><strong>Labor：</strong></div></td>
                    <td><div align="left">
            {$detail.tbLabor}
                    </div></td>
					<td><div align="right"><strong>Day Count：</strong></div></td>
                    <td><div align="left">            {$detail.tbDayCount}
                    </div></td>
                  </tr>
                  <tr>
                    
                    <td><div align="right"><strong>Per Hour Charge ：</strong></div></td>
                    <td><div align="left">
          {$detail.tbHourCharge} {$detail.tbCurrent}</div></td>
					<td><div align="right"><strong>Per Day Charge：</strong></div></td>
                    <td><div align="left">
         {$detail.tbDayCharge} {$detail.tbCurrent}</div></td>
                  </tr>
	<!--{/if}-->
				  <tr bgcolor="#E1FFDF"><td></td><td colspan="3" height="35"><div align="left"><strong>Over Time Work:</strong>
				  </div></td></tr>
				  <tr>
				  <td><div align="right"><strong>Labor ：</strong></div></td>
                    <td><div align="left">
                    <!--{if $detail.tbOverTimeLabor eq 0}-->
					---
					<!--{else}-->
					{$detail.tbOverTimeLabor}
					<!--{/if}-->
					   </div></td>
                    <td><div align="right"><strong>Hour Count ：</strong></div></td>
					<td><div align="left">
					<!--{if $detail.tbOverTime eq 0}-->
					---
					<!--{else}-->
						{$detail.tbOverTime} Hours
					<!--{/if}-->
                        </div></td>
                  </tr>
				  <tr>
				    <td><div align="right"><strong>Per Hour Charge ：</strong></div></td>
					<td><div align="left">
					<!--{if $detail.tbOverTimePrice eq 0}-->
					---
					<!--{else}-->
						{$detail.tbOverTimePrice} {$detail.tbOverCurrent}
					<!--{/if}-->
					</div></td>
                    
                    <td><div align="right"><strong>OverTimeWorkAmount:</strong></div></td>
                    <td><div align="left">
					<!--{if $detail.tbOverTotal eq 0}-->
					---
					<!--{else}-->
						{$detail.tbOverTotal} Hours
					<!--{/if}-->
					</div></td></tr>
                </table>

  	  <!--{if $act eq 'edit'}-->				
				<hr />
				<table width="100%"  border="0" cellpadding="1" cellspacing="1">
             
	<!--{if $detail.tbCheckone eq 'Final Pre-Shipment Inspection' || $detail.tbCheckone eq 'B Stock Inspection' || $detail.tbCheckone eq 'In-Process Inspection'}-->
				  <tr bgcolor="#6699CC">
				  <td><div align="right"><strong>Charge From：</strong></div></td>
				  <td colspan="3"><div align="left"><strong>{$detail.client}</strong></div></td></tr>
				  <tr>
                    <td width="20%"><div align="right"><strong>Labor：</strong></div></td>
                    <td width="20%"><div align="left">
                      <input name="tbLabor" type="text" id="tbLabor" size="6" value="{$detail.tbLabor}">
                    </div></td>
					 <td width="25%"><div align="right"><strong>Day Count：</strong></div></td>
                    <td width="35%"><div align="left">                      <select name="tbDayCount" id="tbDayCount">
                        <option value="1">1</option>
                        <option value="1.5">1.5</option>
                        <option value="2">2</option>
                      </select>
                    </div></td>
                  </tr>
                  <tr>
                    <td><div align="right"><strong>Per Hour Charge ：</strong></div></td>
                    <td><div align="left">
                      <input name="tbHourCharge" type="text" id="tbHourCharge" value="{$detail.tbHourCharge}" size="6">
                      </div></td>
					<td><div align="right"><strong>Per Day Charge：</strong></div></td>
                    <td><div align="left">
                        <input name="tbDayCharge" type="text" id="tbDayCharge" value="{$detail.tbDayCharge}" size="6">
                        </div></td> 
                  </tr>
	<!--{else}-->				  
				  <tr bgcolor="#6699CC"><td width="19%"><div align="right"><strong>Charge From：</strong></div></td>
				  <td colspan="3"><div align="left"><font color="red">{$detail.tbNickName} </font></div></td></tr>
				  <tr>
                    <td><div align="right"><strong>Labor：</strong></div></td>
                    <td><div align="left">
                      <input name="tbLabor" type="text" id="tbLabor" size="6" value="{$detail.tbLabor}">
                    </div></td>
					<td><div align="right"><strong>Day Count：</strong></div></td>
                    <td><div align="left">                      <select name="tbDayCount" id="tbDayCount">
                        <option value="1">1</option>
                        <option value="1.5">1.5</option>
                        <option value="2">2</option>
                      </select>
                    </div></td>
                  </tr>
                  <tr>
                    
                    <td><div align="right"><strong>Per Hour Charge ：</strong></div></td>
                    <td><div align="left">
                      <input name="tbHourCharge" type="text" id="tbHourCharge" value="200" size="6">
                      RMB</div></td>
					<td><div align="right"><strong>Per Day Charge：</strong></div></td>
                    <td><div align="left">
                        <input name="tbDayCharge" type="text" id="tbDayCharge" value="1600" size="6">
                        RMB</div></td>
                  </tr>
	<!--{/if}-->				  
				  <tr><td> </td><td colspan="3" height="35"><div align="left"><strong>Over Time Work Payed by:</strong>
				        <input name="oFinanceFrom" type="radio" id="oFinanceFrom" value="{$detail.client}" />
			          {$detail.client} &nbsp;&nbsp; 
				  <input name="oFinanceFrom" type="radio" id="oFinanceFrom" value="{$detail.tbNickName}">{$detail.tbNickName}</div></td></tr>
				  <tr>
				  <td><div align="right"><strong>Labor ：</strong></div></td>
                    <td><div align="left">
                       <input name="tboLabor" type="text" id="tboLabor" size="6"></div></td>
                    <td><div align="right"><strong>Hour Count ：</strong></div></td>
					<td><div align="left">
					    <input name="tbOverTime" type="text" id="tbOverTime" size="6">
                        Hours</div></td>
                  </tr>
				  <tr>
				    <td><div align="right"><strong>Price(Per Hour)：</strong></div></td>
					<td><div align="left">
<input name="tbOPrice" type="text" id="tbOPrice" size="6" /> 
RMB</div></td>
                    
                    <td><div align="right"><strong>OverTimeWorkAmount:</strong></div></td>
                    <td><div align="left"><input name="tboAmount" type="text" id="tboAmount" size="12"></div></td></tr>
					<tr><td align="right">What`s the reason:</td><td colspan="3"><textarea name="tbMemo" cols="60" rows="2"></textarea></td></tr>
                </table>	
	  <!--{/if}-->	
	  
	  		
			  </TD>
            </TR>
            <TR align=middle>
              <TD bgcolor="#5272A9" colspan="2" align="center">
			  <!--{if $act eq 'edit'}-->
			  <input type="submit" name="Submit" value="Modify"> 	  <!--{else}-->
			  <input type="button" name="edit" value="Edit" onclick="location.href='finance.php?act=edit&id={$detail.tbSN}'">
			  <!--{/if}-->
			  <input name="GoBack" type="button" value="Go Back To Finance List" onclick="location.href='finance.php'" />
			  </TD>
            </TR>
          </TBODY>
		  </form>
      </TABLE>
      </div>
	  {include file="footer.dwt"}
</div>
</body>
</html>
