<?php

include('db_connection.php');
$Mainclass=new DB_Controller();


$Shop_ID = 'GP';

		$currentYr=date("y");
	    $currentMonth=date("m");
		if($currentMonth<04)
		{
			$currentYrFinacila=($currentYr - 1);
		}
		else
		{
			$currentYrFinacila=$currentYr;
		}
		
		$FinalcialRange=$currentYrFinacila."-".($currentYrFinacila+1);
		$Get="select Invoice_No from gold_invoice_master where Dealer_Code='".$Shop_ID."' and Financial_Year='".$FinalcialRange."' and Invoice_No!='' order by SLN desc limit 1";
		$Qry_No=mysqli_query($Mainclass->dbh,$Get);
		$Fetch_No=mysqli_fetch_array($Qry_No);
		$Explode=explode('/',$Fetch_No['Invoice_No']);
		$Invoice_Count= $Explode[2]+ 1;
		$Invoice = str_pad($Invoice_Count, 5, '0', STR_PAD_LEFT);
		
		
		
	echo	$Invoice_Number=$Shop_ID."/G/".$Invoice."/".$FinalcialRange;

?>