@extends('backend.layouts_backend.master2') @section('title') Searched Sales @endsection @section('extra_styles') @endsection @section('content') {{-- header --}}

Sale Records Found

{{-- end header --}} {{-- search form --}} @if (Auth::user()->can('sale-search-records')) @include('backend.pages_backend.point_of_sale.includes.search_sale_records') @endif {{-- end search form --}}
{{-- alert add item --}} @if (session('messagesave')) {{--
{{ session('message')}}
--}} @endif {{-- alert delete item --}} @if (session('messagedelete')) {{--
{{ session('messagedelete')}}
--}} @endif {{-- alert update item --}} @if (session('messageupdate')) @endif
@foreach ($sales as $key => $sale) {{-- payment status computation --}} @if ($loop->last) @endif {{-- view details modal --}} {{-- end of view modal --}} @endforeach
#Id Sale Date Client Final Total Amount Paid Balance Payment Status Action
{{ $key + 1 ?? '' }} {{ short_date($sale->sale_date ?? '') }} {{ $sale->client->first_name ?? '' }} {{ $sale->client->last_name ?? '' }} {{ $sale->client->other_name ?? '' }}
@if (!empty($sale->client->phone)) ({{ $sale->client->phone ?? '' }}) @endif
{{ $sale->final_total ?? '' }} {{ $sale->amount_paid_by_client ?? '' }} {{ $sale->balance_due_to_client ?? '' }} @php $final_total = $sale->final_total ?? 0; $amount_paid = $sale->amount_paid_by_client ?? 0; $balance_due = $sale->balance_due_to_client ?? 0; @endphp @if ($final_total - $amount_paid == 0) Full Payment @elseif($final_total > $amount_paid && $amount_paid > 0) Part Payment @elseif($amount_paid == 0) No Payment @endif
{{-- @can('county-show') --}} {{-- @endcan --}} {{-- print --}} @if (Auth::user()->can('sale-edit')) @endif {{-- @endcan --}} {{-- @can('county-delete') --}}
@csrf @method('DELETE')
{{-- @endcan --}}

Total Sales Amount (All Sales) : {{ $all_sales->sum('amount_paid_by_client') ?? '' }} Ugx

{{-- paginate --}}
{{ $sales->links('pagination::bootstrap-4') }}
@endsection @section('extra_scripts') {{-- search dynamic javascript --}} {{-- end of dynamic search javascript --}} @endsection