Subversion Repositories SmartDukaan

Rev

Rev 33930 | Rev 36529 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29966 amit.gupta 1
<html lang="en">
2
<head>
29983 amit.gupta 3
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
31538 amit.gupta 4
    <meta http-equiv="refresh" content="180">
29988 amit.gupta 5
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
6
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
29966 amit.gupta 7
    <style>
8
        html, body {
29983 amit.gupta 9
            margin-top: 10px;
29966 amit.gupta 10
            padding: 0;
11
        }
12
 
13
 
14
        td, th {
29981 amit.gupta 15
            font-size: 20px;
29966 amit.gupta 16
        }
17
 
29988 amit.gupta 18
 
19
        .table td, .table th {
20
            padding: 0.25rem;
21
        }
22
 
30786 amit.gupta 23
        tr:first-child.green td {
29981 amit.gupta 24
            font-weight: bold;
29982 amit.gupta 25
            background-color: #00d6b2;
29981 amit.gupta 26
        }
29982 amit.gupta 27
 
28
        td {
29983 amit.gupta 29
            font-size: 24px;
29982 amit.gupta 30
        }
29966 amit.gupta 31
    </style>
32
    <link href="../resources/css/brand-logo.css" rel="stylesheet"/>
33
</head>
34
<body>
33917 ranu 35
 
32938 amit.gupta 36
#if($isGtEqL2)
29994 amit.gupta 37
<div class="container-fluid">
33921 ranu 38
 
29983 amit.gupta 39
    #foreach($brands in $brandParts)
40
        <table class="table table-bordered table-striped">
29966 amit.gupta 41
            <thead>
42
            <tr>
29981 amit.gupta 43
                <th rowspan="2">Region</th>
29966 amit.gupta 44
                #foreach($brand in $brands)
45
                    <th colspan="3" class="$brand.toLowerCase()"><p>$brand</p></th>
46
                #end
47
            </tr>
48
            <tr>
49
                #foreach($brand in $brands)
50
                    <th>TODAY PO</th>
29973 amit.gupta 51
                    <th>TODAY PO<br> Billed</th>
29966 amit.gupta 52
                    <th>Total Billed</th>
53
                #end
54
            </tr>
55
            </thead>
56
            <tbody>
57
                #foreach($brandRegionModelEntry in $brandRegionModelMap.entrySet())
30786 amit.gupta 58
                <tr class="green">
29981 amit.gupta 59
                    <td><b>$warehouseMap.get($brandRegionModelEntry.getKey())</b></td>
29966 amit.gupta 60
                    #foreach($brand in $brands)
61
                        #set($obj = $brandRegionModelEntry.getValue().get($brand))
29972 amit.gupta 62
                        #if($obj.getTodayPOValue())
30036 amit.gupta 63
                            <td class="currency">$obj.getTodayPOValue()</td>
29972 amit.gupta 64
                        #else
65
                            <td>-</td>
66
                        #end
67
                        #if($obj.getTodayPOBilledValue())
30036 amit.gupta 68
                            <td class="currency">$obj.getTodayPOBilledValue()</td>
29972 amit.gupta 69
                        #else
70
                            <td>-</td>
71
                        #end
72
                        #if($obj.getTodayBilledValue())
30036 amit.gupta 73
                            <td class="currency">$obj.getTodayBilledValue()</td>
29972 amit.gupta 74
                        #else
75
                            <td>-</td>
76
                        #end
29966 amit.gupta 77
                    #end
78
 
79
                </tr>
80
                #end
81
            </tbody>
82
        </table>
29983 amit.gupta 83
    #end
30787 amit.gupta 84
</div>
33917 ranu 85
 
86
    #if($partnerTypeRegionModelMap)
31538 amit.gupta 87
<div class="container-fluid">
88
    <table class="table table-bordered table-striped">
89
        <thead>
90
        <tr>
31545 amit.gupta 91
            <th>Regionwise Billed Partners</th>
31538 amit.gupta 92
            #foreach($partnerType in $partnerTypes)
31543 amit.gupta 93
                <th>$partnerType.getValue()<br>Today/MTD/Total</th>
31538 amit.gupta 94
            #end
95
        </tr>
96
        </thead>
97
        <tbody>
35454 amit 98
## OPTIMIZED: Use single get with null check instead of containsKey + get pattern
31538 amit.gupta 99
            #foreach($warehouseEntry in $warehouseMap.entrySet())
100
                #if($warehouseEntry.getKey()!=0)
101
                <tr>
102
                    <td><b>$warehouseEntry.getValue()</b></td>
35454 amit 103
                    #set($warehouseTypeMap = $partnerTypeRegionModelMap.get($warehouseEntry.getKey()))
31538 amit.gupta 104
                    #foreach($partnerType in $partnerTypes)
105
                        <td>
35454 amit 106
                            #if($warehouseTypeMap)
107
                                #set($partnerTypeRegionModel = $warehouseTypeMap.get($partnerType.getValue()))
108
                                #if($partnerTypeRegionModel)
31538 amit.gupta 109
                                    $partnerTypeRegionModel.getTodayCount()/$partnerTypeRegionModel.getMtdCount()
110
                                    /$partnerTypeRegionModel.getTotalCount()
111
                                #else
112
                                    -
113
                                #end
114
                            #else
115
                                -
116
                            #end
117
                        </td>
118
                    #end
119
                </tr>
120
                #end
121
            #end
122
        </tbody>
123
    </table>
124
</div>
32938 amit.gupta 125
#end
33917 ranu 126
 
31254 amit.gupta 127
<div class="container-fluid ">
33700 amit.gupta 128
    <h3>Total Collection(Overall Collection/Limit Utilization))</h3>
29994 amit.gupta 129
    <div class="row">
35454 amit 130
## OPTIMIZED: Use single get instead of double get pattern
29994 amit.gupta 131
        #foreach($warehouseEntry in $warehouseMap.entrySet())
35454 amit 132
            #set($warehouseKey = $warehouseEntry.getKey())
133
            #set($collectionValue = $warehouseCollectionMap.get($warehouseKey))
134
            #set($pgCollectionValue = $warehousePgCollectionMap.get($warehouseKey))
31345 amit.gupta 135
            <div class="col-lg-2" style="font-size: 20px">
29994 amit.gupta 136
                $warehouseEntry.getValue() -
35454 amit 137
                #if($collectionValue)
138
                    <span class="currency">$collectionValue</span>
29994 amit.gupta 139
                #else
140
 
141
                #end
31242 amit.gupta 142
                /
35454 amit 143
                #if($pgCollectionValue)
144
                    <span class="currency">$pgCollectionValue</span>
31242 amit.gupta 145
                #else
146
 
147
                #end
148
 
29994 amit.gupta 149
            </div>
150
        #end
151
    </div>
30784 amit.gupta 152
</div>
30783 amit.gupta 153
    #parse("today_target.vm")
32938 amit.gupta 154
#end
29983 amit.gupta 155
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
156
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
157
        crossorigin="anonymous"></script>
158
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
159
        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
160
        crossorigin="anonymous"></script>
161
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
162
        integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
163
        crossorigin="anonymous"></script>
30036 amit.gupta 164
<script type="text/javascript">
165
    function numberToComma(x) {
29966 amit.gupta 166
 
30036 amit.gupta 167
        x = x.toString();
168
        x = x.split('.');
169
        var x1 = x[0];
170
        var x2 = x.length > 1 && x[1] != '0' ? '.' + x[1] : '';
171
        var lastThree = x1.substring(x1.length - 3);
172
        var otherNumbers = x1.substring(0, x1.length - 3);
173
        if (x1.charAt(x1.length - 4) == ',' || x1.charAt(x1.length - 4) == '-') {
174
            console.log(lastThree)
175
        } else {
176
            if (otherNumbers != '')
177
                lastThree = ',' + lastThree;
178
        }
179
        return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + (lastThree)
180
                + x2;
181
 
182
    }
183
 
184
    $(document).ready(function () {
185
        $('.currency').each(function (index, ele) {
186
            if (!isNaN(parseInt($(ele).html()))) {
187
                $(ele).html(numberToComma($(ele).html()));
188
            }
189
        });
190
    })
191
</script>
29966 amit.gupta 192
</body>
193
</html>