{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;
	}
}

function finalRate()
{
  var rate      = $('.rate').val() != '' ? $('.rate').val() : 0;
  var diff      = $('.diff').val() != '' ? $('.diff').val() : 0;
  var diffAmt   = $('.diffAmt').val() != '' ? $('.diffAmt').val() : 0;
  var kg        = $('.kg').val() != '' ? $('.kg').val() : 0;
  var gorssRate = 0;
  var totalAmt  = 0;
  
    //gorssRate = (parseFloat(rate) - parseFloat(diffAmt));
    totalAmt  = (parseFloat(rate) * parseFloat(kg));
	//$('.total').val(rate.toFixed(2));
	//$('.totalAmt').val(totalAmt.toFixed(2));
	$('.totalAmt').val('-' + totalAmt.toFixed(2));
}
</script>
<style>
td{
  text-align: center;
  border: none;
}
</style>
{/block}
{block name=body}
<form name="partyForm"action="{$smarty.server.PHP_SELF}" method="POST">
<input type="hidden" name="vepariId" value="{$vepariId}">
<h1 align="center"><font size="5px">Vepari Entry</font></h1>
<table cellpadding="3" cellspacing="0" border="" align="center" width=50%>
   <tr>
   <td>Date
		{html_select_date prefix="cdt" start_year="-1" end_year="+0"  day_value_format="%02d" field_order="DMY" time=$vDate}
	</td>
    <td>Vepari Name
	  <select name="partyId" required autofocus>
	     <option value="">Select Party</option>
	    {html_options values=$clientArray.partyId output=$clientArray.partyName selected=$partyId}
	  </select>
	</td>
</table>
<br>
<table cellpadding="3" cellspacing="0" border="" align="center" width=30%>
	<!-- <tr> -->
		<!-- <td>Type</td> -->
		<!-- <td> -->
		  <!-- <select name="sell_type" required> -->
			 <!-- <option value="">Select Type</option> -->
			<!-- {html_options values=$sellTypeValue output=$sellTypOutput selected=$sell_type} -->
		  <!-- </select> -->
		<!-- </td> -->
	<!-- </tr> -->
	<tr>
		<td>Transaction Type</td>
		<td>
		  <select name="veTransType" required>
			 <option value="">Transaction Type</option>
			{html_options values=$typeArrayValue output=$typeArrayOutput selected=$veTransType}
		  </select>
		</td>
	</tr>
	<tr>
		<td>Particular</td>
		<td><input type="text" name="particular" value="{$particular}"></td>
	</tr>
	<tr>
		<td>Rate</td>
		<td><input type="text" name="rate" class="rate" onkeyup="finalRate();" onblur="finalRate();" value="{$rate}" size="8" required></td>
	</tr>
	<tr>
		<td>K.G.</td>
		<td><input type="text" name="kg" class="kg" onkeyup="finalRate();" onblur="finalRate();" value="{$kg}" size="4" required></td>
	</tr>
	<tr>
		<td>Total Amount</td>
		<td><input type="text" name="totalAmt" class="totalAmt" size="8" value="{$totalAmt}"></td>
	</tr>
  <tr>
  	<td colspan="7" align="center"><input type="submit" value="Submit" name="submit" class="btn"></td>
  </tr>
</table>
</form>
{/block}