@extends('admin.admin_dashboard') <<<<<<< HEAD @section('admin')

All Payment Vouchers

{{-- Original Table Code --}}
@foreach ($paymentVouchers as $key => $voucher) @endforeach
# Date Processed Farmer No. Name Voucher No. Status Action
{{ $key + 1 }} {{ \Carbon\Carbon::parse($voucher->date_saved)->translatedFormat('l, F j, Y g:i A') }} {{ $voucher->farmer_number }} {{ $voucher->farmer_fname . ' ' . $voucher->farmer_lname }} {{ $voucher->grn_id }} @switch($voucher->voucher_status) @case(2) Valued @break @case(3) Pending Payment @break @case(4) Payment Completed @break @case(5) Pending Review @break @case(6) Rollback Requested @break @case(7) Rollback Approved @break @case(8) Rollback Denied @break @case(9) Payment Approval Denied @break @default Unknown @endswitch
@foreach ($paymentVouchers as $key => $voucher) @endforeach
# Voucher No. Date Farmer Number Farmer Name Village Group FAQ Out Turn MC MC Ded Quantity Unit Price SCN 18 Unit Price 18 Sub-Total Hulling Cost Sacks Cost Advance (Money) Transport Advance Total Deductions Net Pay
{{ $key + 1 }} {{ $voucher->grn_id }} {{ \Carbon\Carbon::parse($voucher->date_saved)->translatedFormat('l, F j, Y g:i A') }} {{ $voucher->farmer_number }} {{ $voucher->farmer_fname . ' ' . $voucher->farmer_lname }} {{ $voucher->farmer_village }} {{ $voucher->group_name }} {{ $voucher->faq }} {{ (int) $voucher->out_turn }}% {{ $voucher->moisture_content }} {{ $voucher->mc_ded }} {{ $voucher->ungraded }} {{ number_format($voucher->unit_price_ungraded, 0) }} {{ $voucher->grade_1800 }} {{ $voucher->unit_price_grade_1800 }} {{ number_format($voucher->subtotal_amount, 0) }} {{ number_format($voucher->hulling_cost, 0) }} {{ number_format($voucher->sacks_cost, 0) }} {{ number_format($voucher->money_advance, 0) }} {{ number_format($voucher->transport_advance, 0) }} {{ number_format($voucher->total_deductions, 0) }} {{ number_format($voucher->net_pay, 0) }}
@if (empty($paymentVouchers))

No valuation data available.

@endif
{{-- Include DataTables JS (if not globally available) --}} ======= @section('admin') @php use App\Support\PaymentVoucherStatus; $activeTab = $activeTab ?? 'list'; $permissions = $permissions ?? []; $workflowCounts = $workflowCounts ?? []; $filters = $filters ?? ['search' => '', 'status' => 'all']; $rowStart = $paymentVouchers->firstItem() ?? 0; $voidUrlTemplate = route('payment-voucher.void', ['voucherId' => '__VOUCHER_ID__']); $statusOptions = PaymentVoucherStatus::filterOptions(); @endphp
@csrf
Home Payment desk Voucher registry @if(Route::has('export.grn')) Export GRN @endif {{-- Workflow pipeline + quick links --}}
Where vouchers are in the process

Tap a step to filter the list. Counts are across all vouchers, not just your current search.

@can('batch_reports.view') Payment desk queue @endcan
@foreach([ [PaymentVoucherStatus::VALUED, 'Valued', 'Awaiting sign-off', 'bx-calculator', $workflowCounts['valued'] ?? 0], [PaymentVoucherStatus::PENDING_PAYMENT, 'Approved', 'Ready to pay farmer', 'bx-wallet', $workflowCounts['pending_payment'] ?? 0], [PaymentVoucherStatus::PAYMENT_COMPLETED, 'Paid', 'Payment completed', 'bx-check-circle', $workflowCounts['paid'] ?? 0], ] as [$stepStatus, $stepTitle, $stepHint, $stepIcon, $stepCount]) @php $stepActive = (string) $filters['status'] === (string) $stepStatus; $stepHref = route('all.payment.vouchers', array_merge(request()->except('page', 'status'), [ 'tab' => $activeTab, 'status' => $stepStatus, ])); @endphp
{{ number_format($stepCount) }}
{{ $stepTitle }}
{{ $stepHint }}
@endforeach
@if(($workflowCounts['needs_attention'] ?? 0) > 0)
{{ number_format($workflowCounts['needs_attention']) }} voucher(s) pending review — show them
@endif
{{-- Filters --}}
Reset
{{-- Quick status chips --}}
@foreach([ 'all' => 'All', (string) PaymentVoucherStatus::VALUED => 'Valued', (string) PaymentVoucherStatus::PENDING_PAYMENT => 'To pay', (string) PaymentVoucherStatus::PAYMENT_COMPLETED => 'Paid', ] as $chipValue => $chipLabel) @php $chipQuery = array_merge(request()->except('page', 'status'), ['tab' => $activeTab, 'status' => $chipValue]); $chipActive = (string) $filters['status'] === (string) $chipValue || ($chipValue === 'all' && ($filters['status'] === 'all' || $filters['status'] === '')); @endphp {{ $chipLabel }} @endforeach
{{-- Tabs --}} @if($activeTab === 'valuation')
Valuation breakdown {{ $paymentVouchers->total() }} rows in current filter
@forelse($paymentVouchers as $key => $voucher) @empty @endforelse
# Voucher Date Farmer Village Group FAQ Out turn MC Qty Unit price Sub-total Deductions Net pay
{{ $rowStart + $key }} #{{ $voucher->grn_id }} {{ $voucher->date_saved ? \Carbon\Carbon::parse($voucher->date_saved)->format('M j, Y') : '—' }}
{{ trim($voucher->farmer_fname.' '.$voucher->farmer_lname) }}
{{ $voucher->farmer_number }}
{{ $voucher->farmer_village ?: '—' }} {{ $voucher->group_name ?: '—' }} {{ number_format($voucher->faq ?? 0, 0) }} {{ (int) $voucher->out_turn }}% {{ $voucher->moisture_content }}% {{ $voucher->ungraded }} {{ number_format($voucher->unit_price_ungraded ?? 0, 0) }} {{ number_format($voucher->subtotal_amount ?? 0, 0) }} {{ number_format($voucher->total_deductions ?? 0, 0) }} {{ number_format($voucher->net_pay ?? 0, 0) }}
No valuation data for this filter.
@if($paymentVouchers->hasPages())
{{ $paymentVouchers->appends(['tab' => 'valuation'])->links() }}
@endif
@else
Voucher registry Showing {{ $paymentVouchers->firstItem() ?? 0 }}–{{ $paymentVouchers->lastItem() ?? 0 }} of {{ $paymentVouchers->total() }}
@forelse($paymentVouchers as $key => $voucher) @php $status = (int) $voucher->voucher_status; [$statusLabel, $badgeClass, $statusIcon] = PaymentVoucherStatus::meta($status); @endphp @empty @endforelse
# Processed Farmer Voucher FAQ Sub-total Net pay Status Actions
{{ $rowStart + $key }}
{{ $voucher->date_saved ? \Carbon\Carbon::parse($voucher->date_saved)->format('M j, Y') : '—' }}
{{ $voucher->date_saved ? \Carbon\Carbon::parse($voucher->date_saved)->format('g:i A') : '' }}
{{ trim($voucher->farmer_fname.' '.$voucher->farmer_lname) }}
{{ $voucher->farmer_number }} @if($voucher->farmer_village) · {{ $voucher->farmer_village }} @endif
#{{ $voucher->grn_id }}
PV {{ $voucher->voucher_id }}
{{ number_format($voucher->faq ?? 0, 0) }} kg {{ number_format($voucher->subtotal_amount ?? 0, 0) }} UGX {{ number_format($voucher->net_pay ?? 0, 0) }} {{ $statusLabel }} @include('admin.hope_coffee.green_bean.partials.payment-voucher-row-actions', [ 'voucher' => $voucher, 'permissions' => $permissions, ])

No payment vouchers found

Try clearing filters or check the payment desk queue for GRNs awaiting valuation.

@if($paymentVouchers->hasPages())
{{ $paymentVouchers->appends(['tab' => 'list'])->links() }}
@endif
@endif
@push('scripts') @endpush >>>>>>> origin/main @endsection