@extends('layouts.admin')

@section('title'){{__('adminforms.invoices.singular')}} br {{$invoice->inv_id}} @endsection
@section('header'){{__('adminforms.invoices.singular')}} br {{$invoice->inv_id}} @endsection
@section('header_desc') @endsection
@section('breadcumbs') @endsection

@section('content')
<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-xs-12">

            {{--<div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list-alt"></i> {{__('adminforms.invoices.general_block')}}</h3>
                </div><!-- /. panel-heading -->

                <div class="panel-body">
                <table width="100%" class="table-responsive table-bordered table-striped">

                    <tr>
                        <th colspan="3">Kupac</th>
                        <th colspan="1">&nbsp;</th>
                        <th colspan="3">Mesto isporuke</th>
                    </tr>
                    <tr>
                        <td colspan="3">
                            {{$invoice->buyer->fullName}}
                            <br>
                            @if($invoice->buyer->company)
                                {{$invoice->buyer->company->com_name}}<br>
                                {{$invoice->buyer->company->com_address}} {{$invoice->buyer->company->com_zip}} {{$invoice->buyer->company->com_city}}<br>
                                {{$invoice->buyer->company->com_phone}}<br>
                                {{$invoice->buyer->company->com_email}}<br>
                            @else
                                {{$invoice->buyer->address}}<br>
                                {{$invoice->buyer->phone}}<br>
                                {{$invoice->buyer->email}}<br>
                            @endif
                        </td>
                        <td colspan="1">&nbsp;</td>
                        <td colspan="3">{{$invoice->inv_delivery}}<br><br><strong>Datum isporuke:</strong><br>{{sr_date($invoice->inv_expected_delivery)}}</td>
                    </tr>
                </table>
                </div> <!-- /.panel-body -->
            </div> <!-- /.panel panel-default-->

            @if(count($invoiceItems))

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="fa fa-list-alt"></i> --}}{{--{{__('adminforms.invoices.general_block')}}--}}{{-- Stavke fakture</h3>
        </div><!-- /. panel-heading -->

        <div class="panel-body">

            <table width="100%" class="table-responsive table-bordered table-striped">

            <tr  style="border-top: 2px solid #333333; border-bottom: 2px solid #333333;">
                <th>Rb.</th>
                <th>Sifra</th>
                <th>Naziv</th>
                <th>Kol</th>
                <th>jm</th>
                <th>Cena</th>
                <th>Total</th>
            </tr>
            @foreach($invoiceItems as $i => $item)
                <tr>
                    <td>{{$i+1}}</td>
                    <td>{{$item->invi_sku}}</td>
                    <td>{{$item->invi_desc}}</td>
                    <td>{{$item->invi_qnt}}</td>
                    <td>{{$item->invi_uom}}</td>
                    <td>{{$item->invi_price}}</td>
                    <td>{{$item->invi_total}}</td>
                </tr>
            @endforeach

            <tr>
                <td colspan="5">&nbsp;</td>
                <td style="border-top: 2px solid #333333;"><strong>Ukupno:</strong></td>
                <td style="border-top: 2px solid #333333;"><strong>{{$invoice->inv_total}}</strong></td>
            </tr>

            </table>
        </div> <!-- /.panel-body -->
    </div> <!-- /.panel panel-default-->

    @endif--}}


            <div id="holder" style="border: 1px solid #999; padding: 15px; width: 825px; background-color: #ffffff; margin: 0 auto;">
                @include('admin.invoices.invoice2',$data)
            </div>



           

        </div>
    </div>
</section>

@endsection


@push('css')
@endpush
@push('primscripts')
@endpush
@push('scripts')
@endpush