<script>
    $(document).ready(function () {
        var target_url = '/load-ledger-trial-balance/{{$ledger->id}}/{{$dateFrom}}/{{$dateTo}}';
        $.ajax({
            type: 'GET',
            url: target_url,
            success: function (res) {
                $('#load-ledger-trial-balance').html(res);
            }
        });

        /**When Data is Supplied:- Run as Below**/
        $('#submit-search-ledger').click(function (){
            $('#load-ledger-trial-balance').html('<div style="text-align: center; margin: 20px 0 20px 0;"><img src="{{asset('images/loads/loader.gif')}}" border=0></div>');
            let dateFrom = $('#from-selector').val();
            let dateTo = $('#to-selector').val();
            var target_url = '/load-ledger-trial-balance/{{$ledger->id}}/'+dateFrom+'/'+dateTo;
            $.ajax({
                type: 'GET',
                url: target_url,
                success: function (res) {
                    $('#load-ledger-trial-balance').html(res);
                }
            });
        });
    });
</script>
<div class="guestDetails_input">
    <div class="guestDetails_Label">
        <b>Ledger Name: </b> <b class="error">{!! $ledger->acc_name !!}</b>
    </div>
</div>
<div class="guestDetails_inputDivider"></div>
<div class="guestDetails_input">
    <div class="guestDetails_Label">
        <b>Date From: </b> {!! Form::date('date', date('Y-m-d', $dateFrom), ['class'=>'input-text-height', 'id'=>'from-selector']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_Label">
        <b>Date To: </b> {!! Form::date('date', date('Y-m-d', $dateTo), ['class'=>'input-text-height', 'id'=>'to-selector']) !!}
    </div>
</div>
<div class="guestDetails_input">
    <div class="guestDetails_input">
        <button type="button" id="submit-search-ledger" style="width: auto; height: 24px; cursor: pointer"
                title="Ledger Trial Balance"><i class="fa fa-search" aria-hidden="true"></i></button>
    </div>
</div>
<div class="guestDetails_inputDivider"></div>
<div class="inputDivider">
    <div class="fields">
        <h3 class="error">{{--I will add SOme heading Here--}}</h3>
        <div style="text-align: center;font-size: 18px"><b id="trial-balance-information"></b></div>
        <div id="load-ledger-trial-balance" style="text-align: center; margin: 20px 0 20px 0;"><img src="{{asset('images/loads/loader.gif')}}" border=0></div>
    </div>
</div>
