<?php

namespace App\Http\Controllers\Reports;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class repStockLevelProfit extends Controller
{
    /**
     * Display a listing of the resource.
     */
    public function index()
    {
        return view('Reports.stocklevel.index');
    }


    public function Report(Request $request){
        //dd($request->StartDate);
        //dd($request->EndDate);

        $stocklevels = DB::SELECT("SELECT a.id ProductId, a.product_code, a.product_name, a.category_id
                                    , a.supplier_id, a.BuyingUnit, a.SellingUnit, a.factor, a.buying_price,
                                    a.selling_price,b.Quantity, c.Code
                            FROM    products a, stocklevels b, units c
                            WHERE   a.id = b.ItemCtrlNum AND a.BuyingUnit = c.id");


        return view('Reports.stocklevel.report',compact('request'))->with('stocklevels',$stocklevels);
    }

    /**
     * Show the form for creating a new resource.
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     */
    public function show(string $id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     */
    public function edit(string $id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     */
    public function update(Request $request, string $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     */
    public function destroy(string $id)
    {
        //
    }
}
