@extends('layouts.master') @push('css') @endpush @section('content')
{{ csrf_field() }}
{{--

Sales Report Filter

--}}
{{--
--}}

{{-- --}}

Daily Sales

 
@php // Initialize variables to prevent undefined errors $totalPending = 0; $totalReceived = 0; $grandTotal = 0; $counter = 0; @endphp @if ($saleReport && !empty($saleReport)) @foreach ($saleReport as $row) @php // Sanitize numeric values $amount = isset($row['amount']) && is_numeric($row['amount']) ? $row['amount'] : 0; $paid = isset($row['paid']) && is_numeric($row['paid']) ? $row['paid'] : 0; $balance = isset($row['balance']) && is_numeric(str_replace(',', '', $row['balance'])) ? str_replace(',', '', $row['balance']) : 0; // Update totals $grandTotal += $amount; $totalReceived += $paid; $totalPending += $balance; $counter++; @endphp @endforeach @else @endif
# Customer Product Bori Weight Rate Total Received Balance
{{ $counter }} {{ $row['customer_name'] }} {{ $row['products_category_name'] ?? '' }} / {{ $row['sub_name'] ?? '' }} / {{ $row['child_name'] ?? '' }} {{ $row['bori'] ?? '' }} {{ $row['weight'] ?? '' }} {{ $row['rate'] ?? '' }} {{ number_format($amount, 2) }} {{ number_format($paid, 2) }} {{ number_format($balance, 2) }}
No records found.
Total: {{ number_format($grandTotal, 2) }} {{ number_format($totalReceived, 2) }} {{ number_format($totalPending, 2) }}

@endsection