Subversion Repositories SmartDukaan

Rev

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

Rev 35868 Rev 35879
Line 138... Line 138...
138
 
138
 
139
    <table id="rbm-call-target-table" class="table table-bordered table-striped">
139
    <table id="rbm-call-target-table" class="table table-bordered table-striped">
140
        <thead>
140
        <thead>
141
        <tr>
141
        <tr>
142
            <th>RBM Name</th>
142
            <th>RBM Name</th>
143
            #*<th style="background-color: #17a2b8; color: white;">Agent Status</th>
143
            <th style="background-color: #17a2b8; color: white;">Agent Status</th>
144
            <th style="background-color: #17a2b8; color: white;">Time in Status</th>*#
144
            <th style="background-color: #17a2b8; color: white;">Time in Status</th>
145
            <th>Partner Count</th>
145
            <th>Partner Count</th>
146
            <th>(Ach/Tgt)</th>
146
            <th>(Ach/Tgt)</th>
147
            <th>Calling Target</th>
147
            <th>Calling Target</th>
148
            <th>Called</th>
148
            <th>Called</th>
149
            <th class="highlight-plan-today">Plan Today</th>
149
            <th class="highlight-plan-today">Plan Today</th>
Line 199... Line 199...
199
            #set($adjustedTotalTarget = $totalTodayTarget + $totalMovedToFuture)
199
            #set($adjustedTotalTarget = $totalTodayTarget + $totalMovedToFuture)
200
            #set($adjustedTotalAchieved = $totalValueAchieved + $totalMovedToFuture)
200
            #set($adjustedTotalAchieved = $totalValueAchieved + $totalMovedToFuture)
201
 
201
 
202
        <tr>
202
        <tr>
203
            <td><strong>TOTAL</strong></td>
203
            <td><strong>TOTAL</strong></td>
204
            #*<td>-</td>
204
            <td>-</td>
205
            <td>-</td>*#
205
            <td>-</td>
206
            <td><strong>$totalPartnerCount</strong></td>
206
            <td><strong>$totalPartnerCount</strong></td>
207
            <td><strong><span class="lakh">$totalArrAchieved</span> / <span class="lakh">$totalArrTarget</span></strong>
207
            <td><strong><span class="lakh">$totalArrAchieved</span> / <span class="lakh">$totalArrTarget</span></strong>
208
            </td>
208
            </td>
209
            <td class="highlight-target"><strong>$adjustedTotalTarget</strong></td>
209
            <td class="highlight-target"><strong>$adjustedTotalTarget</strong></td>
210
            <td class="highlight-achieved currency"><strong>$adjustedTotalAchieved</strong></td>
210
            <td class="highlight-achieved currency"><strong>$adjustedTotalAchieved</strong></td>
Line 222... Line 222...
222
                #set($rowTarget = $model.getTodayTargetOfCall() + $model.getMovedToFuture())
222
                #set($rowTarget = $model.getTodayTargetOfCall() + $model.getMovedToFuture())
223
                #set($rowAchieved = $model.getValueTargetAchieved() + $model.getMovedToFuture())
223
                #set($rowAchieved = $model.getValueTargetAchieved() + $model.getMovedToFuture())
224
                #set($agentStatus = $agentStatusByAuthId.get($model.getAuthId()))
224
                #set($agentStatus = $agentStatusByAuthId.get($model.getAuthId()))
225
            <tr>
225
            <tr>
226
                <td>$model.getRbmName()</td>
226
                <td>$model.getRbmName()</td>
227
                #*<td class="agent-status-cell" data-authid="$model.getAuthId()">
227
                <td class="agent-status-cell" data-authid="$model.getAuthId()">
228
                    #if($agentStatus && $agentStatus.getAgentStatus())
228
                    #if($agentStatus && $agentStatus.getAgentStatus())
229
                        #if($agentStatus.getAgentStatus() == "On Call")
229
                        #if($agentStatus.getAgentStatus() == "On Call")
230
                            <span class="badge" style="background-color: #28a745; color: white;">$agentStatus.getAgentStatus()</span>
230
                            <span class="badge" style="background-color: #28a745; color: white;">$agentStatus.getAgentStatus()</span>
231
                        #elseif($agentStatus.getAgentStatus() == "Available")
231
                        #elseif($agentStatus.getAgentStatus() == "Available")
232
                            <span class="badge" style="background-color: #17a2b8; color: white;">$agentStatus.getAgentStatus()</span>
232
                            <span class="badge" style="background-color: #17a2b8; color: white;">$agentStatus.getAgentStatus()</span>
Line 247... Line 247...
247
                    #if($agentStatus && $agentStatus.getTimeInStatus())
247
                    #if($agentStatus && $agentStatus.getTimeInStatus())
248
                        $agentStatus.getTimeInStatus()
248
                        $agentStatus.getTimeInStatus()
249
                    #else
249
                    #else
250
                        -
250
                        -
251
                    #end
251
                    #end
252
                </td>*#
252
                </td>
253
                <td>$model.getPartnerCount()</td>
253
                <td>$model.getPartnerCount()</td>
254
                <td>
254
                <td>
255
                    #if($arrAchievedByAuthId && $arrAchievedByAuthId.get($model.getAuthId()))
255
                    #if($arrAchievedByAuthId && $arrAchievedByAuthId.get($model.getAuthId()))
256
                        <span class="lakh">$arrAchievedByAuthId.get($model.getAuthId())</span>
256
                        <span class="lakh">$arrAchievedByAuthId.get($model.getAuthId())</span>
257
                    #else
257
                    #else
Line 407... Line 407...
407
                .catch(function () {
407
                .catch(function () {
408
                    document.getElementById('calledDetailsContent').innerHTML = '<p>Error loading details. Please try again.</p>';
408
                    document.getElementById('calledDetailsContent').innerHTML = '<p>Error loading details. Please try again.</p>';
409
                });
409
                });
410
    }
410
    }
411
 
411
 
412
    /* Agent Status columns commented out - uncomment when needed
-
 
413
    // Auto-refresh agent status every 30 seconds
412
    // Auto-refresh agent status every 30 seconds
414
    function refreshAgentStatus() {
413
    function refreshAgentStatus() {
415
        fetch('/indent/rbm_call_target/get_agent_statuses')
414
        fetch('/indent/rbm_call_target/get_agent_statuses')
416
            .then(function (response) {
415
                .then(function (response) {
417
                return response.json();
416
                    return response.json();
418
            })
417
                })
419
            .then(function (data) {
418
                .then(function (data) {
420
                if (data && data.length > 0) {
419
                    if (data && data.length > 0) {
421
                    for (var i = 0; i < data.length; i++) {
420
                        for (var i = 0; i < data.length; i++) {
422
                        var agent = data[i];
421
                            var agent = data[i];
423
                        var statusCell = document.querySelector('.agent-status-cell[data-authid="' + agent.authId + '"]');
422
                            var statusCell = document.querySelector('.agent-status-cell[data-authid="' + agent.authId + '"]');
424
                        var timeCell = document.querySelector('.time-in-status-cell[data-authid="' + agent.authId + '"]');
423
                            var timeCell = document.querySelector('.time-in-status-cell[data-authid="' + agent.authId + '"]');
425
 
424
 
426
                        if (statusCell) {
425
                            if (statusCell) {
427
                            var statusHtml = getStatusBadge(agent.agentStatus);
426
                                var statusHtml = getStatusBadge(agent.agentStatus);
428
                            statusCell.innerHTML = statusHtml;
427
                                statusCell.innerHTML = statusHtml;
429
                        }
428
                            }
430
                        if (timeCell) {
429
                            if (timeCell) {
431
                            timeCell.textContent = agent.timeInStatus || '-';
430
                                timeCell.textContent = agent.timeInStatus || '-';
-
 
431
                            }
432
                        }
432
                        }
433
                    }
433
                    }
434
                }
434
                })
435
            })
-
 
436
            .catch(function (err) {
435
                .catch(function (err) {
437
                console.error('Error refreshing agent status:', err);
436
                    console.error('Error refreshing agent status:', err);
438
            });
437
                });
439
    }
438
    }
440
 
439
 
441
    function getStatusBadge(status) {
440
    function getStatusBadge(status) {
442
        if (!status) return '<span class="badge" style="background-color: #6c757d; color: white;">-</span>';
441
        if (!status) return '<span class="badge" style="background-color: #6c757d; color: white;">-</span>';
443
 
442
 
Line 463... Line 462...
463
    // Refresh every 20 seconds
462
    // Refresh every 20 seconds
464
    setInterval(refreshAgentStatus, 20000);
463
    setInterval(refreshAgentStatus, 20000);
465
 
464
 
466
    // Initial refresh after page load
465
    // Initial refresh after page load
467
    setTimeout(refreshAgentStatus, 2000);
466
    setTimeout(refreshAgentStatus, 2000);
468
    */
-
 
469
 
467
 
470
    // Download All Call Data by Date
468
    // Download All Call Data by Date
471
    function downloadCallData() {
469
    function downloadCallData() {
472
        var selectedDate = document.getElementById('downloadDate').value;
470
        var selectedDate = document.getElementById('downloadDate').value;
473
        if (!selectedDate) {
471
        if (!selectedDate) {