@props([
'infoPanelObj' => null,
'img_path' => null,
'qr_code_url' => null,
'snipeSettings' => \App\Models\Setting::getSettings()
])
@if (($img_path) && ($infoPanelObj->getImageUrl($img_path)))
{{--
--}}
@endif
@if ($infoPanelObj->present()->displayAddress)
{!! nl2br($infoPanelObj->present()->displayAddress) !!}
@endif
@if (isset($before_list))
{{ $before_list }}
@endif
{{ $slot }}
@if ($infoPanelObj->notes)
{!! nl2br(Helper::parseEscapedMarkedownInline($infoPanelObj->notes)) !!}
@endif
@if ($infoPanelObj->serial)
@if(($infoPanelObj::class != "App\Models\License") || (Gate::allows('viewKeys', $infoPanelObj)))
{{ $infoPanelObj->serial }}
@endif
@endif
@if ($infoPanelObj->license_name)
{{ trans('admin/licenses/form.to_name') }}
{{ $infoPanelObj->license_name }}
@endif
@if ($infoPanelObj->license_email)
{{ trans('admin/licenses/form.to_email') }}
{{ $infoPanelObj->license_email }}
@endif
@if ($infoPanelObj->termination_date)
{{ Helper::getFormattedDateObject($infoPanelObj->termination_date, 'date', false) }}
@endif
@if ($infoPanelObj->expiration_date)
{{ Helper::getFormattedDateObject($infoPanelObj->expiration_date, 'date', false) }}
@endif
@if ($infoPanelObj->model)
{!! $infoPanelObj->model->present()->formattedNameLink !!}
{{ trans('general.model_no') }}
{{ $infoPanelObj->model->model_number }}
@elseif ($infoPanelObj->model_number)
{{ trans('general.model_no') }}
{{ $infoPanelObj->model_number }}
@endif
@if ($infoPanelObj->item_no)
{{ trans('admin/consumables/general.item_no') }}
{{ $infoPanelObj->item_no }}
@endif
@if ($infoPanelObj->min_amt)
{{ trans('general.min_amt') }} {{ $infoPanelObj->min_amt }}
@endif
@if (method_exists($infoPanelObj, 'numCheckedOut'))
{{ (int) $infoPanelObj->numCheckedOut() }}
{{ trans('general.checked_out') }}
@endif
@if (method_exists($infoPanelObj, 'numRemaining'))
{{ $infoPanelObj->numRemaining() }}
{{ trans('general.remaining') }}
@endif
{{-- Bulk-fulfill entry point. Requestable::bulkFulfillmentLink()
gates on: (a) type is one of the five bulk-eligible ones,
(b) caller can checkout the type, (c) >=2 open requests,
(d) stock available. Returns null when any gate fails so
the info-panel row is skipped without a Blade-side check. --}}
@if (method_exists($infoPanelObj, 'bulkFulfillmentLink') && $bulkFulfillmentLink = $infoPanelObj->bulkFulfillmentLink())
{{ trans_choice('admin/hardware/general.open_requests_count', $bulkFulfillmentLink['count'], ['count' => $bulkFulfillmentLink['count']]) }}
@endif
@php
// Assets own purchase_cost as a canonical column on the parent
// row and Accessories / Consumables / Components moved that
// concept off the parent onto per-transaction OrderItem lines,
// so read the parent's own value first and let the
// Order-derived fallback fill in for the post-Orders inventory
// types where the parent no longer carries a purchase_cost
// column. See GH #19572.
$lastOrderInfoPanel = method_exists($infoPanelObj, 'lastOrderDefaults')
? $infoPanelObj->lastOrderDefaults()
: null;
$unitCost = $infoPanelObj->purchase_cost ?? $lastOrderInfoPanel['unit_cost'] ?? null;
$unitCostCurrency = $lastOrderInfoPanel['currency']
?? ($infoPanelObj->location->currency ?? null)
?: $snipeSettings->default_currency;
@endphp
@if ($unitCost !== null && $unitCost !== '')
{{ trans('general.unit_cost') }}
{{ $unitCostCurrency }}
{{ Helper::formatCurrencyOutput($unitCost) }}
@endif
{{-- Total cost is independent of the Last Unit Cost row. --}}
{{-- Historical acquisitions may have carried prices even if --}}
{{-- the most recent one didn't, so the total_cost row shows --}}
{{-- whenever totalCostSumByCurrency has anything to sum. --}}
@if (isset($infoPanelObj->qty) && method_exists($infoPanelObj, 'totalCostSumByCurrency'))
@php $totalsByCurrency = $infoPanelObj->totalCostSumByCurrency(); @endphp
@if (count($totalsByCurrency) === 1)
@php $currency = array_key_first($totalsByCurrency); @endphp
{{ trans('general.total_cost') }}
{{ $currency !== '' ? $currency : $snipeSettings->default_currency }}
{{ Helper::formatCurrencyOutput($totalsByCurrency[$currency]) }}
@elseif (count($totalsByCurrency) > 1)
{{ trans('general.total_cost') }}
{{ count($totalsByCurrency) }} {{ trans('general.currencies') }}
@foreach ($totalsByCurrency as $currency => $amount)
{{ $currency !== '' ? $currency : $snipeSettings->default_currency }}
{{ Helper::formatCurrencyOutput($amount) }}
@endforeach
@endif
@endif
{{-- Skip on Asset instances. An asset is 1:1 with a --}}
{{-- transaction, so "ordered N times" is always 1 and --}}
{{-- the Orders table IS the record of the acquisition. --}}
{{-- Applies to Accessory/Consumable/Component (multi-order --}}
{{-- inventory) and to AssetModel (asset TYPE, aggregating --}}
{{-- distinct orders across all its Asset instances). --}}
@if (method_exists($infoPanelObj, 'ordersCount') && ! ($infoPanelObj instanceof \App\Models\Asset))
@php $ordersCount = $infoPanelObj->ordersCount(); @endphp
@if ($ordersCount > 0)
{{ trans('general.total_orders') }}
{{ $ordersCount }}
@endif
@endif
{{-- Accessory/Consumable/Component override getOrderNumberAttribute
to return null so this guard skips — a single order_number
on many-batches inventory is misleading; per-adjustment order
numbers live on QuantityAdjust action_log entries. Assets
are unaffected; a single order_number per unit is real. --}}
@if ($infoPanelObj->order_number)
@if ($infoPanelObj::class == "App\Models\Asset")
{{ $infoPanelObj->order_number }}
@else
{{ $infoPanelObj->order_number }}
@endif
@endif
@if ($infoPanelObj->purchase_order)
{{ $infoPanelObj->purchase_order }}
@endif
@if ($infoPanelObj->companies)
@if ($infoPanelObj->companies->count() > 1)
{{ trans('general.companies') }}
@foreach ($infoPanelObj->companies as $company)
{!! $company->present()->formattedNameLink !!}
@endforeach
@elseif ($infoPanelObj->companies->isNotEmpty())
{!! $infoPanelObj->companies->first()->present()->nameUrl !!}
@endif
@elseif ($infoPanelObj->company)
{!! $infoPanelObj->company->present()->nameUrl !!}
@endif
@if ($infoPanelObj->department)
{!! $infoPanelObj->department->present()->nameUrl !!}
@endif
@if ($infoPanelObj->category)
{!! $infoPanelObj->category->present()->nameUrl !!}
@endif
@if ($infoPanelObj->category_type)
{{ $infoPanelObj->category_type }}
@endif
@if ($infoPanelObj->location)
{!! $infoPanelObj->location->present()->nameUrl !!}
@endif
@if ($infoPanelObj->manager)
{!! $infoPanelObj->manager->present()->nameUrl !!}
@endif
@if ($infoPanelObj->fieldset)
{!! $infoPanelObj->fieldset->present()->nameUrl !!}
@endif
@if (($infoPanelObj instanceof \App\Models\Location) && (isset($infoPanelObj->parent)) && ($infoPanelObj->parent))
@php
$locationAncestors = [];
$ancestorCursor = $infoPanelObj->parent;
while ($ancestorCursor) {
array_unshift($locationAncestors, $ancestorCursor);
$ancestorCursor = $ancestorCursor->parent;
}
@endphp
@foreach ($locationAncestors as $ancestor)
{{ $ancestor->display_name }}@if (! $loop->last) › @endif
@endforeach
@endif
@if ($infoPanelObj->depreciation && $infoPanelObj->purchase_date)
{!! $infoPanelObj->depreciation->present()->nameUrl !!}
({{ trans_choice('general.months_plural', $infoPanelObj->depreciation->months) }})
{{ trans('admin/hardware/form.fully_depreciated') }}
{{ Helper::getFormattedDateObject($infoPanelObj->depreciated_date(), 'date', false) }}
-
{{ Carbon::parse($infoPanelObj->depreciated_date())->diffForHumans(['parts' => 2]) }}
@if (method_exists($infoPanelObj, 'depreciationProgressPercent'))
({{ (int) round($infoPanelObj->depreciationProgressPercent()) }}%)
@endif
@endif
@if ($infoPanelObj->eol)
{{ $infoPanelObj->eol .' '.trans('general.months') }}
@endif
@if ($infoPanelObj->asset_eol_date)
{{ trans('general.device_eol') }}
{{ Helper::getFormattedDateObject($infoPanelObj->asset_eol_date, 'date', false) }}
-
{{ Carbon::parse($infoPanelObj->asset_eol_date)->diffForHumans(['parts' => 2]) }}
@endif
@if ($infoPanelObj->email)
{{ $infoPanelObj->email }}
@endif
@if (isset($infoPanelObj->support_email) && $infoPanelObj->support_email)
{{ $infoPanelObj->support_email }}
@endif
@if ($infoPanelObj->phone)
{{ $infoPanelObj->phone }}
@endif
@if (isset($infoPanelObj->support_phone) && $infoPanelObj->support_phone)
{{ $infoPanelObj->support_phone }}
@endif
@if ($infoPanelObj->mobile)
{{ $infoPanelObj->mobile }}
@endif
@if ($infoPanelObj->fax)
{{ $infoPanelObj->fax }}
@endif
@if ($infoPanelObj->url)
{{ $infoPanelObj->url }}
@endif
@if (isset($infoPanelObj->support_url) && $infoPanelObj->support_url)
{{ $infoPanelObj->support_url }}
@endif
@if (isset($infoPanelObj->warranty_lookup_url) && $infoPanelObj->warranty_lookup_url)
{{ $infoPanelObj->warranty_lookup_url }}
@endif
@if (isset($infoPanelObj->website) && $infoPanelObj->website)
{{ $infoPanelObj->website }}
@endif
@if (($infoPanelObj->present()->displayAddress) && (config('services.google.maps_api_key')))
@endif
@if ((($infoPanelObj->address!='') && ($infoPanelObj->city!='')) || ($infoPanelObj->state!='') || ($infoPanelObj->country!=''))
@endif
@if ($infoPanelObj->months)
{{ $infoPanelObj->months }}
{{ trans('general.months') }}
@endif
@if ($infoPanelObj->depreciation_type)
@if ($infoPanelObj->depreciation_type == 'amount')
{{ trans('general.depreciation_options.amount') }}
@elseif ($infoPanelObj->depreciation_type == 'percent')
{{ trans('general.depreciation_options.amount') }}
@endif
@endif
@php
// Same canonical-parent-first rule as unit cost above. Assets
// keep purchase_date on the parent as the source of truth and
// the AssetObserver doesn't sync it back to Order because
// multiple assets can share one Order row (dedupe by
// order_number + supplier + company), so on that Order row
// purchase_date is a write-once snapshot from the first
// sibling asset's create. Reading the parent's canonical
// column keeps the info-panel in step with the edit form.
// Post-Orders inventory types (Accessory / Consumable /
// Component) have no parent purchase_date column, so their
// Order-derived fallback still wins. See GH #19572.
$displayPurchaseDate = $infoPanelObj->purchase_date
?: ($lastOrderInfoPanel['purchase_date'] ?? null);
@endphp
@if ($displayPurchaseDate)
{{ trans('general.purchased_plain') }}
{{ Helper::getFormattedDateObject($displayPurchaseDate, 'date', false) }} -
{{ Carbon::parse($displayPurchaseDate)->diffForHumans(['parts' => 2]) }}
@endif
@if (isset($infoPanelObj->maintained))
@if ($infoPanelObj->maintained == 1)
{{ trans('admin/licenses/form.maintained') }}
@else
{{ trans('admin/licenses/form.maintained') }}
@endif
@endif
@if (isset($infoPanelObj->reassignable))
@if ($infoPanelObj->reassignable == 1)
{{ trans('admin/licenses/form.reassignable') }}
@else
{{ trans('admin/licenses/form.reassignable') }}
@endif
@endif
@if (isset($infoPanelObj->byod))
@if ($infoPanelObj->byod == 1)
@else
@endif
{{ trans('general.byod') }}
@endif
@if (isset($infoPanelObj->requestable))
@if ($infoPanelObj->requestable == 1)
@else
@endif
{{ trans('admin/hardware/general.requestable') }}
@endif
@if (isset($infoPanelObj->use_default_eula))
@if ($infoPanelObj->eula_text=='')
{{ trans('admin/settings/general.default_eula_text') }}
@else
{{ trans('admin/categories/general.eula_text') }}
@endif
@endif
@if (isset($infoPanelObj->require_acceptance))
@if ($infoPanelObj->require_acceptance == 1)
@else
@endif
{{ trans('admin/categories/general.require_acceptance') }}
@endif
@if (isset($infoPanelObj->alert_on_response))
@if ($infoPanelObj->alert_on_response)
@else
@endif
{{ trans('admin/categories/general.email_to_initiator') }}
@endif
@if ($infoPanelObj->tag_color)
{{ $infoPanelObj->tag_color }}
@endif
@if ($infoPanelObj->adminuser)
{{ trans('general.created_by') }}
{!! $infoPanelObj->adminuser->present()->formattedNameLink !!}
@endif
@if ($infoPanelObj->created_at)
{{ trans('general.created_plain') }}
{{ Helper::getFormattedDateObject($infoPanelObj->created_at, 'datetime', false) }}
@endif
@if ($infoPanelObj->updated_at)
{{ trans('general.updated_plain') }}
{{ Helper::getFormattedDateObject($infoPanelObj->updated_at, 'datetime', false) }}
@endif
@if ($infoPanelObj->deleted_at)
{{ trans('general.deleted_plain') }}
{{ Helper::getFormattedDateObject($infoPanelObj->deleted_at, 'datetime', false) }}
@endif
@if (isset($after_list))
{{ $after_list }}
@endif
@if ($qr_code_url && $snipeSettings->isQrEnabled())
@endif