@extends('layout')
@section('title', 'کھاتہ جات رپورٹس')
@section('page_title', 'کھاتہ جات رپورٹس')
{{-- @section('page_sub_title', '') --}}
@section('content')
    <div class="row">
        <div class="col-md-3"></div>
        <div class="col-md-6">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="input-group">
                                <span class="input-group-addon">تاریخ ابتدا</span>
                                <input type="date" id="starting_date" name="starting_date" value="2022-05-01"
                                       class="form-control">
                            </div>
                            <span class="text-danger error" id="starting_date_error"></span>
                        </div>
                        <div class="col-md-6">
                            <div class="input-group">
                                <span class="input-group-addon">تاریخ انتہا</span>
                                <input type="date" id="ending_date" name="ending_date" class="form-control"
                                       value="{{ date('Y-m-d') }}">
                            </div>
                            <span class="text-danger error" id="ending_date_error"></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-3"></div>
    </div>
    <div class="row mt-2">
        <div class="col-md-4">
            <div class="panel panel-card">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-md-12">
                            <label for="">پارٹی نام منتخب کریں:</label>
                            <select name="party_name" id="party_name" class="form-control">
                                <option value="">----------------------Select Party For Ledger----------------------
                                </option>
                                <option value="cash" data-table="cash">Cash</option>
                                @forelse($brokers as $broker)
                                    <option value="{{ $broker->id }}" data-table="broker">{{ $broker->name }}</option>
                                @empty
                                @endforelse
                                @forelse($other_accounts as $other_account)
                                    <option value="{{ $other_account->id }}" data-table="other_account">{{ $other_account->name }}</option>
                                @empty
                                @endforelse

                                {{-- @forelse($customers as $customer)
                                    <option value="{{ $customer->id }}" data-table="customer">{{ $customer->name }}
                                    </option>
                                @empty --}}
                                {{-- @endforelse --}}
                                @forelse($pumps as $pump)
                                    <option value="{{ $pump->id }}" data-table="pump">{{ $pump->name }}</option>
                                @empty
                                @endforelse
                                @forelse($banks as $bank)
                                    <option value="{{ $bank->id }}" data-table="bank">{{ $bank->name }}</option>
                                @empty
                                @endforelse
                                @forelse($drivers as $driver)
                                    <option value="{{ $driver->id }}" data-table="driver">{{ $driver->name }}
                                    </option>
                                @empty
                                @endforelse
                                {{-- @forelse($workshops as $workshop)
                                    <option value="{{ $workshop->id }}" data-table="workshop">{{ $workshop->shop_name }}
                                    </option> --}}
                                {{-- @empty --}}
                                {{-- @endforelse --}}
                                {{-- @forelse($suppliers as $supplier)
                                    <option value="{{ $supplier->id }}" data-table="supplier">{{ $supplier->name }}
                                    </option> --}}
                                {{-- @empty --}}
                                {{-- @endforelse --}}
                                @forelse($vehicles as $vehicle)
                                    <option value="{{ $vehicle->id }}" data-table="vehicle">{{ $vehicle->vehicle_no }}
                                    </option>
                                @empty
                                @endforelse
                            </select>
                            <span class="text-danger error" id="party_name_error"></span>
                        </div>
                    </div>
                    <div class="row mt-3">
                        <div class="col-md-12">
                            <button onclick="party_ledger()" class="btn btn-primary">Ledger</button>
                            <button onclick="party_ledger_date_wise()" class="btn btn-primary">Date wise</button>
                            <button onclick="trail_balance()" class="btn btn-success pull-right">Trail Balance</button>
                            {{-- <button onclick="balance_sheet()" class="btn btn-info btn-sm">Balance Sheet</button> --}}
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

@endsection
@section('javascript')
    @include('reports.js')
@endsection
