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




?>
<center>
<h2><font face="Arial, Helvetica, sans-serif"><b>Invoice Cancellation</font></h2>
<?

$result= mysqli_query($conn," select distinct compcode,name from company  order by name")or die( mysqli_error() );

?>

<form name='myForm01' method='POST' action="inv_cancel_update.php?compcode=<?=$myCompany?>&pono=<?=$mypono?>&account_year=<?=$account_year?>&dis='T'&pk='T' ">
<table border=0 cellpadding=3 cellspacing=4 width="568" bgcolor="#E6E6FF">


<?


$aresult = mysqli_query($conn,"select compcode from company ");
$arow = mysqli_fetch_row($aresult);
$compcode = $arow[0];


$aresult = mysqli_query($conn,"select distinct account_year from branches ");
$arow = mysqli_fetch_row($aresult);
$account_year = $arow[0];

// Pull all the data from date master & populate it
$stQuery = mysqli_query($conn,"select  distinct  salesreg.inv_date, salesreg.inv_no, salesreg.trans_id from salesreg where salesreg.account_year = '$account_year' and compcode = '$compcode' and salesreg.taxtype = '$myTax'   group by trans_id order by inv_no, inv_date") or die(mysqli_error());
?>

<tr>
    <td width="74" height="31" align="left" ><font color="#003366" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b> Select Invoice
      </b></font></td><td>
  <font face="Arial, Helvetica, sans-serif">
<SELECT  name='mypono'>
  
  <?
     echo "<option  selected value=\" 0\"> Select Invoice";
    while($row = mysqli_fetch_row($stQuery))
    {

		$temp1 = 'InvoiceNo : '.$row[1].'&nbsp;Dt : &nbsp;'.british($row[0]);
		        echo "<option value=\"$row[2]\">$temp1";

		
    }
?>
</SELECT>
</td>
</tr>

<tr>

<td align=center colspan="100%"> <blockquote>
   <input  type =submit name=submit value = "Submit"></blockquote></td> </tr>
</table>
  
</form>

<center>
  <font size="1" face="Arial, Helvetica, sans-serif"><a href="index.html">Return to Index page </a></font> 
</center>
</body>


