<?php include("../../include/dbconnect.php"); 



$inv_date = substr($invdate,6,4).'-'.substr($invdate,3,2).'-'.substr($invdate,0,2);
$tc_date = substr($tcdate,6,4).'-'.substr($tcdate,3,2).'-'.substr($tcdate,0,2);
$min_dt = substr($mindate,6,4).'-'.substr($mindate,3,2).'-'.substr($mindate,0,2);

$query = "select matpo_record  from mat_purreg where record ='$record' ";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_row($result);
$matpo_record = $row[0];

$query = "select indent_record  from matpo where record ='$matpo_record' ";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_row($result);
$indent_record = $row[0];	
	



// UPDATE STOCK 




			$query= "update matindent set received_qty = '$receipt' where record='$indent_record'";
			mysql_query($query) or die(mysql_error());

			$query= "update matpo set received_qty = $receipt,rejected_qty = $rejected_qty,min_no ='$min_no',min_date='$min_dt'  where record ='$matpo_record'";
			mysql_query($query) or die(mysql_error());			

			$query="update mat_purreg set receipt='$receipt',issue='$issue',balance='$balance',rejected_qty='$rejected_qty',invno='$inv_no',inv_date='$inv_date',min_no='$min_no',min_date='$min_dt',tc_no='$tc_no',tc_date='$tc_date',id_no='$id_no',sample_size='$sample_size',finish_spec='$finish_spec',finish_checking='$finish_checking',finish_observe='$finish_observe',burr_spec='$burr_spec',burr_checking='$burr_checking',burr_observe='$burr_observe',bend_spec='$bend_spec',bend_checking='$bend_checking',bend_observe='$bend_observe',thick_spec='$thick_spec',thick_checking='$thick_checking',thick_observe='$thick_observe',width_spec='$width_spec',width_checking='$width_checking',width_observe='$width_observe',diameter_spec='$diameter_spec',diameter_checking='$diameter_checking',diameter_observe='$diameter_observe',hard_spec='$hard_spec',hard_checking='$hard_checking',hard_observe='$hard_observe',carbon_spec='$carbon_spec',carbon_checking='$carbon_checking',carbon_observe='$carbon_observe',inspector='$inspector',incharge_qc='$incharge_qc',status='$status',receipt_nos='$receipt_nos',issue_nos='$issue_nos',balance_nos='$balance_nos' where record ='$record' ";
			mysql_query($query) or die (mysql_error());
			
			$query= "update stktrans set prqty = $receipt  where mat_pur_record ='$record'";
			mysql_query($query) or die(mysql_error());
				
					


?>

<br>
<br>
<br>

<br><br><font size=1><center><a href= "matin.php">Make another MIN</center></font>
<br><br><font size=1><center><a href= "/wilson/stores.html">Return to index page</center></font>
