<?php 
$modid=$_REQUEST['modid'];
$frmid=$_REQUEST['frmid'];
$rurl="&modid=".$modid."&frmid=".$frmid;
if($_REQUEST['DelID']!='' && $_REQUEST['act']=='del')
{
  //echo "Delete from salesorder where id='".$_REQUEST['DelID']."'";
  
 	$query1=DB_query("Delete from salesorder where id='".$_REQUEST['DelID']."'",$db);
	 $query2=DB_query("Delete from salesorder_details where masterId='".$_REQUEST['DelID']."'",$db);
	 $s->pageLocation('index.php?route=SalesOrderList&daction=Deleted'.$rurl);
}
if($_REQUEST['ViewID']=='' && $_REQUEST['act']=='') {
?>
<h2 align="center"><strong>Sales Order</strong></h2>

<?php //if($_SESSION['frmAdd']=='1'){?>
<div align="center"><a href="index.php?route=sales_order&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>">ADD PROCESS SALES ORDER</a><br><a href="index.php?route=sales_order_direct&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>">ADD DIRECT SALES ORDER</a></div><?php //}




if($_REQUEST['daction']=='Deleted')
{
   echo "<div class='error'>Record Deleted Sucessfully</div>";
   }



 ?>
<br>
<form action="" method="Post">
<table width="50%" border="0" cellpadding="2" cellspacing="2" align="center">
<tr><td><strong>Branch Wise</strong></td><td><select name="branch_id" style="width: 100%">
	<option value="000">Select Branch</option>
    	<?php $site_sql=DB_query("Select loccode, locationname from locations where CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
    	while($site_row=DB_fetch_array($site_sql))
		{?>
			<option value="<?php echo $site_row['loccode'];?>"<?php echo($_SESSION['site']==$site_row['loccode']?'selected':'')?>><?php echo $site_row['locationname'];?></option>
		<?php 	
		}
    	?></select></td>
    	<td><strong>Party Wise</strong></td>
    	<td><select name="party_id" style="width: 80%">
    		<option value="000">Select Party</option>
	<?php 
	$vendor_sql=DB_query("Select * from clientmaster where CompanyId='".$_SESSION['ACGCompanyId']."' and  Site in('".$_SESSION['AssignedBranch']."') 
		and Zone in(".$_SESSION['AssignedSites'].") order by c_name",$db);
	while($vendor=DB_fetch_array($vendor_sql))
	{
	?>
      <option value="<?php echo $vendor['client_code'];?>"<?php echo ($_REQUEST['party']==$vendor['client_code']?'selected':'')?>><?php echo $vendor['c_name'];?></option>
      <?php } ?>
			</select></td>
    	<td><input type="submit" name="Search" value="Search" /></td>	
</tr></table>	
</form>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <th><strong>S. NO.</strong></th>
    <th><strong>BRANCH</strong></th>
    <th><strong>Party Po NO. </strong></th>
    <th><strong>DATE</strong></th>
    <th><strong>ORDER NO. </strong></th>
    <th><strong>CUSTOMER</strong></th>
  	<th><strong>CREATED BY</strong></th>
    <th><strong>VIEW</strong></th>
    <th><strong>EDIT</strong></th>
    <th><strong>DELETE</strong></th>
  </tr>
  <?php 
 if(isset($_POST['Search']))
{
if($_REQUEST['branch_id']!='000')
{

$sql=DB_query("Select * from salesorder where branch='".$_REQUEST['branch_id']."' and CompanyId='".$_SESSION['ACGCompanyId']."'",$db);
}
 if($_REQUEST['party_id']!='000') 
{
	
$sql=DB_query("Select * from salesorder where client='".$_REQUEST['party_id']."' and CompanyId='".$_SESSION['ACGCompanyId']."'",$db);	
}
if($_REQUEST['branch_id']!='000' and $_REQUEST['party_id']!='000')
{
	
$sql=DB_query("Select * from salesorder where client='".$_REQUEST['party_id']."' and branch='".$_REQUEST['branch_id']."' and CompanyId='".$_SESSION['ACGCompanyId']."'",$db);	
}

$i=1;
$num=DB_num_rows($sql);
if($num>0)
{
  	
	while($myrow=DB_fetch_array($sql)){
  ?>
  <tr bgcolor="#FFFFFF">
  	<td><strong><?php echo $i;?></strong></td>
    <td><?php 
	$sitename=$s->getField('locations','loccode',$myrow['branch'],'locationname');
	echo $sitename;?></td>
    <td><?php echo $myrow['PORefNo'];?></td>
    <td><?php echo ConvertSQLDate($myrow['orderDate']);?></td>
    <td><?php echo $myrow['orderNo'];?></td>
    <td><?php 
	$clientname=$s->getField('clientmaster','client_code',$myrow['client'],'c_name');
	echo $clientname;?></td>
    	<td><?php
	$username=$s->getField('www_users','id',$myrow['createdBy'],'realname');
	echo $username;?></td>
    <td><?php //if($myrow['frmView']=='1'){?><a href="index.php?route=SalesOrderList&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&ViewID=<?php echo $myrow['id'];?>&act=view">View</a><?php //}else{echo "No Permission";} ?></td>
    <td>
    	<?php 
    	$dispatchStatus="SELECT * FROM `dispatch_details` where SOPNo='".$myrow['id']."' ";
		$dispatchResult=DB_query($dispatchStatus,$db);
		if(DB_num_rows($dispatchResult)=='0')
    	{?><a href="index.php?route=EditSalesOrder1&modid=<?php echo $_REQUEST['modid'];?>&frmid=<?php echo $_REQUEST['frmid'];?>&EditID=<?php echo $myrow['id'];?>&act=edit">Edit</a><?php }else{echo "Edit";} ?></td>
    <td><?php if(DB_num_rows($dispatchResult)=='0'){?><a href="index.php?route=SalesOrderList&DelID=<?php echo $myrow['id']?>&act=del<?php  echo $rurl;?>" onClick="return confirm('Do You want to Delete This Record')">Delete</a><?php }else{echo "Delete";} ?></td>
  </tr>
  <?php $i++;} } else {?>
  	<tr bgcolor="#FFFFFF"><td  colspan="10">No Records</td></tr>
  	<?php } }?>
</table>
<?php }
if($_REQUEST['ViewID']!='' && $_REQUEST['act']=='view')
{
$master_sql=DB_query("Select * from salesorder where id='".$_REQUEST['ViewID']."'",$db);
$master_row=DB_fetch_array($master_sql);
?>
<h2 align="center"><strong>View Sales Order</strong></h2><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>
        <table width="85%" cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#ffffff" style="border:1px solid #ccc;">
        <tr>
            <td><div align="center">
                <table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
                  <tr>
                    <th width="21%" align="left"><strong>Branch</strong></th>
                    <td width="28%"><select name="branch" id="branch" style="width:100%" onchange="getOrderNo(this.value)">
                      <?php 
            $site_sql=DB_query("Select loccode,locationname from locations where loccode='".$master_row['branch']."'",$db);
            while($site_row=DB_fetch_array($site_sql)){
                    ?>
                      <option value="<?php echo $site_row['loccode'];?>"><?php echo $site_row['locationname'];?></option>
                      <?php } ?>
                    </select>				</td>
                    <th width="24%" align="left"><strong>Order No.</strong></th>
                    <td width="27%"><div id="orderid"><input type="text" name="orderNo" id="orderNo" value="<?php echo $master_row['orderNo'];?>" size="6"  style="width:100%;" readonly>
                    </div></td>
                  </tr>
                  <tr>
                    <th align="left"><strong>Order Date</strong></th>
                    <td><input type="text" name="orderDate" id="orderDate" value="<?php echo $master_row['orderDate'];?>" style="width:100%;"readonly/></td>
                    <th align="left"><strong>Customer PO Ref. No.</strong></th>
                    <td><input type="text" name="PORefNo" id="PORefNo" style="width:100%;" value="<?php echo $master_row['PORefNo'];?>" readonly/></td>
                  </tr>
                  <tr>
                    <th align="left"><strong>Customer PO Date</strong></th>
                    <td><input type="text" name="customerPODate" id="customerPODate" value="<?php echo $master_row['customerPODate'];?>" style="width:100%;"readonly/></td>
                    <th align="left"><strong>Ammendment Date</strong></th>
                    <td><input type="text" name="ammendmentDate" id="ammendmentDate" value="<?php echo $master_row['ammendmentDate']; ?>" style="width:100%;"readonly/></td>
                  </tr>
                  <tr>
                    <th align="left"><strong>Order Received</strong></th>
                    <td><select name="orderReceived" id="orderReceived" style="width:100%;">
                      <option value="MO" <?php echo($master_row['orderReceived']=='MO'?'selected':'')?>>Material Order</option>
                      <option value="EO" <?php echo($master_row['orderReceived']=='EO'?'selected':'')?>>Export Order</option>
                      <option value="RO" <?php echo($master_row['orderReceived']=='RO'?'selected':'')?>>Retail Order</option>
                      <option value="SO" <?php echo($master_row['orderReceived']=='SO'?'selected':'')?>>Service Order</option>
                      <option value="CO" <?php echo($master_row['orderReceived']=='CO'?'selected':'')?>>CT3 Order</option>
                      </select></td>
                    <th align="left"><strong>Order Type</strong></th>
                    <td><select name="orderType" id="orderType" style="width:100%">
                      <option value="P" <?php echo($master_row['orderType']=='P'?'selected':'')?>>Process Order</option>
                      <option value="O" <?php echo($master_row['orderType']=='O'?'selected':'')?>>Open Order</option>
                      <option value="PS" <?php echo($master_row['orderType']=='PS'?'selected':'')?>>Process Order Schedule</option>
                      <option value="OS" <?php echo($master_row['orderType']=='OS'?'selected':'')?>>Open Order Schedule</option>
                    </select></td>
                  </tr>
                  <tr>
                    <th align="left"><strong>Party Name </strong></th>
                    <td><select name="client" id="client" style="width:100%;" >
                      <?php 
                    $c_sql=DB_query("select id,client_code, c_name from clientmaster where client_code='".$master_row['client']."'",$db);
                    while($c_row=DB_fetch_array($c_sql)){
                    ?>
                      <option value="<?php echo $c_row['client_code'];?>"><?php echo $c_row['c_name'];?></option>
                      <?php } ?>
                    </select></td>
                    <th align="left"><strong>Salesman</strong></th>
                    <td><select name="salesMan" id="salesMan" style="width:100%;">
                      <?php 
                    $sales_sql=DB_query("select id,sales_name from salesman_master where id='".$master_row['salesMan']."'",$db);
                    while($sales_row=DB_fetch_array($sales_sql)){
                    ?>
                      <option value="<?php echo $sales_row['id'];?>"<?php echo ($_REQUEST['salesMan']==$sales_row['id']?'selected':'')?>><?php echo $sales_row['sales_name'];?></option>
                      <?php } ?>
                      </select></td>
                  </tr>
              </table>
          </div>		</td>
        </tr>
        <tr>
    <td valign="top">
    <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td colspan="4" id="quoteId">
     
        <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
    <tr>
        <td nowrap="nowrap" colspan="2" width="50%" valign="top">
        <div id="enquiryId" style="width:100%; margin:0 auto;">
            <table width="100%" cellpadding="2" cellspacing="1" border="0">
                <tr>
                  <th width="21%" align="left" nowrap="nowrap"><strong>Against Quotation</strong></th>
                  <td nowrap="nowrap" width="28%">
                <select name="quoteNumber" style="width:100%;">
                      <?php 
                 
                 $enq_sql=DB_query("Select id,quotationNo from quotation where id='".$master_row['quoteNo']."'",$db);
                while($enq_row=DB_fetch_array($enq_sql))
                {?>
                      <option value="<?php echo $enq_row['id'];?>"<?php echo($_REQUEST['quoteNumber']==$enq_row['id']?'selected':'')?>><?php echo $enq_row['quotationNo'];?></option>	
                      <?php 	
                }
                ?>
                      </select></td>
              <?php 
              $address_sql=DB_query("select pre_address1,pre_address2,pre_address3,pre_country,pre_state,pre_city from clientmaster where client_code='".$master_row['client']."'",$db); $address_row=DB_fetch_array($address_sql);
              
    $countryName=$s->getField('country_master','id',$address_row['pre_country'],'country');
	$stateName=$s->getField('state_master','id',$address_row['pre_state'],'state');
	$cityName=$s->getField('city_master','id',$address_row['pre_city'],'city');
              ?>
                       <th width="24%" rowspan="3" align="left" nowrap="nowrap"><strong>Address</strong></th>
                       <td width="27%"><input name="partyaddress1" type="text" value="<?php echo $address_row['pre_address1'];?>" size="25"  style="width:100%;" readonly/></td>
                  </tr>
                <tr>
                  <th align="left">Valid Till</th>
                  <td><input name="validTill" type="text" value="<?php echo $master_row['validTill'];?>" size="12" class="datepicker"  style="width:100%;" readonly/></td>
                  <td><input name="partyaddress2" type="text" value="<?php echo $address_row['pre_address2'];?>" size="25"  style="width:100%;" readonly/></td>
                  </tr>
             <tr>
               <th width="21%" align="left" nowrap="nowrap"><strong>Send to PPC</strong></th>
               <td nowrap="nowrap" width="28%">
                 <select name="PPC" style="width:100%;" onchange="showEnqDetails(this.value)">
                  <option value="Yes"<?php echo($master_row['PPC']=='Yes'?'selected':'')?>>Yes</option>
                   <option value="No"<?php echo($master_row['PPC']=='No'?'selected':'')?>>No</option>
                   </select></td>
               <td><input name="partyaddress3" type="text" value="<?php echo $address_row['pre_address3'].",".$cityName.",".$stateName.",".$countryName;?>" size="25"  style="width:100%;" readonly/></td>
                  </tr>
         </table>
         </div>
        </td>
        </tr>
    </table>
    
    </td>
    </tr>
    </table>
    </td>
    </tr>
      </table>
      
      
        </td>
    </tr>
	<tr>
	<td>&nbsp;</td>
	</tr>
	<form action="" method="post">	
	<tr>
	<td height="8">
	</td>
    </tr>
	<tr><!-- c6c6c6 -->
			<td valign="top"><div align="center"><div style="overflow: auto; width: 90%; height: 250px">
			<table width="100%" border="0" cellspacing="2" cellpadding="2">
              <tr>
                <th align="center"><strong>S.No</strong></th>
				<th align="center"><strong>Item Code </strong></th>
                <th align="center"><strong>Item Name </strong></th>
				 <th align="center"><strong>Unit</strong></th>
				<th align="center"><strong>Billing Description </strong></th>
                <th align="center"><strong>Quantity</strong></th>
                <th align="center"><strong>Price</strong></th>
                <th align="center"><strong>Per Unit(s)</strong></th>
                <th align="center"><strong>Value</strong></th>
                <th align="center"><strong>Discount Type</strong></th>
				<th align="center"><strong>Discount</strong></th>
				<th align="center"><strong>Discounted Price</strong></th>
				<th align="center"><strong>Date Of Requisition</strong></th>
              </tr>
			  <?php
			  	$details_sql=DB_query("Select * from salesorder_details where masterId='".$_REQUEST['ViewID']."'",$db);
				$k=0;
				while($details_row=DB_fetch_array($details_sql))
				{
			  		$item_sql=DB_query("Select item_name,unit from item_master where StockID='".$details_row['ItemCode']."'",$db);
			  		$item_row=DB_fetch_array($item_sql);
			  ?>
					  <tr bgcolor="#FFFFFF">
					<td><strong><?php echo $k+1;?></strong></td>
					<td><?php echo $details_row['ItemCode'];?><input type="hidden" name="ItemCode[<?php echo $k;?>]" id="ItemCode_<?php echo $k;?>" value="<?php echo $details_row['itemCode'];?>" readonly/></td>
					<td><?php echo $item_row['item_name'];?><input type="hidden" name="ItemDesc[<?php echo $k;?>]" id="ItemDesc_<?php echo $k;?>" value="<?php echo $product_row['item_desc'];?>" readonly/></td>
					<td><?php echo $s->getField('unitsofmeasure','unitid',$item_row['unit'],'unitname');
					$item_row['unit'];?><input type="hidden" name="unit[<?php echo $k;?>]" id="unit_<?php echo $k;?>" value="<?php echo $product_row['unit'];?>" readonly/></td>
					<td><input type="text" value="<?php echo $item_row['item_name'];?>" size="30" /></td>
					<td><input type="text"  value="<?php echo $details_row['Quantity'];?>"  readonly/></td>
					<td align="right"><input type="text"  value="<?php echo $details_row['Rate'];?>"  readonly/></td>
					<td><input type="text" name="pricePer[<?php echo $k;?>]" id="pricePer_<?php echo $k;?>" value="<?php echo $details_row['pricePer'];?>" readonly/></td>
					<td align="right"><input type="text" value="<?php echo $details_row['Amount'];?>"   readonly/></td>
					<td><?php 
					if($details_row['DiscountType']=='A'){echo "Amount";}else{echo "Percentage";}?></td>
					<td><input type="text" value="<?php echo $details_row['Discount'];?>" readonly/></td> 
					<td><input type="text" value="<?php echo $details_row['valAfterDisc'];?>" readonly/></td>
					<td><input type="text" value="<?php echo $details_row['reqDate'];?>" readonly /></td>
					</tr>
			  <?php $k++;}  ?>        

            </table></div></div></td>
    </tr>
	<tr>
	  <td>&nbsp;</td>
	</tr>
	<tr>
	  <td>&nbsp;</td>
	</tr>
	<tr>
		<td>
			<table width="85%" border="0" cellpadding="0" cellspacing="0" align="center" >
<tr>
<td valign="top" width="40%"><table width="100%" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#FFFFFF" style="border:1px solid #ccc;">
	<?php 
$Amount_and_tax=DB_query("Select * from salesorder where id='".$_REQUEST['ViewID']."'",$db);
$myResult=DB_fetch_array($Amount_and_tax);
?>
  <tr>
    <th style="text-align:center;" colspan="2">Terms And Conditions</th>
  </tr>
  <tr>
    <th width="42%" scope="row"><strong>Freight</strong></th>
    <td width="58%"><select name="freightStatus" id="freightStatus" style="width: 100%">
      <option value="ToPay"<?php echo ($myResult['freightStatus']=='ToPay'?'selected':'')?>>To Pay</option>
      <option value="Payed"<?php echo ($myResult['freightStatus']=='Payed'?'selected':'')?>>Payed</option>
      <option value="Nil"<?php echo ($myResult['freightStatus']=='Nil'?'selected':'')?>>Nil</option>
      </select></td>
  </tr>
  <tr>
    <th scope="row"><strong>Against Payment</strong></th>
    <td><select name="paymentAgainst" style="width: 100%">
     <option value="Advance"<?php echo ($myResult['paymentAgainst']=='Advance'?'selected':'')?>>Advance</option>
     <option value="Cash"<?php echo ($myResult['paymentAgainst']=='Cash'?'selected':'')?>>Cash</option>
     <option value="Credit"<?php echo ($myResult['paymentAgainst']=='Credit'?'selected':'')?>>Credit</option>
    </select></td>
  </tr>
  <tr>
    <th scope="row"><strong>Dispatch To</strong></th>
    <td><input type="text" name="dispatchTo" id="dispatchTo" value="<?php echo $myResult['dispatchTo'];?>" size=""  style="width:100%;" readonly/></td>  
    </tr>
</table></td>
<td width="40%" valign="top">

<table width="95%" border="0" cellspacing="1" cellpadding="0" align="right" bgcolor="#FFFFFF" style="border:1px solid #ccc;">
    		<tr>
    	<th style="text-align:center;" colspan="2">Amount And Taxes</th>
    </tr>
    <tr>
    	  <tr>
    	    <th width="14%">Basic Amount</th>
    	    <td width="31%"><input name="basicAmount" type="text" value="<?php echo $myResult['basicAmount'];?>" size="25" style="width:98%;" onfocus="calculateBasic()" id="basicAmount" readonly /></td>
    	    
  	    </tr>
    	  <tr>
    	    <th nowrap="nowrap">Discounted Price</th>
    	    <td><input name="totalDiscountedPrice" id="totalDiscountedPrice" type="text" value="<?php echo $myResult['totalDiscountedPrice']?>" size="25" style="width:98%;"  readonly onfocus="calculateDiscounted()" /></td>
    	    
  	    </tr>
    	  <tr>
    	    <th>Excise</th>
    	    <td nowrap="nowrap">
    	    <select name="exciseDuty" style="width:98%;" onchange="claculateExcise(this.value)">
    	    <?php 
    	    $excise_sql=DB_query("Select id,caption from excise_tax where id='".$myResult['exciseDuty']."' ",$db);
			while($excise_row=DB_fetch_array($excise_sql))
			{?>
				<option value="<?php echo $excise_row['id'];?>"<?php echo ($_REQUEST['exciseDuty']==$excise_row['id']?'selected':'')?>><?php echo $excise_row['caption'];?></option>
			<?php 	
			}
    	    ?> 
  	      </select><div id="exciseId"><input name="exciseValue" id="exciseValue" type="text" value="<?php echo $myResult['exciseValue'];?>" size="25" style="width:98%;" readonly/></div>
    	   </tr>
    	     
    	     <?php 
    	     $cessSql=DB_query("Select caption from excise_tax where caption like '%cess%'",$db);
			 $k=1;
			 while($cessRow=DB_fetch_array($cessSql))
			 {
			 	$caption[$k]=$cessRow['caption']; 
				
				$rate_sql=DB_query("Select def_rate from excise_tax where caption='".$caption[$k]."'",$db);
				while($rate_row=DB_fetch_array($rate_sql))
				{
					$rate[$k]=$rate_row['def_rate'];
				}
				$k++;
			 } 
    	     ?>
    	     <tr>
    	    <th>E-Cess</th>
    	    <td><input name="ECessPercentage" id="ECessPercentage" type="text" value="<?php echo $rate[1];?>" size="25" style="width:20%;" readonly />
    	    	<input name="ECessValue" id="ECessValue" type="text" value="<?php echo $myResult['ECessValue'];?>" size="25" style="width:75%;" readonly onfocus="calculateECess()"/></td>
    	    </tr>
    	    <tr>
            <th nowrap="nowrap">SAH-E Cess </th>
    	    <td><input name="SAHCessPercentage" id="SAHCessPercentage" type="text" value="<?php echo $rate[2];?>" size="25" style="width:20%;" readonly/>
    	    	<input name="SAHCessValue" id="SAHCessValue" type="text" value="<?php echo $myResult['SAHCessValue'];?>" size="25" style="width:75%;" readonly onfocus="calculateSAHCess()"/></td>
  	    	</tr>
    	  
    	  
   <tr>
   	<th>Taxable Amount</th>
   	<td><input name="taxableAmount" id="taxableAmount" type="text" value="<?php echo $myResult['taxableAmount'];?>" size="25" style="width:98%;" onfocus="calculateTaxable()" readonly/></td>
   </tr> 	  
    	  
    	  <tr>
    	    <th>VAT/CST</th>
    	    <td nowrap="nowrap">
    	    <select name="VatCst" id="value3" style="width:98%;" onchange="calculateVATCST(this.value)">
    	    <?php 
    	    $salesSql=DB_query("Select * from sales_tax_master where salestax_id='".$myResult['VatCst']."'",$db);
			while($salesRow=DB_fetch_array($salesSql))
			{?>
				<option value="<?php echo $salesRow['salestax_id'];?>"><?php echo $salesRow['tax_code'];?></option>
			<?php 	
			}
    	    ?>
  	      </select>
    	      <div id="VATId"><input name="VatCstValue" id="VatCstValue" type="text" value="<?php echo $myResult['VatCstValue'];?>" size="25" style="width:98%;" readonly /></div></td>
    	    
  	    </tr>
    	  <tr>
    	    <th>Freight</th>
    	    <td><input name="freightValue" id="value2" type="text" value="<?php echo $myResult['freightValue'];?>" size="25" style="width:98%;" readonly/></td>
    	    
  	    </tr>
    	  <tr>
    	    <th>Pkg Charges</th>
    	    <td><input name="packagingCharges" id="value1" type="text" value="<?php echo $myResult['packagingCharges'];?>" size="25" style="width:98%;" readonly/></td>
    	    
  	    </tr>
  	    <tr>
    	    <th>Additional Charges</th>
    	    <td><input name="additionalCharges" id="value4" type="text" value="<?php echo $myResult['additionalCharges'];?>" size="25" style="width:98%;" readonly/></td>
    	    
  	    </tr>
    	  <tr>
    	    <th>Round Off</th>
    	    <td><input name="roundOff" type="text" value="<?php echo $myResult['roundOff'];?>" size="25" style="width:98%;" readonly /></td>
    	    
  	    </tr>
    	  <tr>
    	    <th>Grand Total</th>
    	    <td><input name="grandTotal" id="grandTotal" type="text" value="<?php echo $myResult['grandTotal'];?>" size="25" style="width:98%;" onfocus="calculateGrand()" readonly/></td>
    	    
  	    </tr>
  	    </table>
</td>
</tr></table>
      </td>
	</tr>
</table>
<?php 
}
?>
