<div class="row">
                                        <div class="col-md-3">
                                            DATE &nbsp;&nbsp;<input style="background-color: #f7fafc;" type="date" id="date" name="date" value="{{date('Y-m-d',strtotime($entries[0]->date))}}">

                                        </div>

                                        <div class="col-md-3">
                                            ENTRY NO. &nbsp;&nbsp;<input style="background-color: #f7fafc;width: 29%" type="number" name="entry_no" id="entry_no"  value="{{$entries[0]->entry_no}}">

                                        </div>  

                                        <div class="col-md-3">
                                            @if($entries[0]->adjusting_entry)
                                            <input type="checkbox" style="background-color: #f7fafc;" name="adjusting_entry" id="adjusting_entry" checked="" value="1">
                                            @else
                                            <input type="checkbox" style="background-color: #f7fafc;" name="adjusting_entry" id="adjusting_entry" value="1">


                                            @endif
                                             &nbsp;&nbsp;ADJUSTING ENTRY
                                        </div>

                                        <div class=col-md-12 style="overflow-y:auto;height: 176px;">
                                            <table class="table table-bordered table-responsive-md table-striped text-center">
                                                <thead>
                                                    <tr>
                                                        <th class="text-center">ACCOUNT</th>
                                                        <th class="text-center">DEBIT</th>
                                                        <th class="text-center">CREDIT</th>
                                                        <th class="text-center">MEMO</th>
                                                        <th class="text-center">NAME</th>
                                                        <th class="text-center">CLASS</th>
                                                    </tr>

                                                </thead>
                                                <tbody>

                                                    <?php $sum = 0;?>


                                                    @foreach($entries as $entry)

                                                    <tr height="2px">
                                                        <td class="pt-3-half account"  style="width: 40%" contenteditable="true">
                                                            <select class="form-control chosen-select"  style="    width: 80%;height: 26px;font-size: 11px;padding: 0px;padding-left: 18px;cursor: pointer;" name="account[]">
                                                                <option value="0">None</option>
                                                                
                                                                @foreach($accounts as $a)

                                                                @if($entry->account_id == $a->id)
                                                                @if($a->sub_account_id)
                                                                <option style="font-size: 11px;" selected="" value="{{$a->id}}">&nbsp;&nbsp;&nbsp;{{$a->number}} - {{$a->name}}</option>
                                                                @else
                                                                <option style="font-size: 11px;" selected="" value="{{$a->id}}">{{$a->number}} - {{$a->name}}</option>
                                                                @endif

                                                                @else

                                                                @if($a->sub_account_id)
                                                                <option style="font-size: 11px;" value="{{$a->id}}">&nbsp;&nbsp;&nbsp;{{$a->number}} - {{$a->name}}</option>
                                                                @else
                                                                <option style="font-size: 11px;" value="{{$a->id}}">{{$a->number}} - {{$a->name}}</option>
                                                                @endif




                                                                @endif
                                                                @endforeach
                                                            </select>
                                                        </td>
                                                        <td class="pt-3-half debit" onkeyup="addDebit()"  contenteditable="true">{{$entry->amount > 0 ? $entry->amount : 0}}</td>
                                                        <td class="pt-3-half credit"  onkeyup="addCredit()" contenteditable="true">{{$entry->amount < 0 ? abs($entry->amount) : 0}}</td>
                                                        <td class="pt-3-half memo"  contenteditable="true">{{$entry->memo}}</td>
                                                        <td class="pt-3-half name" contenteditable="true">
                                                            <select class="form-control chosen-select"  style="    width: 80%;height: 26px;font-size: 11px;padding: 0px;padding-left: 18px;cursor: pointer;" name="name1[]">
                                                                <option value="0">None</option>
                                                                
                                                                @foreach($customers as $c)
                                                                @if($entry->name_type == 1 && $entry->name == $c->id)
                                                                <option selected="" style="font-size: 11px;" value="{{$c->id}}-1">{{$c->name}}  - Customer

                                                                    @else
                                                                    <option style="font-size: 11px;" value="{{$c->id}}-1">{{$c->name}}  - Customer

                                                                    @endif
                                                                </option>
                                                                @endforeach
                                                                @foreach($vendors as $v)
                                                                @if($entry->name_type == 2 && $entry->name == $v->id)
                                                                <option selected="" style="font-size: 11px;" value="{{$v->id}}-2">{{$v->name}}  - Vendor
                                                                    @else
                                                                    <option style="font-size: 11px;" value="{{$v->id}}-2">{{$v->name}}  - Vendor


                                                                    @endif
                                                                </option>
                                                                @endforeach
                                                            </select>
                                                        </td>

                                                        <td class="pt-3-half name" contenteditable="true">
                                                            <select class="form-control chosen-select"  style="    width: 80%;height: 26px;font-size: 11px;padding: 0px;padding-left: 18px;cursor: pointer;" name="class_id[]">
                                                                
                                                                
                                                                
                                                               <option selected="" style="font-size: 11px;" value="{{env('PROJECT_ID')}}">{{env('APP_NAME')}} </option>
                                                                
                                                                
                                                            </select>
                                                        </td>


                                                    </tr>

                                                    <?php $sum += $entry->amount > 0 ? $entry->amount : 0;?>

                                                    @endforeach

                                                    <?php for($i =0 ; $i<5; $i++) {?>
                                                    <tr height="2px">
                                                        <td class="pt-3-half account"  style="width: 40%" contenteditable="true">
                                                            <select class="form-control chosen-select"  style="    width: 80%;height: 26px;font-size: 11px;padding: 0px;padding-left: 18px;cursor: pointer;" name="account[]">
                                                                <option value="0">None</option>
                                                                @foreach($accounts as $a)
                                                                @if($a->sub_account_id)
                                                                <option style="font-size: 11px;" value="{{$a->id}}">&nbsp;&nbsp;&nbsp;{{$a->number}} - {{$a->name}}</option>
                                                                @else
                                                                <option style="font-size: 11px;" value="{{$a->id}}">{{$a->number}} - {{$a->name}}</option>
                                                                @endif
                                                                @endforeach
                                                            </select>
                                                        </td>
                                                        <td class="pt-3-half debit" onkeyup="addDebit()"  contenteditable="true">0</td>
                                                        <td class="pt-3-half credit"  onkeyup="addCredit()" contenteditable="true">0</td>
                                                        <td class="pt-3-half memo"  contenteditable="true"> </td>
                                                        <td class="pt-3-half name" contenteditable="true">
                                                            <select class="form-control chosen-select"  style="    width: 80%;height: 26px;font-size: 11px;padding: 0px;padding-left: 18px;cursor: pointer;" name="name1[]">
                                                                <option value="0">None</option>
                                                                @foreach($customers as $c)
                                                                <option style="font-size: 11px;" value="{{$c->id}}-1">{{$c->name}}  - Customer</option>
                                                                @endforeach
                                                                @foreach($vendors as $v)
                                                                <option style="font-size: 11px;" value="{{$v->id}}-2">{{$v->name}}  - Vendor</option>
                                                                @endforeach
                                                            </select>
                                                        </td>

                                                        <td class="pt-3-half name" contenteditable="true">
                                                            <select class="form-control chosen-select"  style="    width: 80%;height: 26px;font-size: 11px;padding: 0px;padding-left: 18px;cursor: pointer;" name="class_id[]">
                                                                
                                                                <option style="font-size: 11px;" value="{{env('PROJECT_ID')}}">{{env('APP_NAME')}} </option>
                                                                
                                                            </select>
                                                        </td>
                                                    </tr>

                                                    
                                                <?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                    <table class="table">
                                        <tr>
                                            <th style="text-align: right;width: 37%;">Totals</th>
                                            <th style="text-align: center; width: 10%; font-size: 16px;font-weight: 600;" id="debit-total">{{$sum}}</th>
                                            <th style="text-align: center;width: 10%; font-size: 16px; font-weight: 600;" id="credit-total">{{$sum}}</th>
                                            <th></th>
                                            <th></th>
                                        </tr>
                                    </table>
                                    <div class="form-actions">
                                        <button style="float: right;margin-right: 20px;" type="button" class="btn btn-danger search-customer" id="revert" onclick="deleteEntry('{{$entry->entry_no}}')" data-toggle="confirmation" data-title="Are you sure to delete?" > <i class="fa fa-trash" ></i> Delete </button>
                                        <button style="float: right;margin-right: 20px;" type="button" class="btn btn-success search-customer" id="update" onclick="approveEntry()" > <i class="fa fa-check" ></i> Approve </button>

                                        
                                    </div>