Subversion Repositories SmartDukaan

Rev

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

Rev 35064 Rev 35119
Line 837... Line 837...
837
 
837
 
838
                                <tr>
838
                                <tr>
839
                                    <td class="details">Target</td>
839
                                    <td class="details">Target</td>
840
                                    #foreach($label in $labels)
840
                                    #foreach($label in $labels)
841
                                        #if($monthlyTarget.get($label).getPurchaseTarget())
841
                                        #if($monthlyTarget.get($label).getPurchaseTarget())
842
                                            <td class="currency">$monthlyTarget.get($label).getPurchaseTarget()</td>
842
                                            <td class="currency">$decimalFormatter.format($monthlyTarget.get($label).getPurchaseTarget())</td>
843
                                        #else
843
                                        #else
844
                                            <td>0</td>
844
                                            <td>0</td>
845
                                        #end
845
                                        #end
846
                                    #end
846
                                    #end
847
                                </tr>
847
                                </tr>
Line 1124... Line 1124...
1124
                                <tr class="font-weight-bold">
1124
                                <tr class="font-weight-bold">
1125
                                    <td class="details">Total</td>
1125
                                    <td class="details">Total</td>
1126
                                    #foreach($label in $labels)
1126
                                    #foreach($label in $labels)
1127
                                        #if($totalEarningPerMonth.get($label))
1127
                                        #if($totalEarningPerMonth.get($label))
1128
 
1128
 
1129
                                            <td class="currency">$totalEarningPerMonth.get($label)</td>
1129
                                            <td class="currency">$decimalFormatter.format($totalEarningPerMonth.get($label))</td>
1130
                                        #else
1130
                                        #else
1131
                                            <td> -</td>
1131
                                            <td> -</td>
1132
                                        #end
1132
                                        #end
1133
                                    #end
1133
                                    #end
1134
 
1134
 
Line 1208... Line 1208...
1208
                rightTable.style.display = 'block';
1208
                rightTable.style.display = 'block';
1209
            }
1209
            }
1210
 
1210
 
1211
            const contextPath = window.location.pathname.substring(0, window.location.pathname.indexOf("/", 2));
1211
            const contextPath = window.location.pathname.substring(0, window.location.pathname.indexOf("/", 2));
1212
            doGetAjaxRequestHandler(
1212
            doGetAjaxRequestHandler(
1213
                    `${context}/getBrandItemwisePartnerSale?month=${monthNumber}&brand=${brandName}&fofoId=${fofoId}`,
1213
                    `${context}/getBrandItemwisePartnerSecondarySale?month=${monthNumber}&brand=${brandName}&fofoId=${fofoId}`,
1214
                    function (response) {
1214
                    function (response) {
1215
                        console.log("getting the api response", response)
1215
                        console.log("getting the api response", response)
1216
                        const rightTableBody = document.getElementById('rightTableBody');
1216
                        const rightTableBody = document.getElementById('rightTableBody');
1217
                        if (rightTableBody) {
1217
                        if (rightTableBody) {
1218
                            rightTableBody.innerHTML = '';
1218
                            rightTableBody.innerHTML = '';
-
 
1219
                            let totalQuantity = 0;
1219
 
1220
 
1220
                            response.forEach(function (item) {
1221
                            response.forEach(function (item) {
-
 
1222
                                const qty = parseInt(item.quantity.toString().replace(/,/g, ''), 10) || 0; // remove commas, fallback to 0
1221
                                const row = document.createElement('tr');
1223
                                const row = document.createElement('tr');
1222
                                row.classList.add('clickable-brandrow');
1224
                                row.classList.add('clickable-brandrow');
1223
                                row.innerHTML =
1225
                                row.innerHTML =
1224
                                        '<td>' + item.brand + " " + item.modelNumber + '</td>' +
1226
                                        '<td>' + item.brand + " " + item.modelNumber + '</td>' +
1225
                                        '<td>' + item.quantity + '</td>';
1227
                                        '<td>' + item.quantity + '</td>';
1226
 
1228
 
1227
                                rightTableBody.appendChild(row);
1229
                                rightTableBody.appendChild(row);
-
 
1230
                                totalQuantity += qty;
1228
                            });
1231
                            });
-
 
1232
 
-
 
1233
                            const totalRow = document.createElement('tr');
-
 
1234
                            totalRow.innerHTML =
-
 
1235
                                    '<td><strong>Total</strong></td>' +
-
 
1236
                                    '<td><strong>' + totalQuantity + '</strong></td>';
-
 
1237
                            rightTableBody.appendChild(totalRow);
1229
                        }
1238
                        }
1230
 
1239
 
-
 
1240
 
1231
                        const tableTitle = document.getElementById('tableTitle');
1241
                        const tableTitle = document.getElementById('tableTitle');
1232
                        if (tableTitle) {
1242
                        if (tableTitle) {
1233
                            tableTitle.textContent = `${brandName} - ${monthName} Details`;
1243
                            tableTitle.textContent = `${brandName} - ${monthName} Details`;
1234
                        }
1244
                        }
1235
                    }
1245
                    }