<?php $__env->startSection('title', 'General Ledger Account'); ?>


<?php $__env->startSection('internal-js'); ?>
    <script>
        $(document).ready(function () {
            $('#example').dataTable();
            $('#example7').dataTable();

            $('#search-vehicle').select2();

            $('#submit-search').on('click', function (){
                var account = $('#search-vehicle').val();
                if(account == ""){
                    alert('Please Select a General Ledger Account to Search');
                }else{
                    window.location = '/general-ledger-account/'+account+'?type=summary';
                }
            });

            /**MAXIMIZE AND MINIMIZE THE HEADER SECTION**/
            $('#minimize').on('click', function (){
                $('#main-div-section').slideUp();
                $('#maximize').show();
                $('#minimize').hide();
            });
            $('#maximize').on('click', function (){
                $('#main-div-section').slideDown();
                $('#maximize').hide();
                $('#minimize').show();
            });

            $('#summary-url').on('click', function (){
                window.history.pushState({}, null, '?type=summary');
            });
            $('#log-url').on('click', function (){
                window.history.pushState({}, null, '?type=log');
            });
            $('#trash-url').on('click', function (){
                window.history.pushState({}, null, '?type=trash');
            });
        });
    </script>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('internal-css'); ?>
    <style>
        #example th, td {
            text-align: left;
            padding: 5px;
        }
        #example1 tr:hover {background-color: #a3aef6;}

        #example2 th, td {
            text-align: left;
            padding: 5px;
        }

        #example2 tr:hover {background-color: #a3aef6;}
        #example3 th, td {
            text-align: left;
            padding: 5px;
        }

        #example3 tr:hover {background-color: #a3aef6;}
        #example7 th, td {
            text-align: left;
            padding: 5px;
        }
        #example7 tr:hover {background-color: #a3aef6;}
    </style>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('headers'); ?>
    <?php echo $__env->make('headers.finance-header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>



<?php $__env->startSection('heading'); ?>
    General Ledger Account.:
    <?php if(isset($account)): ?>
        <span class="error"><?php echo $account->acc_name; ?></span>/<?php echo e($account->acc_no); ?>

    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('searches'); ?>
    <div style="float: right">
        <br>
        <?php echo Form::open(['method'=>'POST']); ?>

        <div class="guestDetails_input">
            <div class="guestDetails_input" style="text-align: center">
                <select name="search-vehicle" id="search-vehicle" style="width: 200px">
                    <option value="">--Select Ledger Account--</option>
                    <?php if(isset($accounts)): ?>
                        <?php $__currentLoopData = $accounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($row->stamp); ?>"><?php echo strtoupper($row->acc_name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                </select>
            </div>
        </div>
        <div class="guestDetails_input">
            <div class="guestDetails_input">
                <button type="button" id="submit-search" style="width: auto; height: 22px; cursor: pointer" title="Search a Product"><i class="fa fa-search" aria-hidden="true"></i></button>
            </div>
        </div>
        <?php echo Form::close(); ?>

    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div style="float: left">
        
    </div>
    <div style="text-align: right">
        <button type="button" class="navButtons" style="background-color: #2f45d7" onclick="editLedgerDetails('<?php echo e($account->id); ?>')"><i class="fa fa-pencil-square-o"></i> &nbsp;EDIT LEDGER</button>
        <button onclick="deleteLedger('<?php echo e($account->stamp); ?>')" type="button" class="navButtons" style="background-color: #f10e21"><i class="fa fa-trash"></i> &nbsp;DELETE LEDGER</button>
        <div class="guestDetails_inputDivider"></div>
    </div>
    <div style="background-color: rgba(234,236,238,0.72); border-radius: 5px; padding: 5px 6px">
        <div style="float: right;">
            <i id="minimize" class="fa fa-chevron-up" aria-hidden="true" title="Minimize" style="cursor: pointer"></i>
            <i id="maximize" class="fa fa-chevron-down" aria-hidden="true" title="Maximize" style="cursor: pointer; display: none"></i>
        </div><br>
        <div id="main-div-section">
            <div class="wrapperer" id="client-table-wrapper">
                <div class="column">
                    <table  class="table" style="width: 100%; border-collapse:collapse; margin: 5px">
                        <tr>
                            <th>Ledger Name:</th>
                            <td><b class="error"><?php echo strtoupper($account->acc_name); ?></b></td>
                        </tr>
                        <tr>
                            <th>Ledger Number:</th>
                            <td><b><?php echo strtoupper($account->acc_no); ?></b></td>
                        </tr>
                        <tr>
                            <th>Date Created:</th>
                            <td><b><?php echo e(date('d-m-Y', strtotime($account->created_at))); ?></b></td>
                        </tr>
                    </table>
                </div>
                <div class="column">
                    <table class="table" style="width: 100%; border-collapse:collapse; margin: 5px">
                        <tr>
                            <th>Main Account:</th>
                            <td>
                                <?php if($account->mainAccountDetails): ?>
                                    <b class="error"><?php echo strtoupper($account->mainAccountDetails->name); ?></b>
                                <?php else: ?>
                                    -
                                <?php endif; ?>
                            </td>
                        </tr>

                        <tr>
                            <th>Ledger Is Mapped:</th>
                            <td>
                                <?php if($account->mapped == 1): ?>
                                    <b class="success">YES</b>
                                <?php else: ?>
                                    <b class="error">NO</b>
                                <?php endif; ?>
                            </td>
                        </tr>
                        <tr>
                            <th>Mapped To:</th>
                            <td><b class="error"><?php echo $account->mappedLedger($account->mapped_id); ?></b></td>
                        </tr>
                    </table>

                </div>
                <div class="column">
                    <table class="table" style="width: 100%; border-collapse:collapse; margin: 5px">
                        <tr>
                            <th>Currency Name:</th>
                            <td>
                                <?php if($account->currencyDetails != null): ?>
                                    <b class="error"><?php echo e($account->currencyDetails->name); ?>(<?php echo e($account->currencyDetails->abbr); ?>)</b>
                                <?php endif; ?>
                            </td>
                        </tr>
                    </table>
                    <div class="guestDetails_inputDivider"></div>
                    <table style="width: 100%; border-collapse: collapse;">
                        <tr>
                            <td>
                                <button type="button" class="navButtons" style="background-color: #d9ffff;color: black; margin-bottom: 0;font-weight: bold; min-width: 200px ;font-size: 14px">ACC BAL
                                    <?php if($account->currencyDetails != null): ?>
                                        (<?php echo $account->currencyDetails->abbr; ?>)
                                    <?php endif; ?>
                                    :
                                    <b class="error" style="margin-left: 10px">
                                        <?php if($account->currencyDetails != null): ?>
                                            <?php echo $account->currencyDetails->symbol; ?>

                                        <?php endif; ?>
                                        <?php echo e(number_format($account->ledgerBalance($account->id),2)); ?>

                                    </b>
                                </button>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>

        <?php if($account->reversal_reason != null): ?>
            <div class="guestDetails_inputDivider"></div>
            <div class="policy-notes">
                <table style="border-collapse: collapse; width: 100%" >
                    <tr>
                        <td><b>REVERSAL COMMENTS: </b> <?php echo $account->reversal_reason; ?></td>
                        <td style="text-align: right">Reversed By:
                            <?php if($account->reversedBy != null): ?>
                                <b><?php echo e($account->reversedBy->firstName." ".$account->reversedBy->lastName); ?></b>
                            <?php endif; ?>
                        </td>
                    </tr>
                </table>
            </div>
        <?php endif; ?>

    </div><br>
    <div class="tab">
        <button class="tablinks" onclick="openCity(event, 'policies')" id="defaultOpen" >Recent Transactions <span class="
        <?php if(!1): ?>
            <?php echo e('countItems'); ?>

        <?php else: ?>
            <?php echo e('zeroItems'); ?>

        <?php endif; ?>
        ">&nbsp;<?php echo e(0); ?>&nbsp;</span> </button>
    </div>

    <div class="tabcontent" id="policies">
        <span onclick="this.parentElement.style.display='none'" class="topright" style="margin-left: 20px">&times</span>
        <div class="topright">
            <a class="inner" href="#" ><img src="<?php echo e(asset('images/exports/pdf.png')); ?>"></a>
            <a class="inner" href="#" ><img src="<?php echo e(asset('images/exports/excel.png')); ?>"></a>
        </div>
        <h3 ><span class="error" style="margin-right: 20px">Recent Transaction Listing(10 Days)</span></h3>
        <div class="guestDetails_inputDivider"></div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('created-by'); ?>
    * General Ledger Account Created
    <?php if($account->user != null): ?>
        By <b><?php echo e($account->user->firstName." ".$account->user->lastName); ?></b>
    <?php endif; ?>
    on <b><?php echo e($account->created_at->format('j F Y H:i:s')); ?></b>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('modal_heading'); ?>
    <h1>General Ledger Account</h1>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('modal_title'); ?>
    <h3><u>Dashboard Functionalities</u></h3>
    <ol><b>
            <li>View Ledger Details</li>
            <li>Amend Ledger Details</li>
            <li>Generate Ledger Transactional Report</li>
            <li>Delete a Wrongly created Ledger</li>
        </b>
    </ol>
<?php $__env->stopSection(); ?>







<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\edwulp_chemist\resources\views/general-ledger-account.blade.php ENDPATH**/ ?>