{{-- Body of one "By property" card. Rendered lazily by LockStatisticsController@propertyCard when the card is expanded. Expects: $prop (buildPropertyView row), $propertyEmail, $hasCustomer. --}} @php $formatIsk = fn($amount) => number_format((float) $amount, 0, ',', '.') . ' ISK'; $pendingList = collect($prop['months'])->filter(fn($m) => empty($m['is_invoiced']) && empty($m['is_skipped']))->values(); @endphp
{{-- Why N locks? Opens the per-lock breakdown (last activity, flags, exclude from billing). --}} @php $lastMonthRow = collect($prop['months'])->last(); @endphp
Locks {{ (int) ($lastMonthRow['billable_unique_lock_count'] ?? 0) }} counted
{{-- Inline customer editor — link / edit a dkPlus customer without leaving the page. --}}
@if($hasCustomer)
Customer {{ $propertyEmail->dkplus_customer_name ?: '—' }} #{{ $propertyEmail->dkplus_customer_id }} @if(!empty($prop['has_customer_history'])) swap_horiz company change @endif
Edit
@csrf
@else
link_off No dkPlus customer linked — enter the customer ID and click Save.
@csrf
@endif
@csrf
@foreach($prop['months'] as $m) @php $rowStatus = !empty($m['is_invoiced']) ? 'invoiced' : (!empty($m['is_skipped']) ? 'skipped' : 'pending'); $origSubtotal = (int) ($m['original_subtotal'] ?? $m['subtotal']); $displaySubtotal = $rowStatus === 'skipped' ? 0 : $origSubtotal; @endphp @endforeach
Month Locks Subtotal Status Actions
@if($rowStatus === 'pending') @else — @endif {{ $m['month'] }} @if(!empty($m['is_current_month'])) current @endif @if(!empty($m['customer_is_historical'])) {{ $m['customer_name'] !== '' ? $m['customer_name'] : '#' . $m['customer_id'] }} @endif {{ $m['billable_unique_lock_count'] }} {{ $formatIsk($displaySubtotal) }} @if($rowStatus === 'invoiced') Invoiced @if(!empty($m['invoice_id'])) #{{ $m['invoice_id'] }} @endif @if(!empty($m['invoice_status'])) {{ strtoupper($m['invoice_status']) }} @endif @elseif($rowStatus === 'skipped') Skipped @if(!empty($m['skip_reason'])) — {{ $m['skip_reason'] }} @endif @else Pending @endif @if($rowStatus === 'invoiced' && !empty($m['invoice_id'])) picture_as_pdf @elseif($rowStatus === 'pending') {{-- Single-month invoice for just this row (the header button does all closed months) --}} @else @endif
{{-- Per-card settled-months toggle (hidden in the "All" view, where every month is shown) --}}
{{-- Action bar — always rendered so JS can show/hide as state changes inline --}}
0 ISK
0 of {{ $pendingList->count() }} pending selected
check_circle All months for this property are either invoiced or marked as non-billable.