@php $case=isset($query['case'])?$records->caseDetail([(int)$query['case'],$sid]):null; if($case): @endphp ← All exceptions

Case #{!! $case['id'] !!} · {!! e(str_replace('_',' ',$case['type'])) !!}

{!! \App\Support\Ui::badge($case['state']) !!}

{!! e($case['reason']) !!}

@if($case['decision'])

Latest recorded decision: {!! e($case['decision']) !!}

@php endif; $affected=$case['demand_id']?[['demand_id'=>$case['demand_id']]]:$records->affectedStudents([$case['id']]);$body=[];foreach($affected as $x){$d=\App\Services\FulfillmentService::demand_row((int)$x['demand_id']);$body[]=[''.e($d['name']).' · '.e($d['university_id']).'',e($d['course_code'].' / '.$d['section']),e($d['book_title']),e($d['target_isbn'])];}echo \App\Support\Ui::table(['Affected student','Course / section','Book','Current ISBN'],$body); if(\App\Support\Ui::admin()): $actions=match($case['state']){ 'awaiting_instructor'=>['platform_decision'=>'Instructor will change the platform book','replacement_decision'=>'Instructor chose return and replacement codes'], 'awaiting_platform_confirmation'=>['confirm_resolution'=>'Record confirmation that the platform book was changed'], 'awaiting_replacement'=>['confirm_return'=>'Record publisher confirmation of old code returns','confirm_resolution'=>'Confirm replacement remedy is complete'], 'refund_requested'=>['confirm_refund'=>'Record provider refund confirmation'], 'referred_to_finance'=>['close_finance'=>'Record Finance acknowledgement'], 'open'=>match($case['type']){'finance_referral'=>['refer_finance'=>'Record external referral to Finance'],'kortext_refund'=>['request_refund'=>'Record refund request sent to provider'],'membership_review'=>['restore_membership'=>'Restore scholarship membership','confirm_removal'=>'Confirm membership removal'],default=>[]},default=>[]}; if($actions): $options='';foreach($actions as $value=>$label)$options.=''; @endphp

Record an external action

The system does not change publisher platforms, issue invoices, process payments or perform refunds.

{!! \App\Support\Ui::post_form('case_event',$sid,''.($case['state']==='awaiting_instructor'?\App\Support\Ui::input('isbn','Replacement ISBN (required only for replacement decision)','text','',false):'').'','Save case update') !!}@php endif;endif; @endphp

Case history

{!! \App\Support\Ui::table(['Time (UTC)','Actor','Action','Note'],array_map(fn($r)=>[e($r['created_at']),e($r['actor']),e($r['action']),e($r['note'])],$records->caseHistory([$case['id']]))) !!}
@else

Exceptions and follow-up

@php if(\App\Support\Ui::admin()): echo \App\Support\Ui::post_form('export',$sid,'','Export Finance referrals','inline');endif;@endphp
{!! \App\Support\Ui::table(['Case','Type','State','Reason','Updated (UTC)'],array_map(fn($r)=>['#'.$r['id'].'',e(str_replace('_',' ',$r['type'])),\App\Support\Ui::badge($r['state']),e($r['reason']),e($r['updated_at'])],$records->cases([$sid]))) !!}
@php if(\App\Support\Ui::admin()): $options='';foreach($records->codeRequirements([$sid]) as $r)$options.=''; @endphp

Report an edition mismatch

Records the affected students with issued codes for the selected section and book. The instructor decides the remedy externally.

{!! \App\Support\Ui::post_form('case_create',$sid,'','Create incident') !!}
@php endif;endif; @endphp @if(isset($records->paginators['cases']))@include('components.pagination',['paginator'=>$records->paginators['cases']])@endif