<link rel="stylesheet" href="css/new_mxerp.css">
<link rel="stylesheet" type="text/css" href="css/professional/table_frize.css">

<?php ob_start();
$PageSecurity = 4;
$PageName = 'Finished Material';
include('includes/DefinePOClass.php');
$Prefix_SQL = "Select prefix_id,prefix_code,prefix_name from prefix_tbl Where prefix_name ='".$PageName."'";
$Prefix_Result = DB_query($Prefix_SQL,$db);
$Prefix_Row = DB_fetch_array($Prefix_Result);
$Prefix_code = $Prefix_Row['prefix_code'];
$Prefix_date = date("Y");
$Prefix_date++;
$CurrentFinancialYear = date("Y")."-".$Prefix_date; 
if(isset($_GET['issueid'])  && isset($_GET['issueid']) !='')
{$title = _('Update Finished Material');}
else
{$title = _('Add Finished Material');}
include('includes/SQL_CommonFunctions.inc'); 
$_SESSION['modid'];
if (empty($_GET['identifier'])) {
 $identifier=date('U');
} else {
 $identifier=$_GET['identifier'];

}
$date = date($_SESSION['DefaultDateFormat']);
if(isset($_POST['Save']))
{

	
	$sitename=$s->GetFieldValue('locations',"loccode='".$_REQUEST['site']."'",'prefix');
	$sqlqut=DB_query("select * from finished_recieved where site='".$_REQUEST['site']."'",$db);
	if(DB_num_rows($sqlqut)>0)
	{
	$SQLMax=DB_query("select MAX(production_slip_no) as QutNo from finished_recieved where site='".$_REQUEST['site']."'",$db);
	$MaxQut=DB_fetch_array($SQLMax);
	$MXNo=substr($MaxQut['QutNo'],-2);
	$FinMx=$MXNo+1;
	$FinalCode=$sitename."/"."FMR"."/".str_pad($FinMx,5,0,STR_PAD_LEFT);
	}
	else
	{
	$FinalCode=$sitename."/"."FMR"."/".'00001';
	}
	 
  //print_r($_REQUEST); exit;
  $sql = "INSERT INTO finished_recieved set
						site='".$_REQUEST['site']."',
						production_slip_no='".$FinalCode."',
						store='".$_REQUEST['store']."',  
						work_order_no='".$_REQUEST['work_order_no']."',  
						job_card_no='".$_REQUEST['job_card_no']."',  
						work_order_date='".FormatDateForSQL($_REQUEST['work_order_date'])."',  
						job_card_date='".FormatDateForSQL($_REQUEST['job_card_date'])."',
						recieved_date='".FormatDateForSQL($_REQUEST['recieved_date'])."',
						remarks='".$_REQUEST['remarks']."',
						finished_item='".$_REQUEST['finished_item']."',
						createdby='".$_SESSION['UserID']."',  
						created='".FormatDateForSQL(date('d/m/Y'))."' ,
						expected_date='".FormatDateForSQL($_REQUEST['expected_date'])."',
						CompanyId='".$_SESSION['ACGCompanyId']."'";

	$insertResult = DB_query($sql,$db,$ErrMsg);
     $Last_id=DB_Last_Insert_ID($db,'finished_recieved',$ErrMsg);
    // echo $Last_id;
			 
if($Last_id!='')
	{
		
		for($i=0;$i<count($_REQUEST['itemid']);$i++)
		{
			$sql2 = "INSERT INTO finished_recieved_details set
								finished_recieved_id='".$Last_id."', 
								mst_itemid='".$_REQUEST['itemid'][$i]."',
								itemcode='".$_REQUEST['itemcode'][$i]."', 
								itemdesc='".$_REQUEST['desc'][$i]."', 
								uom='".$_REQUEST['uom'][$i]."',   
								process='".$_REQUEST['prodprocess'][$i]."', 
								machine='".$_REQUEST['machine'][$i]."',  
								reciveqty='".$_REQUEST['reciveqty'][$i]."'";
			
			 $insertResult2 = DB_query($sql2,$db,$ErrMsg); 
			 
			 
				
				
		}
         prnMsg( _('Record Insert Successfully'),'success');
     echo "<script>location.href='index.php?route=finished_material_recieved_index&modid=".$_REQUEST['modid']."&frmid=".$_REQUEST['frmid']."'</script>";
     unset($_REQUEST);
}
	 }


 ?>

<div class="body_contain" style="width:1220px;">
<div class="tab_div">

 <h1>Finished Material Recieved</h1>
<form name="form1" action="" method="post">
<div align="center">
<table width="100%" border="0" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
<tr class="row1">
    <td class="tabledata1" width="15%"><strong>Branch</strong></td>
    <td width="35%"><?php
	if($_SESSION['AssignedBranch']!='')
	  {	  	
  $ss="Select loccode, locationname from locations  where CompanyId='".$_SESSION['ACGCompanyId']."' and loccode in('".$_SESSION['AssignedBranch']."')";
	  	 $site_sql=DB_query($ss,$db);
	  }
	  else
	  {
		$ss="Select loccode,locationname from locations where CompanyId='".$_SESSION['ACGCompanyId']."'";
		$site_sql=DB_query($ss,$db);
	  }
	?>

	<select name="site" id="site" style="width:150px;" onchange="showsitename158(this.value)">
	<option value="0">Select</option>
       <?php 
					while($Row=DB_fetch_array($site_sql)){?>
             <option value="<?php echo $Row['loccode']?>"<?php echo($_SESSION['Site']==$Row['loccode'] ? 'selected':'');?> ><?php echo $Row['locationname']?></option>
                                <?php  } ?>
    </select></td>
    <td class="tabledata1" width="15%"><strong>Production Slip No.</strong></td>
    <td id="ISSUE"><input name="production_slip_no" type="text" id="return_slipno2" value="<?php if($_REQUEST['return_slipno']=='') {echo "Auto Generate";} else {echo $_REQUEST['return_slipno'];} ?>" size="15" style="width:150px;" readonly />  </td>  
	</tr>
  <tr class="row1">
    <td class="tabledata1"><strong>Godown</strong></td>
    <td><div id='hid-Godown-div'>
	<?php
	     $sql_store ='select distinct StoreCode, StoreName from storetype';
		 $resultStkLocs = DB_query($sql_store,$db);
		?>
      <select name="store" id="store" style="width:150px;">
        <option value="0">Select</option>
        <?php 
		while ($myrow=DB_fetch_array($resultStkLocs))
		{?>
        <option value="<?php echo $myrow['StoreCode'];?>"<?php echo($_REQUEST['store']==$myrow['StoreCode']?'selected':'')?>><?php echo $myrow['StoreName'];?></option>
        <?php 
		}
		?>
      </select></div></td>
    <td class="tabledata1"><strong>Work Order No.</strong>  </td>
    <td><div id="workorder">
	<select name="work_order_no" id="work_order_no" onchange="Get_oderdata(this.value)" style="width:150px;">
		<option value="0">Select</option>
		<?php             
              
		
                 $sql_wo=DB_query("Select fpr_flag from fin_Product where company_id='".$_SESSION['ACGCompanyId']."' order by id ASC",$db);
                   $result_wo=DB_fetch_array($sql_wo);
                   if($result_wo['fpr_flag']=='0'){
                   $floor_sql1=DB_query("Select id,orderNo from salesorder where CompanyId='".$_SESSION['ACGCompanyId']."' order by orderNo ASC",$db);
              
                while($floor_row1=DB_fetch_array($floor_sql1))
			{?>
	
     <option value="<?php echo $floor_row1['id'];?>"<?php echo $work_order_no==$floor_row1['id']?'selected':''; ?>><?php echo $floor_row1['orderNo'];?></option>
	<?php 	
                   }
                   
                        }else if($result_wo['fpr_flag']=='1'){
                     $floor_sql2=DB_query("Select id,wo_no from prd_wo where CompanyId='".$_SESSION['ACGCompanyId']."' order by wo_no ASC",$db);
                      while($floor_row2=DB_fetch_array($floor_sql2))
			{?>
	
     <option value="<?php echo $floor_row2['id'];?>"<?php echo $work_order_no==$floor_row2['id']?'selected':''; ?>><?php echo $floor_row2['wo_no'];?></option>
	<?php 	
                        }
                   }
	?></select>
	</div>
	
	</td>
  </tr>
  
  
  <tr class="row1">
    <td class="tabledata1"><strong>Job Card No.</strong></td>
    <td><div id="jobcarddata">
	<input name="job_card_no" type="text" id="job_card_no" style="width:150px;" value="<?php echo $_REQUEST['job_card_no']; ?>" size="15" />
	
	</div>
	
	
	</td>
    <td class="tabledata1"><strong>Work Order  Date </strong> </td>
    <td><input name="work_order_date" type="text" id="work_order_date" value="<?php if(isset($_REQUEST['work_order_date'])) echo $_REQUEST['work_order_date']; else echo $date; ?>" size="15" class="datepicker"  style="width:150px;"/></td>
  </tr>
   <tr class="row1">
    <td class="tabledata1"><strong>Job Card Date</strong></td>
    <td>
	<div id="jobcarddate1">
	
	<input name="job_card_date" type="text" id="job_card_date" style="width:150px;" value="<?php echo $_REQUEST['return_slipno']; ?>" size="15" class="datepicker"/></div></td>
    <td class="tabledata1"><strong>Recieved Date</strong></td>
    <td><input name="recieved_date" type="text" id="recieved_date" value="<?php if(isset($_REQUEST['recieved_date'])) echo $_REQUEST['returndate']; else echo $date; ?>" size="15" class="datepicker"  style="width:150px;"/></td>
  </tr>
  <tr class="row1">
    <td class="tabledata1"><strong>Finished Item Details</strong></td>
    <td style="width:250px;">
	<div id="oderitem">
	</div>
	</td>
	<td class="tabledata1"><strong>Expected Return Date</strong></td>
	<td><input type="text" name="expected_date" id="expected_date" class="datepicker"  style="width:150px;" /></td>
	</tr>
</table>
</div>
<p align="left">
<input type="button" onclick="addRow('dataTable')" value="Add More" class="search" />&nbsp;
<input type="button"   onclick="deleteRow('dataTable')" value="Delete"  class="search"/>
</p>

 <div class="frisetable21">
	<div class="bodywidth2" id="showitemdataid">
<table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
  <tr class="row1">
          <td class="headerl_1">Sr. No.</td>
		   <td class="headerl_2"></td>
          <td class="headerl_3">Part Code</td>
          <td class="headerl_4">Part Name</td>  
           <td class="tabledata">UOM</td>
	  <td class="tabledata">Stock Qty</td>
    <td class="tabledata">Received Qty </td>
	<td class="tabledata">Process </td>
	<td class="tabledata">Machine Center </td>
    
  </tr>
  <tbody id="dataTable">
<!--<tr bgcolor="#c1c1c1">
  <td><input type="checkbox" name="chk" />
    <input type="hidden" value="" id="user_shipping" name="user_shipping[]" /></td>
  <td><input type="button" name="profile_popup" value="+" id="profile_popup"  onclick="openPopupProfile(this.id)" />      </td>
  <td><input type="text" value="" tabindex=""  readonly="" id="washing_profile" name="itemcode[]"size="10" />      </td>
  <td><input type="text" name="desc[]"  id="desc" size="25" readonly/></td>
  <input type="hidden" name="make[]" id="make" value="" readonly/>
  <input type="hidden" name="color[]" id="color" value="" readonly/>
  <input type="hidden" name="grade[]" id="grade" value="" readonly/>
  <td><input type="text" name="uom[]" id="uom" value="" readonly/></td>
   <td><input type="text" name="reciveqty[]"  id="reciveqty" size="10" onblur="calTotal(this)"/></td>
  </tr>-->
  
  <tr  class="row1">
  <td class="headercol1"><input name="delitem[]" type="checkbox"  id="delitem" /></td>
<td class="headercol2"><input  type="hidden"   readonly=""  id="itemdataid"  name="itemdataid[]" /></td>
<td class="headercol3"><input type="text" value="" tabindex="" id="itemcode" name="itemcode[]"  onkeyup="opendata(this.value,this.id)"/></td>
<td class="headercol4"><input type="text" name="desc[]"  id="descriptions" size="25"  value="" readonly /></td> 
 
 <td class="col1"><input type="text" name="uom[]" id="uom" value="" readonly  size="30"/>  </td>
  <td class="col1"><input type="text" name="stock[]" id="stock" value="" readonly  size="30"/>  </td>
   <td class="col1"><input  type="text" name="reciveqty[]"  id="reciveqty" size="30"   value=""   /></td>
    <td class="col1"><select name="prodprocess[]" id="prodprocess" >
	   <option value="0">Select</option>
	   <?php 
	   $sql1=DB_query("select * from production_process_master",$db);
	   while($row1=DB_fetch_array($sql1))
	   {
	   
	   ?> 
	   <option value="<?php echo $row1['id'];  ?>"><?php  echo $row1['manuf_process_name']; ?></option>
	   <?php } ?>
	</select></td>
	 <td class="col1"><select name="machine[]" id="machine" >
	   <option value="0">Select</option>
	   <?php 
	   $sql1=DB_query("select * from machine_center",$db);
	   while($row1=DB_fetch_array($sql1))
	   {
	   
	   ?> 
	   <option value="<?php echo $row1['id'];  ?>"><?php  echo $row1['name']; ?></option>
	   <?php } ?>
	</select></td>
          </tr>
   </tbody>
</table>
 </div>
	  </div>

<div class="body_lightbox1" id="lightbox1" style="overflow:auto; width:600px; height:250px; display:none;"></div>
<input type="hidden" name="hiditemcount" id="hiditemcount" value="" />
  <input type="hidden" name="" value="" id="edit_cnt" />


<table width="100%" border="1" cellpadding="3" cellspacing="0" style="border-collapse:collapse; border:#666666 solid 1px;">
  <tr class="row1">
    <td class="tabledata1" width="15%">Remarks:</td>
    <td class="tabledata1"><textarea name="remarks" id="remarks" cols="" rows="" style="width:100%; height:60px;"></textarea></td>
  </tr>
</table>



<p align="center"><input type="submit" name="Save" value="Save" class="search" /></p>
</form>
</div>
</div>




<script language="javascript" type="text/javascript">

function addRow(tableID) 
{	
	if(document)
		var table = document.getElementById(tableID);
		
		var rowCount = table.rows.length;
		var row = table.insertRow(rowCount);
		document.getElementById("hiditemcount").value=rowCount;
		var colCount = table.rows[0].cells.length;
		for(var i=0; i<colCount; i++) {	 
            
			var newcell = row.insertCell(i);
			if(i==0)
	newcell.className='headerl_1';	
	else if(i==1)
	newcell.className='headerl_2';
	else if(i==2)
	newcell.className='headerl_3';
	else if(i==3)
	newcell.className='headerl_4';
	else
	newcell.className='col1';
           	//newcell.style.background='#e7e7e7';
			//  newcell.className='tabledata';
			   newcell.innerHTML = table.rows[0].cells[i].innerHTML;
				switch(newcell.childNodes[0].type) 
				{
				case "text":
					newcell.childNodes[0].value = "";
					var nod_id = newcell.childNodes[0].id;

					newcell.childNodes[0].id = newcell.childNodes[0].id+'_'+rowCount;
										
				break;

				case "hidden":

					newcell.childNodes[0].value = "";

					var nod_id_hidden = newcell.childNodes[0].id;

					newcell.childNodes[0].id = newcell.childNodes[0].id+'_'+rowCount;

				break;

				case "button":

					var nod_id = newcell.childNodes[0].id;

					newcell.childNodes[0].id = newcell.childNodes[0].id+'_'+rowCount;

				break;

				case "checkbox":

				newcell.childNodes[0].checked = false;
				var nod_id_chk = newcell.childNodes[0].id;
				newcell.childNodes[0].id = newcell.childNodes[0].id+'_'+rowCount;
				

				break;

				case "select-one":
				
				newcell.childNodes[0].selectedIndex = 0;
				var nod_id = newcell.childNodes[0].id;
				newcell.childNodes[0].id = newcell.childNodes[0].id+'_'+rowCount;
				break;	
			}
		}
	}
function deleteRowOrder(tableID) 
{
	try 
	{
		var table = document.getElementById(tableID);
		//alert(table);
		var rowCount = table.rows.length;
		//alert(rowCount);
		for(var i=0; i<rowCount; i++) 
			{
				var row = table.rows[i];
				var chkbox = row.cells[0].childNodes[0];
				if(null != chkbox && true == chkbox.checked) 
				{
					if(rowCount <= 1) 
					{
						alert("Cannot delete all the rows.");
						break;
					}
				table.deleteRow(i);
				rowCount--;
				i--;
				}
				
			}
	document.getElementById("hiditemcount").value=parseInt(rowCount)-1;		
	}
	catch(e) 
	{
		alert(e);
	}

}
function issuedetails(str)
{
	var branch=document.getElementById("site").value;
	var godown=document.getElementById("store").value;
	
if (str.length==0)
  {
  document.getElementById("ISSUE").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("ISSUE").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","JobWorkItems.php?q="+str+"&site="+branch+"&store="+godown,true);
xmlhttp.send();

}
function openPopupProfile(i)
{ 
        window.open("issu_searchpopupfinish.php?rowcount="+i,"profiles_popup_window","height=425,width=640,toolbar=no,menubar=no,dependent=yes,resizable=yes");
}
 var xmlHttp

function GetXmlHttpObject()
{
    var xmlHttp=null;
    try
      {
      // Firefox, Opera 8.0+, Safari
      xmlHttp=new XMLHttpRequest();
      }
    catch (e)
      {
      // Internet Explorer
      try
        {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
      catch (e)
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      }
    return xmlHttp;
}


function opendata(str,id)
{

   var sitecode=document.getElementById("site").value;
   var date=document.getElementById("recieved_date").value;
   
  if (str.length == 0)
    {    	
     document.getElementById("lightbox1").innerHTML="";
     document.getElementById("lightbox1").style.border="0px";
     return;
    }	
	if(sitecode=='0')
	{
	alert("Must Select Site");
	document.getElementById("site").focus();
	return;
	}
	else if(date=='')
	{
	alert("Must Select Date");
	document.getElementById("recieved_date").focus();
	return;
	}

var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("lightbox1").style.display='block';	
	document.getElementById("lightbox1").innerHTML=xmlhttp.responseText;	
   // document.getElementById("textitem").innerHTML=data[1];	
    }
  }
  var store=document.getElementById("store").value;
 

  xmlhttp.open("GET","issu_searchpopupfinish.php?site="+str+"&data="+id+"&store="+store+"&site1="+sitecode+"&date="+date,true);
	xmlhttp.send();	
	
}


function hidedata()
{
document.getElementById("lightbox1").style.display='none';
}

function getItemsList1(id,code,shade,netrate,mrprate,rate,ctr)
{ 
    var ctr1=ctr.split("_");
    var i=ctr1[1]
	var itemcount=parseInt(document.getElementById('hiditemcount').value)+1;
	var edit_cnt=document.getElementById('edit_cnt').value;
	if(edit_cnt==''){var counter=1;} else if(edit_cnt>itemcount){var counter=edit_cnt;
	var itemcount=parseFloat(counter)+parseFloat(itemcount);
	} else  {var counter=edit_cnt;}
	  
	if(ctr1[1]==undefined)
	{
	//if(document.getElementById('itemdataid').value=='')
	//{
	
	document.getElementById('itemdataid').value = id;
	document.getElementById('itemcode').value = code;
	document.getElementById('descriptions').value = shade;
	document.getElementById('uom').value = netrate;
	document.getElementById('stock').value = mrprate;
	//}
	}
	else
	{
	//if(document.getElementById('itemdataid_'+i).value=='')
	//{		
	document.getElementById('itemdataid_'+i).value = id;
	document.getElementById('itemcode_'+i).value = code;
	document.getElementById('descriptions_'+i).value = shade;
	document.getElementById('uom_'+i).value = netrate;
	document.getElementById('stock_'+i).value = mrprate;
	//}	
	}	
	document.getElementById("lightbox1").style.display='none';
	//var data= addRow('dataTable')
	
}

function showsitename158(str)
{

var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
	var data=xmlhttp.responseText.split("__");	
	
	document.getElementById("hid-Godown-div").innerHTML=data[0];
    document.getElementById("workorder").innerHTML=data[1];
	
    }
  }
  xmlhttp.open("GET","GoDownIssueSlip10.php?site="+str,true);
	xmlhttp.send();

//xmlhttp.open("GET","getSort.php?s="+str+"&cat="+cat,true);

	
}

function Get_oderdata(str)
{	
if (str=="")
  {
  document.getElementById("dept").innerHTML="";
  return;
  }
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    var data=xmlhttp.responseText.split("__");	
	document.getElementById("oderitem").innerHTML=data[0];
	document.getElementById("jobcarddata").innerHTML=data[1];
    }
  }
  
xmlhttp.open("GET","get_orderdata9.php?salid="+str,true);
xmlhttp.send();	
	
}


function Get_oderdata1(str)
{
		
	
if (str=="")
  {
  document.getElementById("dept").innerHTML="";
  return;
  }
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
   
	document.getElementById("jobcarddate1").innerHTML=xmlhttp.responseText;
	
    }
  }
  
xmlhttp.open("GET","get_joborderdata.php?salid="+str,true);
xmlhttp.send();	
	
}

function GetItemQty(itemid)
{
	var xmlhttp;
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
	xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{
	
		//var data=xmlhttp.responseText.split("__");
           
		
		document.getElementById("showitemdataid").innerHTML=xmlhttp.responseText;
		
	}
	}
		//xmlhttp.open("GET","GoDownIssueSlip7.php?site="+str,true);
	var sitecode=document.getElementById("site").value;
         var godown=document.getElementById("store").value;
        
	xmlhttp.open("GET","GetItemQtyall.php?itemid="+itemid+"&sitecode="+sitecode+"&godown="+godown,true);
	
	xmlhttp.send();	
}









function calamt(str,str1)
{
var k=str.split("_");
if(k[1]==undefined)
{
if(parseFloat(document.getElementById("reciveqty").value)>parseFloat(document.getElementById("stock").value))
{
alert("Receive Qty Should Be less then Stock Qty");
document.getElementById("reciveqty").value='';
}

}
else
{
var i=k[1];
if(parseFloat(document.getElementById("reciveqty_"+i).value)>parseFloat(document.getElementById("stock_"+i).value))
{
alert("Receive Qty Should Be less then Stock Qty");
document.getElementById("reciveqty_"+i).value='';

}
}


}



</script>
<style type="text/css">
.body_lightbox1 {
width:100%;
background-color:#e7e7e7;
position:absolute;
left:280px;
top:95px;
padding-left:5px;
padding-right:5px;
border:#666666 solid 3px;
}
</style>
