<?php
error_reporting("E_ALL");
$PageSecurity = 5;

$sql=DB_query("select * from dbl_sale_return where id='".$_REQUEST['SID']."'",$db);
$myrow1=DB_fetch_array($sql);


?>
<link rel="stylesheet" href="css/new_mxerp.css">

<link rel="stylesheet" href="css/jquery.ui.all.css" />
<script src="js/jquery-1.5.1.js"></script>
<script src="ui/jquery.ui.core.js"></script>
<script src="ui/jquery.ui.widget.js"></script>





	<h3><strong>View Sales Return</strong></h3>
	<br />
			
			<div style="width:auto; margin-left:auto; margin-right:auto;">


			<table width="96%" border="1" cellpadding="3" cellspacing="0">
			 <tr>
		<th width="11%"><strong>Form No</strong></th>
		<td width="17%"><?php echo $myrow1['form_no']; ?></td>
		<th width="14%"><strong>Form Date</strong></th>
		<td width="16%"><?php echo ConvertSQLDate($myrow1['form_date']); ?></td>
		<th width="15%" nowrap="nowrap"><strong>Return Type </strong></th>
		<td width="27%"><?php echo $myrow1['return_typep']; ?></td>
			 </tr>
			 <tr>
				<th nowrap="nowrap"><strong>Customer Name</strong></th>
				<td><?php echo $s->getField('clientmaster','id',$myrow1['customer'],'c_name'); ?></td>
				<th nowrap="nowrap"><strong>Pick List No </strong></th>
                <td><?php echo $s->getField('dbl_dealer_dispatch','id',$myrow1['pln'],'pick_list_no'); ?></td>
                <th><strong>Pick List Date</strong></th>
                <td><?php echo ConvertSQLDate($myrow1['pln_date']); ?></td>
			 </tr>
			
			  <tr>
			    <th ><strong>Area</strong></th>
			    <td><?php echo $s->getField('zone_master','id',$myrow1['area'],'ZoneTitle'); ?></td>
			    <th><strong> Sub Area</strong></th>
			    <td ><?php echo $s->getField('subzone_master','id',$myrow1['sub_area'],'subzone'); ?></td>
			    <th><strong>Engineer</strong></th>
				<td><?php echo $s->getField('dbl_engineer_master','id',$myrow1['engineer'],'engineer_name'); ?></td>
			  </tr>
			  <tr>
				<th nowrap="nowrap">SOI No</th>
				<td><?php echo $s->getField('dbl_process_sale_order','id',$myrow1['soi_no'],'SOI_no'); ?></td>
				<th nowrap="nowrap">SOI Date </th>
                <td><?php echo ConvertSQLDate($myrow1['soi_date']); ?></td>
                <th>PO No </th>
                <td><?php echo $myrow1['po_no']; ?></td>
			 </tr>
			  <tr>
				<th nowrap="nowrap"><strong>Mistake Type</strong></th>
				<td><?php echo $myrow1['mistake_type']; ?></td>
				<th nowrap="nowrap"><strong>Responsible</strong></th>
                <td><?php echo $myrow1['responsible']; ?></td>
                <th><strong>Incentive Reco</strong></th>
                <td><?php echo $myrow1['Inc_Reco']; ?></td>
			 </tr>
			 <tr>
				<th nowrap="nowrap"><strong>Restocking Charges</strong></th>
				<td><?php echo $myrow1['resto_chrg']; ?></td>
				<th nowrap="nowrap"><strong>Excise</strong></th>
                <td><?php echo $myrow1['Excise']; ?></td>
                <th><strong>Party Ref No</strong></th>
                <td>&nbsp;</td>
			 </tr>
			 <tr class="row1">
    <td class="tabledata1" colspan="6">
	<table width="50%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10%"><strong>Sales</strong></td>
    <td width="10%">
		<input type="radio" name="saletype" id="saletype" value="sales"  <?php if($myrow1['saletype']=='sales') { ?> checked="checked" <?php } ?>/>
	</td>
    <td width="10%"><strong>Sample</strong></td>
    <td width="10%">
		<input type="radio" name="saletype" id="saletype" value="sample" <?php if($myrow1['saletype']=='sample') { ?> checked="checked" <?php } ?> />
	</td>
    <td width="10%"><strong>warranty</strong></td>
    <td width="10%">
		<input type="radio" name="saletype" id="saletype" value="warranty" <?php if($myrow1['saletype']=='warranty') { ?> checked="checked" <?php } ?> />
	</td>
    <td width="10%"><strong>Invoice</strong></td>
    <td>
		<input type="radio" name="saletype" id="saletype" value="invoice" <?php if($myrow1['saletype']=='invoice') { ?> checked="checked" <?php } ?> />
	</td>
  </tr>
</table>

	</td>
    </tr> </table>				
				
			</div>
				  
				 
<p align="left">&nbsp;</p>				 
<div style="width:auto; margin-left:auto; margin-right:auto;"> 
<table width="100%" border="1" cellspacing="0" cellpadding="3">
  <tr class="row1">
    <td class="tabledata"><strong>Sr. No.</strong></td>
    <td class="tabledata"><strong>Part No.</strong></td>
    <td class="tabledata"><strong>Part name</strong></td>
    <td class="tabledata"><strong>Invoice Qty</strong></td>
	<td class="tabledata"><strong>Returned Qty</strong></td>
	<td class="tabledata"><strong>Accepted Qty </strong></td>
	<td class="tabledata"><strong>Rate Amount</strong></td>
	<td class="tabledata"><strong>Return Reason</strong></td>
    <td class="tabledata"><strong>Return Type</strong></td>
	<td class="tabledata"><strong>Store</strong></td>
  </tr>
<?php
$i=1; 
$sql1=DB_query("select * from dbl_sale_return_details where parant_id='".$_REQUEST['SID']."'",$db);
while($row=DB_fetch_array($sql1))
{
?>
 <tr class='row1'>
 <td class='tabledata'><?php echo $i; ?></td>
<td style='white-space:nowrap;' class='tabledata'><?php echo $s->getField('item_master','id',$row['mst_itemid'],'StockID'); ?></td>
<td class='tabledata'><?php echo $s->getField('item_master','id',$row['mst_itemid'],'item_name'); ?></td>
<td class='tabledata'><?php echo $row['invoice_qty']; ?></td>
<td class='tabledata' style='white-space:nowrap'><?php echo $row['return_qty']; ?></td>
<td class='tabledata'><?php echo $row['accepted_qty']; ?></td>
<td class='tabledata'><?php echo $row['rate']; ?></td>
<td class='tabledata'><?php echo $row['return_reason']; ?></td>
<td class='tabledata'><?php echo $row['return_type']; ?></td>
<td class='tabledata'><?php echo $s->getField('dbl_dealer_store','id',$row['dblstore'],'dealer_store_name'); ?></td>
 </tr>
<?php  $i++; } ?>			
	</table>
  </div>
			</div>
	

