@extends('layouts.app')
@section('title', __('vrc::lang.parts_to_order'))
@section('content')
<section class="content-header"><h1>@lang('vrc::lang.parts_to_order')</h1></section>
<section class="content">
    @component('components.widget', ['class' => 'box-primary'])
        @slot('tool')<div class="box-tools"><a href="{{ $erpPurchaseUrl }}" class="btn btn-primary" target="_blank"><i class="fa fa-plus"></i> @lang('vrc::lang.create_erp_po')</a></div>@endslot
        <table class="table table-bordered table-striped">
            <thead><tr><th>@lang('vrc::lang.repair_order')</th><th>@lang('vrc::lang.part')</th><th>@lang('vrc::lang.qty')</th></tr></thead>
            <tbody>
            @forelse ($parts as $p)
                <tr><td><a href="{{ route('vrc.repair-orders.show', $p->ro_id) }}">{{ $p->ro_number ?: ('#'.$p->ro_id) }}</a></td><td>{{ $p->description }}</td><td>{{ $p->qty }}</td></tr>
            @empty
                <tr><td colspan="3" class="text-muted text-center">@lang('vrc::lang.nothing_to_order')</td></tr>
            @endforelse
            </tbody>
        </table>
        <p class="help-block">@lang('vrc::lang.po_reuse_note')</p>
    @endcomponent
</section>
@endsection
