Subversion Repositories SmartDukaan

Rev

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