<?
session_start();
include("test.php");
include("opendb.php");
include("includes/function.php");
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}



$us=mysqli_query($db,"select level from bruser where username='$user'")or die(mysqli_error($db));
$r=mysqli_fetch_row($us);
$user_level=$r[0];
 //print "User Level:".$user_level;
        
?>
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>World Wide Automotive Center</title>
    <script type="text/javascript" src="scripts/jquery-latest.js"></script>
	<link type="text/css" href="includes/style1.css" rel="stylesheet" />
<link type="text/css" href="css/form1.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script>

$(document).ready(function() {
	$('a.login-window').click(function() {
		
		// Getting the variable's value from a link 
		var loginBox = $(this).attr('href');

		//Fade in the Popup and add close button
		$(loginBox).fadeIn(300);
		
		//Set the center alignment padding + border
		var popMargTop = ($(loginBox).height() + 24) / 2; 
		var popMargLeft = ($(loginBox).width() + 24) / 2; 
		
		$(loginBox).css({ 
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft
		});
		
		// Add the mask to body
		$('body').append('<div id="mask"></div>');
		$('#mask').fadeIn(300);
		
		return false;
	});
	
	// When clicking on the button close or the mask layer the popup closed
	$('a.close, #mask').live('click', function() { 
	  $('#mask , .login-popup').fadeOut(300 , function() {
		$('#mask').remove();  
	}); 
	return false;
	});
});



 $(document).ready(function(){
  $("#svbttn").click(function(){

$("#msgbox").html('<small>Loading...</small>');


   
  	 var values1 = $("#jforms").serialize();


  	  $.ajax({
   	   url: "sv_purchase_return.php",
    	  type: "POST",
   	  data:   values1,
     	  success: function(msg){

 

           	 if(parseInt(msg)!=0)    

          	  {

                $('#msgbox').html(msg);
 
		}
           

      	},
      error:function(){
          alert("failure");
          $("#msgbox").html('there is error while submit');
      }   
   	 }); 

	 }); 
	 }); 
       

</script>

  <style>
#mask {
	display: none;
	background:url(images/bgimg1.gif) repeat;
	//background: #000; 
	position: fixed; left: 0; top: 0; 
	z-index: 10;
	width: 100%; height: 100%;
	opacity: 0.8;
	z-index: 999;
}

.login-popup{
		display:none;
	background:white;
	padding: 10px; 	
	border: 2px solid #ddd;
	float: left;
	font-size: 1.2em;
	position: fixed;
	top: 4%; left: 45%;
	z-index: 99999;
	box-shadow: 0px 0px 20px #999;
	-moz-box-shadow: 0px 0px 20px #999; /* Firefox */
    -webkit-box-shadow: 0px 0px 20px #999; /* Safari, Chrome */
	border-radius:3px 3px 3px 3px;
    -moz-border-radius: 3px; /* Firefox */
    -webkit-border-radius: 3px; /* Safari, Chrome */
}
}

img.btn_close {
	float: right; 
	margin: -28px -28px 0 0;
}

fieldset { 
	border:none; 
}

form.signin .textbox label { 
	display:block; 
	padding-bottom:7px; 
}

form.signin .textbox span { 
	display:block;
}

form.signin p, form.signin span { 
	color:white; 
	font-size:11px; 
	line-height:18px;
} 

form.signin .textbox input { 
	background:#666666; 
	border-bottom:1px solid #333;
	border-left:1px solid #000;
	border-right:1px solid #333;
	border-top:1px solid #000;
	color:white; 
	border-radius: 3px 3px 3px 3px;
	-moz-border-radius: 3px;
    -webkit-border-radius: 3px;
	font:13px Arial, Helvetica, sans-serif;
	padding:6px 6px 4px;
	width:200px;
}

form.signin input:-moz-placeholder { color:white; text-shadow:0 0 2px #000; }
form.signin input::-webkit-input-placeholder { color:hwite; text-shadow:0 0 2px #000;  }

.submit button { 
	background: -moz-linear-gradient(center top, #f3f3f3, #dddddd);
	background: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#dddddd));
	background:  -o-linear-gradient(top, #f3f3f3, #dddddd);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f3f3f3', EndColorStr='#dddddd');
	border-color:#000; 
	border-width:1px;
	border-radius:4px 4px 4px 4px;
	-moz-border-radius: 4px;
    -webkit-border-radius: 4px;
	color:#333;
	cursor:pointer;
	display:inline-block;
	padding:6px 6px 4px;
	margin-top:10px;
	font:12px; 
	width:100px;
}

.button:hover { background:#ddd; }


.del{
      border: none;
     background: url("images/delete.png") no-repeat scroll 0 0 transparent;
}



<style>
#mask {
	display: none;
	background:url(images/bgimg1.gif) repeat;
	//background: #000; 
	position: fixed; left: 0; top: 0; 
	z-index: 10;
	width: 100%; height: 100%;
	opacity: 0.8;
	z-index: 999;
}

.login-popup{
		display:none;
	background:white;
	padding: 10px; 	
	border: 2px solid #ddd;
	float: left;
	font-size: 1.2em;
	position: fixed;
	top: 4%; left: 45%;
	z-index: 99999;
	box-shadow: 0px 0px 20px #999;
	-moz-box-shadow: 0px 0px 20px #999; /* Firefox */
    -webkit-box-shadow: 0px 0px 20px #999; /* Safari, Chrome */
	border-radius:3px 3px 3px 3px;
    -moz-border-radius: 3px; /* Firefox */
    -webkit-border-radius: 3px; /* Safari, Chrome */
}
}

img.btn_close {
	float: right; 
	margin: -28px -28px 0 0;
}

fieldset { 
	border:none; 
}

form.signin .textbox label { 
	display:block; 
	padding-bottom:7px; 
}

form.signin .textbox span { 
	display:block;
}

form.signin p, form.signin span { 
	color:white; 
	font-size:11px; 
	line-height:18px;
} 

form.signin .textbox input { 
	background:#666666; 
	border-bottom:1px solid #333;
	border-left:1px solid #000;
	border-right:1px solid #333;
	border-top:1px solid #000;
	color:white; 
	border-radius: 3px 3px 3px 3px;
	-moz-border-radius: 3px;
    -webkit-border-radius: 3px;
	font:13px Arial, Helvetica, sans-serif;
	padding:6px 6px 4px;
	width:200px;
}

form.signin input:-moz-placeholder { color:white; text-shadow:0 0 2px #000; }
form.signin input::-webkit-input-placeholder { color:hwite; text-shadow:0 0 2px #000;  }

.submit button { 
	background: -moz-linear-gradient(center top, #f3f3f3, #dddddd);
	background: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#dddddd));
	background:  -o-linear-gradient(top, #f3f3f3, #dddddd);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f3f3f3', EndColorStr='#dddddd');
	border-color:#000; 
	border-width:1px;
	border-radius:4px 4px 4px 4px;
	-moz-border-radius: 4px;
    -webkit-border-radius: 4px;
	color:#333;
	cursor:pointer;
	display:inline-block;
	padding:6px 6px 4px;
	margin-top:10px;
	font:12px; 
	width:100px;
}

.button:hover { background:#ddd; }


.del{
      border: none;
     background: url("images/delete.png") no-repeat scroll 0 0 transparent;
}



/*  code below for search button* /


/* reset webkit search input browser style */
input[type=search] {
	outline: none;
}
input[type=search] {
	-webkit-appearance: textfield;
	-webkit-box-sizing: content-box;
	font-family: inherit;
	font-size: 100%;
}
input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button {
	display: none; /* remove the search and cancel icon */
}

/* search input field */
input[type=search] {
	background: #ededed url(images/search-icon.png) no-repeat 9px center;
	border: solid 1px #ccc;
	padding: 9px 10px 9px 32px;
	width: 45px;
	
	-webkit-border-radius: 10em;
	-moz-border-radius: 10em;
	border-radius: 10em;
	
	-webkit-transition: all .5s;
	-moz-transition: all .5s;
	transition: all .5s;
}
input[type=search]:focus {
	width: 130px;
	background-color: #fff;
	border-color: #6dcff6;
	
	-webkit-box-shadow: 0 0 5px rgba(109,207,246,.5);
	-moz-box-shadow: 0 0 5px rgba(109,207,246,.5);
	box-shadow: 0 0 5px rgba(109,207,246,.5);
}

/* placeholder */
input[type=search]:-moz-placeholder {
	color: #999;
}
input[type=search]::-webkit-input-placeholder {
	color: #999;
}



.sel{
     padding:9px;
    margin: 0;
    border-radius:4px;
    -webkit-box-shadow: 
        0 0px 0 #ccc,
        0 0px #fff inset;
   
    color:black;
    border:none;
    display: inline-block;
   // -webkit-appearance:none; 
    cursor:pointer;
    border: 1px solid #ccc;
     background: -moz-linear-gradient(top, #FBFBFB 0%, #E9E9E9 100%);
    background:  -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FBFBFB), color-stop(100%,#E9E9E9));
    width:183px;
    }

.sub_btn{
    padding:9px;
    margin: 0;
    border-radius:4px;
    -webkit-box-shadow: 
        0 0px 0 #ccc,
        0 0px #fff inset;
  
    color:black;
    border:none;
    outline:none;
    display: inline-block;
    -webkit-appearance:none; 
    cursor:pointer;
    border: 1px solid #ccc;

    }
</style>




</style>
 <script>
      


function handleEnter (field, event) {
               
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 


                if (keyCode == 38){
                    var row=field.parentNode.parentNode.rowIndex;
			 var col  =field.parentNode.cellIndex ;
			 
                     document.getElementById('myTable').rows[row-1].cells[col].getElementsByTagName("input")[0].focus();
			
			 
              }

                  if (keyCode == 40){
                    var row=field.parentNode.parentNode.rowIndex;
			 var col  =field.parentNode.cellIndex ;
			 
                     document.getElementById('myTable').rows[row+1].cells[col].getElementsByTagName("input")[0].focus();
			
			 
              }
                     if (keyCode == 37){


                  

                   var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i - 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
			
			 
              }
               
 
                   
		else
		return true;
	}      


     function check_val(val1,r,event){
          
          
          var i =r.parentNode.parentNode.rowIndex;
   	   var tbl=document.getElementById('myTable');
          var id1=tbl.rows[i].cells[0].innerHTML;
          var val=parseFloat(val1).toFixed(2);
	   var qry_id=document.getElementById('retn_qty'+id1);
          var p_qty=document.getElementById('qty'+id1).value;
          if((isNaN(val))||(val>p_qty)){
            alert('Invalid Entry');
            qry_id.value='0';
            qry_id.select();
            check_val(0,r,event);
            return false;
          }
          
          
          var ret_tot=0; 
         var rowcount=tbl.rows.length;
         for(var p=1;p<rowcount;p++){
         	
        	var id3=tbl.rows[p].cells[0].innerHTML;
              var gtot=document.getElementById('gtot'+id3).value;
		var qty=document.getElementById('qty'+id3).value;
              var r_qty=document.getElementById('retn_qty'+id3).value;
              document.getElementById('pr_tot'+id3).value=(gtot/qty*r_qty).toFixed(2);
              ret_tot+=(gtot/qty*r_qty);
               
         }
         
         document.getElementById('spare_total').value=ret_tot.toFixed(2); 
 
         check_valid();
     }

   

 function check_valid(){

   
   var val=document.getElementById('round_fig').value;
   var sign=document.getElementById('sign').value;

 
   if((isNaN(val))||(val>=1))
   {
    alert('Invalid Number');

    document.getElementById('round_fig').value='0.00';
    document.getElementById('round_fig').focus();
    document.getElementById('round_total').value=(document.getElementById('spare_total').value)-(document.getElementById('round_fig').value);

  }

  else{
    if(sign=='+'){
     
       document.getElementById('round_total').value=(parseFloat(document.getElementById('spare_total').value)+parseFloat(document.getElementById('round_fig').value)).toFixed(2);
     }
    if(sign=='-'){

      document.getElementById('round_total').value=(parseFloat(document.getElementById('spare_total').value)-parseFloat(document.getElementById('round_fig').value)).toFixed(2);

     }

 }

}


</script>
<style>
.tble1 input {
background-color:transparent;
border: 0px solid;
height:20px;
//width:160px;
color:black;
}
.tble1
{
border-collapse:collapse;
border:1px solid silver;
margin-top:20px;
}	
.tble1 td, th
{
border-collapse:collapse;
border:1px solid silver;
}


#tbl1{
 margin-top:40px;
min-width:65%;
 text-align:center;
}

#tbltd1{
vertical-align: top;
margin-top:20px;
 height:400px;
background-color:white;
-moz-box-shadow: 0 0 5px -1px #000;
-webkit-box-shadow: 0 0 5px -1px #000;
box-shadow: 0 0 5px -1px #000;

}
#tbl1 td{
 text-align:left;

}
#tbl2{
 //margin:50px 20px 10px 20px;
 width:100%;
}
#tbl3{
 width:100%;
border-collapse:collapse;
}
#myTable{
width:100%;
border-collapse:collapse;
}
#myTable2{
width:100%;
border-collapse:collapse;
}
#myTable td,th{
border:1px solid grey;
}
#myTable th{
font-color:black;
}
#myTable2 td,th{
border:1px solid grey;
}
#tbl3 td,th{
border:1px solid grey;
}
</style>




<?
  
?>
<?php include('includes/top.php'); ?>
<body style="text-align: center;"  >


         <table class='tbl1' id='tbl1'  align='center'><tr><td align='left' colspan='6'>
		<h1 style="font-size:20px;font-weight:bold;font-family:verdana;color:#FFFFFD;margin:0px; padding:0px;">
		 PURCHASE RETURN</h1></td></tr>


<tr>
  <td  colspan='6' style="text-align:right;" ><a href="edit_purchase_return.php" target='blank'  style="text-decoration:none;"><input  style="height:32px;width:110px;" value="Edit" type="button" ></a>

<a href="#login-box" class="login-window" style="text-decoration:none;"><input  style="height:32px;width:110px;" value="Save" type="button" id='svbttn'></a>

</td>
</tr>
	
<tr><td id='tbltd1' colspan='6'>

<div>
 <fieldset style="border:2px solid grey; border-style:dotted;">
            <legend style="text-align:center;">Purchase Return</legend>
<table align='center'>

<form name='f1' action='<? print $PHP_SELF;?>'  >
  <tr><td>        <font color='white'>Select Purchase No. </font><select name=invno>
<option>(Pur.No)--(Jc.No)--(Reg.NO)</option>
<?
$re=mysqli_query($db,"select distinct jcno, msno,invno from pjobcard where brcode='$brcode' order by invno desc");
while($row=mysqli_fetch_row($re))
{
 	$re2=mysqli_query($db,"select * from pur_return  where brcode='$brcode' and pur_invno='$row[2]' ");


 		print "<option value='$row[2]'>".round($row[2])."--".round($row[0])."--$row[1]</option>";
	
}
?>
</select>
</td><td ><input type='submit' name='show' value='Show' ></td></tr>

      

</table>
</form>
<?
if($show)
{
 $res1=mysqli_query($db,"select * from pjobcard where invno='$invno' and brcode='$brcode'");
   $prow=mysqli_fetch_array($res1);
 $res=mysqli_query($db,"select * from gateentry where jcno='$prow[jcno]' and brcode='$brcode'");
 $jrow=mysqli_fetch_array($res);
?>

<form id="jforms" name="f2" method='post'>

<input type='hidden' name='updprint' id='upd_flag' value='2'>

<table class='tbl2' id='tbl2'><tr><td style="width:100%;">
   <table border=1 id='tbl3'>
<tr>PurNo: <input type=text readonly name='invno' size=5 value='<?print $invno?>'>  <input type=hidden name='jcno' size=5 value='<?print $prow[jcno]?>'></tr>
<tr><td>Date </td><td><input type=text readonly name='date' value= '<?print datetohtml($jrow[entrydate])?>' size=8></td>
    <td>RegNo </td><td><input type=text readonly name='msno' value='<?print $jrow[regno]?>' size=12></td>

	<td>Delivery Date</td><td><input type=text readonly name='dcomm' value='<?print datetohtml($jrow[estdate])?>' size=8></td>
	<td>Model </td><td><input type=text readonly name='model' value='<?print $jrow[model]?>' size=8></td>
	<td>Owner </td><td><input type=text readonly name='cname' value='<?print $jrow[owner]?>'></td>
</tr>
<tr>	<td>Make </td><td><input type=text readonly name='stdate' value='<?print $jrow[vehiclename]?>'></td>
	<td>Ins type </td><td><input type=text readonly name='instype' value='<?print $jrow[instype]?>'></td>
	<td>Job Type </td><td><input type=text readonly name='wtstdate' value='<?print $jrow[jobtype]?>' size=8></td>
	<td>ReceivedBy </td><td><input type=text readonly name='wtyenddate' value='<?print $jrow[receivedby]?>' size=8></td>
	<td>KMS </td><td><input type=text name='hmr' size=8 value='<?print $jrow[hmr]?>'></td>

</tr>
<tr>
			<td>User </td><td><input type=text readonly name='user' value='<?print $user?>' size=8></td>
<td>Entry Date </td><td colspan=3>
dd <input type=text readonly name='entrdate1' size=1 value='<?print date('d')?>'>
mm <input type=text readonly name='entrdate2' size=1 value='<?print date('m')?>'>
yy <input type=text readonly name='entrdate3' size=2 value='<?print date('Y')?>'>
</td>
<td>ChasisNO </td><td colspan="3"><input type=text name='chasisno' value='<?print $jrow[chasisno]?>'></td></tr><tr>
<td>Purchase Bill Date </td><td >
dd <input type=text readonly name='pdate1' size=1 value='<?print date('d')?>'>
mm <input type=text readonly name='pdate2' size=1 value='<?print date('m')?>'>
yy <input type=text readonly name='pdate3' size=2 value='<?print date('Y')?>'>
</td>
<td>PurchaseBillNo</td><td><input type=text name='pbillno' readonly size=8 value='<?print $prow[pbillno]?>'></td>

<td >Supplier Account</td>
    <td colspan="5"><input type=text name='supplier'  readonly value='<? echo $prow[cname];?>'onkeypress="return handleEnter(this, event)" >
</td>

</tr>
</table> 

</td></tr>

  <tr><td>
<h4>Parts Request </h4>

<table border=1  id="myTable" >


<th> No <th>Order No <th>Order<th>Part Code<th> Part Name<th>Part type <th>Order Qty<th>Purchase<br>Qty<th>Rate<th>Discount<th>Other<br>Charges<th>Total<th >OrderDate<th>Return Qty<th>Return Total


<?
$tbl="stockrepdet10".$brcode.$user;
mysqli_query($db,"delete from $tbl where supqty<=0 ");

 $res=mysqli_query($db,"select * from pjcardparts where invno='$invno' and brcode='$brcode'");


 
 $i=1;
 $j=1;
   $return_tot=0;
 while($jrow=mysqli_fetch_array($res))
  {
  
  $rtn_tot=0;
  $rtn_qty=0;
 
  $rtn_flg='';   // this variable is used to put 'readonly' for already pur_returned row 

  $pr_res=mysqli_query($db,"select * from pur_return  where pur_invno='$invno' and pur_slno='$jrow[sno]' and brcode='$brcode' ");
 
   if(mysqli_num_rows($pr_res)>0){
    
      $pr_row=mysqli_fetch_array($pr_res);

      $rtn_tot=$pr_row[pr_tot];
      $rtn_qty=$pr_row[pr_qty];
      $rtn_flg='readonly';
   }
  $prd_qty=0;
  $p_res=mysqli_query($db,"select * from pjcardparts   where jcno='$jrow[0]' and invno<> '$invno' and brcode='$brcode' and porder='$jrow[3]'");
  while($prow=mysqli_fetch_array($p_res)){
   
   $prd_qty+=$prow[5];  
   }

  $res1=mysqli_query($db,"select * from prime_jcardparts where jcno='$jrow[0]' and brcode='$brcode' and partname='$jrow[20]' ");
  $row=mysqli_fetch_array($res1);

  $edate1=explode('-',$jrow[edate]);

  print "<tr><td>".$i."</td>";
  print "<td><input type=text size=1 name='slno[]'  readonly id='slno$j' value='$jrow[sno]' onKeydown='return handleEnter(this, event)' /></td>";
  print "<td><input type=text  name='porder[]'  readonly value='$jrow[porder]' id='porder$j' readonly size=20 onKeydown='return handleEnter(this, event)'></td> ";
  print "<td><input type=text readonly  name='partcode[]' id='partcode$j' value='$jrow[2]' size=20  class='partcode' onKeydown='return handleEnter(this, event)'  ></td>";
  print "<td><input type=text size=20 readonly name='partname[]' value='$jrow[3]' id='partname$j'  class='partname' onKeydown='return handleEnter(this, event)'></td>";
  print "<td><input type='text' readonly name='spareengineer[]' id='spareengineer$j'  value='$jrow[engineer]' onKeydown='return handleEnter(this, event)'/></td>";

 
print "<td>";
$res1=mysqli_query($db,"select qty from prime_jcardparts where jcno='$jcno' and brcode='$brcode' and partname='$jrow[porder]'");
$jrow1=mysqli_fetch_row($res1);

print "<input type=text size=3 readonly name='odr_qty[]' id='odr_qty$j' value='$row[5]' onChange=calcamt2($j) onKeydown='return handleEnter(this, event)' >";

print "</td>";
 print "<td><input type=text size=3   name='qty[]' id='qty$j' value='$jrow[qty]' onKeydown='return handleEnter(this, event)' ></td>";

  print "<td><input type=text size=4  readonly name='rate[]' id='rate$j' value='$jrow[rate]' onKeydown='return handleEnter(this, event)' > </td>";
   print "<td><input type=text size=3 readonly name='disc[]' id='disc$j' value='$jrow[disc]' onKeydown='return handleEnter(this, event)' ></td>";


   print "<td><input type=text size=3 readonly name='hnd[]' id='hnd$j' value='$jrow[hnd]'  onKeydown='return handleEnter(this, event)'></td>";

   print "<td><input type=text size=5 readonly name='gtot[]' id='gtot$i' value='$jrow[gtot]' onKeydown='return handleEnter(this, event)'></td>";


  $qtres=mysqli_query($db,"select supqty from $tbl where partcode='$jrow[2]'");
  $qtrow=mysqli_fetch_row($qtres);
  $qqty=($qtrow[0]+$jrow[qty]);

     print "<td><input type=text name='edate[]' readonly id='day$j' value='$jrow[edate]'  size=6 onKeydown='return handleEnter(this, event)'></td>";

     
     print "<td><input type=text    name='retn_qty[]' id='retn_qty$j' value='".$rtn_qty."' size=1 onkeyup='check_val(this.value,this,event)' onKeydown='return handleEnter(this, event)'  ".$rtn_flg." /></td>";
     

     print "<td><input type=text size=5 readonly name='pr_tot[]' id='pr_tot$i'   value='".$rtn_tot."' onKeydown='return handleEnter(this, event)' /></td>";



$return_gtot+=$rtn_tot;
   $i++;
   $j++;

 print "<script> check_valid(); </script>";
  }
?>
</table>


<br>



<input type='hidden' name='brcode' id='brcode' value='<? print $brcode;?>'>

<input type='hidden' name='savecount' id='savecount' value='0'>
<div id='txtHint'></div>

<div id="view" class="login-popup">

</div>


 <div id="login-box" class="login-popup">
        <a href="#" class="close"><img src="images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
          <div id='msgbox'></div>
		</div>



</td></tr>
<tr>   
<td  colspan='5' style="text-align:right;">
                      
                    Parts Return Total
                <input  style="border:0px solid white;text-align:right; width:100px; padding-right:5px; font-weight:normal; font-family:verdana;font-size:13px;color:#3c3c3c;" readonly="readonly" name="spare_total" id="spare_total" value='<? echo $return_gtot; ?>' type="text">
</td></tr>
<tr>   
<td  colspan='5' style="text-align:right;">
                      
                    Round Figure

                <select id='sign' style="border:0px solid white;text-align:right; font-weight:normal; font-family:verdana;font-size:13px;color:#3c3c3c; -webkit-appearance: none;-moz-appearance: none;appearance: none;" onchange='check_valid()' ><option>+</option><option>-</option></select>
                <input  style="border:0px solid lavendar;text-align:right; width:40px; padding-right:5px; font-weight:normal; font-family:verdana;font-size:13px;color:#3c3c3c;"  name="round_fig" id="round_fig" type="text" value='0.00' onkeyup='check_valid()'>
</td></tr>


<td  colspan='5' style="text-align:right;">
                      
                    Net Total
                <input  style="border:0px solid white;text-align:right; width:100px; padding-right:5px; font-weight:normal; font-family:verdana;font-size:13px;color:#3c3c3c;"  readonly='true' name="net_total" id="round_total" type="text" value='<? echo $return_gtot; ?>' >
</td></tr>

<input type='hidden' name='mode' value='purchase_return'/>
 </form>

   </td></tr>
</table>
   
</div>
</fieldset> 

</td></tr></table>

<?


}// close if show
?>

