<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
if($_REQUEST['taxId']!=''){
$discounted=$_REQUEST['discounted'];
//echo "select def_rate from excise_tax where id='".$_REQUEST['taxId']."'";
$sql=DB_query("select def_rate from excise_tax where id='".$_REQUEST['taxId']."'",$db);
$row=DB_fetch_array($sql);
$rate=$row['def_rate'];
$exciseValue=$discounted*($rate/100);
?>
<input name="exciseValue" id="exciseValue" type="text" value="<?php echo $exciseValue;?>" size="25" style="width:100%;" readonly />
<?php
}elseif($_REQUEST['salesId']!='')
{
	$sql=DB_query("Select taxrate from sales_tax_master where salestax_id ='".$_REQUEST['salesId']."'",$db);
	$row=DB_fetch_array($sql);
	$taxrate=$row['taxrate'];
	$total=$_REQUEST['taxable']*($taxrate/100);
?>
<input name="VatCstValue" id="VatCstValue1" type="text" value="<?php echo $total;?>" size="25" style="width:24%;" readonly />
<?php
}
elseif($_REQUEST['quotTaxId']!='')
{
	
	$sql=DB_query("select def_rate from excise_tax where id='".$_REQUEST['quotTaxId']."'",$db);
	$row=DB_fetch_array($sql);
	$rate=$row['def_rate'];
	?>
	<input name="ExcisePercentage[<?php echo $_REQUEST['data']; ?>]" id="ExcisePercentage_<?php echo $_REQUEST['data']; ?>" type="text" value="<?php echo $rate;?>"  style="width:100%;"  /> <input name="exciseValue[<?php echo $_REQUEST['data']; ?>]" id="exciseValue_<?php echo $_REQUEST['data']; ?>" type="text" value="" size="25" style="width:75%;" onfocus="calculateExciseDuty(<?php echo $_REQUEST['data']; ?>)" />
<?php 	
} 
elseif($_REQUEST['qid'])
{
$discounted=$_REQUEST['discounted'];	

$sql=DB_query("select def_rate from excise_tax where id='".$_REQUEST['qid']."'",$db);
$row=DB_fetch_array($sql);
$rate=$row['def_rate'];
$exciseValue=$discounted*($rate/100);	
?>
<input name="ExcisePercentage" id="ExcisePercentage" type="text" value="<?php echo $rate;?>"  style="width:100%;"  /> <input name="exciseValue" id="exciseValue" type="text" value="<?php echo $exciseValue;?>" size="25" style="width:75%;"  />
<?php } 
else if($_REQUEST['type']=='bill')
{
$discounted=$_REQUEST['value'];	

$sql=DB_query("select def_rate from excise_tax where id='".$_REQUEST['id']."'",$db);
$row=DB_fetch_array($sql);
$rate=$row['def_rate'];
$exciseValue=$discounted*($rate/100);
?>
<input name="totalDiscountedPrice" id="totalDiscountedPrice" type="text"  style="width:107px;" onfocus="calculateTotalExcise()" value="<?php echo $exciseValue;  ?>"/>	
<?php } ?>
