<?php  error_reporting(0);
$PageSecurity = 3;
 include('includes/Class_Branch.php');
	include('includes/AccountGroupMaster_Class.php');
 	$modid=$_REQUEST['modid'];
	$frmid=$_REQUEST['frmid'];
	$rurl="&modid=".$modid."&frmid=".$frmid;
 global $db;	
 include ('includes/session.inc');
  include ('includes/function_lib.php');
  
     $invledger= $s->getField('sales_tax_master','salestax_id',$_REQUEST['vid'],'tax_code');

   	$site= $_REQUEST['site'];
     $fromDate=
FormatDateForSQL ($_REQUEST['fromDate']); 
     $toDate= 
FormatDateForSQL($_REQUEST['toDate']); 

    echo '<link href="'.$rootpath. '/css/'. $_SESSION['Theme'] .'/default.css" rel="stylesheet" type="text/css" />';
	if($site!=''){
			  // $loccode=	$s->getField('locations','loccode',$site,'prefix');
			  $filter1[]="site='".$site."'";
			
			
			}
			if($fromDate!='' &&  $toDate!='')
			 $filter1[]="bill_date   >='".$fromDate."' and  bill_date   <='".$toDate."'";
			 
			 if(count($filter1)>0)
 			 {
			   $f=implode("and  " , $filter1);
  			   $query="select * from purchase_billbook  where $f and taxname    ='".$_REQUEST['vid']."'  order by  bill_date ";
			 
			 }else{			
			 		 		
			   $query="select * from purchase_billbook  where taxname    ='".$_REQUEST['vid']."' order by  bill_date  ";
			   }
			 
?>
<center><h2>Vat Computation Detail Wise Report<br /><?php echo $invledger?></h2></center>
 <table width="100%" border="1">
  <tr>
    <th>Bill No </th>
    <th>Bill Date </th>
    <th>Party Name </th>
    <th>Basic Value </th>
    <th>Exise</th>
    <th>ECess.</th>
    <th>SHEC Amount </th>
    <th>Tax Amount </th>
    
     <th>Pack.Charges</th>
	 <th>Addition Charges</th> 
    <th>Total Charges</th>
    
    <th>Branch</th>
   </tr>
 <?php 
 	 $result=DB_query($query,$db);
		$i=0;
		if(DB_num_rows($result)>0)
		{
			while($myrow=DB_fetch_array($result))
			{
			   if($i++%2==0)
			   $bg="bgcolor='#CCCCCC'";else
			   $bg='';
			  ?>
 			  <tr <?php  echo $bg;?>>
			<td><?php echo $myrow['bill'] ?></td>
			<td><?php echo $myrow['bill_date'] ?></td>
			<td><?php // echo $myrow['vendor'] ;
			echo $s->getField('suppliers','vendor_code',$myrow['vendor'],'vendor_name');?></td>
			<td><?php echo $myrow['basic_amount'] ?></td>
			<td><?php echo $myrow['Excise_Duty'] ?></td>
			
			
		    <td><?php echo $myrow['Edu_Cess'] ?></td>
			<td><?php echo $myrow['SHE_Cess'] ?></td>
			<td><?php echo $myrow['taxable_amt'] ?></td>
			 <td><?php echo $myrow['pkg_charges'] ?></td>
			  <td><?php echo $myrow['add_charges'] ?></td>
			<td><?php echo $myrow['total_charges'] ?></td>
	 		 
			
			  <td><?php echo $myrow['site'] ?></td>
 			  </tr>
			<?php
			}
			
		}
	?>		
</table>
