Subversion Repositories SmartDukaan

Rev

Rev 30036 | Rev 30038 | Go to most recent revision | 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">
    #foreach($brands in $brandParts)
        <table class="table table-bordered table-striped">
            <thead>
            <tr>
                <th rowspan="2">Region</th>
                #foreach($brand in $brands)
                    <th colspan="3" class="$brand.toLowerCase()"><p>$brand</p></th>
                #end
            </tr>
            <tr>
                #foreach($brand in $brands)
                    <th>TODAY PO</th>
                    <th>TODAY PO<br> Billed</th>
                    <th>Total Billed</th>
                #end
            </tr>
            </thead>
            <tbody>
                #foreach($brandRegionModelEntry in $brandRegionModelMap.entrySet())
                <tr>
                    <td><b>$warehouseMap.get($brandRegionModelEntry.getKey())</b></td>
                    #foreach($brand in $brands)
                        #set($obj = $brandRegionModelEntry.getValue().get($brand))
                        #if($obj.getTodayPOValue())
                            <td class="currency">$obj.getTodayPOValue()</td>
                        #else
                            <td>-</td>
                        #end
                        #if($obj.getTodayPOBilledValue())
                            <td class="currency">$obj.getTodayPOBilledValue()</td>
                        #else
                            <td>-</td>
                        #end
                        #if($obj.getTodayBilledValue())
                            <td class="currency">$obj.getTodayBilledValue()</td>
                        #else
                            <td>-</td>
                        #end
                    #end

                </tr>
                #end
            </tbody>
        </table>
    </div>
    #end
<div class="container">
    <h3>Total Collection</h3>
    <div class="row">
        #foreach($warehouseEntry in $warehouseMap.entrySet())
            <div class="col-lg-3 currency" style="font-size: 24px">
                $warehouseEntry.getValue() -
                #if($warehouseCollectionMap.get($warehouseEntry.getKey()))
                    $warehouseCollectionMap.get($warehouseEntry.getKey())
                #else
                    0
                #end
            </div>
        #end
    </div>
</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>