@extends('admin.layouts.app') @section('title', 'Dashboard') @section('content')

Dashboard

@if(Auth::guard('admin')->user()->type == 'admin')
Total Invested
xaf
{{ number_format(array_sum(\App\Models\Item::get()->pluck("total_buying_price")->toArray()), 2) }}
Expected Sales
xaf
{{ number_format(array_sum(\App\Models\Item::get()->pluck("total_selling_price")->toArray()), 2) }}
Total Discount
xaf
{{ number_format(array_sum(\App\Models\Order::get()->pluck("discount")->toArray()), 2) }}
Total Expenses
xaf
{{ number_format(array_sum(\App\Models\Expense::get()->pluck("amount")->toArray()), 2) }}
Total After Discount
xaf
@php $expectedSales = array_sum(\App\Models\Item::get()->pluck("total_selling_price")->toArray()); $discount = array_sum(\App\Models\Order::get()->pluck("discount")->toArray()); $expense = array_sum(\App\Models\Expense::get()->pluck("amount")->toArray()); $discountPlusExpense = $discount + $expense; $remainingBalance = $expectedSales - $discountPlusExpense; @endphp {{ number_format($remainingBalance, 2) }}
@endif
{{--
All System Orders
--}}
Recent Sales
{{--

Add lightweight datatables to your project with using the Simple DataTables library. Just add .datatable class name to any table you wish to conver to a datatable. Check for more examples.

--}}
{{-- @csrf --}}
@if(Auth::guard('admin')->user()->type == 'admin') @forelse($orders as $order) @empty @endforelse
Customer Name Discount Date Ordered Status Action
{{-- . --}} {{ $order->customer_name }} {{ number_format($order->discount, 2) }} {{ $order->created_at->format('D-M-Y') }} Details
No Orders Yet. Please PROCESS AN ORDER
@else @forelse($workerOrders as $order) @empty @endforelse
Customer Name Discount Date Ordered Status Action
{{-- . --}} {{ $order->customer_name }} {{ number_format($order->discount, 2) }} {{ $order->created_at->format('D-M-Y') }} Details
No Orders Yet. @if(isset($date)) For: {{ $date }} @endif Please PROCESS AN ORDER

Total Sales @if(isset($date)) For: {{ $date }} @endif {{ number_format($totalWorkerSale) }}

@endif
@endsection @section('footer_scripts') @endsection