@extends('layouts.master') @section('css') @endsection @section('title') {{ __('home.home') }} @stop @section('page-header')
{{ (App::getLocale() == 'en' ? (optional(Auth::user()->branch)->name_en ?? optional(Auth::user()->branch)->name) : optional(Auth::user()->branch)->name) ?? __('home.all_branches') }} {{ Auth::user()->roles_name[0] ?? (app()->getLocale() == 'en' ? 'Authorized User' : 'مستخدم معتمد') }}

{{ __('home.welcome') }}{{ app()->getLocale() == 'en' ? ', ' : '، ' }}{{ Auth::user()->name }} 👋

{{ app()->getLocale() == 'en' ? 'Live executive overview of sales, inventory, and daily operations.' : 'لوحة القيادة والمؤشرات الحية لأداء المبيعات والمخزون والعمليات اليومية.' }}

@endsection @section('content') @can('Home')
{{ __('home.select_branch') }}:
{{ __('home.branch_filter_hint') }}

{{ app()->getLocale() == 'en' ? 'Live Restaurant Operations Hub' : 'مركز عمليات ومؤشرات المطعم الحية' }}

{{ app()->getLocale() == 'en' ? 'Live metrics, cashier shift status, and instant operations' : 'متابعة حية للطلبات، حالة وردية الكاشير، وبوابات التشغيل السريعة للمطعم' }}

@if($currentShift) {{ app()->getLocale() == 'en' ? 'Active Shift #' . $currentShift->shift_number : 'وردية نشطة #' . ($currentShift->shift_number ?? $currentShift->id) }} ({{ $currentShift->cashier->name ?? Auth::user()->name }}) {{ app()->getLocale() == 'en' ? 'Close Shift' : 'تقفيل الوردية' }} @else {{ app()->getLocale() == 'en' ? 'No Active Shift For You' : 'لا توجد وردية مفتوحة باسمك' }} {{ app()->getLocale() == 'en' ? 'Open POS Shift' : 'فتح وردية الآن' }} @endif {{ app()->getLocale() == 'en' ? 'Shifts Log' : 'سجل الورديات' }}
{{ app()->getLocale() == 'en' ? "Today's Restaurant Orders" : 'طلبات المطعم اليوم' }}
{{ $todayRestaurantOrdersCount }} {{ app()->getLocale() == 'en' ? 'orders' : 'طلب' }}
🍽️ {{ app()->getLocale() == 'en' ? 'Dine-in:' : 'صالة:' }} {{ $todayRestaurantDineIn }} 🥡 {{ app()->getLocale() == 'en' ? 'Takeaway:' : 'سفري:' }} {{ $todayRestaurantTakeaway }} 🛵 {{ app()->getLocale() == 'en' ? 'Delivery:' : 'توصيل:' }} {{ $todayRestaurantDelivery }}
{{ app()->getLocale() == 'en' ? "Today's Restaurant Sales" : 'مبيعات المطعم اليوم' }}
{{ number_format($todayRestaurantSales, 2) }} {{ __('home.SAR') }}
@if($todayRestaurantRefunds > 0) {{ app()->getLocale() == 'en' ? 'Refunds:' : 'مرتجعات:' }} {{ number_format($todayRestaurantRefunds, 2) }} {{ __('home.SAR') }} @else {{ app()->getLocale() == 'en' ? 'All orders settled' : 'إجمالي المبيعات المحصلة' }} @endif
{{ app()->getLocale() == 'en' ? 'Active Cashier Shifts' : 'ورديات الكاشير النشطة' }}
{{ $activeShiftsCount }} {{ app()->getLocale() == 'en' ? 'shifts' : 'وردية' }}
{{ app()->getLocale() == 'en' ? 'Across selected branches' : 'تعمل حالياً في نقاط البيع' }}
@if(isset($recentRestaurantOrders) && $recentRestaurantOrders->count() > 0)
{{ app()->getLocale() == 'en' ? 'Recent Restaurant Orders Today' : 'أحدث طلبات المطعم اليوم' }}
{{ app()->getLocale() == 'en' ? 'View All Orders →' : 'عرض كل الطلبات ←' }}
@foreach($recentRestaurantOrders as $ro) @endforeach
{{ app()->getLocale() == 'en' ? 'Queue #' : 'رقم النداء' }} {{ app()->getLocale() == 'en' ? 'Order #' : 'رقم الفاتورة' }} {{ app()->getLocale() == 'en' ? 'Time' : 'الوقت' }} {{ app()->getLocale() == 'en' ? 'Type' : 'النوع' }} {{ app()->getLocale() == 'en' ? 'Cashier' : 'الكاشير' }} {{ app()->getLocale() == 'en' ? 'Total' : 'الإجمالي' }} {{ app()->getLocale() == 'en' ? 'Status' : 'الحالة' }}
#{{ $ro->queue_number }} {{ $ro->order_number }} {{ $ro->created_at ? $ro->created_at->format('H:i') : '—' }} @if($ro->order_type == 'dine_in') 🍽️ {{ app()->getLocale() == 'en' ? 'Dine-in' : 'صالة' }} {{ $ro->table_number ? '('.$ro->table_number.')' : '' }} @elseif($ro->order_type == 'takeaway') 🥡 {{ app()->getLocale() == 'en' ? 'Takeaway' : 'سفري' }} @else 🛵 {{ app()->getLocale() == 'en' ? 'Delivery' : 'توصيل' }} @endif {{ $ro->cashier->name ?? '—' }} {{ number_format($ro->total, 2) }} {{ __('home.SAR') }} @if($ro->refunded_at) {{ app()->getLocale() == 'en' ? 'Refunded' : 'مرتجع' }} @elseif($ro->status == 'served') {{ app()->getLocale() == 'en' ? 'Served' : 'مكتمل' }} @elseif($ro->status == 'ready') {{ app()->getLocale() == 'en' ? 'Ready' : 'جاهز' }} @else {{ app()->getLocale() == 'en' ? 'Preparing' : 'قيد التحضير' }} @endif
@endif
{{ __('home.salesdoday') }}
{{ $todayInvoicesCount }} {{ __('home.invoice') }}
@if(($todayRestaurantOrdersCount ?? 0) > 0)
🍽️ منها {{ $todayRestaurantOrdersCount }} طلب مطعم ({{ number_format($todayRestaurantSales, 2) }} ر.س)
@endif
{{ __('home.TODAYEARNINGS') }}
{{ number_format($todayEarnings, 2) }} {{ __('home.SAR') }}
@if(($todayRestaurantOrdersCount ?? 0) > 0)
🍽️ مبيعات المطعم: {{ number_format($todayRestaurantSales, 2) }} ر.س
@endif
{{ __('home.purchasesdoday') }}
{{ $todayPurchasesCount }} {{ __('home.invoice') }}
{{ __('home.TODAYpurchases') }}
{{ number_format($todayPurchasesTotal, 2) }} {{ __('home.SAR') }}
{{ __('home.receipt_vouchers') }}
{{ $receiptVouchersCount }} {{ app()->getLocale() == 'en' ? 'voucher(s)' : 'سند' }}
{{ number_format($receiptVouchersTotal, 2) }} {{ __('home.SAR') }}
{{ __('home.payment_vouchers') }}
{{ $paymentVouchersCount }} {{ app()->getLocale() == 'en' ? 'voucher(s)' : 'سند' }}
{{ number_format($paymentVouchersTotal, 2) }} {{ __('home.SAR') }}
{{ __('home.branch_transfers') }}
{{ $transfersCount }} {{ __('home.transfer') }}
{{ number_format($transfersTotal, 2) }} {{ __('home.SAR') }}
{{ __('home.returns_total') }}
{{ app()->getLocale() == 'en' ? 'Sales: ' : 'مبيعات: ' }}{{ number_format($salesReturnsTotal, 2) }} {{ app()->getLocale() == 'en' ? 'Purchases: ' : 'مشتريات: ' }}{{ number_format($purchaseReturnsTotal, 2) }}
{{ __('home.sales_purchases_comparison_current_month') }}
{{ now()->translatedFormat('F Y') }}
{{ __('home.customers_and_suppliers') }}
{{ __('home.total_customers') }} {{ $customersCount }}
{{ __('home.total_suppliers') }} {{ $suppliersCount }}
{{ __('home.returns_and_delivery') }}
{{ __('home.sel_product_withoud_tax') }} ({{ __('home.today') }})
{{ $todayDeliveryCount }} {{ __('home.invoice') }} ({{ number_format($todayDeliveryNet, 2) }} {{ __('home.SAR') }})
{{ __('home.numberodreturnsSale') }}
{{ $uniqueReturnSalesCount }} {{ __('home.invoice') }}
{{ __('home.numberodreturnsPurchases') }}
{{ $resourcePurchasesCount }} {{ __('home.invoice') }}
{{ __('home.top_branch_today') }}
{{ __('home.today') }}
{{ __('home.top_employee_today') }}
{{ __('home.today') }}
{{ __('home.view_employee_sales_today') }}
{{ __('home.invoices_count') }} 0
{{ __('home.total_sales') }} 0
{{ __('home.select_employee_hint') }}
{{ __('home.search_invoices_by_date_employee') }}
{{ __('home.invoice_number') }} {{ __('home.customer') }} {{ __('home.employee') }} {{ __('home.total') }} {{ __('home.payment_method') }} {{ __('home.time') }}
{{ __('home.select_date_search_hint') }}
{{ __('home.branch_transfers_today') }}
@include('partials.branch-transfers')
# {{ __('home.from_branch') }} {{ __('home.to_branch') }} {{ __('home.amount_sar') }} {{ __('home.status') }}
{{ __('home.latest_transactions_today') }}
{{ __('home.view_all') }}
@include('partials.latest-invoices')
{{ __('home.invoice_number') }} {{ __('home.customer') }} {{ __('home.total_amount') }} {{ __('home.payment_method') }} {{ __('home.status') }} {{ __('home.time') }}
{{ app()->getLocale() == 'en' ? "Today's Latest 5 Purchases" : 'آخر 5 عمليات شراء اليوم' }}
{{ __('home.view_all') }}
@forelse($latestPurchasesToday as $purchase) @empty @endforelse
{{ __('home.invoice_number') }} {{ __('home.supplier') }} {{ __('home.amount') }} {{ __('home.payment_method') }} {{ __('home.time') }}
#{{ $purchase->orderId ?? $purchase->purchase_invoice_no ?? $purchase->id }} {{ optional($purchase->supllier)->name ?? '—' }} {{ number_format($purchase->In_debt, 2) }} {{ __('home.SAR') }} {{ $purchase->Pay_Method_Name ?? '—' }} {{ \Carbon\Carbon::parse($purchase->created_at)->format('H:i') }}
{{ app()->getLocale() == 'en' ? 'No purchase transactions recorded today' : 'لا توجد عمليات شراء اليوم' }}
@endcan @endsection @section('js') @endsection