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

<div class="page-purchases top-15">
    <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>{{__('administrator.adjustment')}}</h2>
                        <table class="table table-striped table-hover ">
                             <tr>
                                <td><b class="pull-left">{{__('administrator.invoice')}} :</b></td>
                                <td><span class="pull-left">{{$adj->invoice_number}}</span></td>
                            </tr>
                            <tr>
                                <td><b class="pull-left">{{__('administrator.date')}} :</b></td>
                                <td><span class="pull-left">{{date('d-m-Y',strtotime($adj->adjustment_date))}}</span></td>
                            </tr>
                            <tr>
                                <td><b class="pull-left">{{__('administrator.warehouse')}} :</b></td>
                                <td><span class="pull-left">{{findWarehouse($adj->warehouse_id)->warehouse_name}}</span></td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        
        <hr>
        <div class="summary-header">
        <div class="wrapper-table">
        <table class="table table-striped table-hover ">
            <thead>
                <tr>
                    <th>#</th>                    
                    <th>{{__('administrator.code')}}</th>
                    <th>{{__('administrator.item_name')}}</th>
                    <th>{{__('administrator.type')}}</th>
                    <th>{{__('administrator.qty')}}</th>
                </tr>
            </thead>

            <tbody>
                    @foreach ($adj_detail as $key => $item)
                        <tr class='remove'>
                            <td scope="row"> {{ $key+1 }}</td>
                            <td>{{  getProductById($item->product_id)->barcode }}</td>
                            <td>{{ getProductById($item->product_id)->product_name }}</td>
                            <td>{{ $item->adjustment_type }}</td>
                            <td>{{ $item->adjustment_qty.' '.$item->unit }}</td>
                        </tr>
                    @endforeach
            </tbody>

           <tfoot class="label-right customize-tfoot">
                <tr>
                </tr>                
            </tfoot>
        </table> 
    </div>
    </div>
</div>
   
@endsection


