Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
35631 ranu 1
<style>
2
    #rbm-call-target-table td, #rbm-call-target-table th {
3
        font-size: 14px;
4
        text-align: center;
5
        padding: 0.4rem;
6
        vertical-align: middle;
7
    }
8
 
9
    #rbm-call-target-table thead th {
10
        background-color: #343a40;
11
        color: white;
12
        font-weight: 600;
13
    }
14
 
15
    #rbm-call-target-table tbody tr:first-child td {
16
        font-weight: bold;
17
        background-color: #00d6b2;
18
    }
19
 
20
    .highlight-target {
21
        background-color: #fff3cd !important;
22
        font-weight: bold;
23
    }
24
 
25
    .highlight-achieved {
26
        background-color: #d4edda !important;
27
    }
28
 
29
    .highlight-oos {
30
        background-color: #f8d7da !important;
31
    }
32
 
33
    .highlight-plan-today {
34
        background-color: #0f57a4 !important;
35
        color: white !important;
36
    }
37
 
38
    .highlight-carry-forward {
39
        background-color: #ffc107 !important;
40
        color: #000 !important;
41
    }
42
 
43
    .highlight-untouched {
44
        background-color: #dc3545 !important;
45
        color: white !important;
46
    }
47
 
48
    .highlight-future-plan {
49
        background-color: #6c757d !important;
50
        color: #000 !important;
51
    }
52
 
53
    .clickable {
54
        cursor: pointer;
55
        text-decoration: underline;
56
        color: #007bff;
57
    }
58
 
59
    .clickable:hover {
60
        color: #0056b3;
61
    }
62
 
63
    .modal-body table {
64
        width: 100%;
65
    }
66
 
67
    .modal-body table th, .modal-body table td {
68
        padding: 8px;
69
        border: 1px solid #ddd;
70
    }
71
</style>
72
 
73
<div class="container-fluid">
74
    <h3>RBM Call Target Summary</h3>
75
    <table id="rbm-call-target-table" class="table table-bordered table-striped">
76
        <thead>
77
        <tr>
78
            <th>RBM Name</th>
79
            <th>Partner Count</th>
35637 ranu 80
            <th>ARR (Ach/Tgt)</th>
35631 ranu 81
            <th>Calling Target</th>
82
            <th>Called</th>
83
            <th class="highlight-plan-today">Plan Today</th>
84
            <th class="highlight-carry-forward">Carry Forward</th>
85
            <th style="background-color: #1e6e0e; color: white;">Zero Billing</th>
86
            <th class="highlight-untouched">Untouched</th>
87
            <th class="highlight-future-plan">Future Plan</th>
88
            <th>Normal</th>
89
            <th style="background-color: #c0392b;">Out of Sequence</th>
90
        </tr>
91
        </thead>
92
        <tbody>
93
            #set($totalPartnerCount = 0)
94
            #set($totalTodayTarget = 0)
95
            #set($totalValueAchieved = 0)
96
            #set($totalMovedToFuture = 0)
97
            #set($totalPlanToday = 0)
98
            #set($totalCarryForward = 0)
99
            #set($totalZeroBilling = 0)
100
            #set($totalUntouched = 0)
101
            #set($totalFuturePlan = 0)
102
            #set($totalNormal = 0)
103
            #set($totalOutOfSequence = 0)
104
            #set($totalL2CallingList = 0)
105
            #set($totalArrAchieved = 0)
106
            #set($totalArrTarget = 0)
107
 
108
            ## Total row first
109
            #foreach($model in $rbmCallTargetModels)
110
                #set($totalPartnerCount = $totalPartnerCount + $model.getPartnerCount())
111
                #set($totalTodayTarget = $totalTodayTarget + $model.getTodayTargetOfCall())
112
                #set($totalValueAchieved = $totalValueAchieved + $model.getValueTargetAchieved())
113
                #set($totalMovedToFuture = $totalMovedToFuture + $model.getMovedToFuture())
114
                #set($totalPlanToday = $totalPlanToday + $model.getPlanToday())
115
                #set($totalCarryForward = $totalCarryForward + $model.getCarryForward())
116
                #set($totalZeroBilling = $totalZeroBilling + $model.getZeroBilling())
117
                #set($totalUntouched = $totalUntouched + $model.getUntouched())
118
                #set($totalFuturePlan = $totalFuturePlan + $model.getFuturePlan())
119
                #set($totalNormal = $totalNormal + $model.getNormal())
120
                #set($totalOutOfSequence = $totalOutOfSequence + $model.getOutOfSequenceCount())
121
                #set($totalL2CallingList = $totalL2CallingList + $model.getL2CallingList())
122
                #if($arrAchievedByAuthId && $arrAchievedByAuthId.get($model.getAuthId()))
123
                    #set($totalArrAchieved = $totalArrAchieved + $arrAchievedByAuthId.get($model.getAuthId()))
124
                #end
125
                #if($arrTargetByAuthId && $arrTargetByAuthId.get($model.getAuthId()))
126
                    #set($totalArrTarget = $totalArrTarget + $arrTargetByAuthId.get($model.getAuthId()))
127
                #end
128
            #end
129
 
130
            #set($adjustedTotalTarget = $totalTodayTarget + $totalMovedToFuture)
131
            #set($adjustedTotalAchieved = $totalValueAchieved + $totalMovedToFuture)
132
 
133
        <tr>
134
            <td><strong>TOTAL</strong></td>
135
            <td><strong>$totalPartnerCount</strong></td>
35636 ranu 136
            <td><strong><span class="lakh">$totalArrAchieved</span> / <span class="lakh">$totalArrTarget</span></strong>
35631 ranu 137
            </td>
138
            <td class="highlight-target"><strong>$adjustedTotalTarget</strong></td>
139
            <td class="highlight-achieved currency"><strong>$adjustedTotalAchieved</strong></td>
140
            <td class="highlight-plan-today"><strong>$totalPlanToday</strong></td>
141
            <td class="highlight-carry-forward"><strong>$totalCarryForward</strong></td>
142
            <td><strong>$totalZeroBilling</strong></td>
143
            <td class="highlight-untouched"><strong>$totalUntouched</strong></td>
144
            <td class="highlight-future-plan"><strong>$totalFuturePlan</strong></td>
145
            <td><strong>$totalNormal</strong></td>
146
            <td class="highlight-oos"><strong>$totalOutOfSequence</strong></td>
147
        </tr>
148
 
149
            #foreach($model in $rbmCallTargetModels)
150
                #set($rowTarget = $model.getTodayTargetOfCall() + $model.getMovedToFuture())
151
                #set($rowAchieved = $model.getValueTargetAchieved() + $model.getMovedToFuture())
152
            <tr>
153
                <td>$model.getRbmName()</td>
154
                <td>$model.getPartnerCount()</td>
155
                <td>
156
                    #if($arrAchievedByAuthId && $arrAchievedByAuthId.get($model.getAuthId()))
35636 ranu 157
                        <span class="lakh">$arrAchievedByAuthId.get($model.getAuthId())</span>
35631 ranu 158
                    #else
159
 
160
                    #end
161
                    /
162
                    #if($arrTargetByAuthId && $arrTargetByAuthId.get($model.getAuthId()))
35636 ranu 163
                        <span class="lakh">$arrTargetByAuthId.get($model.getAuthId())</span>
35631 ranu 164
                    #else
165
 
166
                    #end
167
                </td>
168
                <td class="highlight-target">$rowTarget</td>
169
                <td class="highlight-achieved currency">$rowAchieved</td>
170
                <td class="highlight-plan-today">$model.getPlanToday()</td>
171
                <td class="highlight-carry-forward">$model.getCarryForward()</td>
172
                <td>$model.getZeroBilling()</td>
173
                <td class="highlight-untouched">$model.getUntouched()</td>
174
                <td class="highlight-future-plan">$model.getFuturePlan()</td>
175
                <td>$model.getNormal()</td>
176
                <td class="highlight-oos" style="color: red;">
177
                    #if($model.getOutOfSequenceCount() > 0)
178
                        <span class="clickable" style="color: #e80404"
179
                              onclick="showOutOfSequenceDetails($model.getAuthId(), '$model.getRbmName()')">$model.getOutOfSequenceCount()</span>
180
                    #else
181
 
182
                    #end
183
                </td>
184
            </tr>
185
            #end
186
        </tbody>
187
    </table>
188
</div>
189
 
190
<script type="text/javascript">
35636 ranu 191
    $(document).ready(function () {
192
        $('.lakh').each(function () {
193
            var val = parseInt($(this).text().trim());
194
            if (!isNaN(val)) {
35637 ranu 195
                $(this).text((val / 100000).toFixed(1) + 'L');
35636 ranu 196
            }
197
        });
198
    });
199
 
35631 ranu 200
    function showOutOfSequenceDetails(authId, rbmName) {
201
        document.getElementById('oosModalLabel').textContent = 'Out of Sequence Calls - ' + rbmName;
202
        document.getElementById('oosDetailsContent').innerHTML = '<p>Loading...</p>';
203
        $('#oosModal').modal('show');
204
 
205
        fetch('/indent/rbm_call_target/oos_details?authId=' + authId)
206
                .then(function (response) {
207
                    return response.json();
208
                })
209
                .then(function (data) {
210
                    if (data && data.length > 0) {
211
                        var html = '<table class="table table-bordered table-sm"><thead><tr><th>S.No</th><th>Party Name</th><th>Code</th><th>Time</th></tr></thead><tbody>';
212
                        for (var i = 0; i < data.length; i++) {
213
                            html += '<tr><td>' + (i + 1) + '</td><td>' + data[i].partyName + '</td><td>' + data[i].code + '</td><td>' + data[i].time + '</td></tr>';
214
                        }
215
                        html += '</tbody></table>';
216
                        document.getElementById('oosDetailsContent').innerHTML = html;
217
                    } else {
218
                        document.getElementById('oosDetailsContent').innerHTML = '<p>No out of sequence calls found.</p>';
219
                    }
220
                })
221
                .catch(function () {
222
                    document.getElementById('oosDetailsContent').innerHTML = '<p>Error loading details. Please try again.</p>';
223
                });
224
    }
225
</script>