Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

<script type="text/javascript">

    $(document).ready(function () {
        // Initialize first table
        var sanctionTable = $('#sanctiontable').DataTable({
            "scrollX": true,
            "scrollY": "518px",
            scrollCollapse: true,
            "fixedHeader": true,
            "order": [[0, "desc"]],
            fixedColumns: {
                leftColumns: 3
            },
            dom: '<"top"lf>rt<"bottom"ip><"clear">' // Proper dom setup
        });

        // Initialize second table
        var sanctionTableApproved = $('#sanctiontable-approved').DataTable({
            "scrollX": true,
            "scrollY": "518px",
            scrollCollapse: true,
            "fixedHeader": true,
            "order": [[0, "desc"]],
            fixedColumns: {
                leftColumns: 3
            },
            dom: '<"top"lf>rt<"bottom"ip><"clear">' // Proper dom setup
        });

        // Adjust columns when tab changes
        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
            // Wait for tab switch and then adjust columns
            setTimeout(function () {
                sanctionTable.columns.adjust().draw();
                sanctionTableApproved.columns.adjust().draw();
            }, 100); // Delay adjustment slightly to ensure tab switch is complete
        });
    });


    $('#sanctiontable').on('click', '.loanCount', function () {
        var fofoId = $(this).data('fofoid');
        doGetAjaxRequestHandler(context + "/getLoanSummary?fofoId="
                + fofoId, function (response) {
            $('#loanSummarydetail .modal-content').html(response);

        });
    });

    $('#sanctiontable-approved').on('click', '.loanCount', function () {
        var fofoId = $(this).data('fofoid');
        doGetAjaxRequestHandler(context + "/getLoanSummary?fofoId="
                + fofoId, function (response) {
            $('#loanSummarydetail .modal-content').html(response);

        });
    });

</script>


<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="icon_document_alt"></i>Sanction Request</h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                <li><i class="icon_document_alt"></i>Sanction Request</li>

            </ol>
        </div>
    </div>
    <div class="col-lg-12">
        <ul class="nav nav-tabs">
            <li class="active"><a data-toggle="tab" href="#pending">Pending</a></li>
            <li><a data-toggle="tab" href="#approved">Approved</a></li>
        </ul>

        <div class="tab-content">
            <div id="pending" class="tab-pane fade in active">
                <div class="col-lg-12">

                    <table class="table table-border table-condensed table-bordered" id="sanctiontable"
                           style="width:100%">

                        <thead class="row htable" style="background:#F5F5F5;">

                        <tr style="color:black;">
                            <th>Id</th>
                            <th>Code</th>
                            <th>Partner Name</th>
                            <th>Lms</th>
                            <th>Lmtd</th>
                            <th>Mtd</th>

                            <th>limit</th>
                            <th>Available Limit</th>
                            <th>Utilization Amount</th>
                            <th>Interest</th>
                            <th>Credit Duration</th>
                            <th>Avg Credit Days</th>
                            <th>Active Loan</th>

                            <th>Risk</th>
                            <th>Total Investment</th>

                            <th>Short Investment</th>
                            <th>Wallet Amount</th>
                            <th>Requested By</th>
                            <th>Req Amount</th>
                            <th>Approval Amount</th>
                            <th>Free days</th>
                            <th>L2 Status</th>
                            <th>Final Status</th>
                            <th>Hold Stock</th>
                            <th>Provider</th>
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody>
                            #foreach($sanctionRequest in $sanctionRequests)
                                #if($sanctionRequest.getRbmL2ApprovalStatus() ==
                                    "PENDING" && $sanctionRequest.getStatus() != 'REJECTED')
                                <tr>
                                        #parse("rbm-l2-pending-sanction-request.vm")

                                </tr>
                                #end

                            #end

                        </tbody>

                    </table>
                </div>
            </div>
            <div id="approved" class="tab-pane fade">
                <div class="col-lg-12">

                    <table class="table table-border table-condensed table-bordered" id="sanctiontable-approved"
                           style="width:100%">

                        <thead class="row htable" style="background:#F5F5F5;">

                        <tr style="color:black;">
                            <th>Id</th>
                            <th>Code</th>
                            <th>Partner Name</th>
                            <th>Lms</th>
                            <th>Lmtd</th>
                            <th>Mtd</th>

                            <th>limit</th>
                            <th>Available Limit</th>
                            <th>Utilization Amount</th>
                            <th>Interest</th>
                            <th>Credit Duration</th>
                            <th>Avg Credit Days</th>
                            <th>Active Loan</th>

                            <th>Risk</th>
                            <th>Total Investment</th>

                            <th>Short Investment</th>
                            <th>Wallet Amount</th>
                            <th>Requested By</th>
                            <th>Req Amount</th>
                            <th>Approval Amount</th>
                            <th>Free days</th>
                            <th>L2 Status</th>
                            <th>Final Status</th>
                            <th>Hold Stock</th>
                            <th>Provider</th>
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody>
                            #foreach($sanctionRequest in $sanctionRequests)
                                #if($sanctionRequest.getRbmL2ApprovalStatus() ==
                                    "APPROVED" && $sanctionRequest.getStatus() != 'REJECTED')
                                <tr>
                                        #parse("rbm-l2-approved-sanction-request.vm")

                                </tr>
                                #end


                            #end

                        </tbody>

                    </table>
                </div>
            </div>
        </div>
    </div>


    <div id="loanSummarydetail" class="modal" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">

            </div>
        </div>
    </div>
</section>