@extends('layouts.app')
@section('title','Close Ticket '.$t->ticket_no)
@section('crumbs', '<a href="'.route('weighbridge-tickets.index').'">Weighbridge</a> · <b>{{ $t->ticket_no }}</b>')
@section('content')
<div class="card" style="max-width:640px"><div class="card-h"><h2>Second weighing — {{ $t->ticket_no }}</h2></div>
<div class="card-b">
<dl class="dl" style="margin-bottom:14px">
<div><dt>Vehicle</dt><dd>{{ $t->vehicle_no }}</dd></div>
<div><dt>First weight</dt><dd>{{ $t->gross_weight>0 ? qty($t->gross_weight).' t (GROSS)' : qty($t->tare_weight).' t (TARE)' }}</dd></div>
<div><dt>Customer</dt><dd>{{ $t->customer->name ?? '—' }}</dd></div>
</dl>
<form method="POST" action="{{ route('weighbridge-tickets.close',$t->id) }}">@csrf
<div class="fld"><label>Second weight (tonnes) *</label><input type="number" step="0.001" name="second_weight" required autofocus style="font-size:20px;font-weight:800"></div>
<button class="btn btn-pri">Close ticket & compute net</button> <a class="btn btn-ghost" href="{{ route('weighbridge-tickets.show',$t->id) }}">Cancel</a>
</form></div></div>
@endsection
