@extends('backend.layouts.master') @section('section-title', 'Product') @section('page-title', 'Product List') @if (check_permission('product.create')) @section('action-button') Add Product @endsection @endif @push('css') @endpush @section('content')
Reset Print
@php $total_product = App\Models\Product::where('is_service', 0)->count(); @endphp
Total Product : {{ $product_count }}
@forelse($products as $data) @php $count_inv = App\Models\InvoiceItem::where('product_id', $data->id)->count(); $count_pur = App\Models\PurchaseItem::where('product_id', $data->id)->count(); $userBranchId = auth()->user()->branch_id; $filterBranchId = session('branch_filter_id', null); if ($userBranchId == 1) { if($filterBranchId){ $branch_product = App\Models\BranchProduct::where('branch_id',$filterBranchId)->where( 'product_id', $data->id, )->get(); }else{ $branch_product = App\Models\BranchProduct::where( 'product_id', $data->id, )->get(); } } else { $branch_product = App\Models\BranchProduct::where('product_id', $data->id) ->where('branch_id', $userBranchId) ->get(); } @endphp {{-- delete modal --}} @csrf @empty @endforelse
#SL Branch Name Barcode Category Brand Cost Price Status Action
{{ $loop->index + 1 }} @foreach ($branch_product as $branch) {{ $branch->branch?->name }} @endforeach {{ $data->name }} {{ $data->barcode }} {{ $data->category?->name }} {{ $data->brand_id == null ? 'No Brand' : $data->brand->name }} {{ $data->purchase_price }} {{ $data->selling_price }} @if ($data->status == 1) Active @endif @if ($data->status == 0) Deactive @endif
No Data Available
{{ $products->onEachSide(1)->links() }}
@endsection @push('js') @endpush