{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
function myFunction()
{
	if(confirm("Are You Sure To Delete")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
<style>
td{
  text-align: center;
  font-weight: bold;
  
}
</style>
{/block}
{block name=body}
<form name="partyForm"action="{$smarty.server.PHP_SELF}" method="POST" onsubmit="return confirm('DO You Want To Submit !!!!!')";>
<input type="hidden" name="partyId" value="{$partyId}">
<h1 align="center"><font size="5px">Vepari List</font>&nbsp;&nbsp;<a href="vepariprint.php?partyId={$partyId}" target="_blank" style="text-decoration:none;"><font size="3px;">Print</font></a>
<a href="vepariDel.php?partyId={$partyId}" style="text-decoration:none;"><font size="3px;">Delete</font></a></h1>
<table cellpadding="3" cellspacing="0"  align="center" width=90%>
   <tr>
    <td colspan="9">Vepari Name
	  <select name="partyId" onchange="this.form.submit();" autofocus>
	     <option value="">Select Party</option>
	    {html_options values=$clientArray.partyId output=$clientArray.partyName selected=$partyId}
	  </select>
	</td>
  </tr>
</table>
<table cellspacing="0"  width="98%"   align="center">
	<table cellspacing="0"  width="90%" border="" align="center">
		<tr>
			<td>
				<table cellspacing="14">
					<tr><td colspan="14" align="center">Buy</td></tr>
					<tr>
						<td></td>
						<td>Edit</td>
						<td>Type</td>
						<td>Sell Type</td>
						<td>Particular</td>
						<td>Date</td>
						<td>Rate</td>
						<td>K.G.</td>
						<td>TotalAmt</td>
					</tr>
					<tr>
						{section name="sec" loop=$clientDetail}
						 <td><a href="veparidelete.php?vepariId={$clientDetail[sec].vepariId}" onclick="return confirm('DO You Want To Delete !!!!!')";><img src="img/delete.png"></a></td>
						 <td><a href="vepari.php?vepariId={$clientDetail[sec].vepariId}"><img src="img/edit.png"></a></td>
						 {if $clientDetail[sec].veTransType == 'J'}
						   <td>Sell</td>
						 {else}
						   <td>Buy</td>
						 {/if}
						 {if $clientDetail[sec].sell_type == 'D'}
							<td>Direct</td>
						{else}
							<td>Khata</td>
						{/if}
						 <td>{$clientDetail[sec].particular}</td>
						 <td>{$clientDetail[sec].vDate}</td>
						 <td>{$clientDetail[sec].rate}</td>
						 <td>{$clientDetail[sec].kg}</td>
						 <td>{$clientDetail[sec].totalAmt}</td>
					</tr>
					{/section}
				</table>
			</td>
			<td>
				<table cellspacing="14">
					<tr><td colspan="14" align="center">Rojmel Entry</td></tr>
					<tr>
						<td>Type</td>
						<td>Particular</td>
						<td>Date</td>
						<td>K.G.</td>
						<td>Total Amount</td>
					</tr>
					{section name="secnew" loop=$clientDet}
					<tr>
						{if $clientDet[secnew].veTransType == 'J'}
							<td>Javak</td>
						{else}
							<td>Aavak</td>
						{/if}
						<td>{$clientDet[secnew].particular}</td>
						<td>{$clientDet[secnew].vDate}</td>
						<td>{$clientDet[secnew].kg|number_format:3}</td>
						<td>{$clientDet[secnew].totalAmt}</td>
					</tr>
				  {/section}
				</table>
			</td>
		</tr>
	</table>
<br>
<table align="center" border="">
<tr>
	{if $finalkg < 0}
      <td colspan="3" align="right" style="color:red;">Final Kg : &nbsp;&nbsp; 	{$finalKg|string_format:"%.3f"}</td>
	{else}
	  <td colspan="3" align="right" style="color:green;">Final Kg : &nbsp;&nbsp; {$finalKg|string_format:"%.3f"}</td>
	{/if}
</tr>
<tr>
   
	{if $finalkg < 0}
      <td colspan="3" align="right" style="color:red;">Final Amount : &nbsp;&nbsp; 	{$finalAmount}</td>
	{else}
	  <td colspan="3" align="right" style="color:green;">Final Amount : &nbsp;&nbsp; 	{$finalAmount}</td>
	{/if}
  </tr>
</table>
</form>
{/block}