{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_new.php?partyId={$partyId}&todate={$toDate}&fromDate={$fromDate}" target="_blank" style="text-decoration:none;"><font size="3px;">Print</font></a>
<a href="vdeleteNew.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"autofocus>
	     <option value="">Select Party</option>
	    {html_options values=$clientArray.partyId output=$clientArray.partyName selected=$partyId}
	  </select>
	</td>
	<th>From</th>
		<td>{html_select_date prefix="to" start_year="-3" end_year="+1" field_order="DMY" day_value_format="%02d"}</td>
	<th>To</th>
		<td>{html_select_date prefix="from" start_year="-3" end_year="+1" field_order="DMY" day_value_format="%02d"}</td>
	<td><input type="submit" name="submit" value="Submit"></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>Buy</td>
						 {else}
						   <td>Sell</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|string_format:"%.3f"}</td>
						 <td>{$clientDetail[sec].totalAmt|string_format:"%.0f"}</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' && $clientDet[secnew].is_opening == '1'}
							<td>Baki</td>
						{else if $clientDet[secnew].veTransType == 'A' && $clientDet[secnew].is_opening == '1'}
							<td>Jama</td>
						{else if $clientDet[secnew].veTransType == 'A' && $clientDet[secnew].is_opening == '0'}
							<td>Aavak</td>
						{else}
							<td>Javak</td>
						{/if}
						<td>{$clientDet[secnew].particular}</td>
						<td>{$clientDet[secnew].vDate}</td>
						<td>{$clientDet[secnew].kg|string_format:"%.3f"}</td>
						<td>{$clientDet[secnew].totalAmt|string_format:"%.0f"}</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|string_format:"%.0f"}</td>
	{else}
	  <td colspan="3" align="right" style="color:green;">Final Amount : &nbsp;&nbsp; 	{$finalAmount|string_format:"%.0f"}</td>
	{/if}
  </tr>
</table>
</form>
{/block}