<?php
namespace App\Http\Controllers\API\Reports;

use App\Models\User;
use PDF;
use Illuminate\Http\Request;
use App\Http\Controllers\AppBaseController;
use InfyOm\Generator\Criteria\LimitOffsetCriteria;
use App\Http\Controllers\API\Criteria\OrderbyPositionCriteria;
use Prettus\Repository\Criteria\RequestCriteria;
use Response;
use App\Http\Resources\User\UserResource;
use App\Http\Resources\ApiResourceCollection;
use Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Log;
use Carbon\Carbon;
use Storage;

/**
 * Class DemoController
 * @package App\Http\Controllers\API
 */

class InvoiceReportController extends BaseReportController
{
    
    public function generatePdf($invoiceId){

        $companyDetail = \App\Models\CompanyDetail::find(1);
        $invoice = \App\Models\Invoice::findOrFail($invoiceId);
        if($invoice->net_gst>0){
            return view('reports.invoices.invoice_two', compact('companyDetail', 'invoice'));    
        }else{
            return view('reports.invoices.invoice_one', compact('companyDetail', 'invoice'));
        }
        
        
    }


    public function generatePdf1($invoiceId){

    }
    
}

