@extends('admin.layouts.app') @section('title', 'Sales Report') @section('content')
SALES ANALYTICS
{!! $salesHistory->html() !!}
SALES CHANNELS
{!! $salesChannel->html() !!}
SALES REPORTS
  • Today Sales
    {{ $todaySales }} Tickets {{number_format($cTotalCollectionToday)}} /=
  • @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $month = $localTime->format('M'); echo $month; @endphp Month's Sales
    {{ $mSales }} Tickets {{number_format($cTotalCollectionMonth)}} /=
  • @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $month = $localTime->format('Y'); echo $month; @endphp Year Sales
    {{ $ySales }} Tickets {{number_format($cTotalCollectionYear)}} /=
    @foreach ($routes as $x => $route)
  • @php $pA = \App\Models\Route::where(['id' => $route->id])->first()->start_point; $pB = \App\Models\Route::where(['id' => $route->id])->first()->end_point; $pointA = \App\Models\Cities::where(['id' => $pA])->first()->city; $pointB = \App\Models\Cities::where(['id' => $pB])->first()->city; echo $pointA .' - '.$pointB; @endphp
    @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $kifuaDate = $localTime->format('Y-m-d'); $today = $localTime->format('Y-m-d'); $bookings = \Illuminate\Support\Facades\DB::table('booking_histories') ->leftJoin('sub_routes', function ($join) { $join->on('sub_routes.id', '=', 'booking_histories.sub_route_id'); }) ->leftJoin('routes', function ($join) { $join->on('routes.id', '=', 'sub_routes.route'); }) ->where('booking_histories.company', '=', \Illuminate\Support\Facades\Auth::user()->company) ->where('booking_histories.booking_date', $today) ->where('booking_histories.status', '>', 2) ->where('routes.id', '=', $route->id) ->select('booking_histories.fullname as passenger', 'booking_histories.msisdn', 'booking_histories.status', 'booking_histories.booking_date') ->count(); $mauzo = \Illuminate\Support\Facades\DB::table('booking_histories') ->leftJoin('sub_routes', function ($join) { $join->on('sub_routes.id', '=', 'booking_histories.sub_route_id'); }) ->leftJoin('routes', function ($join) { $join->on('routes.id', '=', 'sub_routes.route'); }) ->where('booking_histories.company', '=', \Illuminate\Support\Facades\Auth::user()->company) ->where('booking_histories.booking_date', $today) ->where('booking_histories.status', '>', 2) ->where('routes.id', '=', $route->id) ->select('booking_histories.fullname as passenger', 'booking_histories.msisdn', 'booking_histories.status', 'booking_histories.booking_date') ->sum('booking_histories.fare'); echo 'Tickets: '.$bookings.' Sales: '.number_format($mauzo); @endphp
  • @endforeach
GENERATE REPORT
@csrf
{!! \ConsoleTVs\Charts\Facades\Charts::scripts() !!} {!! $salesHistory->script() !!} {!! $salesChannel->script() !!} @endsection