@extends('layouts.app') @section('title', __('home.home')) @section('content') @php use App\Utils\ColorUtil; @endphp @php $is_admin = auth() ->user() ->hasRole('Admin#' . session('business.id')) ? true : false; @endphp
@if ($is_admin)

{{ Session::get('business.name') }}

{{ __('home.welcome_message', ['name' => Session::get('user.first_name')]) }}

@if (count($all_locations) > 1)
{!! Form::select('dashboard_location', $all_locations, null, [ 'class' => 'form-control select2 modern-select', 'placeholder' => __('lang_v1.select_location'), 'id' => 'dashboard_location', ]) !!}
@endif
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('home.total_sell') }}
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('lang_v1.net') }} @show_tooltip(__('lang_v1.net_home_tooltip'))
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('home.invoice_due') }}
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('lang_v1.total_sell_return') }}
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('home.total_purchase') }}
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('home.purchase_due') }}
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('lang_v1.expense') }}
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('lang_v1.total_purchase_return') }}
{{ __('lang_v1.today') ?: 'Today' }}
Profit Margin {{ number_format($profit_margin ?? 0, 2) }}%
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('lang_v1.average_order_value') ?: __('home.average_order_value') ?: 'Average Order Value' }} {{ number_format($average_order_value ?? 0, 2) }}
{{ __('lang_v1.vs_yesterday') ?: 'vs Yesterday' }}
{{ __('lang_v1.growth_rate') ?: __('home.growth_rate') ?: 'Growth Rate' }} {{ ($growth_rate ?? 0) >= 0 ? '+' : '' }}{{ number_format($growth_rate ?? 0, 2) }}%
{{ __('lang_v1.total') ?: 'Total' }}
{{ __('home.total_customers') ?: __('lang_v1.total_customers') ?: 'Total Customers' }} {{ number_format($total_customers ?? 0) }}
{{ __('lang_v1.total') ?: 'Total' }}
{{ __('home.total_products') ?: __('lang_v1.total_products') ?: 'Total Products' }} {{ number_format($total_products ?? 0) }}
{{ __('lang_v1.today') ?: 'Today' }}
{{ __('home.total_transactions') ?: __('lang_v1.total_transactions') ?: 'Total Transactions' }} {{ number_format($total_transactions_today ?? 0) }}
{{ __('lang_v1.today') ?: 'Today' }}
Cash Sales {{ number_format($cash_sales ?? 0, 2) }}
{{ __('lang_v1.today') ?: 'Today' }}
Credit Sales {{ number_format($credit_sales ?? 0, 2) }}

Last Invoice

@php $business_id = session('business.id'); $location_id = session()->get('user.selected_location_id'); $permitted_locations = auth()->user()->permitted_locations(); $query = \DB::table('transactions') ->where('business_id', $business_id) ->where('type', 'sell') ->where('status', 'final'); if ($permitted_locations != 'all') { $query->whereIn('location_id', $permitted_locations); } elseif (!empty($location_id)) { $query->where('location_id', $location_id); } $last_invoices = $query->orderBy('created_at', 'desc') ->limit(10) ->select('invoice_no', 'final_total', 'created_at') ->get(); @endphp @forelse($last_invoices as $index => $invoice) @empty @endforelse
SL Invoice Number Amount
{{ $index + 1 }} {{ $invoice->invoice_no ?? 'N/A' }} {{ number_format($invoice->final_total ?? 0, 2) }}
No invoices found

{{ __('home.business_statistics') }}

{{ __('home.sales_vs_purchase') }}
{{ __('lang_v1.revenue_breakdown') ?: 'Revenue Breakdown' }}
{{ __('lang_v1.invoice_due_vs_purchase_due') ?: __('home.invoice_due_vs_purchase_due') ?: 'Invoice Due vs Purchase Due' }}
{{ __('lang_v1.outstanding_payments') ?: 'Outstanding Payments' }}
{{ __('lang_v1.net_vs_expense') ?: __('home.net_vs_expense') ?: 'Net vs Expense' }}
{{ __('lang_v1.profit_analysis') ?: 'Profit Analysis' }}
{{ __('lang_v1.cash_vs_credit_sales') ?: __('home.cash_vs_credit_sales') ?: 'Cash vs Credit Sales' }}
{{ __('lang_v1.payment_methods') ?: 'Payment Methods' }}
{{ __('lang_v1.revenue_distribution') ?: __('home.revenue_distribution') ?: 'Revenue Distribution' }}
{{ __('lang_v1.income_sources') ?: 'Income Sources' }}
{{ __('lang_v1.profit_margin_trend') ?: __('home.profit_margin_trend') ?: 'Profit Margin Trend' }}
{{ __('home.monthly_performance') }}
{{ __('home.monthly_performance') }}
{{ __('home.expenses_by_month') ?: __('lang_v1.expenses_by_month') ?: 'Expenses by Month' }}

{{ __('home.sells_last_30_days') }}

{!! $sells_chart_1->container() !!}

{{ __('home.sells_current_fy') }}

{!! $sells_chart_2->container() !!}
@if (!empty($widgets['after_sale_purchase_totals'])) @foreach ($widgets['after_sale_purchase_totals'] as $widget) {!! $widget !!} @endforeach @endif @endif
@if (auth()->user()->can('dashboard.data')) @if (auth()->user()->can('sell.view') || auth()->user()->can('direct_sell.view'))
@if (!empty($all_locations)) @endif
@endif @endif
@if (auth()->user()->can('dashboard.data'))
@if (auth()->user()->can('sell.view') || auth()->user()->can('direct_sell.view'))

{{ __('lang_v1.sales_payment_dues') }} @show_tooltip(__('lang_v1.tooltip_sales_payment_dues'))

{!! Form::select('sales_payment_dues_location', $all_locations, null, [ 'class' => 'form-control select2', 'placeholder' => __('lang_v1.select_location'), 'id' => 'sales_payment_dues_location', ]) !!}
@lang('contact.customer') @lang('sale.invoice_no') @lang('home.due_amount') @lang('messages.action')
@endif @can('purchase.view')

{{ __('lang_v1.purchase_payment_dues') }} @show_tooltip(__('tooltip.payment_dues'))

@if (count($all_locations) > 1)
{!! Form::select('purchase_payment_dues_location', $all_locations, null, [ 'class' => 'form-control select2 ', 'placeholder' => __('lang_v1.select_location'), 'id' => 'purchase_payment_dues_location', ]) !!}
@endif
@lang('purchase.supplier') @lang('purchase.ref_no') @lang('home.due_amount') @lang('messages.action')
@endcan @can('stock_report.view')

{{ __('home.product_stock_alert') }} @show_tooltip(__('tooltip.product_stock_alert'))

@if (count($all_locations) > 1)
{!! Form::select('stock_alert_location', $all_locations, null, [ 'class' => 'form-control select2', 'placeholder' => __('lang_v1.select_location'), 'id' => 'stock_alert_location', ]) !!}
@endif
@lang('sale.product') @lang('business.location') @lang('report.current_stock')
@if (session('business.enable_product_expiry') == 1)

{{ __('home.stock_expiry_alert') }} @show_tooltip( __('tooltip.stock_expiry_alert', [ 'days' =>session('business.stock_expiry_alert_days', 30) ]) )

@lang('business.product') @lang('business.location') @lang('report.stock_left') @lang('product.expires_in')
@endif @endcan

Top Performers

Leading Customers & Best Selling Products

Top Customers

Highest Revenue Generators

@if (count($all_locations) > 1)
{!! Form::select('top_customers_location', $all_locations, null, [ 'class' => 'form-control select2 top-filter-select', 'placeholder' => __('lang_v1.all_locations'), 'id' => 'top_customers_location', 'style' => 'min-width: 150px;' ]) !!}
@endif
10
Rank Customer Name Amount

Top Products

Most Sold Items

10
Rank Product Name Quantity
@if (auth()->user()->can('so.view_all') || auth()->user()->can('so.view_own'))

{{ __('lang_v1.sales_order') }}

@if (count($all_locations) > 1)
{!! Form::select('so_location', $all_locations, null, [ 'class' => 'form-control select2', 'placeholder' => __('lang_v1.select_location'), 'id' => 'so_location', ]) !!}
@endif
@lang('messages.action') @lang('messages.date') @lang('restaurant.order_no') @lang('sale.customer_name') @lang('lang_v1.contact_no') @lang('sale.location') @lang('sale.status') @lang('lang_v1.shipping_status') @lang('lang_v1.quantity_remaining') @lang('lang_v1.added_by')
@endif @if ( !empty($common_settings['enable_purchase_requisition']) && (auth()->user()->can('purchase_requisition.view_all') || auth()->user()->can('purchase_requisition.view_own')))

@lang('lang_v1.purchase_requisition')

@if (count($all_locations) > 1) @if (count($all_locations) > 1) {!! Form::select('pr_location', $all_locations, null, [ 'class' => 'form-control select2', 'placeholder' => __('lang_v1.select_location'), 'id' => 'pr_location', ]) !!} @endif @endif
@lang('messages.action') @lang('messages.date') @lang('purchase.ref_no') @lang('purchase.location') @lang('sale.status') @lang('lang_v1.required_by_date') @lang('lang_v1.added_by')
@endif @if ( !empty($common_settings['enable_purchase_order']) && (auth()->user()->can('purchase_order.view_all') || auth()->user()->can('purchase_order.view_own')))

@lang('lang_v1.purchase_order')

@if (count($all_locations) > 1) {!! Form::select('po_location', $all_locations, null, [ 'class' => 'form-control select2', 'placeholder' => __('lang_v1.select_location'), 'id' => 'po_location', ]) !!} @endif
@lang('messages.action') @lang('messages.date') @lang('purchase.ref_no') @lang('purchase.location') @lang('purchase.supplier') @lang('sale.status') @lang('lang_v1.quantity_remaining') @lang('lang_v1.added_by')
@endif @if (auth()->user()->can('access_pending_shipments_only') || auth()->user()->can('access_shipping') || auth()->user()->can('access_own_shipping'))

@lang('lang_v1.pending_shipments')

@if (count($all_locations) > 1)
{!! Form::select('pending_shipments_location', $all_locations, null, [ 'class' => 'form-control select2 ', 'placeholder' => __('lang_v1.select_location'), 'id' => 'pending_shipments_location', ]) !!}
@endif
@if (!empty($custom_labels['shipping']['custom_field_1'])) @endif @if (!empty($custom_labels['shipping']['custom_field_2'])) @endif @if (!empty($custom_labels['shipping']['custom_field_3'])) @endif @if (!empty($custom_labels['shipping']['custom_field_4'])) @endif @if (!empty($custom_labels['shipping']['custom_field_5'])) @endif
@lang('messages.action') @lang('messages.date') @lang('sale.invoice_no') @lang('sale.customer_name') @lang('lang_v1.contact_no') @lang('sale.location') @lang('lang_v1.shipping_status') {{ $custom_labels['shipping']['custom_field_1'] }} {{ $custom_labels['shipping']['custom_field_2'] }} {{ $custom_labels['shipping']['custom_field_3'] }} {{ $custom_labels['shipping']['custom_field_4'] }} {{ $custom_labels['shipping']['custom_field_5'] }} @lang('sale.payment_status') @lang('restaurant.service_staff')
@endif @if (auth()->user()->can('account.access') && config('constants.show_payments_recovered_today') == true)

@lang('lang_v1.payment_recovered_today')

@lang('messages.date') @lang('account.account') @lang('lang_v1.description') @lang('lang_v1.payment_method') @lang('lang_v1.payment_details') @lang('account.credit') @lang('lang_v1.account_balance') @show_tooltip(__('lang_v1.account_balance_tooltip')) @lang('lang_v1.total_balance') @show_tooltip(__('lang_v1.total_balance_tooltip'))
@endif {{-- @if (!empty($widgets['after_dashboard_reports'])) @foreach ($widgets['after_dashboard_reports'] as $widget) {!! $widget !!} @endforeach @endif --}}
@endif @endsection @section('css') @endsection @section('javascript') @includeIf('sales_order.common_js') @includeIf('purchase_order.common_js') @if (!empty($all_locations)) {!! $sells_chart_1->script() !!} {!! $sells_chart_2->script() !!} @endif @endsection