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

All Batch Reports

@if (Auth::user()->can('grn.add')) + Add GRN @endif @if (Auth::user()->can('grn.import')) Import GRN @endif
@php $totalFAQ = 0; @endphp @foreach ($batchReports as $key => $report) @php $totalFAQ += $report->faq; @endphp @endforeach
S/N Farmer Number Name FAQ Moisture Date Processed Voucher No. Action
{{ $key + 1 }} {{ $report->farmer_number }} {{ $report->farmer_fname . ' ' . $report->farmer_lname }} {{ $report->faq }} {{ $report->moisture_content }}% {{ $report->date_processed }} {{ $report->id }}
Total FAQ: {{ number_format($totalFAQ, 2) }}
{{-- Custom styles --}} {{-- JavaScript --}} {{-- Include DataTables JS (if not globally available) --}} @endsection ======= confirmButtonText: 'Yes, delete it', }) : Promise.resolve({ isConfirmed: window.confirm('Delete this GRN?') })); confirmDelete.then(function (result) { if (!result || !result.isConfirmed) return; fetch(@json(route('delete.grn')), { method: 'DELETE', headers: { 'X-CSRF-TOKEN': csrf, 'Content-Type': 'application/json', 'Accept': 'application/json', }, body: JSON.stringify({ grn_id: grnId }) }) .then(function (res) { return res.json(); }) .then(function (data) { if (data.status === 'success') { notify('success', 'Deleted', data.message).then(function () { location.reload(); }); } else { notify('error', 'Error', data.message); } }) .catch(function () { notify('error', 'Error', 'Failed to delete GRN.'); }); }); } }); document.addEventListener('DOMContentLoaded', function () { if (window.jQuery && jQuery.fn.DataTable && document.getElementById('batchReportsTable')) { table = jQuery('#batchReportsTable').DataTable({ paging: false, searching: true, info: true, lengthChange: false, order: [[0, 'asc']], }); } syncDeskButtons(@json($summary)); refreshLive(); setInterval(refreshLive, 8000); }); })(); @endpush >>>>>>> origin/main