@extends('layouts.app') @section('title', 'Active Budgets Control') @section('admin-content')

Active Budgets Control

{{-- --- BAGIAN 1: PANEL FILTER DINAMIS --- --}}

Current Active Budget

@if (auth()->user()->can('budget_control.create'))
@if(auth()->user()->hasAnyRole(['Accounting', 'accounting', 'Admin Region', 'Superadmin', 'Super Admin'])) @endif Add New Budget
@endif
@include('backend.layouts.partials.messages')
@foreach ($data as $item) @php $realtimeBudget = $item->availableBudget ?? 0; @endphp @endforeach
# Penerima / Cabang Pengirim Assigned Budget Real-time Sisa Budget Periode Status Budget Status Transfer Bukti Aksi
{{ ($data->currentPage() - 1) * $data->perPage() + $loop->iteration }}
{{ $item->receiver->name ?? '-' }}
{{ $item->cabang->name ?? '-' }}
{{ $item->sender->name ?? '-' }}
Rp {{ number_format($item->amount, 0, ',', '.') }}
Rp {{ number_format($realtimeBudget, 0, ',', '.') }}
{{ strtoupper($item->periode_month) }} {{ $item->periode_year }} {{ $item->status }}
{{ $item->created_at->format('d M Y H:i') }} WIB
@php $tStatus = $item->transfer_status ?? 'Pending'; $badgeClass = match(strtolower($tStatus)) { 'validated' => 'badge-success', 'waiting approval' => 'badge-info', 'rejected' => 'badge-danger', default => 'badge-secondary' }; @endphp {{ $tStatus }} @if($item->transfer_proof) View @else - @endif
@if(strtolower($item->transfer_status) != 'validated') @endif @if(Auth::user()->hasAnyRole(['accounting', 'Accounting', 'admin', 'Admin', 'Superadmin']) && strtolower($item->transfer_status) == 'waiting approval')
@csrf
@csrf
@endif @if (auth()->user()->can('budget_control.delete'))
@csrf @method('DELETE')
@endif
{{-- --- BAGIAN 2: NAVIGASI HALAMAN (SERVER-SIDE) --- --}}
Menampilkan {{ $data->firstItem() }} sampai {{ $data->lastItem() }} dari {{ $data->total() }} data
{{ $data->appends(request()->query())->links('pagination::bootstrap-4') }}
@include('backend.pages.budget_control.partials.modals') @endsection @section('scripts') @endsection