@extends('layouts.print')
@section('content')
<?php Fun::lang()?>
<?php $total = 0 ?>
<?php $total_discount = 0 ?>
<?php $grand_total = 0 ?>

<div class="page-purchases">
    <div class="container">
        <div class="row">
            <div class="col-sm-12 col-xs-12">
                <div class="pull-left mr-bt">
                    <img src="{{nsoLogo()}}" width="200">
                </div>
                <div class="pull-right">
                    <div class="title-add">
                        <h2>{{__('purchase-order')}}</h2>
                        <table class="table table-striped table-hover ">
                            {{-- <tr>
                                <td><b class="pull-left">{{__('administrator.invoice')}} :</b></td>
                                <td><span class="pull-left">{{$purchases->invoice_number}}</span></td>        
                            </tr>
                            <tr>
                                <td><b class="pull-left">{{__('administrator.purchase_date')}} :</b></td>
                                <td><span class="pull-left">{{$purchases->purchase_date}}</span></td>
                            </tr> --}}
                        </table>
                    </div>
                </div>
            </div>
        </div>
        
        <hr>
        <div class="summary-header">    
            <div class="row">
                <div class="col-sm-6">
                    <div class="pull-left">
                        {{-- <div class="vender"><h4>{{__('administrator.suppliers')}}</h4></div><div>
                        <p>{{__('administrator.from')}}: {{$purchases->supplier_name}}</p>
                        <p>{{__('administrator.supplier_phone')}}: {{$purchases->supplier_phone}}</p>
                        <p>{{__('administrator.supplier_type')}}: {{$supplier_type->type_name}}</p> --}}
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="pull-right">
                        {{-- <div class="vender"><h4>{{__('administrator.ship_to')}}</h4></div><br> --}}
                            {{-- <p>{{__('administrator.company_name')}}: {{\Globals::branches()->company_name}}</p>
                            <p>{{__('administrator.address')}}: {{\Globals::branches()->address}}</p>
                            <p>{{__('administrator.phone')}}: {{\Globals::branches()->phone}}</p>
                            <p>{{__('administrator.email')}}: {{\Globals::branches()->email}}</p> --}}
                    </div>
                </div>
            </div>
        </div>
        <div class="wrapper-table">
        <table class="table table-striped table-hover ">
            <thead>
                <tr>
                    <th>#</th>
                    <th>{{__('administrator.invoice_number')}}</th>
                    <th>{{__('administrator.transaction_code')}}</th>
                    <th>{{__('administrator.purchase_date')}}</th>
                    <th>{{__('administrator.supplier_name')}}</th>
                    <th>{{__('administrator.supplier_phone')}}</th>
                    <th>{{__('administrator.total')}}</th>
                </tr>
            </thead>

            <tbody>
                @if(@$purchases && @$purchases)
                    @foreach ($purchases as $key => $purchase)
                        <tr>
                            <td>{{ $key+1 }}</td>
                            <td>{{ $purchase->invoice_number }}</td>
                            <td>{{ $purchase->transaction_code }}</td>
                            <td>{{ $purchase->purchase_date }}</td>
                            <td>{{ $purchase->supplier_name }}</td>
                            <td>{{ $purchase->supplier_phone }}</td>
                            <td>${{ number_format($purchase->amount, 2) }}</td>
                        </tr>   
                    @endforeach
                @endif
            </tbody>

           <tfoot class="label-right customize-tfoot">
                <tr>
                </tr>                
            </tfoot>
        </table> 
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="col-sm-6">
                <div class="border-seller pull-left">
                    <p><b>SELLER</b></p>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="border-seller pull-right">
                    <p><b>WARE HOUSE</b></p>
                </div>
            </div>
        </div> 
    </div> 
    <div class="row">
        <div class="col-sm-12">
            <p class="text-center">សម្រាប់សំណួរទាក់ទងនឹងការបញ្ជាទិញនេះសូមទាក់ទងមកកាន់<br><b>(123) 000-000</b></p>
        </div>
    </div>
    </div>
</div>
   
@endsection