Subversion Repositories SmartDukaan

Rev

Rev 35147 | Rev 35172 | 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>
33991 ranu 35
 
36
    #if($isGtEqL2)
34055 ranu 37
 
38
        #parse("rbm-today-arr.vm")
33953 ranu 39
<br>
35147 ranu 40
    <div class="container-fluid mb-3">
41
        <label for="userType">Select User Type</label>
42
        <select id="userType" class="form-control" style="width:200px; display:inline-block;">
43
            <option value="">--Select--</option>
44
            <option value="RBM">RBM</option>
45
            <option value="BM">BM</option>
46
            <option value="ASM">ASM</option>
47
        </select>
48
    </div>
49
 
50
    <div class="container-fluid">
29983 amit.gupta 51
    #foreach($brands in $brandParts)
52
        <table class="table table-bordered table-striped">
29966 amit.gupta 53
            <thead>
54
            <tr>
33791 amit.gupta 55
                <th rowspan="2">AuthUser</th>
29966 amit.gupta 56
                #foreach($brand in $brands)
57
                    <th colspan="3" class="$brand.toLowerCase()"><p>$brand</p></th>
58
                #end
59
            </tr>
60
            <tr>
61
                #foreach($brand in $brands)
62
                    <th>TODAY PO</th>
33801 amit.gupta 63
                    <th>Partner Count</th>
29966 amit.gupta 64
                    <th>Total Billed</th>
65
                #end
66
            </tr>
67
            </thead>
68
            <tbody>
69
                #foreach($brandRegionModelEntry in $brandRegionModelMap.entrySet())
30786 amit.gupta 70
                <tr class="green">
35155 ranu 71
                    <td>
72
                        #if($brandRegionModelEntry.getKey() != -1)
73
                            <b>$authUserMap.get($brandRegionModelEntry.getKey())</b>
74
                        #else -
75
                        #end
76
                    </td>
29966 amit.gupta 77
                    #foreach($brand in $brands)
78
                        #set($obj = $brandRegionModelEntry.getValue().get($brand))
29972 amit.gupta 79
                        #if($obj.getTodayPOValue())
30036 amit.gupta 80
                            <td class="currency">$obj.getTodayPOValue()</td>
29972 amit.gupta 81
                        #else
82
                            <td>-</td>
83
                        #end
33801 amit.gupta 84
                        #if($obj.getPartiesBilled())
85
                            <td>$obj.getPartiesBilled()</td>
29972 amit.gupta 86
                        #else
87
                            <td>-</td>
88
                        #end
89
                        #if($obj.getTodayBilledValue())
30036 amit.gupta 90
                            <td class="currency">$obj.getTodayBilledValue()</td>
29972 amit.gupta 91
                        #else
92
                            <td>-</td>
93
                        #end
29966 amit.gupta 94
                    #end
95
 
96
                </tr>
97
                #end
98
            </tbody>
99
        </table>
29983 amit.gupta 100
    #end
30787 amit.gupta 101
</div>
32938 amit.gupta 102
#if($partnerTypeRegionModelMap)
31538 amit.gupta 103
<div class="container-fluid">
33953 ranu 104
    ##    <table class="table table-bordered table-striped">
105
##        <thead>
106
##        <tr>
107
##            <th>Regionwise Billed Partners</th>
108
##            #foreach($partnerType in $partnerTypes)
109
##                <th>$partnerType.getValue()<br>Today/MTD/Total</th>
110
##            #end
111
##        </tr>
112
##        </thead>
113
##        <tbody>
114
##            #foreach($authUserEntry in $authUserMap.entrySet())
115
##                #if($authUserEntry.getKey()!=0)
116
##                <tr>
117
##                    <td><b>$authUserEntry.getValue()</b></td>
118
##                    #foreach($partnerType in $partnerTypes)
119
##                        <td>
120
##                            #if($partnerTypeRegionModelMap.containsKey($warehouseEntry.getKey()))
121
##                                #if($partnerTypeRegionModelMap.get($warehouseEntry.getKey()).containsKey($partnerType.getValue()))
122
##                                    #set ($partnerTypeRegionModel=$partnerTypeRegionModelMap.get($warehouseEntry.getKey()).get($partnerType.getValue()))
123
##                                    $partnerTypeRegionModel.getTodayCount()/$partnerTypeRegionModel.getMtdCount()
124
##                                    /$partnerTypeRegionModel.getTotalCount()
125
##                                #else
126
##                                    -
127
##                                #end
128
##                            #else
129
##                                -
130
##                            #end
131
##                        </td>
132
##                    #end
133
##                </tr>
134
##                #end
135
##            #end
136
##        </tbody>
137
##    </table>
31538 amit.gupta 138
</div>
32938 amit.gupta 139
#end
31254 amit.gupta 140
<div class="container-fluid ">
33700 amit.gupta 141
    <h3>Total Collection(Overall Collection/Limit Utilization))</h3>
29994 amit.gupta 142
    <div class="row">
143
        #foreach($warehouseEntry in $warehouseMap.entrySet())
31345 amit.gupta 144
            <div class="col-lg-2" style="font-size: 20px">
29994 amit.gupta 145
                $warehouseEntry.getValue() -
146
                #if($warehouseCollectionMap.get($warehouseEntry.getKey()))
31250 amit.gupta 147
                    <span class="currency">$warehouseCollectionMap.get($warehouseEntry.getKey())</span>
29994 amit.gupta 148
                #else
149
 
150
                #end
31242 amit.gupta 151
                /
31250 amit.gupta 152
                #if($warehousePgCollectionMap.get($warehouseEntry.getKey()))
31251 amit.gupta 153
                    <span class="currency">$warehousePgCollectionMap.get($warehouseEntry.getKey())</span>
31242 amit.gupta 154
                #else
155
 
156
                #end
157
 
29994 amit.gupta 158
            </div>
159
        #end
160
    </div>
30784 amit.gupta 161
</div>
30783 amit.gupta 162
    #parse("today_target.vm")
32938 amit.gupta 163
#end
29983 amit.gupta 164
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
165
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
166
        crossorigin="anonymous"></script>
167
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
168
        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
169
        crossorigin="anonymous"></script>
170
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
171
        integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
172
        crossorigin="anonymous"></script>
30036 amit.gupta 173
<script type="text/javascript">
174
    function numberToComma(x) {
29966 amit.gupta 175
 
30036 amit.gupta 176
        x = x.toString();
177
        x = x.split('.');
178
        var x1 = x[0];
179
        var x2 = x.length > 1 && x[1] != '0' ? '.' + x[1] : '';
180
        var lastThree = x1.substring(x1.length - 3);
181
        var otherNumbers = x1.substring(0, x1.length - 3);
182
        if (x1.charAt(x1.length - 4) == ',' || x1.charAt(x1.length - 4) == '-') {
183
            console.log(lastThree)
184
        } else {
185
            if (otherNumbers != '')
186
                lastThree = ',' + lastThree;
187
        }
188
        return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + (lastThree)
189
                + x2;
190
 
191
    }
192
 
193
    $(document).ready(function () {
194
        $('.currency').each(function (index, ele) {
195
            if (!isNaN(parseInt($(ele).html()))) {
196
                $(ele).html(numberToComma($(ele).html()));
197
            }
198
        });
199
    })
200
</script>
33991 ranu 201
 
202
 
203
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
204
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
205
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
206
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
207
 
208
<script>
209
    // Initialize the date range picker
210
    $('input[name="rbmArrPeriod"]').daterangepicker({
211
        autoUpdateInput: false, // Prevent auto-filling the input with dates
212
        locale: {
213
            cancelLabel: 'Clear'
214
        }
215
    });
216
 
217
    // Update the input field when dates are selected
218
    $('input[name="rbmArrPeriod"]').on('apply.daterangepicker', function (ev, picker) {
219
        $(this).val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
220
    });
221
 
222
    // Clear the input field when the user cancels
223
    $('input[name="rbmArrPeriod"]').on('cancel.daterangepicker', function (ev, picker) {
224
        $(this).val('');
225
    });
226
 
227
    // Function to get the dates from the picker
228
    function getDatesFromPicker(selector) {
229
        const pickerElement = $(selector).data('daterangepicker');
230
        if (!pickerElement) {
231
            console.error('Date Range Picker is not initialized.');
232
            return {startDate: null, endDate: null};
233
        }
234
        return {
235
            startDate: pickerElement.startDate.format('YYYY-MM-DD'),
236
            endDate: pickerElement.endDate.format('YYYY-MM-DD')
237
        };
238
    }
239
 
240
    // Button click event
241
    $(document).on('click', '.sold-catalog-report', function () {
242
        const dates = getDatesFromPicker('input[name="rbmArrPeriod"]');
243
        const startDate = dates.startDate;
244
        const endDate = dates.endDate;
245
 
246
        if (!startDate || !endDate) {
247
            alert("Start date and end date cannot be empty!!");
248
            return;
249
        }
250
 
251
        let endPoint = `/downloadSoldCatalogReport?startDate=${startDate}&endDate=${endDate}`;
252
        window.open(endPoint, '_blank');
253
        ;
254
    });
33997 ranu 255
 
256
    // Button click event
257
    $(document).on('click', '.rbm-target-achievement', function () {
258
        const dates = getDatesFromPicker('input[name="rbmArrPeriod"]');
259
        const startDate = dates.startDate;
260
        const endDate = dates.endDate;
261
 
262
        if (!startDate || !endDate) {
263
            alert("Start date and end date cannot be empty!!");
264
            return;
265
        }
266
 
267
        let endPoint = `/getDateWiseRabmTargetAndAchievements?startDate=${startDate}&endDate=${endDate}`;
268
        window.open(endPoint, '_blank');
269
        ;
270
    });
33991 ranu 271
</script>
35147 ranu 272
 
273
<script>
274
    $(document).on('change', '#userType', function () {
275
        const selectedType = $(this).val();
276
        if (selectedType) {
277
            // Reload the same page with categoryType param
278
            window.location.href = `/indent/today_po_rbm?categoryType=${selectedType}`;
279
        }
280
    });
281
 
282
    // Keep dropdown selected on reload
283
    $(document).ready(function () {
284
        const urlParams = new URLSearchParams(window.location.search);
285
        const selectedType = urlParams.get('categoryType');
286
        if (selectedType) {
287
            $('#userType').val(selectedType);
288
        }
289
    });
290
</script>
291
 
29966 amit.gupta 292
</body>
293
</html>