Subversion Repositories SmartDukaan

Rev

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