<?php $PageSecurity = 11;
include('includes/session.inc');
include('includes/function_lib.php');
include('includes/SQL_CommonFunctions.inc');
//echo  $s->getField('voucher_master','VoucherType',$_GET['Prefix'],'VPrefix');
//echo "select count(id) from account_book where Vprefix=".$_GET['Prefix']." group by Vprefix ";
  $voucher_id=DB_query("select count(id) as ID from account_book where Vprefix='".$_GET['Prefix']."' group by Vprefix ",$db);
 $rowCate =DB_fetch_array($voucher_id);
  $l=$rowCate['ID']+1;
 
 
 $voucher_no=$s->getField('locations','loccode', $_GET['q'],'prefix').'-'. $s->getField('voucher_master','VoucherType',$_GET['Prefix'],'VPrefix').'-'.'000'.$l;

  ?>
<input name="voucher_no" type="text" size="27"  value="<?php echo $voucher_no;?>" style="width:98%;"  readonly='true'/>