@extends('backEnd.layouts.master') @section('title','Purchases') @php use Illuminate\Support\Facades\Auth; @endphp @section('css') @endsection @section('content')

🛒 Purchase Management

View Reports / Logs
This Year ({{ $currentYear }})
{{ number_format($yearlyTotal, 2) }} à§³
Total Purchase
{{ \Carbon\Carbon::createFromDate(now()->year, $currentMonth, 1)->format('F') }}
{{ number_format($monthlyTotal, 2) }} à§³
Monthly Purchase
Today ({{ now()->format('d M') }})
{{ number_format($todayTotal, 2) }} à§³
Daily Purchase
Supplier Due
{{ number_format($totalDue, 2) }} à§³
Total Liability
New Purchase Entry
@csrf
Product Details
Deducted from fund
Export Report
From
To
Recent Purchase History
@forelse($purchases as $p) @php $user = Auth::guard('admin')->user(); $isAdmin = false; if ($user) { if ($user->id == 1) { $isAdmin = true; } else { $spatieRoles = $user->getRoleNames()->map(function($role) { return strtolower($role); })->toArray(); $isAdmin = in_array('admin', $spatieRoles); } } @endphp @empty @endforelse
# Date Invoice Supplier Total Paid Due Actions
{{ $loop->iteration + ($purchases->currentPage()-1)*$purchases->perPage() }} {{ \Carbon\Carbon::parse($p->purchase_date)->format('d M, Y') }} {{ $p->invoice_no }} @if($p->updated_by) @endif @if($p->supplier)
{{ $p->supplier->name }}
{{ $p->supplier->phone }} @else Deleted @endif
{{ number_format($p->grand_total,2) }} {{ number_format($p->paid_amount,2) }} {{ number_format($p->due_amount,2) }}
@if($p->due_amount > 0)
@csrf
@else Paid @endif @if($isAdmin)
@csrf @method('DELETE')
@endif

No purchase records found.

{{ $purchases->links('pagination::bootstrap-4') }}
@endsection @push('scripts') @endpush