@extends('layouts.app')

@section('content')
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-12">
            <div class="page-title-box">
                <h4 class="page-title">Edit Tax Rate</h4>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <form action="{{ route('finance.taxes.update', $tax->id) }}" method="POST">
                        @csrf
                        @method('PUT')
                        <div class="mb-3">
                            <label class="form-label">Tax Name</label>
                            <input type="text" name="name" class="form-control" value="{{ $tax->name }}" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Rate (%)</label>
                            <input type="number" step="0.01" name="rate" class="form-control" value="{{ $tax->rate }}" required>
                        </div>
                        <div class="mt-3">
                            <button type="submit" class="btn btn-primary">Update Tax Rate</button>
                            <a href="{{ route('finance.settings.taxes') }}" class="btn btn-secondary">Cancel</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
