{{-- {{$i+1}} | --}}
{{$i + $agentParcels->firstItem()}} |
@if($parcel->senderAgent == 0)
TiketiGala
@else
{{ \App\Models\Agent::where(['id' => $parcel->senderAgent])->first()->name }}
@endif
|
{{ \App\Models\Office::where(['id' => $parcel->sentOffice])->first()->location }}
|
@php
$localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam'));
$todayA = $localTime->format('d-M-Y 00:00:00');
$todayB = $localTime->format('d-M-Y 23:59:00');
$fareT = \App\Models\Parcel::where('senderAgent', '=', $parcel->senderAgent)
->where('status', '>', 0)
->where('is_deleted', '=', 0)
->whereBetween('dateSent', [$todayA, $todayB])
->sum('collection');
echo $fareT;
@endphp
|
@php
$fareLD = \App\Models\Parcel::whereDate('created_at', \Illuminate\Support\Carbon::yesterday()->toDateString())
->where('senderAgent', '=', $parcel->senderAgent)
->where('status', '>', 0)
->where('is_deleted', '=', 0)
->sum('collection');
echo $fareLD;
@endphp
|
@php
$fareW = \App\Models\Parcel::whereBetween('created_at', [\Illuminate\Support\Carbon::now()->startOfWeek(), \Illuminate\Support\Carbon::now()->endOfWeek()])
->where('senderAgent', '=', $parcel->senderAgent)
->where('status', '>', 0)
->where('is_deleted', '=', 0)
->sum('collection');
echo $fareW;
@endphp
|
@php
$previous_week = strtotime("-1 week +1 day");
$start_week = strtotime("last sunday midnight",$previous_week);
$end_week = strtotime("next saturday",$start_week);
$start_week = date("Y-m-d",$start_week);
$end_week = date("Y-m-d",$end_week);
$fareLW = \App\Models\Parcel::whereBetween('created_at', [$start_week, $end_week])
->where('senderAgent', '=', $parcel->senderAgent)
->where('status', '>', 0)
->where('is_deleted', '=', 0)
->sum('collection');
echo $fareLW;
@endphp
|
@php
$fareM = \App\Models\Parcel::whereMonth('created_at', date('m'))
->where('senderAgent', '=', $parcel->senderAgent)
->where('status', '>', 0)
->where('is_deleted', '=', 0)
->sum('collection');
echo $fareM;
@endphp
|
@php
$fareLM = \App\Models\Parcel::whereMonth('created_at', '=', \Illuminate\Support\Carbon::now()->subMonth()->month)
->where('senderAgent', '=', $parcel->senderAgent)
->where('status', '>', 0)
->where('is_deleted', '=', 0)
->sum('collection');
echo $fareLM;
@endphp
|
@php
$fareW = \App\Models\Parcel::whereYear('created_at', date('Y'))
->where('senderAgent', '=', $parcel->senderAgent)
->where('status', '>', 0)
->where('is_deleted', '=', 0)
->sum('collection');
echo $fareW;
@endphp
|
@php
$fareW = \App\Models\Parcel::whereYear('created_at', date('Y', strtotime('-1 year')))
->where('senderAgent', '=', $parcel->senderAgent)
->where('status', '>', 0)
->where('is_deleted', '=', 0)
->sum('collection');
echo $fareW;
@endphp
|
@endforeach