@extends('layouts.app') @section('title', $inventory_count->reference_no) @section('content')

{{ $inventory_count->reference_no }} {{ $inventory_count->name }}

@php $badge = [ 'in_progress' => 'label-warning', 'submitted' => 'label-info', 'approved' => 'label-primary', 'posted' => 'label-success', 'cancelled' => 'label-default', ][$inventory_count->status] ?? 'label-default'; @endphp
@lang('inventory_count.menu') @lang('inventory_count.export_csv') @if($inventory_count->status === \App\InventoryCount::STATUS_IN_PROGRESS && auth()->user()->can('inventory_count.count')) @lang('inventory_count.continue_count') @endif @if($inventory_count->status === \App\InventoryCount::STATUS_SUBMITTED && auth()->user()->can('inventory_count.approve')) @lang('inventory_count.review_recounts') @endif

@lang('inventory_count.title')

{{ $inventory_count->status_label }}
@lang('inventory_count.reference'):
{{ $inventory_count->reference_no }}
@lang('inventory_count.location'):
{{ optional($inventory_count->location)->name }}
@lang('inventory_count.scope'):
{{ $inventory_count->scope_type === 'cycle' ? __('inventory_count.scope_cycle') : __('inventory_count.scope_full') }}
@lang('inventory_count.started_at'):
{{ @format_datetime($inventory_count->started_at) }}

@lang('inventory_count.created_by'):
{{ optional($inventory_count->creator)->user_full_name }}
@lang('inventory_count.assignees'):
{{ $inventory_count->assignees->map->user_full_name->filter()->implode(', ') ?: '—' }}
@lang('inventory_count.blind_count'):
{{ $inventory_count->blind_count ? __('messages.yes') : __('messages.no') }}
@lang('inventory_count.adjustment_transaction'):
@if($inventory_count->adjustmentTransaction) {{ $inventory_count->adjustmentTransaction->ref_no }} @elseif($inventory_count->status === \App\InventoryCount::STATUS_POSTED) @lang('inventory_count.no_adjustment') @else — @endif
@if($inventory_count->notes)
@lang('inventory_count.notes'): {{ $inventory_count->notes }} @endif
@php $summaryCards = [ [__('inventory_count.total_items'), $summary->total_items, 'bg-aqua'], [__('inventory_count.counted_items'), $summary->counted_items, 'bg-green'], ]; if ($showExpected) { $summaryCards[] = [__('inventory_count.variance_items'), $summary->variance_items, 'bg-yellow']; $summaryCards[] = [__('inventory_count.pending_recount_items'), $summary->pending_recounts, 'bg-red']; } @endphp @foreach($summaryCards as $card)

{{ $card[1] ?: 0 }}

{{ $card[0] }}

@endforeach
@if($showExpected)
@lang('inventory_count.net_quantity_variance'){{ (float)$summary->net_quantity_variance }}
@lang('inventory_count.net_value_variance')@format_currency($summary->net_value_variance)
@lang('inventory_count.absolute_value_variance')@format_currency($summary->absolute_value_variance)
@endif

@lang('inventory_count.count_stock')

@if($showExpected)@endif @if($showExpected) @endif @foreach($items as $item) @php $systemMap = []; foreach(($item->system_serials ?: []) as $serial) $systemMap[mb_strtolower($serial)] = $serial; $finalMap = []; foreach($item->finalSerials() as $serial) $finalMap[mb_strtolower($serial)] = $serial; $missingSerials = array_values(array_diff_key($systemMap, $finalMap)); $extraSerials = array_values(array_diff_key($finalMap, $systemMap)); $varianceClass = (float)$item->variance_quantity < 0 ? 'text-danger' : ((float)$item->variance_quantity > 0 ? 'text-success' : ''); @endphp @if($showExpected)@endif @if($showExpected) @endif @endforeach
@lang('inventory_count.product') @lang('inventory_count.sku')@lang('inventory_count.system_quantity')@lang('inventory_count.first_count') @lang('inventory_count.manager_recount') @lang('inventory_count.final_count')@lang('inventory_count.variance_quantity') @lang('inventory_count.variance_value') @lang('inventory_count.missing_serials') @lang('inventory_count.extra_serials')@lang('inventory_count.notes')
{{ optional($item->product)->name }} {{ optional($item->variation)->sub_sku }}{{ $item->system_quantity }}{{ $item->first_count_quantity ?? '—' }} {{ $item->recount_quantity ?? '—' }} {{ $item->final_count_quantity ?? '—' }}{{ $item->variance_quantity ?? '—' }} @if($item->variance_value !== null) @format_currency($item->variance_value) @else — @endif {{ implode(', ', $missingSerials) ?: '—' }} {{ implode(', ', $extraSerials) ?: '—' }}{{ $item->notes ?: '—' }}
{{ $items->links() }}
@if($inventory_count->status === \App\InventoryCount::STATUS_SUBMITTED && auth()->user()->can('inventory_count.approve'))

@lang('inventory_count.approve')

@csrf
@endif @if($inventory_count->status === \App\InventoryCount::STATUS_APPROVED && auth()->user()->can('inventory_count.post'))

@lang('inventory_count.post_adjustment')

@lang('inventory_count.post_warning')

@csrf
@endif @if(!in_array($inventory_count->status, [\App\InventoryCount::STATUS_POSTED, \App\InventoryCount::STATUS_CANCELLED]) && auth()->user()->can('inventory_count.cancel'))

@lang('inventory_count.cancel')

@csrf
@endif

@lang('inventory_count.audit_history')

    @foreach($inventory_count->audits as $audit)
  • {{ @format_datetime($audit->created_at) }}

    {{ __('inventory_count.audit_actions.'.$audit->action) }} — {{ optional($audit->user)->user_full_name ?: __('business.system') }}

    @if($audit->notes)
    {{ $audit->notes }}
    @endif
  • @endforeach
@endsection @section('css') @endsection