<div class="pos-tab-content">
    <div class="row">
        <div class="col-sm-4">
            <a href="#" type="button"   data-href="{{action('\Modules\Accounting\Http\Controllers\TransactionController@autoMap',['purchase'])}}" 
				class="btn-modal btn btn-primary btn-sm bg-olive mt-10" data-container=".view_modal"><i class="fas fa-link"></i> Auto Map Purchases</a><br>
				<span class="label bg-orange">Last Recon Txn Date: {{(isset($maxpurchasedate) && !empty($maxpurchasedate)) ? date('d M Y',strtotime($maxpurchasedate->operation_date)): '--'}}</span>
				<span class="label bg-purple">Latest Transaction Date: {{(isset($maxpurchasetxndate) && !empty($maxpurchasetxndate)) ? date('d M Y',strtotime($maxpurchasetxndate->transaction_date)) : '--'}}</span>
        </div>
    </div>
    <div class="row">
        @component('components.filters', ['title' => __('report.filters')])
            <div class="col-md-3">
                <div class="form-group">
                    {!! Form::label('purchase_list_filter_location_id',  __('purchase.business_location') . ':') !!}
                    {!! Form::select('purchase_list_filter_location_id', $business_locations, null, ['class' => 'form-control select2', 'style' => 'width:100%', 'placeholder' => __('lang_v1.all')]); !!}
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    {!! Form::label('purchase_list_filter_supplier_id',  __('purchase.supplier') . ':') !!}
                    {!! Form::select('purchase_list_filter_supplier_id', $suppliers, null, ['class' => 'form-control select2', 'style' => 'width:100%', 'placeholder' => __('lang_v1.all')]); !!}
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    {!! Form::label('purchase_list_filter_status',  __('purchase.purchase_status') . ':') !!}
                    {!! Form::select('purchase_list_filter_status', $orderStatuses, null, ['class' => 'form-control select2', 'style' => 'width:100%', 'placeholder' => __('lang_v1.all')]); !!}
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    {!! Form::label('purchase_list_filter_payment_status',  __('purchase.payment_status') . ':') !!}
                    {!! Form::select('purchase_list_filter_payment_status', ['paid' => __('lang_v1.paid'), 'due' => __('lang_v1.due'), 'partial' => __('lang_v1.partial'), 'overdue' => __('lang_v1.overdue')], null, ['class' => 'form-control select2', 'style' => 'width:100%', 'placeholder' => __('lang_v1.all')]); !!}
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    {!! Form::label('purchase_list_filter_date_range', __('report.date_range') . ':') !!}
                    {!! Form::text('purchase_list_filter_date_range', null, ['placeholder' => __('lang_v1.select_a_date_range'), 'class' => 'form-control', 'readonly']); !!}
                </div>
            </div>
        @endcomponent
    </div>

    <div class="row">
        <div class="col-md-12">
            

        <table class="table table-bordered table-striped" id="purchase_table">
            <thead>
                <tr>
                    <th>@lang('messages.action')</th>
                    <th>@lang('messages.date')</th>
                    <th>@lang('purchase.ref_no')</th>
                    <th>@lang('purchase.location')</th>
                    <th>@lang('purchase.supplier')</th>
                    <th>@lang('purchase.purchase_status')</th>
                    <th>@lang('purchase.payment_status')</th>
                    <th>@lang('purchase.grand_total')</th>
                    <th>@lang('purchase.payment_due') &nbsp;&nbsp;<i class="fa fa-info-circle text-info no-print" data-toggle="tooltip" data-placement="bottom" data-html="true" data-original-title="{{ __('messages.purchase_due_tooltip')}}" aria-hidden="true"></i></th>
                    <th>@lang('lang_v1.added_by')</th>
                </tr>
            </thead>
        </table>
        </div>
    </div>
</div>