
<?php Fun::lang() ?>
<div class="page-purchases">
    <div class="container-fluid">
        <div class="top-content">
            <div class="row1">
                <div class="col-sm-12 col-xs-12">
                    {{--<h2 class="show-product">{{__('administrator.transfer_stock')}} </h2>--}}
                    <img src="{{headerlogo()}}" alt="">
                    <hr>
                </div>
            </div>
        </div>
        <hr>
        <hr>
        <div class="summary-header">
            <table>
                <tr>
                    <td>
                        <table class="text-left">
                            <tr>
                                <td>{{__('administrator.invoice_number')}}</td>
                                <td> : {{$tran->invoice_number}} </td>
                            </tr>
                            <tr>
                                <td>{{__('administrator.from_warehouse')}}</td>
                                <td> :  {{findWarehouse($tran->from_warehouse_id)->warehouse_name}}</td>
                            </tr>
                            <tr>
                                <td>{{__('administrator.to_warehouse')}}</td>
                                <td> :  {{findWarehouse($tran->to_warehouse_id)->warehouse_name}}</td>
                            </tr>
                            <tr>
                                <td>{{__('administrator.created_at')}}</td>
                                <td> : {{date('d-m-Y',strtotime($tran['date']))}} </td>
                            </tr>
                            <tr>
                                <td>{{__('administrator.description')}}</td>
                                <td> : {{$tran->note}} </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <div class="wrapper-table">
            <table class="table table-striped table-hover ">
                <thead>
                <tr>
                    <th>#</th>
                    <th>{{__('administrator.barcode')}}</th>
                    <th>{{__('administrator.item')}}</th>
                    <th>{{__('administrator.qty')}}</th>
                    <th>U/M</th>
                </tr>
                </thead>
                <tbody>
                    @foreach($tran_detail as $key => $value)
                        @php
                            $product = getProductById($value->product_id);
                        @endphp
                        <tr>
                            <td>{{$key+=1}}</td>
                            <td>{{$value->barcode}} </td>
                            <td>{{$product->product_name}} </td>
                            <td>{{$value->qty}} {{findUnit($product->unit_id)->unit}}</td>
                            <td>{{$value->qty_per_unit}} {{findUnit($product->child_unit)->unit}}</td>
                        </tr>
                    @endforeach
                    @php
                        $key=0;
                        $total_row = 10;
                        $total_data = count($tran_detail);
                        $left_row = $total_row-$total_data;
                    @endphp
                    @for ($i=0;$i<$left_row;$i++)
                        <tr>
                            <td>{{ $key += 1}}</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>

                        </tr>
                    @endfor
                </tbody>
            </table>
        </div>
    </div>
</div>
