@extends('admin.layouts') @section('content') {{-- ========================================================= --}} {{-- HEADER --}} {{-- ========================================================= --}}

{{ $category->category_name }}

Sales Details
@if(!empty($branchName)) Branch: {{ $branchName }} @else All Branches @endif
{{-- HEADER BUTTONS --}}
{{-- Export --}} {{-- Print --}} {{-- Back --}} Back
{{-- ========================================================= --}} {{-- SUMMARY CARDS --}} {{-- ========================================================= --}} @php $totalBills = $details ->pluck('order_id') ->unique() ->count(); $totalQuantity = $details ->sum('quantity'); $totalSales = $details ->sum('total'); $totalCost = $details ->sum('cost'); $totalProfit = $details ->sum('profit'); @endphp {{-- ========================================================= --}} {{-- CATEGORY SUMMARY CARD --}} {{-- ========================================================= --}}
{{-- CATEGORY NAME --}}
CATEGORY

{{ $category->category_name }}

{{-- BILL COUNT --}}
{{ $category->category_name }} BILLS
{{ number_format($totalBills) }}
{{-- QUANTITY --}}
TOTAL QUANTITY
{{ number_format( $totalQuantity, 3 ) }}
{{-- SALES --}}
CATEGORY SALES
₹{{ number_format( $totalSales, 2 ) }}
{{-- PROFIT --}}
CATEGORY PROFIT
₹{{ number_format( $totalProfit, 2 ) }}
{{-- ========================================================= --}} {{-- FILTER --}} {{-- ========================================================= --}}
Filter Sales
{{-- FROM DATE --}}
{{-- TO DATE --}}
{{-- ORDER ID --}}
{{-- SEARCH --}}
{{-- RESET --}}
{{-- ========================================================= --}} {{-- DETAILS TABLE --}} {{-- ========================================================= --}}
{{-- TABLE HEADER --}}
Sales Details
{{ $details->count() }} product entries found
{{-- TABLE --}}
@forelse( $details as $index => $detail ) {{-- SNO --}} {{-- DATE --}} {{-- ORDER ID --}} {{-- PRODUCT --}} {{-- CODE --}} {{-- QTY --}} {{-- SELL PRICE --}} {{-- SALES --}} {{-- COST --}} {{-- PROFIT --}} @empty @endforelse
SNO DATE ORDER ID PRODUCT CODE QTY SELL PRICE SALES COST PROFIT
{{ $index + 1 }} {{ \Carbon\Carbon::parse( $detail['date'] )->format('d-m-Y h:i A') }} {{ $detail['order_id'] }} {{ $detail['product_name'] }} {{ $detail['code'] }} {{ number_format( $detail['quantity'], 3 ) }} ₹{{ number_format( $detail['price'], 2 ) }} ₹{{ number_format( $detail['total'], 2 ) }} ₹{{ number_format( $detail['cost'], 2 ) }} @if($detail['profit'] >= 0) ₹{{ number_format( $detail['profit'], 2 ) }} @else ₹{{ number_format( $detail['profit'], 2 ) }} @endif
No Sales Found

No sales are available for the selected filters.

{{-- ========================================================= --}} {{-- EXPORT + PRINT JAVASCRIPT --}} {{-- ========================================================= --}} @endsection