<?php  include('ClassInvoice.php');?>
<h2><center>Excise Computation Chart</center></h2> 
		
	<form action="" 	 method="post">
	 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td   valign="top">
				<select name="site" id="site" style="width:150px">
		<option value="0">Select</option>
		<?php 
		$site_sql=DB_query("Select loccode, prefix, locationname from locations",$db);
		while($site_row=DB_fetch_array($site_sql))
		{?>
		<option value="<?php echo $site_row['loccode'];?>"<?php echo($_REQUEST['site']==$site_row['loccode']?'selected':'')?>><?php echo $site_row['locationname'];?></option>
		<?php 
		}
		?>
	  </select>
                <fieldset>
                <legend class="heading">Selection Criteria : RG 23 A / C</legend>
                <table   border="0" align="center" cellpadding="0" cellspacing="0">
				  <tr>
					<td  align="left" class="text"><strong>From :</strong></td>
					<td  > <input name="fromdate" class="datepicker" type="text" value="<?php echo $_REQUEST['fromdate'];?>"></td>
					<td><span class="text"><strong>To :</strong></span></td>
					<td > <input name="todate" class="datepicker" type="text" value="<?php echo $_REQUEST['todate'];?>"></td>
				  </tr>
				</table>

                </fieldset>
                </td>
                <td  >
                <fieldset>
                <legend class="heading">PLA Register</legend>
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td  class="text"><strong>From :</strong></td>
                    <td  ><input name="PLAfromdate" class="datepicker" type="text" value="<?php echo $_REQUEST['PLAfromdate'];?>"></td>
                    <td><span class="text"><strong>To :</strong></span></td>
                    <td width="95"><input name="PLAtodate" class="datepicker" type="text" value="<?php echo $_REQUEST['PLAtodate'];?>"></td>
                  </tr>
                  
                </table>
                </fieldset>
                </td>
              </tr>
 			  <tr>
			    <td  class="text">&nbsp;</td>
                    <td  colspan="3">
					<input type="submit" name="Search" id="button" value="Calculate and Show" />
             		 <input type="reset" name="button2" id="button2" value="Close" />
					</td>
			  </tr>
            </table>
	</form>
<?php
if($_REQUEST['Search'])
{
  $todate=str_replace('/','-',FormatDateForSQL($_REQUEST['todate']));
  $fromdate=str_replace('/','-',FormatDateForSQL($_REQUEST['fromdate']));
  $branch_name=$_REQUEST['site'];
}
?> 
 
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top">
		
		<table width="100%" border="0" align="left" cellpadding="2" cellspacing="2" class="border">
          <tr>
            <td height="30" align="center" bgcolor="#cccccc" class="text">
			<strong><center>RG 1 Sale Excise Status</center> </strong></td>
          </tr>
          <tr>
            <td>
			<?php $r1= $ClassINV->GetExciseEffect( 'RG-1',$todate,$fromdate ,$branch_name);
			$r2= $ClassINV->GetExciseEffect( 'Supplementry',$todate,$fromdate ,$branch_name);
			
			//print_r($r1);
			?>
			<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
              <tr>
                <th  >&nbsp;</th>
                <th  align="center" class="text">Cenvat</th>
                <th  align="center" class="text">E.Cess A/c</th>
                <th  align="center" class="text">SAH E.Cess</th>
              </tr>
              <tr>
                <td class="text">RG-1 SaleA/C </td>
                <td align="center"><?php  echo $r1[0];?></td>
                <td align="center"><?php  echo $r1[1];?></td>
                <td align="center"><?php  echo $r1[2];?></td>
              </tr>
              <tr>
                <td class="text">Supplementary Sales</td>
                  <td align="center"><?php  echo $r2[0];?></td>
                <td align="center"><?php  echo $r2[1];?></td>
                <td align="center"><?php  echo $r2[2];?></td>
              </tr>
              <tr bgcolor="#CCCCCC">
                <td class="text">Closing Balances</td>
                <td align="center"><?php  echo $r1[0]+ $r2[0];?></td>
                <td align="center"><?php  echo $r1[1]+ $r2[1];?></td>
                <td align="center"><?php  echo $r1[2]+ $r2[2];?></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td align="right" valign="top">
		
		<table width="100%" border="0" align="left" cellpadding="2" cellspacing="2" class="border">
          <tr>
            <td height="30" align="center" bgcolor="#cccccc" class="text">
			<strong><center>RG-23A IInd</center> </strong></td>
          </tr>
          <tr>
            <td>
			<?php $r1= $ClassINV->Get_PO_ExciseEffect( 'RG-23A',$todate,$fromdate ,$branch_name);
				   
			
			// print_r($r1);
			?>
			<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
              <tr>
                <th  >&nbsp;</th>
                <th  align="center" class="text">Cenvat</th>
                <th  align="center" class="text">E.Cess A/c</th>
                <th  align="center" class="text">SAH E.Cess</th>
              </tr>
              <tr>
                <td class="text">RG-23A IInd </td>
                <td align="center"><?php  echo $r1[0];?></td>
                <td align="center"><?php  echo $r1[1];?></td>
                <td align="center"><?php  echo $r1[2];?></td>
              </tr>
               
              <tr bgcolor="#CCCCCC">
                <td class="text">Closing Balances</td>
                <td align="center"><?php  echo $r1[0];?></td>
                <td align="center"><?php  echo $r1[1];?></td>
                <td align="center"><?php  echo $r1[2];?></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table>
		
		
		</td>
      </tr>
      <tr>
        <td   align="left" valign="top">
		
		
		
		<table width="100%" border="0" align="left" cellpadding="2" cellspacing="2" class="border">
          <tr>
            <td height="30" align="center" bgcolor="#cccccc" class="text">
			<strong><center>Service Tax</center> </strong></td>
          </tr>
          <tr>
            <td>
			<?php  
				  $TDR=   $ClassINV-> Get_Led_ExciseEffect( 'DR',$todate,$fromdate ,$branch_name,'20');
			  $TCR=   $ClassINV-> Get_Led_ExciseEffect( 'CR',$todate,$fromdate ,$branch_name,'20');
			// print_r($r1);
			?>
			<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
              <tr>
                <th  >&nbsp;</th>
                <th  align="center" class="text">Cenvat</th>
                <th  align="center" class="text">&nbsp;</th>
                <th  align="center" class="text">&nbsp;</th>
              </tr>
              <tr>
                <td class="text">Debit Amount</td>
                <td align="center"><?php  echo $TDR;?></td>
                <td align="center">&nbsp;</td>
                <td align="center">&nbsp;</td>
              </tr>
                 <tr>
                <td class="text">Credit Amount</td>
                <td align="center"><?php  echo $TDR;?></td>
                <td align="center">&nbsp;</td>
                <td align="center">&nbsp;</td>
              </tr>
              <tr bgcolor="#CCCCCC">
                <td class="text">Closing Balances</td>
                <td align="center"><?php echo ($TDR+$TCR)?></td>
                <td align="center">&nbsp;</td>
                <td align="center">&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table>
		
		
		
		
		</td>
        <td   align="right" valign="top">
		
		<table width="100%" border="0" align="left" cellpadding="2" cellspacing="2" class="border">
          <tr>
            <td height="30" align="center" bgcolor="#cccccc" class="text">
			<strong><center>RG-23C IInd</center> </strong></td>
          </tr>
          <tr>
            <td>
			<?php $r1= $ClassINV->Get_PO_ExciseEffect( 'RG-23C',$todate,$fromdate ,$branch_name);
				   
			
			// print_r($r1);
			?>
			<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
              <tr>
                <th  >&nbsp;</th>
                <th  align="center" class="text">Cenvat</th>
                <th  align="center" class="text">E.Cess A/c</th>
                <th  align="center" class="text">SAH E.Cess</th>
              </tr>
              <tr>
                <td class="text">RG-23C IInd </td>
                <td align="center"><?php  echo $r1[0];?></td>
                <td align="center"><?php  echo $r1[1];?></td>
                <td align="center"><?php  echo $r1[2];?></td>
              </tr>
               
              <tr bgcolor="#CCCCCC">
                <td class="text">Closing Balances</td>
                <td align="center"><?php  echo $r1[0];?></td>
                <td align="center"><?php  echo $r1[1];?></td>
                <td align="center"><?php  echo $r1[2];?></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table>
		
		
		</td>
      </tr>
    </table> 