@extends('layouts/inventory_layout') @section('title', '| Use Report') @section('content') @include('successMsg')
{!! Form::open(['url' => 'viewUseReport','method' => 'get']) !!} @php $userBranchId = Auth::user()->branchId; @endphp @if($userBranchId==1)
{!! Form::label('', 'Project:', ['class' => 'control-label pull-left']) !!}
@endif @if($userBranchId==1)
{!! Form::label('', 'Pro. Type:', ['class' => 'control-label pull-left']) !!}
@endif @if($userBranchId==1)
{!! Form::label('', 'Branch:', ['class' => 'control-label pull-left']) !!}
@endif
{!! Form::label('', 'Category:', ['class' => 'control-label pull-left']) !!}
{!! Form::label('', 'S. Category:', ['class' => 'control-label pull-left']) !!}
{!! Form::label('', 'Product:', ['class' => 'control-label pull-left']) !!}
{!! Form::label('', 'Search By:', ['class' => 'control-label pull-left']) !!}
{!! Form::select('searchMethod',[''=>'Please Select','1'=>'Fiscal Year','2'=>'Current Year','3'=>'Date Range'],$searchMethodSelected,['id'=>'searchMethod','class'=>'form-control input-sm']) !!}
{!! Form::submit('Search',['id'=>'search','class'=>'btn btn-primary btn-xs','style'=>'font-size:15px;']) !!}
{!! Form::close() !!}
{{-- End Filtering Group --}}

Use Report

@php if($branchSelected===0){ $selectedBranchName = "All Branches"; } else{ $selectedBranchName = DB::table('gnr_branch')->where('id',$branchSelected)->value('name'); } $selectedProjectName = DB::table('gnr_project')->where('id',$projectSelected)->value('name'); $selectedProjectTypeName = DB::table('gnr_project_type')->where('id',$projectTypeSelected)->value('name'); $selectedCategoryName = DB::table('inv_product_category')->where('id',$categorySelected)->value('name'); @endphp @if(!$firstRequest )

@php $totalUserAmount = 0; $totalUserQuantity = 0; @endphp @foreach($useDetails as $key => $useDetail) @php $productName = DB::table('inv_product')->where('id',$useDetail->productId)->value('name'); $emloyeeName = DB::table('inv_tra_use')->where('id',$useDetail->useId)->value('employeeId'); $emloyeeNames = DB::table('hr_emp_general_info')->where('id',$emloyeeName)->value('emp_name_english'); $branchId = DB::table('inv_tra_use')->where('id',$useDetail->useId)->value('branchId'); $branchName = DB::table('gnr_branch')->where('id',$branchId)->value('name'); $roomId= DB::table('inv_tra_use')->where('id',$useDetail->useId)->value('roomId'); $deptId= DB::table('inv_tra_use')->where('id',$useDetail->useId)->value('departmentId'); if($roomId>0){ $deptName = DB::table('gnr_room')->where('id',$roomId)->value('name'); }else{ $deptName = DB::table('gnr_department')->where('id',$deptId)->value('name'); } $useDate = DB::table('inv_tra_use')->where('id',$useDetail->useId)->value('useDate'); @endphp @php $totalUserAmount = $totalUserAmount + $useDetail->totalCostPrice; $totalUserQuantity = $totalUserQuantity + $useDetail->productQuantity; @endphp @endforeach
SL# Use Date Use Bill No Branch Name Room/Dept Employee Name Product Name Total Quantity Total Amount (Tk)
{{$key+1}} {{date('d-m-Y',strtotime($useDate))}} {{$useDetail->useBillNo}} {{$branchName}} {{$deptName}} {{$emloyeeNames}} {{$productName}} {{$useDetail->productQuantity}} {{number_format($useDetail->totalCostPrice,2)}}
Total {{$totalUserQuantity}} {{number_format($totalUserAmount,2)}}
@endif
{{-- Filtering Mehod --}} {{-- End Filtering Mehod --}} {{-- Filtering --}}