@php $cost = $order->cost; $canEdit = (bool) auth()->user()?->hasPermission('orders.edit'); $dollars = fn (string $field): string => old(str_replace('_cents', '', $field), $cost && $cost->{$field} ? number_format($cost->{$field} / 100, 2, '.', '') : ''); $status = old('status', $cost?->status ?? 'estimated'); $inputs = [ 'production_cents' => ['label' => 'Production / product cost', 'icon' => 'factory', 'help' => 'Manufacturing, supplier invoice, or landed product cost.'], 'shipping_cents' => ['label' => 'Outbound shipping', 'icon' => 'truck', 'help' => 'Paid to the carrier. Customer was charged '.$order->money('shipping_cents').'.'], 'packaging_cents' => ['label' => 'Packaging & handling', 'icon' => 'package', 'help' => 'Boxes, crating, pallets, pick & pack labour.'], 'payment_fees_cents' => ['label' => 'Payment processing fees', 'icon' => 'credit-card', 'help' => 'Card, gateway, or bank fees for this order.'], ]; @endphp

Cost of goods sold (COGS)

Record what this order cost to make and ship. Internal only; customers never see it.

@if($cost)
Updated {{ $cost->updated_at?->diffForHumans() }} @if($cost->updatedBy)
by {{ $cost->updatedBy->name ?: $cost->updatedBy->email }}@endif
@endif
@if($catalogueCost['cents'] > 0 || $inventoryCogsCents > 0)
@if($catalogueCost['cents'] > 0)
Catalogue cost
{{ $order->moneyFromCents($catalogueCost['cents']) }}
Variant unit cost × qty · {{ $catalogueCost['costed_lines'] }} of {{ $catalogueCost['total_lines'] }} lines
@if($canEdit) @endif
@endif @if($inventoryCogsCents > 0)
Inventory COGS (FIFO)
{{ $order->moneyFromCents($inventoryCogsCents) }}
Posted from stock when items were fulfilled
@if($canEdit) @endif
@endif
@endif
@csrf @method('PUT')
@foreach($inputs as $field => $meta) @php $name = str_replace('_cents', '', $field); @endphp
{{ $order->currency }}
@endforeach
{{ $order->currency }}
@if($canEdit)
@else

You need the "Edit orders" permission to change costs.

@endif