| {{ __('Code') }} | {{ __('Machine') }} | {{ __('Product') }} | {{ __('Expiry') }} | {{ __('Status') }} | {{ __('Actions') }} |
|---|---|---|---|---|---|
| @if($code->status === 'active' && $code->expires_at->isFuture()) code }}'; activeTicketUrl = '{{ $code->ticket_url }}'; showQrModal = true" class="text-lg font-black font-mono text-cyan-600 dark:text-cyan-400 tracking-widest bg-cyan-50 dark:bg-cyan-500/10 px-4 py-1.5 rounded-xl border border-cyan-100 dark:border-cyan-500/20 shadow-sm cursor-pointer hover:bg-cyan-100 dark:hover:bg-cyan-500/20 transition-all"> {{ $code->code }} @else {{ $code->code }} @endif |
{{ $code->machine?->name ?? '-' }}
{{
$code->machine?->serial_no }}
|
@php
// 綁商品碼(新):直接取 product 名稱,不顯示貨道。
// 綁貨道碼(舊,向後相容):由貨道反查商品,並保留貨道資訊。
if ($code->product_id) {
$productName = $code->product?->name ?? __('Empty');
$slotLabel = null;
} else {
$slot = $code->machine?->slots->where('slot_no', $code->slot_no)->first();
$productName = $slot ? ($slot->product?->name ?? __('Empty')) : __('Empty');
$slotLabel = $code->slot_no;
}
@endphp
{{
$productName
}}
@if($slotLabel)
{{
__('Slot')
}}: {{ $slotLabel }}
@endif
|
{{ $code->expires_at->format('Y-m-d H:i') }}
{{ $code->expires_at->diffForHumans() }}
|
@php
$displayStatus = $code->status === 'active' && $code->expires_at->isPast() ?
'expired' :
$code->status;
@endphp
|
@if($code->status === 'active' && $code->expires_at->isFuture())
@endif
@if($code->status === 'active' && $code->expires_at->isFuture())
{{-- View QR Code Button --}}
@endif
@if($code->status === 'active' && $code->expires_at->isFuture())
@endif
|
{{ $code->machine?->name ?? '-' }}
{{ __('Product') }}
{{ $prodMobile }} @if($slotMobileLabel) {{ __('Slot') }}: {{ $slotMobileLabel }} @endif
{{ __('Expiry') }}
{{ $code->expires_at->format('m-d H:i') }} {{ $code->expires_at->diffForHumans() }}