@extends('layouts.app') @section('main')

Sales Management

@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif

{{ count($sales) }}

Total Sales

{{ $all_settings->currency ?? 'BDT' }} {{ number_format($totals['total_amount'], 2) }}

Total Amount

{{ $all_settings->currency ?? 'BDT' }} {{ number_format($totals['total_profit'], 2) }}

Total Profit

{{ $totals['total_sale'] }}

Items Sold

@push('script') @endpush
@php $line_total_amount = 0; $total_amount = 0; $total_profit = 0; $line_total_profit = 0; @endphp @foreach ($sales as $sale) @php $line_total_amount = $sale->sell_price * $sale->sold_quantity; $line_total_profit = $sale->profit; $total_amount += $line_total_amount; $total_profit += $line_total_profit; @endphp @endforeach
# Customer Name Brand/Tpye Model/Name IMEI/SN Selling Price Quantity Total Amount Profit Sale Date Actions
{{ $sale->id }} {{ htmlspecialchars($sale->customer_name) }} {{ e($sale->product->brand) }} {{ e($sale->product->type) }} {{ e($sale->product->model) }} {{ e($sale->product->name) }} {{ htmlspecialchars($sale->product->imei_or_sn) }} {{ $all_settings->currency . ' ' . number_format($sale->sell_price, 2) }} {{ $sale->sold_quantity }} {{ $all_settings->currency . ' ' . number_format($line_total_amount, 2) }} {{ $all_settings->currency . ' ' . number_format($line_total_profit, 2) }} {{ $sale->created_at }}
# Customer Name Brand Model IMEI/SN Selling Price Quantity Total Amount Profit Sale Date Actions
Total Sale Total Amount Total Profit
{{ count($sales) }} {{ $all_settings->currency }} {{ number_format($total_amount, 3) }} {{ $all_settings->currency }} {{ number_format($total_profit, 3) }}
@endsection @push('script') @endpush