@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, 'date' => $request->get('date', null)]); @endphp

بحث

@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) @php [$date, $time] = explode(' ', $vl->created_at); [$year, $month, $day] = explode('-', $request->get('date', date('Y-m-d'))); @endphp @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) { [$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 }}
{{ __('messages.admin.total_sum') }} {{ number_format($final_station_total) }}
{{ number_format($vl->last_number) }} @php $file_name = $vl->ps_supervisor_id . '-' . $vl->getMaster->user?->id . '.png'; $path = ['supervisors', $year, $month, $day]; $path = public_path('storage' . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $path) . DIRECTORY_SEPARATOR . $file_name); @endphp @if (is_file($path)) @endif {{ number_format($vl->last_number - $vl->first_number) }} {{ $vl->getMaster->user?->name }}
{{ substr($time, 0, -3) }}
{{ __('messages.admin.total_sum') }} {{ number_format($products_total_sum[$product->id] ?? 0) }}
{{ __('messages.admin.sales_calculator') }} {{ $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)
{{-- Single expense delete modal --}}

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

{{-- --}} @php $proccessed_tanks = []; @endphp @foreach ($fuel_tankers as $tank) @if (!isset($proccessed_tanks[$tank->product_id])) @php $proccessed_tanks[$tank->product_id] = $tank; @endphp @endif @endforeach @php $capacities = []; foreach ($fuel_tank_capacity as $capacity) { $product_id = $fuel_tankers->find($capacity->tank_id)->product_id; if (!isset($capacities[$product_id])) { $capacities[$product_id] = $capacity->secondary_amount; } else { $capacities[$product_id] += $capacity->secondary_amount; } } @endphp @foreach ($fuel_tankers as $tank) @if (isset($capacities[$tank->id])) @endif @endforeach
{{ __('messages.admin.the_morning_lift') }}
{{ $tank->product->title }}
{{ number_format($capacities[$tank->id] ?? 0) }}

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

{{-- --}} @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin 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 ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach @foreach ($product_secret_origin as $product) @endforeach
{{ __('messages.admin.the_finding') }} {{ $product->title }}
{{ __('messages.admin.opening') }} {{ count($form_18) > 0 ? $form_18[$product->id]->first_number ?? 0 : 0 }}
{{ __('messages.admin.received') }} {{ number_format(count($form_18) > 0 ? $form_18[$product->id]->incoming_quantities ?? 0 : 0) }}
{{ __('messages.admin.total_sum') }} {{ number_format(count($form_18) > 0 ? ($form_18[$product->id]->first_number ?? 0) + ($form_18[$product->id]->incoming_quantities ?? 0) : 0) }}
{{ __('messages.admin.total') }} {{ number_format(count($form_18) > 0 ? $form_18[$product->id]->cash_credit ?? 0 : 0) }}
{{ __('messages.admin.nezah') }} {{ number_format(count($form_18) > 0 ? $form_18[$product->id]->nezah ?? 0 : 0) }}
{{ __('messages.admin.conclusion') }} {{ number_format(count($form_18) > 0 ? $form_18[$product->id]->last_number ?? 0 : 0) }}
{{ __('messages.admin.the_difference') }}{{ ($capacities[$product->id] ?? 0) - ($form_18[$product->id]->last_number ?? 0) }}

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

@php $products_total_price_sum = []; $products_total_diff_price_sum = []; $products_total_profit_sum = []; $products_total_litters_sum = []; $products_total_diff_litters_sum = []; $products_total_commercial_sum = []; $products_total_commercial_litters_sum = []; @endphp @foreach ($products as $product) @php $product_secret = is_null($product->getReleted) ? $product : $product->getReleted; @endphp @php $products_total_price_sum[$product->id] = $product_sales_report[$product->id]['secret']['sum_total_by_buy_price'] ?? 0; $products_total_litters_sum[$product->id] = $product_sales_report[$product->id]['secret']['sum_total_liters'] ?? 0; @endphp @php $products_total_profit_sum[$product->id] = $product_sales_report[$product->id]['secret']['sum_total_profit'] ?? 0; @endphp @php $products_total_diff_price_sum[$product->id] = $product_sales_report[$product->id]['diff']['sum_total_price'] ?? 0; $products_total_diff_litters_sum[$product->id] = $product_sales_report[$product->id]['diff']['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_p = array_sum($products_total_profit_sum); @endphp @php $total_price_d = array_sum($products_total_diff_price_sum); @endphp @php $total = ($total + $total_p + $total_price_d ) - $total_expenses; @endphp @php $total_products_atabe_sum = []; $total_products_atabe_litters = []; @endphp @foreach ($products as $product) @php $product_secret = is_null($product->getReleted) ? $product : $product->getReleted; @endphp @php if (isset($products_master_ids[$product->id])) { [$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_secret->title]) }} @convert($product_sales_report[$product->id]['secret']['sum_total_liters'] ?? 0) {{ $product->buy_price }}@convert($products_total_price_sum[$product->id])
{{ __('messages.admin.total_product_profit', ['product' => $product_secret->title]) }} @convert($product_sales_report[$product->id]['secret']['sum_total_liters'] ?? 0) {{ ($product_sales_report[$product->id]['secret']['price'] ?? $product->price) - $product->buy_price }} @convert($products_total_profit_sum[$product->id])
{{ __('messages.admin.product_differences', ['product' => $product_secret->title]) }} @convert($product_sales_report[$product->id]['diff']['sum_total_liters']) {{ $product->diff_price }} @convert($product_sales_report[$product->id]['diff']['sum_total_price'])
{{ __('messages.admin.prdocut_calculator_difference', ['product' => $product_secret->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.the_total_number_of_profits_today') }} --- --- {{ number_format($total_p) }}
{{ __('messages.admin.the_total_number_of_diffs_today') }} --- --- {{ number_format($total_price_d) }}
{{ __('messages.admin.total_masroufat') }} --- --- @convert($total_expenses, 0)
{{ __('messages.admin.remaining_price') }} --- ---{{ number_format($total) }}
{{ __('messages.equip_the_credit') }} {{ $product_secret->title }}{{ $total_liters_pd ?? 0 }} {{ number_format($total_sum_pd ?? 0) }}
{{ __('messages.admin.the_total_profit') }} {{ number_format($total_p + $total_price_d) }}
{{ __('messages.admin.total_sum') }} {{ __('messages.equip_the_credit') }} {{ number_format($total_atabe_price) }}
{{ __('messages.admin.remaining_amount_price') }} {{ number_format($total - $total_atabe_price) }}

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

@php $products_total_diff_price_sum = []; $products_total_profit_sum = []; $products_total_litters_sum = []; $products_total_diff_litters_sum = []; @endphp @foreach ($products as $product) @php $product_secret = is_null($product->getReleted) ? $product : $product->getReleted; @endphp @php $products_total_profit_sum[$product->id] = $product_sales_report[$product->id]['secret']['sum_total_profit'] ?? 0; @endphp @php $products_total_diff_price_sum[$product->id] = $product_sales_report[$product->id]['diff']['sum_total_price'] ?? 0; $products_total_diff_litters_sum[$product->id] = $product_sales_report[$product->id]['diff']['sum_total_liters'] ?? 0; @endphp @endforeach @php $total_p = array_sum($products_total_profit_sum); @endphp @php $total_price_d = array_sum($products_total_diff_price_sum); @endphp @php $total_p_diff = $total_p + $total_price_d; @endphp @php $total = ($total_p + $total_price_d ) - $total_expenses; @endphp
{{ __('messages.admin.mantooj') }} {{ __('messages.admin.kamie') }} {{ __('messages.admin.unit_price') }} {{ __('messages.admin.formal') }}
{{ __('messages.admin.total_product_profit', ['product' => $product_secret->title]) }} @convert($product_sales_report[$product->id]['secret']['sum_total_liters'] ?? 0) {{ ($product_sales_report[$product->id]['secret']['price'] ?? $product->price) - $product->buy_price }} @convert($products_total_profit_sum[$product->id])
{{ __('messages.admin.product_differences', ['product' => $product_secret->title]) }} @convert($product_sales_report[$product->id]['diff']['sum_total_liters']) {{ $product->diff_price }} @convert($product_sales_report[$product->id]['diff']['sum_total_price'])
{{ __('messages.admin.the_total_number_of_profits_today') }} --- --- {{ number_format($total_p) }}
{{ __('messages.admin.the_total_number_of_diffs_today') }} --- --- {{ number_format($total_price_d) }}
{{ __('messages.admin.the_total_number_of_profits_and_diff_today') }} --- ---{{ number_format($total_p_diff) }}
{{ __('messages.admin.total_masroufat') }} --- --- @convert($total_expenses, 0)
{{ __('messages.admin.remaining_price') }} --- ---{{ number_format($total) }}
{{-- Single capture modal --}} @stop @section('javascript') @if ($isModelTranslatable) @endif @stop