@extends('admin.master') @section('main_content')

{{ session('lang') == 2 ? 'ফি বরাদ্দ' : 'Fee Allocation' }}

@if(session('success'))
{{ session('success') }}
@endif {{-- Per-item breakdown of the last run: an item that allocated nothing says here which gate its students fell at. --}} @if(session('allocation_detail')) @php $bnA = session('lang') == 2; @endphp
@foreach(session('allocation_detail') as $row) @endforeach
{{ $bnA ? 'ফি আইটেম' : 'Fee item' }} {{ $bnA ? 'নতুন' : 'New' }} {{ $bnA ? 'আপডেট' : 'Updated' }} {{ $bnA ? 'অপরিবর্তিত' : 'Unchanged' }} {{ $bnA ? 'যারা পায়নি — কারণ' : 'Not allocated — reason' }}
{{ $row['item'] }} @if($row['per_student']) {{ $bnA ? 'পরিমাণ শিক্ষার্থীর প্রোফাইল থেকে' : 'amount from the student profile' }} @endif {{ $row['created'] ?: '—' }} {{ $row['updated'] ?: '—' }} {{ $row['unchanged'] ?: '—' }} @php $reasons = []; @endphp @if($row['no_food']) @php $reasons[] = ($bnA ? $row['no_food'] . " জনের প্রোফাইলে 'খাবার গ্রহণ করে' টিক দেওয়া নেই" : $row['no_food'] . " student(s) are not marked 'Takes food' on their profile"); @endphp @endif @if($row['food_no_amount']) @php $reasons[] = ($bnA ? $row['food_no_amount'] . ' জনের নিট খাবার ফি শূন্য বা খালি' : $row['food_no_amount'] . ' student(s) have a net food fee of 0 / blank'); @endphp @endif @if($row['no_price']) @php $reasons[] = ($bnA ? $row['no_price'] . ' জনের কোনো মূল্য পাওয়া যায়নি (ক্লাস প্যাকেজ বা আইটেমের মূল্য শূন্য)' : $row['no_price'] . ' student(s) had no price (cost package and item price are both 0)'); @endphp @endif @if($row['not_applicable']) @php $reasons[] = ($bnA ? $row['not_applicable'] . ' জনের ক্ষেত্রে প্রযোজ্য নয় (ভর্তি/সেশন নিয়ম)' : $row['not_applicable'] . ' student(s) not applicable (admission / session rule)'); @endphp @endif @if(empty($reasons)) — @else {{ implode(' · ', $reasons) }} @endif
@endif @if(session('error'))
{{ session('error') }}
@endif
@csrf
{{-- Year --}}
{{-- Month --}}
{{-- Class --}}
{{-- Section --}}
{{-- Products --}}
{{ session('lang') == 2 ? 'ফি আইটেম নির্বাচন করুন' : 'Select Fee Items to Allocate' }} ({{ session('lang') == 2 ? 'প্রতিটি শিক্ষার্থীর ক্লাস অনুযায়ী মূল্য নির্ধারিত হবে' : 'Amount determined by class cost package or product price' }})
@foreach($products as $product)
id == 1) checked @endif>
@endforeach
{{-- Info box --}}
{{ session('lang') == 2 ? 'ভর্তির তারিখ বাছাইয়ের মাসের পরে হলে সেই শিক্ষার্থীকে বাদ দেওয়া হবে। ইতিমধ্যে তৈরি (Due) ফি-র মূল্য পরিবর্তন হলে আপডেট করা হবে। পেইড ফি স্পর্শ করা হবে না।' : 'Students admitted after the selected month will be skipped. Existing Due fees will have their amount updated if the price changed. Paid fees are never modified.' }}
{{ session('lang') == 2 ? 'বেতন ও খাবার ফি-র পরিমাণ ক্লাস প্যাকেজ নয়, শিক্ষার্থীর প্রোফাইল থেকে নেওয়া হয় — খাবারের ক্ষেত্রে নিট খাবার ফি (খাবার ফি − ছাড় − গোরাবা ফান্ড)। যারা খাবার গ্রহণ করে না তাদের খাবার ফি বরাদ্দ হবে না।' : 'Tuition Fee and Food Fee are not priced from a cost package — they come from the student profile, food being the net food fee (food fee − discount − Goraba fund). Students not marked as taking food get no food charge.' }}
{{ session('lang') == 2 ? 'ফিরে যান' : 'Back' }} @if(session('user.super_admin') == 'yes') {{ session('lang') == 2 ? 'আইটেম অনুযায়ী মুছুন' : 'Delete by Item' }} @endif
{{-- Allocated Fee Records (per-record list + single-row delete) --}} {{-- Recent Allocation Runs --}} @php $recentRuns = $recentRuns ?? []; @endphp @if(count($recentRuns) > 0)
{{ session('lang') == 2 ? 'সাম্প্রতিক বরাদ্দ' : 'Recent Allocation Runs' }}
@if(session('user.super_admin') == 'yes') @endif @foreach($recentRuns as $run) @if(session('user.super_admin') == 'yes') @endif @endforeach
{{ session('lang') == 2 ? 'তারিখ' : 'Date' }} {{ session('lang') == 2 ? 'বরাদ্দকারী' : 'Allocated By' }} {{ session('lang') == 2 ? 'বছর/মাস' : 'Year/Month' }} {{ session('lang') == 2 ? 'শ্রেণী/শাখা' : 'Class/Section' }} {{ session('lang') == 2 ? 'নতুন/আপডেট/স্কিপ' : 'Created/Updated/Skipped' }} {{ session('lang') == 2 ? 'শিক্ষার্থী' : 'Students' }}
{{ date('d M Y h:i A', strtotime($run->created_at)) }} {{ $run->created_by_name ?? '-' }} {{ $run->year }} / {{ $run->month ?? 'All' }} {{ $run->class_filter ?? 'All' }} / {{ $run->section_filter ?? 'All' }} {{ $run->created_count }} / {{ $run->updated_count }} / {{ $run->skipped_count }} {{ $run->student_count }}
@endif
@endsection