<?php 
if($_REQUEST['Cancel']!='')
{
	unset($_REQUEST);
}
?>
<style type="text/css">
.box_rotate {
     -moz-transform: rotate(-90deg);  /* FF3.5+ */
       -o-transform: rotate(-90deg);  /* Opera 10.5 */
  -webkit-transform: rotate(-90deg);  /* Saf3.1+, Chrome */
		 filter:  progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083);  /* IE6,IE7 */
	 -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)"; /* IE8 */
	 border:none;
}

</style>
<link rel="stylesheet" href="../../Phpsrvr/webtech/css/professional/forms.css" type="text/css" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td style="padding:5px"><!-- General details -->
      <table width="100%" cellspacing="0" cellpadding="0" border="0" class="small">
        <tr>
          <td class="detailedViewHeader"  style="text-align:center; font-size:20px;"><b>FORM R. G-23C PART-II</b></td>
        </tr>
        <tr>
          <td align="center" class="detailedViewHeader" style="text-align:center; font-size:12px; color:#333;"><b>ENTRY BOOK OF DUTY CREDIT ON CAPITAL GOODS </b><br />(Rule 57Q)</td>
        </tr>
		<tr><td>&nbsp;</td></tr>
     	<tr>
		<td><form action="" method="post">
		<table width="30%" cellpadding="2" cellspacing="2" align="center" border="0">
		<tr>
		<th><strong>Branch</strong></th>
		<td><select name="site" id="site" style="width:150px">
		<option value="0">Select</option>
		<?php 
		$site_sql=DB_query("Select loccode, prefix, locationname from locations where CompanyId='".$_SESSION['ACGCompanyId']."' and loccode in('".$_SESSION['AssignedBranch']."')",$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></td>
		</tr>
		<tr>
		<th><strong>Vendor</strong></th>
		<td><select name="vendor" id="vendor" style="width:150px">
		<option value="0">Select</option>
		<?php 
		$vendor_sql=DB_query("Select vendor_code, vendor_name from suppliers",$db);
		while($vendor_row=DB_fetch_array($vendor_sql))
		{?>
		<option value="<?php echo $vendor_row['vendor_code'];?>"<?php echo($_REQUEST['vendor']==$vendor_row['vendor_code']?'selected':'')?>><?php echo $vendor_row['vendor_name'];?></option>
		<?php 
		}
		?>
		</select></td>
		</tr>
		<tr>
		<th><strong>Date</strong></th>
		<td><input name="fromDate" type="text" id="fromDate" value="<?php echo $_REQUEST['fromDate'];?>" size="10" class="datepicker" />
		  <strong>		  to  </strong>
		  <input name="toDate" type="text" id="toDate" value="<?php echo $_REQUEST['toDate'];?>" size="10" class="datepicker"/></td>
		</tr>
		</table>
		<p align="center"><input type="submit" name="View" value="View" /><input type="submit" name="Cancel" value="Cancel" /></p></form>
		</td>
		</tr>
		<tr><td>&nbsp;</td></tr>
		<tr>
          <td><div style="overflow:auto; width:800px; height:350px">
            <table width="100%" cellspacing="2" cellpadding="3" border="0" class="lvt lists" bgcolor="#CCCCCC">
              <!-- Table Headers -->
              <tr>
                <th width="3%" rowspan="2" align="center" class="" style="text-align:center;">S. No.  </th>
                <th width="14%" rowspan="2" align="center" class="" style="text-align:center;">Date</th>
                <th colspan="3" align="center" class="" style="text-align:center;">Opening Balance of duty in credit </th>
                <th colspan="4" align="center" class="" style="text-align:center;">Document particulars of fresh credit allowed</th>
                <th colspan="4" align="center" class="" style="text-align:center;">Amount of fresh credit allowed</th>
                <th colspan="3" align="center" class="" style="text-align:center;">Total Credit available </th>
                <th colspan="6" align="center" class="" style="text-align:center;">Debit</th>
                <th colspan="3" align="center" class="" style="text-align:center;"> Balance of Credit  </th>
                <th rowspan="2"  align="center" class="" style="text-align:center;">Central Excise Officer's Initials</th>
                <th rowspan="2" align="center" class="" style="text-align:center;">Remarks</th>
              </tr>
              <tr>
                <th width="4%" align="center" valign="middle" class="" style="text-align:center">Basic Excise Duty </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">Edu. Cess </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">S &amp; H Edu. Cess </th>
                <th width="4%" align="center" valign="middle" class="" style="text-align:center">Invoice/ Bill of Entry No. * Date</th>
                <th width="4%" align="center" valign="middle" class="" style="text-align:center">EC code of suppliers </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">Range Division/ Custom house from where received </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">Folio and Entry No. in Part-1 </th>
                <th width="4%" align="center" valign="middle" class="" style="text-align:center">Basic Excise Duty </th>
                <th width="4%" align="center" valign="middle" class="" style="text-align:center">Additional Duty of customs </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">Edu. Cess </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">S &amp; H Edu Cess </th>
                <th width="4%" align="center" valign="middle" class="" style="text-align:center">&nbsp;</th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">Edu. Cess </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">S &amp; H Edu Cess </th>
                <th width="4%" align="center" valign="middle" class="" style="text-align:center">AR I/ Invoice/ Other approved document No. and date </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">CET sub- heading </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">EC Code of the Buyer </th>
                <th width="4%" align="center" valign="middle" class="" style="text-align:center">Amount of Basic Excise duty </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">Edu. Cess </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">S &amp; H Edu Cess </th>
                <th width="4%" align="center" valign="top" class="" style="text-align:center">&nbsp;</th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">Edu. Cess </th>
                <th width="10%" align="center" valign="middle" class="" style="text-align:center">S &amp; H Edu. Cess </th>
              </tr>
              <tr>
                <th>&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;</th>
                <th align="center">2</th>
                <th align="center">3 (a) </th>
                <th align="center">3(b)</th>
                <th align="center">3(c)</th>
                <th align="center">4(a)</th>
                <th align="center">4(b)</th>
                <th align="center">5</th>
                <th align="center">6</th>
                <th align="center">7(a)</th>
                <th align="center">7(b)</th>
                <th align="center">7(c)</th>
                <th align="center">7(d)</th>
                <th align="center">8(a)</th>
                <th align="center">8 (b) </th>
                <th align="center">8 (c) </th>
                <th align="center">9 (a) </th>
                <th align="center">9 (b) </th>
                <th align="center">9 (c) </th>
                <th align="center">10</th>
                <th align="center">10 (a) </th>
                <th align="center">10 (b) </th>
                <th align="center">11 (a) </th>
                <th align="center">11 (b) </th>
                <th align="center">11 (c) </th>
                <th align="center">12 </th>
                <th align="center">13</th>
              </tr>
              <!-- Table Contents -->
			  <?php if($_REQUEST['View']!='')
			  {
			  	$filter=array();
		
				$fromDate=$_REQUEST['fromDate'];
				$fromDateBrk=explode("/",$fromDate);
				$fromDate=$fromDateBrk[0];
				$fromMonth=$fromDateBrk[1];
				$fromYear=$fromDateBrk[2];
				$From=$fromYear."-".$fromMonth."-".$fromDate;
				
				$toDate=$_REQUEST['toDate'];
				$toDateBrk=explode("/",$toDate);
				$toDate=$toDateBrk[0];
				$toMonth=$toDateBrk[1];
				$toYear=$toDateBrk[2];
				$To=$toYear."-".$toMonth."-".$toDate;
				
				if($_REQUEST['site']!='0')
				$filter[]="site = '".$_REQUEST['site']."'";
				if($_REQUEST['vendor']!='0')
				$filter[]="vendor = '".$_REQUEST['vendor']."'";
				if($_REQUEST['fromDate']!='' && $_REQUEST['toDate']!='')
				$filter[]="billDate BETWEEN '".$From."' and '".$To."'";
				
				if($filter!='')
				{
					$filter=implode(" and ",$filter);
				}
				
				$sql="Select * from import_billbook where $filter";
				echo $sql;
			  	$result=DB_query($sql,$db); 
				$i=0;
				while($myrow=DB_fetch_array($result)){
			  ?>
              <tr bgcolor="#FFFFFF">
                <td><strong><?php echo $i+1;?></strong></td>
                <td><strong><?php echo $myrow['billDate'];?></strong></td>
                <td><strong><?php $A3=0; echo $A3;?></strong></td>
                <td><strong><?php $B3=0; echo $B3;?></strong></td>
                <td><strong><?php $C3=0; echo $C3;?></strong></td>
                <td><strong><?php echo $myrow['billNo'];?></strong></td>
                <td><strong>
				  <?php 
				$EC_Code=$s->getField('suppliers','vendor_code',$myrow['vendor'],'excise_no');
				echo $EC_Code;?></strong>
				</td>
                <td>
				  <strong>
				  <?php 
				$range_divisionSQL=DB_query("Select sup_range,sup_division from suppliers where vendor_code='".$myrow['vendor']."'",$db);
				$rd_result=DB_fetch_array($range_divisionSQL);
				echo "Range = ".$rd_result['sup_range']."<br>Div. = ".$rd_result['sup_division'];
				?>
				   </strong></td>
                <td></td>
                <td><strong><?php echo $A7=$myrow['exciseDutyVal'];?></strong></td>
                <td></td>
                <td><strong><?php echo $B7=$myrow['eduCessVal'];?></strong></td>
                <td><strong><?php echo $C7=$myrow['sheCessVal'];?></strong></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
              </tr><?php $i++;} }?>
            </table>
          </div></td>
        </tr>
        <tr>
          <td style="padding:5px; text-align:center;" align="right"><a href=""></a></td>
        </tr>
      </table></td>
  </tr>
</table>