@extends('voyager::master') @section('page_title', __('voyager::generic.view').' '.$dataType->getTranslatedAttribute('display_name_singular')) @section('page_header') @include('voyager::multilingual.language-selector') @stop @section('content')

{{ __('voyager::generic.viewing') }} {{ ucfirst($dataType->getTranslatedAttribute('display_name_singular')) }}  

@php $params = http_build_query(['print' => true, 'to_date' => $request->get('to_time', null), 'to_time' => $request->get('to_time', null), 'from_date' => $request->get('from_date', null), 'from_time' => $request->get('from_time', null)]); @endphp

بحث

@if ($request->has('search'))
@php $products_total_sum = []; $products_master_ids = []; $products_commercial = []; @endphp @foreach ($products as $product)

{{ $product->title }}

{{-- --}} @php $station_total = 0; $final_station_total = -1; $count_station = 1; $station_items = []; @endphp @foreach($output[$product->id] as $value) @php $sum = $value->last_number - $value->first_number; if(!isset($products_total_sum[$product->id])) $products_total_sum[$product->id] = 0; $products_total_sum[$product->id] += $sum; if(!isset($products_master_ids[$product->id])) $products_master_ids[$product->id] = []; if (array_search($value->total_accounting_id, $products_master_ids[$product->id]) === false) { array_push($products_master_ids[$product->id], $value->total_accounting_id); } $count_station++; $station_items[] = $value; if(!$loop->last && $value->ps_supervisor_id == $output[$product->id][$loop->index+1]->ps_supervisor_id ){ $station_total += $sum; } else{ $final_station_total = $station_total + $sum; $station_total = 0; } @endphp @if ($final_station_total > -1) @foreach ($station_items as $vl ) @endforeach @php $count_station = 1; $final_station_total = -1; $station_items = []; @endphp @endif @endforeach @if ($product->is_commercial) @php if (!isset($products_commercial[$product->id])) { $products_commercial[$product->id]['sales_calculator'] = 0; $products_commercial[$product->id]['commercial_fuel_gasoline'] = 0; $products_commercial[$product->id]['diff_commercial'] = 0; } if (isset($products_master_ids[$product->id]) && count($products_master_ids[$product->id]) > 0) { list($sales_calculator, $commercial_fuel_gasoline) = \App\Models\DailyClosingReport::calculateCommercialFuel($products_master_ids[$product->id]); $products_commercial[$product->id]['sales_calculator'] = $sales_calculator; $products_commercial[$product->id]['commercial_fuel_gasoline'] = $commercial_fuel_gasoline; $products_commercial[$product->id]['diff_commercial'] = \App\Models\DailyClosingReport::calculationDifferenceCommercialFuel($products_master_ids[$product->id][0]); } @endphp @endif
{{ $product->title }}
{{ __('messages.admin.t') }} {{ __('messages.admin.last_numbers') }} {{ __('messages.admin.total') }} المستخدمين
{{ $value->detailSupervisor->name }}
{{ $final_station_total }}
{{ number_format( $vl->last_number ) }} {{ $vl->last_number - $vl->first_number }} {{ $vl->getMaster->user->name ?? '' }}
{{ __('messages.admin.total_sum') }} {{ number_format( $products_total_sum[$product->id] ?? 0 ) }}
{{ __('messages.admin.sales_calculator') }} {{ number_format( $products_commercial[$product->id]['sales_calculator'] ) }}
{{ __('messages.admin.sales_commercial') }} {{ $products_commercial[$product->id]['commercial_fuel_gasoline'] }}
@endforeach @foreach ($products as $product) @endforeach

المصاریف

{{-- --}} @php $total_expenses = 0; @endphp @foreach ( $expenses_list as $item ) @php $total_expenses += $item->amount; $incomeAccount = $item->incomeAccount->withTrashed()->first(); @endphp @endforeach
المصاریف
اسم الحساب اسم المستخدم التفاصيل المبلغ
{{ $incomeAccount->name }} {{ $item->user->name ?? "---" }} {{ $item->description }} @convert($item->amount)
{{ __('messages.admin.total_sum') }} @convert($total_expenses)

{{ __('messages.admin.the_morning_lift') }}

{{-- --}}
{{ __('messages.admin.the_morning_lift') }}
{{ __('messages.Petrol') }} {{ __('messages.Oil') }} {{ __('messages.Gasoline') }}
{{ ($fuel_tank_capacity[1]->amount ?? 0) + ($fuel_tank_capacity[2]->amount ?? 0) }} {{ ($fuel_tank_capacity[5]->amount ?? 0) + ($fuel_tank_capacity[6]->amount ?? 0) }} {{ ($fuel_tank_capacity[3]->amount ?? 0) + ($fuel_tank_capacity[4]->amount ?? 0) }}

{{ __('messages.admin.morning_stand') }}

{{-- --}} @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach
{{ __('messages.admin.morning_stand') }}
{{ $product->title }}
{{ $form_18[$product->id]->last_number ?? 0 }}
{{ $form_18[$product->id]->cash_credit ?? 0 }}
{{ $form_18[$product->id]->incoming_quantities ?? 0 }}

{{ __('messages.admin.the_finding') }}

@foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach @foreach ($products as $product) @endforeach {{-- @foreach ($products as $product) @php $different_petrol = (($fuel_tank_capacity[1]->amount ?? 0) + ($fuel_tank_capacity[2]->amount ?? 0)) - ($form_18[$petrol_id]->last_number ?? 0); @endphp @endforeach @php $different_petrol = (($fuel_tank_capacity[1]->amount ?? 0) + ($fuel_tank_capacity[2]->amount ?? 0)) - ($form_18[$petrol_id]->last_number ?? 0); $different_oil = (($fuel_tank_capacity[5]->amount ?? 0) + ($fuel_tank_capacity[6]->amount ?? 0)) - ($form_18[$oil]->last_number ?? 0); $different_gasoline = (($fuel_tank_capacity[3]->amount ?? 0) + ($fuel_tank_capacity[4]->amount ?? 0)) - ($form_18[$gasoline]->last_number ?? 0); @endphp --}}
{{ __('messages.admin.the_finding') }} {{ $product->title }}
{{ __('messages.admin.opening') }} {{ count($form_18) > 0 ? ($form_18[$product->id]->first_number ?? 0 ) : 0 }}
{{ __('messages.admin.received') }} {{ count($form_18) > 0 ? ($form_18[$product->id]->incoming_quantities ?? 0) : 0 }}
{{ __('messages.admin.total_sum') }} {{ count($form_18) > 0 ? ($form_18[$product->id]->first_number ?? 0) + ($form_18[$product->id]->incoming_quantities ?? 0) : 0 }}
{{ __('messages.admin.total') }} {{ number_format( $products_total_sum[$product->id] ?? 0 )}}
{{ __('messages.admin.nezah') }} {{ count($form_18) > 0 ? ($form_18[$product->id]->nezah ?? 0 ): 0 }}
{{ __('messages.admin.conclusion') }} {{ count($form_18) > 0 ? ($form_18[$product->id]->last_number ?? 0) : 0 }}
{{ __('messages.admin.the_difference') }}{{ $different_petrol }}{{ $different_petrol }} {{ $different_oil }} {{ $different_gasoline }}

{{ __('messages.admin.final_calculation') }}

@php $products_total_price_sum =[]; $products_total_litters_sum =[]; $products_total_commercial_sum =[]; $products_total_commercial_litters_sum =[]; @endphp @foreach ($products as $product) @php $products_total_price_sum[$product->id] = $product_sales_report[$product->id]['electronic']['sum_total_price'] ?? 0; $products_total_litters_sum[$product->id] = $product_sales_report[$product->id]['electronic']['sum_total_liters'] ?? 0; @endphp @if ($product->is_commercial) @php $products_total_commercial_sum[$product->id] = $products_commercial[$product->id]['commercial_fuel_gasoline'] * $products_commercial[$product->id]['diff_commercial']; $products_total_commercial_litters_sum[$product->id] = $products_commercial[$product->id]['commercial_fuel_gasoline']; @endphp @endif @endforeach @php $total = array_sum($products_total_price_sum) + array_sum($products_total_commercial_sum); $total_litters = array_sum($products_total_litters_sum) + array_sum($products_total_commercial_litters_sum); @endphp @php $total = $total - $total_expenses; @endphp @php $total_products_atabe_sum = []; $total_products_atabe_litters = []; @endphp @foreach ($products as $product) @php if (isset($products_master_ids[$product->id])) { list($total_liters_pd, $total_sum_pd) = \App\Models\DailyClosingReport::calculationTotalAtabe($products_master_ids[$product->id]); $total_products_atabe_sum[$product->id] = $total_sum_pd; $total_products_atabe_litters[$product->id] = $total_liters_pd; } @endphp @endforeach @php $total_atabe_price = array_sum($total_products_atabe_sum); @endphp
{{ __('messages.admin.mantooj') }} {{ __('messages.admin.kamie') }} {{ __('messages.admin.unit_price') }} {{ __('messages.admin.formal') }}
{{ __('messages.admin.total_product',['product'=>$product->title]) }} @convert($product_sales_report[$product->id]['electronic']['sum_total_liters'] ?? 0) {{ number_format($product->price )}}@convert($products_total_price_sum[$product->id])
{{ __('messages.admin.product_differences',['product'=>$product->title]) }} @convert($product_sales_report[$product->id]['diff']['sum_total_liters']) {{ number_format( $product->diff_price ) }} @convert($product_sales_report[$product->id]['diff']['sum_total_price'])
{{ __('messages.admin.prdocut_calculator_difference',['product'=>$product->title]) }} {{ $products_commercial[$product->id]['commercial_fuel_gasoline'] }} {{ $products_commercial[$product->id]['diff_commercial'] }}{{ number_format($products_total_commercial_sum[$product->id]) }}
{{ __('messages.admin.the_total_number_of_objections_today') }}{{ number_format($total_litters) }} --- {{ number_format($total) }}
{{ __('messages.admin.total_masroufat') }} --- --- @convert($total_expenses,0)
{{ __('messages.admin.remaining_price') }} --- ---{{ number_format($total) }}
{{ __('messages.equip_the_credit') }} {{ $product->title }}{{ number_format( $total_liters_pd ?? 0 ) }} {{ number_format($total_sum_pd ?? 0) }}
{{ __('messages.admin.total_sum')}} {{ __('messages.equip_the_credit') }} {{ number_format($total_atabe_price) }}
{{ __('messages.admin.remaining_amount_price') }} {{ number_format($total - $total_atabe_price) }}
@endif
@stop @section('javascript') @if ($isModelTranslatable) @endif @stop