Subversion Repositories SmartDukaan

Rev

Rev 32663 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="refresh" content="120">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <style>
        html, body {
            margin-top: 10px;
            padding: 0;
        }


        td, th {
            font-size: 20px;
        }


        .table td, .table th {
            padding: 0.25rem;
        }

        /*tr:first-child td {
            font-weight: bold;
            background-color: #00d6b2;
        }*/

        td {
            font-size: 24px;
        }
    </style>
    <link href="../resources/css/brand-logo.css" rel="stylesheet"/>
</head>
<body>
<div class="container-fluid">
    <table class="table table-bordered table-striped">
        <thead>
        <tr>
            <th rowspan="2">RBM</th>
            <th rowspan="2">P.Count</th>
            <th rowspan="2">Called</th>
            <th colspan="2">Collection</th>
            <th colspan="2">Secondary</th>
            <th colspan="5">Active</th>
            <th colspan="5">Low Sale</th>
            <th colspan="5">Disputed</th>
        </tr>
        <tr>
            <th>Target</th>
            <th>Achieved</th>
            <th>Target</th>
            <th>Achieved</th>
            <th>Plan Today</th>
            <th>Carry Fwd</th>
            <th>Un Touched</th>
            <th>Plan Fut</th>
            <th>Normal</th>
            <th>Plan Today</th>
            <th>Carry Fwd</th>
            <th>Un Touched</th>
            <th>Plan Fut</th>
            <th>Normal</th>
            <th>Plan Today</th>
            <th>Carry Fwd</th>
            <th>Un Touched</th>
            <th>Plan Fut</th>
            <th>Normal</th>

        </tr>
        </thead>
        <tbody>
            #foreach($summaryModel in $summaryModels)
            <tr>
                <td>$summaryModel.getAuthName()</td>
                <td>$summaryModel.getUndisputedPartnerCount()</td>
                <td>$summaryModel.getPartnersCommunicated()</td>
                <td class="currency">$summaryModel.getCollectionTarget()</td>
                <td class="currency">$summaryModel.getCollection()</td>
                <td class="currency">$summaryModel.getSecondaryTarget()</td>
                <td class="currency">$summaryModel.getSecondary()</td>
                #foreach($entry in $summaryModel.getChartLeadModelMap().entrySet())
                    #set($datasets = $entry.getValue().getData().getDatasets().get(0))
                    #set($dataPoints=$datasets.getData())
                    #set($bgColors=$datasets.getBackgroundColor())
                    #set($labels = $entry.getValue().getData().getLabels())
                    #set($total=0)
                    #foreach($dataPoint in $dataPoints)
                        #set($count = $velocityCount - 1)
                        <td style="background-color: $bgColors.get($count)">
                            #if(!$dataPoint) 0 #else $dataPoint #end
                        </td>
                    #end
                #end
            </tr>
            #end
        </tbody>
    </table>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
        crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
        crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
        integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
        crossorigin="anonymous"></script>
<script type="text/javascript">
    function numberToComma(x) {

        x = x.toString();
        x = x.split('.');
        var x1 = x[0];
        var x2 = x.length > 1 && x[1] != '0' ? '.' + x[1] : '';
        var lastThree = x1.substring(x1.length - 3);
        var otherNumbers = x1.substring(0, x1.length - 3);
        if (x1.charAt(x1.length - 4) == ',' || x1.charAt(x1.length - 4) == '-') {
            console.log(lastThree)
        } else {
            if (otherNumbers != '')
                lastThree = ',' + lastThree;
        }
        return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + (lastThree)
                + x2;

    }

    $(document).ready(function () {
        $('.currency').each(function (index, ele) {
            if (!isNaN(parseInt($(ele).html()))) {
                $(ele).html(numberToComma($(ele).html()));
            }
        });
    })
</script>
</body>
</html>