<?php $PageSecurity = 11;
include('includes/session.inc');
//include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');

if($_REQUEST['id']=='Consolidate')
{
	
	?>
<table align="center" width="100%;" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
<tr ><td class="tabledata" style="text-align:center;" colspan="12">Item Details</td></tr>
<tr >
<td class="tabledata">Sr No</td>
<td class="tabledata"></td>
<td class="tabledata">Item Code</td>
<td class="tabledata">Item Name</td>
<td class="tabledata">Size</td>
<td colspan="2" class="tabledata" style="text-align:center"><span class="tabledata" style="text-align:center">Quantity</span></td>
<td class="tabledata">Price</td>
<td class="tabledata">Total Amt</td>
<td class="tabledata">Excise Duty Rate</td>
<td class="tabledata">ED Amt</td>
</tr>
  <tbody id="dataTable">
  	<tr >
<td style="white-space:nowrap;" class="tabledata"><input name="delitem[]" type="checkbox" value="<?php echo $item_row['id'];?>" />
</td>	
<td class="tabledata"><input type="hidden" name="item_code[]" id="itemid" /></td>
<td class="tabledata"><input type="text" name="" value="" id="itemcode" size="6" /></td>
<td class="tabledata" style="white-space:nowrap"><input type="text" name="" value="" id="itemname" /></td>
<!--<td class="tabledata"><input type="text" name="Qty[]" value="" id="qty" size="6" /></td>-->
  <td class="tabledata"><select  name="size[]" id="size"  >
						<option >--Select--</option>
                   <?php $SQLSize=DB_query("SELECT * FROM size_master where CompanyId='".$_SESSION['ACGCompanyId']."'",$db); 
					while($sizeid=DB_fetch_array($SQLSize)){?>
					<option value="<?php echo $sizeid['id']; ?>"><?php echo $sizeid['size']; ?></option>
					<?php } ?></select></td>
   <td class="tabledata"><input type="text" name="qty[]" id="qty" size="10px;"  onkeyup="showsecondary(this.value,this.id)" />      </td>
  <!-- onchange="showconvunit(this.value,this.id)"-->
	<td class="tabledata"><select name="unit[]" id="unit"  style="width:54px;"  >
	                      <option value="0">Select</option>
						  <?php  $unit=DB_query("select * from  unitsofmeasure",$db);
						   while($unit_row=DB_fetch_array($unit))
						   {
						   ?>
						   <option value="<?php echo $unit_row['unitid']; ?>"><?php echo $unit_row['unitname']; ?></option>
						   <?php } ?>
                          </select></td>
						  
<td class="tabledata"><input type="text" name="price[]" value="" id="price" onkeyup="calculateTotalAmt(this.value,this.id)" size="6"/></td>
<td class="tabledata"><input type="text" name="stock_value[]" value="" id="totalamt" readonly="true" size="9"/></td>
<td class="tabledata"><select name="EDRate[]" id="exciserate" style="width:107px" 
onchange="calculateExcise(this.value,this.id)">
<option value="0">--Select--</option>
<?php
$ServiceSql="select * from  excise_tax WHERE caption LIKE '%excise%'" ;
$ServiceRes=DB_query($ServiceSql,$db);
while($ServiceRow=DB_fetch_array($ServiceRes))
{
?>
<option value="<?php echo $ServiceRow['id']?>" <?php echo($edit_EDRate==$ServiceRow['id']?'selected':'') ?>><?php echo $ServiceRow['caption'];?></option>
<?php	
}
?>
</select></td>
<td class="tabledata"><input type="text" name="EDAmt[]" value="" id="excisevalue" size="5"/></td>

</tr>
</tbody>
 </table>

<?php } else
 { ?>
 	<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border:#666666 solid 1px;">
               <tr class="row1">
                <th>S.No</th>	
                <th></th>			
				<th>Item Code</th>
				<th>Item Name. </th>
				<th>Qty</th>
                <th>Price</th>
                <th>Total Amt</th>
                <th>MRP /Unit</th>
                <th>Ass Price</th>
                <th>Total Ass Value</th>
                <th>Excise Duty Rate</th>
                <th>ED Amt</th>
              </tr>
			   <tbody id="dataTable">
				<tr class="row1">
<td style="white-space:nowrap;" class="tabledata"><input name="delitem[]" type="checkbox" value="<?php echo $item_row['id'];?>" />
</td>	
<td class="tabledata"><input type="hidden" name="item_code[]" id="itemid" /></td>
<td class="tabledata"><input type="text" name="" value="" id="itemcode" size="6" /></td>
<td class="tabledata" style="white-space:nowrap"><input type="text" name="" value="" id="itemname" /></td>
<td class="tabledata"><input type="text" name="Qty[]" value="" id="qty" size="6" /></td>
<td class="tabledata"><input type="text" name="price[]" value="" id="price"  size="6"/></td>
<td class="tabledata"><input type="text" name="stock_value[]" value="" id="totalamt" readonly="true" size="9"/></td>
<td class="tabledata"><input type="text" name="mrp_per[]" value="" id="mrpper"  size="9" onkeyup="calassprice(this.value,this.id)" /></td>
<td class="tabledata"><input type="text" name="ass_price[]" value="" id="ass_price" readonly="readonly"  size="9"/></td>
<td class="tabledata"><input type="text" name="total_ass_price[]" value="" id="totalassamt" readonly="true" size="25" onfocus="calass_amount(this.id)" /></td>

<td class="tabledata"><select name="EDRate[]" id="exciserate" style="width:107px" 
		onchange="calculateExcise1(this.value,this.id)">
      <option value="0">--Select--</option>
      <?php
    		$ServiceSql="select * from  excise_tax WHERE caption LIKE '%excise%'" ;
			$ServiceRes=DB_query($ServiceSql,$db);
			while($ServiceRow=DB_fetch_array($ServiceRes))
			{
			?>
      <option value="<?php echo $ServiceRow['id']?>" <?php echo($edit_EDRate==$ServiceRow['id']?'selected':'') ?>><?php echo $ServiceRow['caption'];?></option>
      <?php	
			}
    		?>
    </select></td>
   <td class="tabledata"><input type="text" name="EDAmt[]" value="" id="excisevalue" size="5"/></td>
   
  </tr>
  </tbody>
</table>	
	
<?php } ?>	


