<?php Fun::lang() ?>
<div class="print_this_form">
    <h3>
        {{__('administrator.history')}}
    </h3>
    <table class="table" style="margin-top: 10px">
        <thead>
        <tr>
            <td>#</td>
            <td> {{__('administrator.edited_at')}}</td>
            <td> {{__('administrator.edited_by')}}</td>
            <td> {{__('administrator.invoice_number')}}</td>
            <td> {{__('administrator.seller')}}</td>
            <td> {{__('administrator.customer')}}</td>
            <td> {{__('administrator.description')}}</td>
            <td> {{__('administrator.action')}}</td>
        </tr>
        </thead>
        <tbody>
        @foreach($history as $key => $row)
            <tr>
                <td>{{$key+1}}</td>
                <td>{{date('d-m-Y H:i:s',strtotime($row->edited_at))}}</td>
                <td>{{findUser($row->edited_by)->name}}</td>
                <td>{{$row->invoice_number}}</td>
                <td>{{findUser($row->user_id)->name}}</td>
                <td>{{findCustomer($row->customer_id)->name}}</td>
                <td>{{$row->refund_reason}}</td>
                <td><button class="button_info show_edit_invoice_history" data-url="{{route('view-invoice-edit-history',$row->id)}}"> {{__('administrator.view')}}</button></td>
            </tr>
        @endforeach
        @if(count($history)==0)
            <tr>
                <td colspan="8"> {{__('administrator.no_data')}}</td>
            </tr>
        @endif
        </tbody>
    </table>
</div>

<script type="text/javascript">

</script>
