<?php

//require "config/configDB.php"; 

$sqlVehicleQuery = mysqli_query($conn,"SELECT id, vehicleno  FROM vehicle_master WHERE isdelete=1 ");

$sqlVehicleNo = '';
//$prow = mysqli_fetch_array($sqlBrandQuery,MYSQLI_NUM))
while($prow = mysqli_fetch_array($sqlVehicleQuery)){

    $sqlVehicleNo =$sqlVehicleNo."<option value='".$prow['id']."'>".$prow['vehicleno']."</option>";

}

$sqlSupplierQuery = mysqli_query($conn,"SELECT id, sname   FROM supplier_master WHERE isdelete=1 and stype='Diesel' ");

$sqlSupplierName = '';
//$prow = mysqli_fetch_array($sqlBrandQuery,MYSQLI_NUM))
while($prow = mysqli_fetch_array($sqlSupplierQuery)){

    $sqlSupplierName =$sqlSupplierName."<option value='".$prow['id']."'>".$prow['sname']."</option>";

}

$sqlAStockQuery = mysqli_query($conn,"SELECT sum(litres) as astock   FROM purchase_dieselinvoice WHERE isdelete=1 and status='' ");
$AStockrow = mysqli_fetch_array($sqlAStockQuery,MYSQLI_ASSOC);

$sqlinternalstockQuery = mysqli_query($conn,"SELECT sum(litres) as iastock   FROM internalpro_diesel WHERE isdelete=1 ");
$internalstockrow = mysqli_fetch_array($sqlinternalstockQuery,MYSQLI_ASSOC);

$sqlinternalunfillstockQuery = mysqli_query($conn,"SELECT sum(litres) as iaunfillstock   FROM internalunfillpro_diesel WHERE isdelete=1 ");
$internalunfillstockrow = mysqli_fetch_array($sqlinternalunfillstockQuery,MYSQLI_ASSOC);

$stk=$internalstockrow['iastock']+$internalunfillstockrow['iaunfillstock'];


$AStock =($AStockrow['astock']-$stk);


$accountyear        = $financialYearStart."-".$financialYearEnd;
$sql_InvoiceQuery   = mysqli_query($conn,"SELECT count(*) as invoice FROM purchase_dieselinvoice  ");
$rowInvoiceCount    = mysqli_fetch_array($sql_InvoiceQuery,MYSQLI_ASSOC);
$invoice_count      = $rowInvoiceCount['invoice']+1;


?>