Subversion Repositories SmartDukaan

Rev

Rev 35200 | Rev 35202 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35200 Rev 35201
Line 34... Line 34...
34
<body>
34
<body>
35
 
35
 
36
    #if($isGtEqL2)
36
    #if($isGtEqL2)
37
 
37
 
38
        #parse("rbm-today-arr.vm")
38
        #parse("rbm-today-arr.vm")
39
<br>
39
    <br>
40
    <div class="container-fluid mb-3">
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;">
41
        <select id="categoryDropdown" class="form-control" style="width:200px; display:inline-block;">
43
            <option value="">--Select--</option>
-
 
44
            <option value="RBM">RBM</option>
42
            <option value="RBM">All RBMs</option>
45
            <option value="BM">BM</option>
43
            <option value="BM">All BMs</option>
46
            <option value="ASM">ASM</option>
44
            <option value="ASM">All ASMs</option>
47
        </select>
45
        </select>
48
        <button class="partnerwise-billed-po btn btn-info btn-sm">Today PO and Billed (Partner
46
        <button class="partnerwise-billed-po btn btn-info btn-sm">Today PO and Billed (Partner
49
            wise)
47
            wise)
50
        </button>
48
        </button>
51
    </div>
-
 
52
 
49
 
53
    <div class="container-fluid">
-
 
54
    #foreach($brands in $brandParts)
-
 
55
        <table class="table table-bordered table-striped">
50
        <div class="purchaseMilestoneContainer">
56
            <thead>
-
 
57
            <tr>
-
 
58
                <th rowspan="2">AuthUser</th>
-
 
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>
-
 
66
                    <th>Partner Count</th>
-
 
67
                    <th>Total Billed</th>
51
            <!-- Initial table load -->
68
                #end
-
 
69
            </tr>
-
 
70
            </thead>
-
 
71
            <tbody>
-
 
72
                #foreach($brandRegionModelEntry in $brandRegionModelMap.entrySet())
-
 
73
                <tr class="green">
-
 
74
                    <td>
-
 
75
                        #if($brandRegionModelEntry.getKey() != -1)
-
 
76
                            <b>$authUserMap.get($brandRegionModelEntry.getKey())</b>
-
 
77
                        #else -
-
 
78
                        #end
-
 
79
                    </td>
-
 
80
                    #foreach($brand in $brands)
-
 
81
                        #set($obj = $brandRegionModelEntry.getValue().get($brand))
-
 
82
                        #if($obj.getTodayPOValue())
-
 
83
                            <td class="currency">$obj.getTodayPOValue()</td>
-
 
84
                        #else
-
 
85
                            <td>-</td>
-
 
86
                        #end
-
 
87
                        #if($obj.getPartiesBilled())
-
 
88
                            <td>$obj.getPartiesBilled()</td>
-
 
89
                        #else
-
 
90
                            <td>-</td>
-
 
91
                        #end
-
 
92
                        #if($obj.getTodayBilledValue())
-
 
93
                            <td class="currency">$obj.getTodayBilledValue()</td>
-
 
94
                        #else
-
 
95
                            <td>-</td>
-
 
96
                        #end
-
 
97
                    #end
-
 
98
 
-
 
99
                </tr>
-
 
100
                #end
-
 
101
            </tbody>
-
 
102
        </table>
-
 
103
    #end
-
 
104
</div>
-
 
105
        #if($partnerTypeRegionModelMap)
-
 
106
        <div class="container-fluid">
-
 
107
            ##    <table class="table table-bordered table-striped">
-
 
108
##        <thead>
-
 
109
##        <tr>
-
 
110
##            <th>Regionwise Billed Partners</th>
52
            #parse("today_po_table_fragment.vm")
111
##            #foreach($partnerType in $partnerTypes)
-
 
112
##                <th>$partnerType.getValue()<br>Today/MTD/Total</th>
-
 
113
##            #end
-
 
114
##        </tr>
-
 
115
##        </thead>
-
 
116
##        <tbody>
-
 
117
##            #foreach($authUserEntry in $authUserMap.entrySet())
-
 
118
##                #if($authUserEntry.getKey()!=0)
-
 
119
##                <tr>
-
 
120
##                    <td><b>$authUserEntry.getValue()</b></td>
-
 
121
##                    #foreach($partnerType in $partnerTypes)
-
 
122
##                        <td>
-
 
123
##                            #if($partnerTypeRegionModelMap.containsKey($warehouseEntry.getKey()))
-
 
124
##                                #if($partnerTypeRegionModelMap.get($warehouseEntry.getKey()).containsKey($partnerType.getValue()))
-
 
125
##                                    #set ($partnerTypeRegionModel=$partnerTypeRegionModelMap.get($warehouseEntry.getKey()).get($partnerType.getValue()))
-
 
126
##                                    $partnerTypeRegionModel.getTodayCount()/$partnerTypeRegionModel.getMtdCount()
-
 
127
##                                    /$partnerTypeRegionModel.getTotalCount()
-
 
128
##                                #else
-
 
129
##                                    -
-
 
130
##                                #end
-
 
131
##                            #else
-
 
132
##                                -
-
 
133
##                            #end
-
 
134
##                        </td>
-
 
135
##                    #end
-
 
136
##                </tr>
-
 
137
##                #end
-
 
138
##            #end
-
 
139
##        </tbody>
-
 
140
##    </table>
-
 
141
        </div>
53
        </div>
-
 
54
 
142
        #end
55
    </div>
143
    <div class="container-fluid ">
56
    <div class="container-fluid ">
144
    <h3>Total Collection(Overall Collection/Limit Utilization))</h3>
57
    <h3>Total Collection(Overall Collection/Limit Utilization))</h3>
145
    <div class="row">
58
    <div class="row">
146
        #foreach($warehouseEntry in $warehouseMap.entrySet())
59
        #foreach($warehouseEntry in $warehouseMap.entrySet())
147
            <div class="col-lg-2" style="font-size: 20px">
60
            <div class="col-lg-2" style="font-size: 20px">
Line 280... Line 193...
280
        ;
193
        ;
281
    });
194
    });
282
</script>
195
</script>
283
 
196
 
284
<script>
197
<script>
285
    $(document).on('change', '#userType', function () {
198
    function refreshTodayPOTable() {
286
        const selectedType = $(this).val();
199
        var selectedCategory = $('#categoryDropdown').val();
-
 
200
 
-
 
201
        $.ajax({
-
 
202
            url: "/indent/today_po_table_fragment",
287
        if (selectedType) {
203
            type: "GET",
288
            // Reload the same page with categoryType param
204
            data: {categoryType: selectedCategory},
-
 
205
            success: function (response) {
-
 
206
                $('.purchaseMilestoneContainer').fadeOut(200, function () {
-
 
207
                    $(this).html(response).fadeIn(200);
-
 
208
                });
-
 
209
            },
-
 
210
            error: function (xhr, status, error) {
-
 
211
                console.error("Error loading table: " + error);
289
            window.location.href = `/indent/today_po_rbm?categoryType=${selectedType}`;
212
                alert("Failed to load table data. Please try again.");
-
 
213
            }
290
        }
214
        });
291
    });
215
    }
292
 
216
 
-
 
217
    // Refresh table when dropdown changes
-
 
218
    $('#categoryDropdown').on('change', refreshTodayPOTable);
-
 
219
 
293
    // Keep dropdown selected on reload
220
    // Optional: load default table on page load
294
    $(document).ready(function () {
221
    $(document).ready(function () {
295
        const urlParams = new URLSearchParams(window.location.search);
-
 
296
        const selectedType = urlParams.get('categoryType');
-
 
297
        if (selectedType) {
222
        refreshTodayPOTable();
298
            $('#userType').val(selectedType);
-
 
299
        }
-
 
300
    });
223
    });
-
 
224
 
-
 
225
 
301
</script>
226
</script>
302
 
227
 
-
 
228
 
303
</body>
229
</body>
304
</html>
230
</html>
305
231