<?php $PageSecurity = 11;
include('includes/session.inc');
$title = _('Client');
 include('includes/SQL_CommonFunctions.inc');
include('includes/function_lib.php');

 $q=$_GET['q'];
 $getlastid=DB_query("select VoucherNo from cashbankvoucher_master where BranchId='".$q."' order by voucherMasterId desc limit 1",$db);
 
 $lastid=DB_fetch_array($getlastid);
 if( $lastid=='' || $lastid==0)
 $voucherid=1;
 else
  $voucherid=$lastid['VoucherNo']+1;

   ?>


 <input name="voucher_code" type="text"  size="5"  value="<?php  echo $q;?>"  tabindex="3" readonly="true"/>
 	<input name="VoucherNo" type="text" size="27"  value="<?php echo  $voucherid;?>"   tabindex="4" readonly="true"> 