@extends('layouts.app')
@section('title', __('messages.edit').' '.$invoice->invoice_number)
@section('content')
<div class="page-head">
    <h1>{{ __('messages.edit') }} — {{ $invoice->invoice_number }}</h1>
    <a class="btn btn-outline-secondary" href="{{ route('invoices.show',$invoice) }}">{{ __('messages.back') }}</a>
</div>
<form method="post" action="{{ route('invoices.update',$invoice) }}" class="card card-body">
    @csrf
    @method('PUT')
    <div class="row g-3">
        <div class="col-md-4">
            <label class="form-label">{{ __('messages.date') }}</label>
            <input class="form-control" type="date" name="date" value="{{ old('date', $invoice->date?->toDateString()) }}" required>
        </div>
        <div class="col-md-8">
            <label class="form-label">{{ __('messages.notes') }}</label>
            <textarea class="form-control" name="notes" rows="3">{{ old('notes', $invoice->notes) }}</textarea>
        </div>
    </div>
    <p class="small text-muted mt-3 mb-0">{{ __('messages.invoice_edit_hint') }}</p>
    <div class="mt-3">
        <button class="btn btn-success">{{ __('messages.save') }}</button>
    </div>
</form>
@endsection
