Subversion Repositories SmartDukaan

Rev

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

Rev 34591 Rev 35064
Line 1... Line -...
1
 
-
 
2
<!doctype html>
1
<!doctype html>
3
<html lang="en">
2
<html lang="en">
4
 
3
 
5
<head>
4
<head>
6
    <!-- Required meta tags -->
5
    <!-- Required meta tags -->
7
    <meta charset="utf-8">
6
    <meta charset="utf-8">
8
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
9
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"> </script>
8
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
10
    
-
 
11
     
-
 
12
 
9
 
13
 
10
 
14
    <!-- Bootstrap CSS -->
11
    <!-- Bootstrap CSS -->
15
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css"
12
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css"
16
        integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
13
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
17
        
14
 
18
        
15
 
19
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
16
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
20
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
17
            integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
21
        crossorigin="anonymous"></script>
18
            crossorigin="anonymous"></script>
22
        
19
 
23
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.3/dist/umd/popper.min.js"
20
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.3/dist/umd/popper.min.js"
24
        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
21
            integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
25
        crossorigin="anonymous"></script>
22
            crossorigin="anonymous"></script>
26
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js"
23
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js"
27
        integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
24
            integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
28
        crossorigin="anonymous"></script>
25
            crossorigin="anonymous"></script>
29
        
26
 
30
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
27
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
31
        <script type="text/javascript" src="resources/js/common.js?v=${version}"></script>
28
    <script type="text/javascript" src="resources/js/common.js?v=${version}"></script>
32
        
29
 
33
        <script type="text/javascript" src="resources/js/retailer.js?v=${version}"></script>
30
    <script type="text/javascript" src="resources/js/retailer.js?v=${version}"></script>
34
        
31
 
35
        <script type="text/javascript">
32
    <script type="text/javascript">
36
				function numberToComma(x) {
33
        function numberToComma(x) {
37
				
34
 
38
				    x = x.toString();
35
            x = x.toString();
39
				    x = x.split('.');
36
            x = x.split('.');
40
				    var x1 = x[0];
37
            var x1 = x[0];
41
				    var x2 = x.length > 1 && x[1] != '0' ? '.' + x[1] : '';
38
            var x2 = x.length > 1 && x[1] != '0' ? '.' + x[1] : '';
42
				    var lastThree = x1.substring(x1.length - 3);
39
            var lastThree = x1.substring(x1.length - 3);
43
				    var otherNumbers = x1.substring(0, x1.length - 3);
40
            var otherNumbers = x1.substring(0, x1.length - 3);
44
				    if (x1.charAt(x1.length - 4) == ',' || x1.charAt(x1.length - 4) == '-') {
41
            if (x1.charAt(x1.length - 4) == ',' || x1.charAt(x1.length - 4) == '-') {
45
				        console.log(lastThree)
42
                console.log(lastThree)
46
				    } else {
43
            } else {
47
				        if (otherNumbers != '')
44
                if (otherNumbers != '')
48
				            lastThree = ',' + lastThree;
45
                    lastThree = ',' + lastThree;
49
				    }
46
            }
50
				    return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + (lastThree)
47
            return otherNumbers.replace(/\B(?=(\d{2})+(?!\d))/g, ",") + (lastThree)
51
				            + x2;
48
                    + x2;
52
				
49
 
53
				}
50
        }
54
				
51
 
55
				$(document).ready(function () {
52
        $(document).ready(function () {
56
				    $('.currency').each(function (index, ele) {
53
            $('.currency').each(function (index, ele) {
57
				        if (!isNaN(parseInt($(ele).html()))) {
54
                if (!isNaN(parseInt($(ele).html()))) {
58
				            $(ele).html(numberToComma($(ele).html()));
55
                    $(ele).html(numberToComma($(ele).html()));
59
				        }
56
                }
60
				    });
57
            });
61
 
58
 
62
                    $(document).on('click', '.new-dashboard', function () {
59
            $(document).on('click', '.new-dashboard', function () {
63
                        console.log('click11111')
60
                console.log('click11111')
64
                        var fofoId = $(this).data('fofoid');
61
                var fofoId = $(this).data('fofoid');
65
 
62
 
66
                        window.open("/analysisDashboard?fofoId=" + fofoId, '_blank');
63
                window.open("/analysisDashboard?fofoId=" + fofoId, '_blank');
67
                    });
64
            });
68
				})
65
        })
69
</script>
66
    </script>
70
   
67
 
71
    <style>
68
    <style>
-
 
69
        .ms-10 {
-
 
70
            margin-left: 100px !important;
-
 
71
        }
72
        .yellow {
72
        .yellow {
73
            background-color: #fdfd96;
73
            background-color: #fdfd96;
74
        }
74
        }
75
 
75
 
76
        .orange {
76
        .orange {
Line 87... Line 87...
87
 
87
 
88
        .details {
88
        .details {
89
            color: #A3A3A5;
89
            color: #A3A3A5;
90
            font-weight: 400;
90
            font-weight: 400;
91
        }
91
        }
92
        
92
 
93
     
93
 
94
        .normal {
94
        .normal {
95
            color: #0000ff;
95
            color: #0000ff;
96
            font-weight: 400;
96
            font-weight: 400;
97
        }
97
        }
98
 
98
 
Line 102... Line 102...
102
        }
102
        }
103
 
103
 
104
        .light-red {
104
        .light-red {
105
            background-color: #FBE4D5;
105
            background-color: #FBE4D5;
106
        }
106
        }
107
        
107
 
108
     .raised th{
108
        .raised th {
109
     width :30%
109
            width: 30%
110
     } 
110
        }
111
      
111
 
112
    </style>
112
    </style>
113
 
113
 
114
</head>
114
</head>
115
 
115
 
116
<body>
116
<body>
117
 
117
 
118
 
118
 
119
    <div class="container-fluid mt-2 mb-5">
119
<div class="container-fluid mt-2 mb-5">
120
        <div class="row mt-5" >
120
    <div class="row mt-5">
121
            <div class="col bg-dark text-left px-3 py-2 border-bottom">
121
        <div class="col bg-dark text-left px-3 py-2 border-bottom">
122
                <h5 class="text-light mb-0">Raised Flags
122
            <h5 class="text-light mb-0">Raised Flags
123
                    <button class="new-dashboard btn btn-info btn-sm" data-fofoid="$fofoId">Dashboard Info</button>
123
                <button class="new-dashboard btn btn-info btn-sm" data-fofoid="$fofoId">Dashboard Info</button>
124
                    <a id="mobileAppId" href="${rc.contextPath}/mobileapp?emailId=$customRetailer.getEmail()"
124
                <a id="mobileAppId" href="${rc.contextPath}/mobileapp?emailId=$customRetailer.getEmail()"
125
                            class="btn btn-danger btn-sm" target="_blank">Franchise App
125
                   class="btn btn-danger btn-sm" target="_blank">Franchise App
126
                    </a>
126
                </a>
127
 
127
 
128
                </h5>
-
 
129
            </div>
128
            </h5>
130
        </div>
129
        </div>
-
 
130
    </div>
131
        <div class="row mt-5">
131
    <div class="row mt-5">
132
            <div class="col">
132
        <div class="col">
133
                <div>
133
            <div>
134
                    <h6 class=" yellow p-1 m-0">Working status</h6>
134
                <h6 class=" yellow p-1 m-0">Working status</h6>
135
                    <table class="table  table-sm raised">
-
 
136
                        <tbody>
-
 
137
                            <tr>
-
 
138
                                <th class="details">Partner Status</th>
-
 
139
                                #if($fofoStore.isActive())
-
 
140
                                <td>ACTIVE</td>
-
 
141
                                #else
-
 
142
                                  <td class="text-danger">INACTIVE</td>
-
 
143
                                #end
-
 
144
                            </tr>
-
 
145
                        </tbody>
-
 
146
                    </table>
-
 
147
                </div>
-
 
148
                <div>
-
 
149
                    <h6 class=" yellow p-1 m-0">Partner Investment Level</h6>
-
 
150
                    <table class="table  table-sm raised">
-
 
151
                        <tbody>
-
 
152
                            <tr>
-
 
153
                              <th class="details">Investment</th>
-
 
154
                               #if($investment.getShortPercentage() <= 0)
-
 
155
                                <td class="text-success" > OK:>100% </td>
-
 
156
                               #elseif($investment.getShortPercentage() > 20)
-
 
157
                               
-
 
158
                               <td class="text-danger">Low:<80% </td>
-
 
159
                               #else
-
 
160
                                <td class="normal">Below Normal:(80% -100%) </td>
-
 
161
                                #end
-
 
162
                            </tr>
-
 
163
                        </tbody>
-
 
164
                    </table>
-
 
165
                </div>
-
 
166
                <div>
-
 
167
                    <h6 class=" yellow p-1 m-0">Regularity of Buisness</h6>
-
 
168
                    <table class="table  table-sm raised">
-
 
169
                        <tbody>
-
 
170
                            <tr>
-
 
171
                                <th class="details">Last Secondary</th>
-
 
172
                                #if($lastPurchaseDays < 5)
-
 
173
                                
-
 
174
                                <td class="text-success">$lastPurchaseDays days back </td>
-
 
175
                                
-
 
176
                                #else
-
 
177
                                
-
 
178
                                <td class="text-danger">$lastPurchaseDays days back </td>
-
 
179
                                
-
 
180
                                #end
-
 
181
                            </tr>
-
 
182
                            <tr>
-
 
183
                                <th class="details">Last Tertiary</th>
-
 
184
                                #if($lastTertiaryDays)
-
 
185
                                #if($lastTertiaryDays < 5)
-
 
186
                                
-
 
187
                                <td class="text-success">$lastTertiaryDays days back </td>
-
 
188
                                
-
 
189
                                #else
-
 
190
                                
-
 
191
                                <td class="text-danger">$lastTertiaryDays days back </td>
-
 
192
                                
-
 
193
                                #end
-
 
194
                                #end
-
 
195
                            </tr>
-
 
196
                            <tr>
-
 
197
                                <th class="details">Unbilled Activated Stock</th>
-
 
198
                                 #if($lastUnbilledActivated > 0)
-
 
199
                                  <td class="text-danger">$investment.getUnbilledAmount()</td>
-
 
200
                              
-
 
201
                               
-
 
202
                                #else
-
 
203
                                
-
 
204
                                  <td class="text-success"> - </td>
-
 
205
                               
-
 
206
                                #end
-
 
207
                               
-
 
208
                             </tr>
-
 
209
                        </tbody>
-
 
210
                    </table>
-
 
211
                </div>
-
 
212
                 
-
 
213
                 #if(!$loans.isEmpty())
-
 
214
                  <div>
-
 
215
                    <h6 class=" yellow p-1 m-0">Active Loans</h6>
-
 
216
                    <table class="table  table-sm raised">
135
                <table class="table  table-sm raised">
217
                        <tbody>
136
                    <tbody>
218
                            <tr>
-
 
219
                                <th>Loan Id</th>
-
 
220
						        <th>Interest Rate(%)</th>
-
 
221
						        <th>Initial Amount</th>
-
 
222
								<th>Pending Amount</th>
-
 
223
								<th>Interest Accrued</th>
-
 
224
								<th>Interest Paid</th>
-
 
225
								<th>Opening Date</th>
-
 
226
								<th>Due Date</th>
-
 
227
                            </tr>
-
 
228
                   
-
 
229
                     #foreach($ls in $loans)
-
 
230
                              
-
 
231
                    <tr>
137
                    <tr>
232
						 
-
 
233
				        <td>$ls.getId()</td>
-
 
234
		    	          <td>$ls.getInterestRate().setScale(2,$ru)</td>
-
 
235
		    	          <td>$ls.getIntialAmount().setScale(2,$ru)</td>
-
 
236
		    	          <td>$ls.getPendingAmount().setScale(2,$ru)</td>
-
 
237
		    	          <td>$ls.getInterestAccrued().setScale(2,$ru)</td>
-
 
238
		    	      
-
 
239
		    	          <td>$ls.getInterestPaid().setScale(2,$ru)</td>
-
 
240
		    	          <td>$ls.getCreatedOn().format($dateTimeFormatter)</td>
-
 
241
		    	          <td>$ls.getDueDate().format($dateTimeFormatter)</td>
-
 
242
		    		   </tr>
-
 
243
                     #end
-
 
244
                            <tr>
-
 
245
                                <td colspan="2" style="text-align: right;">Total</td>
-
 
246
                                <td>$totalInitialAmount.setScale(2,$ru)</td>
-
 
247
                                <td>$totalPendingAmount.setScale(2,$ru)</td>
-
 
248
                                <td>$totalInterestAccured.setScale(2,$ru)</td>
-
 
249
                                <td>$totalInterestPaid.setScale(2,$ru)</td>
138
                        <th class="details">Partner Status</th>
250
                                <td>-</td>
139
                        #if($fofoStore.isActive())
251
                                <td>-</td>
140
                            <td>ACTIVE</td>
252
                            </tr>
141
                        #else
253
			      
-
 
254
		  
-
 
255
                        </tbody>
142
                            <td class="text-danger">INACTIVE</td>
256
                    </table>
143
                        #end
257
                </div>
-
 
258
                #end
-
 
259
                
-
 
260
                  <div>
144
                    </tr>
261
                    <button class="btn btn-primary agingDataAfterNintyDays" data-fofoid="$fofoId" data-brand="$brand"
-
 
262
                                                          data-toggle="modal" data-target="#agingItemWiseBrandStock">AgingDataGt90Days</button>
-
 
263
                    
145
                    </tbody>
264
                </div>
146
                </table>
265
                 <div id="agingItemWiseBrandStock" class="modal" role="dialog">
-
 
266
                                         <div class="modal-dialog">
-
 
267
                                         <div class="modal-content" style="width:140%">
-
 
268
 
-
 
269
                                         </div>
-
 
270
                                       </div>
-
 
271
                                 </div>  
-
 
272
            </div>
147
            </div>
273
            <div class="col">
-
 
274
                <div>
148
            <div>
275
                    <h6 class=" yellow p-1 m-0">Logistics</h6>
149
                <h6 class=" yellow p-1 m-0">Partner Investment Level</h6>
276
                    <table class="table  table-sm raised">
150
                <table class="table  table-sm raised">
277
                        <tbody>
151
                    <tbody>
278
                            <tr>
152
                    <tr>
279
                             <th class="details">Order to Billing time</th>
153
                        <th class="details">Investment</th>
280
                              #if($createdToBillingAverage)
154
                        #if($investment.getShortPercentage() <= 0)
-
 
155
                            <td class="text-success"> OK:>100%</td>
281
                                #if($createdToBillingAverage < 1)
156
                        #elseif($investment.getShortPercentage() > 20)
-
 
157
 
282
                                <td class="text-success"> Normal < 1 ($decimalFormatter.format($createdToBillingAverage) days)</td>
158
                            <td class="text-danger">Low:<80%</td>
283
                                #else
159
                        #else
284
                                    <td class="text-danger"> High >= 1
160
                            <td class="normal">Below Normal:(80% -100%)</td>
285
                                        ($decimalFormatter.format($createdToBillingAverage) days)
161
                        #end
286
                                    </td>
162
                    </tr>
287
                                #end
163
                    </tbody>
288
                              #else
164
                </table>
289
                                 <td>-</td>
165
            </div>
290
                              #end
166
            <div>
-
 
167
                <h6 class=" yellow p-1 m-0">Regularity of Buisness</h6>
291
                                
168
                <table class="table  table-sm raised">
292
                            </tr>
169
                    <tbody>
293
                            <tr>
170
                    <tr>
294
                               <th class="details">Billing to Delivery time</th>
171
                        <th class="details">Last Secondary</th>
295
                                #if($billingToDeliverAverage)
172
                        #if($lastPurchaseDays < 5)
296
 
173
 
297
                                    #if($billingToDeliverAverage < 2)
-
 
298
                                        <td class="text-success"> Normal < 2
174
                            <td class="text-success">$lastPurchaseDays days back</td>
299
                                            ($decimalFormatter.format($billingToDeliverAverage) days)
-
 
300
                                        </td>
-
 
301
                                    #else
-
 
302
                                        <td class="text-danger"> High >= 2
-
 
303
                                            ($decimalFormatter.format($billingToDeliverAverage) days)
-
 
304
                                        </td>
-
 
305
                                    #end
-
 
306
                                #else
-
 
307
                                    <td>-</td>
-
 
308
 
175
 
-
 
176
                        #else
-
 
177
 
-
 
178
                            <td class="text-danger">$lastPurchaseDays days back</td>
-
 
179
 
-
 
180
                        #end
-
 
181
                    </tr>
-
 
182
                    <tr>
-
 
183
                        <th class="details">Last Tertiary</th>
-
 
184
                        #if($lastTertiaryDays)
-
 
185
                            #if($lastTertiaryDays < 5)
-
 
186
 
-
 
187
                                <td class="text-success">$lastTertiaryDays days back</td>
-
 
188
 
309
                                #end
189
                            #else
-
 
190
 
-
 
191
                                <td class="text-danger">$lastTertiaryDays days back</td>
-
 
192
 
310
                            </tr>
193
                            #end
-
 
194
                        #end
-
 
195
                    </tr>
-
 
196
                    <tr>
-
 
197
                        <th class="details">Unbilled Activated Stock</th>
-
 
198
                        #if($lastUnbilledActivated > 0)
-
 
199
                            <td class="text-danger">$investment.getUnbilledAmount()</td>
-
 
200
 
-
 
201
 
-
 
202
                        #else
-
 
203
 
-
 
204
                            <td class="text-success"> -</td>
-
 
205
 
-
 
206
                        #end
-
 
207
 
-
 
208
                    </tr>
311
                        </tbody>
209
                    </tbody>
312
                    </table>
210
                </table>
313
                </div>
211
            </div>
-
 
212
 
-
 
213
            #if(!$loans.isEmpty())
314
                <div>
214
                <div>
315
                    <h6 class=" yellow p-1 m-0">Stocking</h6>
215
                    <h6 class=" yellow p-1 m-0">Active Loans</h6>
316
                    <table class="table  table-sm raised">
216
                    <table class="table  table-sm raised">
317
                        <tbody>
217
                        <tbody>
-
 
218
                        <tr>
-
 
219
                            <th>Loan Id</th>
-
 
220
                            <th>Interest Rate(%)</th>
-
 
221
                            <th>Initial Amount</th>
-
 
222
                            <th>Pending Amount</th>
-
 
223
                            <th>Interest Accrued</th>
-
 
224
                            <th>Interest Paid</th>
-
 
225
                            <th>Opening Date</th>
-
 
226
                            <th>Due Date</th>
-
 
227
                        </tr>
-
 
228
 
-
 
229
                            #foreach($ls in $loans)
-
 
230
 
318
                            <tr>
231
                            <tr>
-
 
232
 
319
                                <th class="details">Stock Level</th>
233
                                <td>$ls.getId()</td>
320
                                #if($oneFourthOfTertiary > $totalStock)
-
 
321
                                <td class="text-danger">Low</td>
234
                                <td>$ls.getInterestRate().setScale(2,$ru)</td>
322
                                #else 
-
 
323
                                 <td class="text-success">  High </td>
235
                                <td>$ls.getIntialAmount().setScale(2,$ru)</td>
324
                                #end
-
 
325
                             
-
 
326
                            </tr>
-
 
327
                            <tr>
-
 
328
                                <th class="details">Sufficient Stock</th>
236
                                <td>$ls.getPendingAmount().setScale(2,$ru)</td>
329
                                <td class="text-success" >  #foreach($suffientModel of $suffientModels) 
-
 
330
                                    $suffientModel.getBrand(),
237
                                <td>$ls.getInterestAccrued().setScale(2,$ru)</td>
331
                                #end
-
 
332
                                
-
 
333
                                
-
 
334
                                </td>
-
 
335
                            </tr>
-
 
336
                            <tr>
-
 
-
 
238
 
337
                                <th class="details">Low Stock</th>
239
                                <td>$ls.getInterestPaid().setScale(2,$ru)</td>
338
                                <td class="text-danger">
240
                                <td>$ls.getCreatedOn().format($dateTimeFormatter)</td>
339
                                 #foreach($lowModel of $lowModels) 
241
                                <td>$ls.getDueDate().format($dateTimeFormatter)</td>
340
                                   $lowModel.getBrand(),
-
 
341
                                #end
-
 
342
                                </td>
-
 
343
                            </tr>
242
                            </tr>
-
 
243
                            #end
-
 
244
                        <tr>
-
 
245
                            <td colspan="2" style="text-align: right;">Total</td>
-
 
246
                            <td>$totalInitialAmount.setScale(2,$ru)</td>
-
 
247
                            <td>$totalPendingAmount.setScale(2,$ru)</td>
-
 
248
                            <td>$totalInterestAccured.setScale(2,$ru)</td>
-
 
249
                            <td>$totalInterestPaid.setScale(2,$ru)</td>
-
 
250
                            <td>-</td>
-
 
251
                            <td>-</td>
-
 
252
                        </tr>
-
 
253
 
-
 
254
 
344
                        </tbody>
255
                        </tbody>
345
                    </table>
256
                    </table>
346
                </div>
257
                </div>
-
 
258
            #end
347
 
259
 
-
 
260
            <div>
-
 
261
                <button class="btn btn-primary agingDataAfterNintyDays" data-fofoid="$fofoId" data-brand="$brand"
-
 
262
                        data-toggle="modal" data-target="#agingItemWiseBrandStock">AgingDataGt90Days
-
 
263
                </button>
348
 
264
 
349
                <div>
-
 
350
                    <h6 class=" yellow p-1 m-0">Brands</h6>
-
 
351
                    <table class="table  table-sm raised">
-
 
352
                        <tbody>
-
 
353
                            <tr>
-
 
354
                                <th class="details">Working Brands</th>
-
 
355
                                
-
 
356
                                
-
 
357
                               <td class="text-success" >  
-
 
358
                                #foreach($brandsDisplay of $brandsDisplays) 
-
 
359
                                    #set($brand = $brandsDisplay.getName())
-
 
360
                                     #if(!$retailerBlockBrands.get($brand)) 
-
 
361
                                      $brand ,
-
 
362
                                     #end
-
 
363
                                #end
-
 
364
                               </td>
-
 
365
                    
-
 
366
                             
-
 
367
                            </tr>
-
 
368
                            <tr>
-
 
369
                                <th class="details">Blocked Brands</th>
-
 
370
                                 <td class="text-danger" >  
-
 
371
                                 #foreach($brandsDisplay of $brandsDisplays) 
-
 
372
                                    #set($brand = $brandsDisplay.getName())
-
 
373
                                     #if($retailerBlockBrands.get($brand)) 
-
 
374
                                      $brand ,
-
 
375
                                     #end
-
 
376
                                #end
-
 
377
                                </td>
-
 
378
                            </tr>
-
 
379
                    
-
 
380
                    </table>
-
 
381
                </div>
-
 
382
            </div>
265
            </div>
-
 
266
            <div id="agingItemWiseBrandStock" class="modal" role="dialog">
-
 
267
                <div class="modal-dialog">
-
 
268
                    <div class="modal-content" style="width:140%">
383
 
269
 
384
        </div>
270
                    </div>
385
 
-
 
386
        <div class="row mt-2">
271
                </div>
387
            <div class="col bg-dark text-left px-3 py-2 border-bottom">
-
 
388
                <h5 class="text-light mb-0">Partner Basic Details</h5>
-
 
389
            </div>
272
            </div>
390
        </div>
273
        </div>
391
        <div class="row mt-2">
274
        <div class="col">
392
            <div class="col">
275
            <div>
-
 
276
                <h6 class=" yellow p-1 m-0">Logistics</h6>
393
                <table class="table table-sm">
277
                <table class="table  table-sm raised">
394
                    <tbody>
278
                    <tbody>
395
                        <tr>
279
                    <tr>
396
                            <th class="details">Partner Code </th>
-
 
397
                            <td class="">$customRetailer.getCode()</td>
-
 
398
                        </tr>
-
 
399
                        <tr>
-
 
400
                            <th class="details">Partner Name</th>
280
                        <th class="details">Order to Billing time</th>
401
                            <td>$customRetailer.getBusinessName()</td>
-
 
402
                        </tr>
-
 
403
                        <tr>
-
 
404
                            <th class="details">City</th>
281
                        #if($createdToBillingAverage)
405
                            <td>$customRetailer.getAddress().getCity()</td>
-
 
406
                        </tr>
-
 
407
                        <tr>
-
 
408
                            <th class="details">State</th>
282
                            #if($createdToBillingAverage < 1)
409
                            <td>$customRetailer.getAddress().getState()</td>
-
 
410
                        </tr>
-
 
411
                        <tr>
-
 
412
                            <th class="details">Current Category</th>
283
                                <td class="text-success"> Normal < 1 ($decimalFormatter.format($createdToBillingAverage)
413
                            <td>$partnerType.getValue()</td>
-
 
414
                        </tr>
284
                                    days)
415
                   
-
 
416
                    </tbody>
-
 
417
                </table>
-
 
418
            </div>
-
 
419
 
-
 
420
            <div class="col">
-
 
421
                <table class="table table-sm">
-
 
422
                    <tbody>
-
 
423
                    
-
 
424
                        <tr>
-
 
425
                            <th class="details">Contact Person</th>
-
 
426
                            <td>#if($customRetailer.getFirstName())$customRetailer.getFirstName() #end #if($customRetailer.getLastName()) $customRetailer.getLastName() #end</td>
-
 
427
                        </tr>
285
                                </td>
428
                        <tr>
-
 
429
                            <th class="details">Partner DOB </th>
-
 
430
                            
-
 
431
                            #if($partnerOnboardingPanel.getDob())
-
 
432
                            <td>$partnerOnboardingPanel.getDob().format($dateFormatter)</td>
-
 
433
                            #else
286
                            #else
-
 
287
                                <td class="text-danger"> High >= 1
-
 
288
                                    ($decimalFormatter.format($createdToBillingAverage) days)
434
                             <td> - </td>
289
                                </td>
435
                            #end
290
                            #end
-
 
291
                        #else
-
 
292
                            <td>-</td>
-
 
293
                        #end
-
 
294
 
436
                        </tr>
295
                    </tr>
437
                        <tr>
296
                    <tr>
438
                            <th class="details">Partner Anniv</th>
297
                        <th class="details">Billing to Delivery time</th>
439
                                  
298
                        #if($billingToDeliverAverage)
-
 
299
 
440
                            #if($partnerOnboardingPanel.getAnniversaryDate())
300
                            #if($billingToDeliverAverage < 2)
-
 
301
                                <td class="text-success"> Normal < 2
441
                            <td>$partnerOnboardingPanel.getAnniversaryDate().format($dateFormatter)</td>
302
                                    ($decimalFormatter.format($billingToDeliverAverage) days)
-
 
303
                                </td>
442
                            #else
304
                            #else
-
 
305
                                <td class="text-danger"> High >= 2
-
 
306
                                    ($decimalFormatter.format($billingToDeliverAverage) days)
443
                             <td> - </td>
307
                                </td>
444
                            #end
308
                            #end
445
                        </tr>
309
                        #else
446
                        <tr>
-
 
447
                            <th class="details">Latitude</th>
-
 
448
                            <td>$fofoStore.getLatitude()</td>
-
 
449
                        </tr>
310
                            <td>-</td>
-
 
311
 
450
                        <tr>
312
                        #end
451
                            <th class="details">Longitude</th>
-
 
452
                            <td>$fofoStore.getLongitude()</td>
-
 
453
                        </tr>
313
                    </tr>
454
              
-
 
455
                    </tbody>
314
                    </tbody>
456
                </table>
315
                </table>
457
            </div>
316
            </div>
458
            
-
 
459
            
317
            <div>
460
                <div class="col">
318
                <h6 class=" yellow p-1 m-0">Stocking</h6>
461
                <table class="table table-sm">
319
                <table class="table  table-sm raised">
462
                    <tbody>
320
                    <tbody>
463
                    
-
 
464
                       
321
                    <tr>
465
                        <tr>
322
                        <th class="details">Stock Level</th>
466
                            <th class="details">Outlet Potential</th>
323
                        #if($oneFourthOfTertiary > $totalStock)
467
                            <td class="currency">$fofoStore.getCounterPotential()</td>
324
                            <td class="text-danger">Low</td>
468
                        </tr>
325
                        #else
469
                    </tbody>
326
                            <td class="text-success"> High</td>
470
                </table>
327
                        #end
471
            </div>
-
 
472
        </div>
-
 
473
 
328
 
474
        <div class="row mt-2">
329
                    </tr>
475
            <div class="col bg-dark text-left px-3 py-2 border-bottom">
330
                    <tr>
476
                <h5 class="text-light mb-0">Logistics</h5>
331
                        <th class="details">Sufficient Stock</th>
477
            </div>
332
                        <td class="text-success">  #foreach($suffientModel in $suffientModels)
478
        </div>
-
 
479
        <div class="row mt-2">
333
                            $suffientModel.getBrand(),
480
            <div class="col">
334
                        #end
-
 
335
 
481
                <table class="table table-sm">
336
                        </td>
482
                    <tbody>
337
                    </tr>
483
                        <tr>
338
                    <tr>
484
                            <th class="details">Last courier sent </th>
339
                        <th class="details">Low Stock</th>
485
                            #if($lastCourierSent)
340
                        <td class="text-danger">
486
                            <td class="">$lastCourierSent.format($dateFormatter)</td>
-
 
487
                            #else
341
                            #foreach($lowModel in $lowModels)
488
                            <td>- </td>
342
                                $lowModel.getBrand(),
489
                            #end
343
                            #end
490
                        </tr>
344
                        </td>
491
                        <tr>
-
 
492
                            <th class="details">Last courier partner</th>
-
 
493
                            #if($lastCourierPartner)
-
 
494
                            <td>$lastCourierPartner</td>
-
 
495
                            #else
-
 
496
                             <td>- </td>
-
 
497
                           #end
-
 
498
                        </tr>
345
                    </tr>
499
                    </tbody>
346
                    </tbody>
500
                </table>
347
                </table>
501
            </div>
348
            </div>
502
 
349
 
-
 
350
 
503
            <div class="col">
351
            <div>
-
 
352
                <h6 class=" yellow p-1 m-0">Brands</h6>
504
                <table class="table table-sm">
353
                <table class="table  table-sm raised">
505
                    <tbody>
354
                    <tbody>
506
                        <tr>
355
                    <tr>
507
                            <th class="details">Order to billing </th>
356
                        <th class="details">Working Brands</th>
-
 
357
 
-
 
358
 
-
 
359
                        <td class="text-success">
508
                            #if($createdToBillingAverage)
360
                            #foreach($brandsDisplay in $brandsDisplays)
509
                            <td>$decimalFormatter.format($createdToBillingAverage) days </td>
361
                                #set($brand = $brandsDisplay.getName())
-
 
362
                                #if(!$retailerBlockBrands.get($brand))
510
                            #else
363
                                    $brand ,
511
                              <td>- </td>
364
                                #end
512
                            #end
365
                            #end
513
                        </tr>
366
                        </td>
-
 
367
 
-
 
368
 
-
 
369
                    </tr>
514
                        <tr>
370
                    <tr>
515
                            <th class="details">Billing to delivery</th>
371
                        <th class="details">Blocked Brands</th>
516
                            #if($billingToDeliverAverage)
372
                        <td class="text-danger">
-
 
373
                            #foreach($brandsDisplay in $brandsDisplays)
517
                            <td>$decimalFormatter.format($billingToDeliverAverage) days </td>
374
                                #set($brand = $brandsDisplay.getName())
-
 
375
                                #if($retailerBlockBrands.get($brand))
518
                            #else
376
                                    $brand ,
519
                             <td> - </td>
377
                                #end
520
                            #end
378
                            #end
521
                        </tr>
379
                        </td>
522
                    </tbody>
380
                    </tr>
-
 
381
 
523
                </table>
382
                </table>
524
            </div>
383
            </div>
525
        </div>
384
        </div>
526
 
385
 
-
 
386
    </div>
-
 
387
 
527
        <div class="row mt-2">
388
    <div class="row mt-2">
528
            <div class="col bg-dark text-left px-3 py-2 border-bottom">
389
        <div class="col bg-dark text-left px-3 py-2 border-bottom">
529
                <h5 class="text-light mb-0">Investment Trend</h5>
390
            <h5 class="text-light mb-0">Partner Basic Details</h5>
530
            </div>
-
 
531
        </div>
391
        </div>
-
 
392
    </div>
532
        <div class="row mt-2">
393
    <div class="row mt-2">
533
            <div class="col">
394
        <div class="col">
-
 
395
            <table class="table table-sm">
-
 
396
                <tbody>
-
 
397
                <tr>
-
 
398
                    <th class="details">Partner Code</th>
-
 
399
                    <td class="">$customRetailer.getCode()</td>
-
 
400
                </tr>
-
 
401
                <tr>
534
                <h6 class=" yellow p-1 text-center">Investment</h6>
402
                    <th class="details">Partner Name</th>
-
 
403
                    <td>$customRetailer.getBusinessName()</td>
-
 
404
                </tr>
-
 
405
                <tr>
-
 
406
                    <th class="details">City</th>
-
 
407
                    <td>$customRetailer.getAddress().getCity()</td>
-
 
408
                </tr>
-
 
409
                <tr>
-
 
410
                    <th class="details">State</th>
-
 
411
                    <td>$customRetailer.getAddress().getState()</td>
-
 
412
                </tr>
-
 
413
                <tr>
-
 
414
                    <th class="details">Current Category</th>
-
 
415
                    <td>$partnerType.getValue()</td>
-
 
416
                </tr>
-
 
417
 
-
 
418
                </tbody>
535
            </div>
419
            </table>
536
        </div>
420
        </div>
537
 
421
 
538
        <div class="row">
422
        <div class="col">
539
            <div class="col">
423
            <table class="table table-sm">
-
 
424
                <tbody>
-
 
425
 
-
 
426
                <tr>
540
                <table class="table table-bordered table-sm">
427
                    <th class="details">Contact Person</th>
-
 
428
                    <td>#if($customRetailer.getFirstName())$customRetailer.getFirstName() #end #if($customRetailer.getLastName()) $customRetailer.getLastName() #end</td>
541
                    <tbody>
429
                </tr>
542
                        <tr>
430
                <tr>
543
                            <th class="details">Wallet Value </th>
431
                    <th class="details">Partner DOB</th>
-
 
432
 
-
 
433
                    #if($partnerOnboardingPanel.getDob())
544
                            <td class="currency">$investment.getWalletAmount()</td>
434
                        <td>$partnerOnboardingPanel.getDob().format($dateFormatter)</td>
-
 
435
                    #else
545
                        </tr>
436
                        <td> -</td>
546
                        
437
                    #end
-
 
438
                </tr>
547
                         <tr>
439
                <tr>
548
                            <th class="details">Agreed Investment </th>
440
                    <th class="details">Partner Anniv</th>
-
 
441
 
-
 
442
                    #if($partnerOnboardingPanel.getAnniversaryDate())
549
                            <td class="currency">$investment.getMinInvestment()</td>
443
                        <td>$partnerOnboardingPanel.getAnniversaryDate().format($dateFormatter)</td>
-
 
444
                    #else
550
                        </tr>
445
                        <td> -</td>
551
                        <tr>
446
                    #end
-
 
447
                </tr>
-
 
448
                <tr>
-
 
449
                    <th class="details">Latitude</th>
-
 
450
                    <td>$fofoStore.getLatitude()</td>
-
 
451
                </tr>
-
 
452
                <tr>
552
                            <th class="details">Current investment</th>
453
                    <th class="details">Longitude</th>
-
 
454
                    <td>$fofoStore.getLongitude()</td>
-
 
455
                </tr>
-
 
456
 
-
 
457
                </tbody>
-
 
458
            </table>
-
 
459
        </div>
-
 
460
 
-
 
461
 
-
 
462
        <div class="col">
-
 
463
            <table class="table table-sm">
-
 
464
                <tbody>
-
 
465
 
-
 
466
 
-
 
467
                <tr>
553
                            <td class="light-red currency">$investment.getTotalInvestment() &nbsp; &nbsp;<span
468
                    <th class="details">Outlet Potential</th>
554
                                    class="font-weight-bold ">$nf.format($investment.getShortPercentage()) %</span> </td>
469
                    <td class="currency">$fofoStore.getCounterPotential()</td>
555
                        </tr>
470
                </tr>
-
 
471
                </tbody>
-
 
472
            </table>
-
 
473
        </div>
-
 
474
    </div>
-
 
475
 
-
 
476
    <div class="row mt-2">
-
 
477
        <div class="col bg-dark text-left px-3 py-2 border-bottom">
-
 
478
            <h5 class="text-light mb-0">Logistics</h5>
-
 
479
        </div>
-
 
480
    </div>
-
 
481
    <div class="row mt-2">
-
 
482
        <div class="col">
-
 
483
            <table class="table table-sm">
-
 
484
                <tbody>
556
                        <tr>
485
                <tr>
557
                            <th class="details">Short / Excess</th>
486
                    <th class="details">Last courier sent</th>
-
 
487
                    #if($lastCourierSent)
558
                            <td class="light-red currency">$investment.getShortInvestment() &nbsp; &nbsp;
488
                        <td class="">$lastCourierSent.format($dateFormatter)</td>
559
                            
489
                    #else
560
                            
490
                        <td>-</td>
561
                            
491
                    #end
-
 
492
                </tr>
-
 
493
                <tr>
-
 
494
                    <th class="details">Last courier partner</th>
-
 
495
                    #if($lastCourierPartner)
562
                             #if($investment.getShortPercentage() <= 0)
496
                        <td>$lastCourierPartner</td>
-
 
497
                    #else
563
                                  <span
498
                        <td>-</td>
-
 
499
                    #end
-
 
500
                </tr>
-
 
501
                </tbody>
-
 
502
            </table>
-
 
503
        </div>
-
 
504
 
-
 
505
        <div class="col">
-
 
506
            <table class="table table-sm">
-
 
507
                <tbody>
-
 
508
                <tr>
564
                                    class="text-success font-weight-bold">OK</span> 
509
                    <th class="details">Order to billing</th>
-
 
510
                    #if($createdToBillingAverage)
-
 
511
                        <td>$decimalFormatter.format($createdToBillingAverage) days</td>
565
                           
512
                    #else
-
 
513
                        <td>-</td>
566
                        
514
                    #end
-
 
515
                </tr>
-
 
516
                <tr>
-
 
517
                    <th class="details">Billing to delivery</th>
-
 
518
                    #if($billingToDeliverAverage)
-
 
519
                        <td>$decimalFormatter.format($billingToDeliverAverage) days</td>
-
 
520
                    #else
567
                                #else
521
                        <td> -</td>
-
 
522
                    #end
-
 
523
                </tr>
-
 
524
                </tbody>
-
 
525
            </table>
-
 
526
        </div>
-
 
527
    </div>
-
 
528
 
-
 
529
    <div class="row mt-2">
-
 
530
        <div class="col bg-dark text-left px-3 py-2 border-bottom">
-
 
531
            <h5 class="text-light mb-0">Investment Trend</h5>
-
 
532
        </div>
-
 
533
    </div>
-
 
534
    <div class="row mt-2">
-
 
535
        <div class="col">
-
 
536
            <h6 class=" yellow p-1 text-center">Investment</h6>
-
 
537
        </div>
-
 
538
    </div>
-
 
539
 
-
 
540
    <div class="row">
-
 
541
        <div class="col">
-
 
542
            <table class="table table-bordered table-sm">
-
 
543
                <tbody>
-
 
544
                <tr>
-
 
545
                    <th class="details">Wallet Value</th>
-
 
546
                    <td class="currency">$investment.getWalletAmount()</td>
-
 
547
                </tr>
-
 
548
 
-
 
549
                <tr>
-
 
550
                    <th class="details">Agreed Investment</th>
-
 
551
                    <td class="currency">$investment.getMinInvestment()</td>
-
 
552
                </tr>
-
 
553
                <tr>
-
 
554
                    <th class="details">Current investment</th>
-
 
555
                    <td class="light-red currency">$investment.getTotalInvestment() &nbsp; &nbsp;<span
-
 
556
                            class="font-weight-bold ">$nf.format($investment.getShortPercentage()) %</span></td>
-
 
557
                </tr>
-
 
558
                <tr>
-
 
559
                    <th class="details">Short / Excess</th>
-
 
560
                    <td class="light-red currency">$investment.getShortInvestment() &nbsp; &nbsp;
-
 
561
 
-
 
562
 
-
 
563
 
-
 
564
                        #if($investment.getShortPercentage() <= 0)
568
                                <span
565
                            <span
569
                                    class="text-danger font-weight-bold">Short</span> 
566
                                    class="text-success font-weight-bold">OK</span>
-
 
567
 
-
 
568
 
570
                           
569
                        #else
571
                                #end   
570
                            <span
-
 
571
                                    class="text-danger font-weight-bold">Short</span>
-
 
572
 
572
                                    
573
                        #end
-
 
574
 
573
                            </td>
575
                    </td>
574
                        </tr>
576
                </tr>
575
                    </tbody>
577
                </tbody>
576
                </table>
578
            </table>
577
            </div>
579
        </div>
578
            <div class="col">
580
        <div class="col">
579
                <table class="table table-bordered table-sm">
581
            <table class="table table-bordered table-sm">
580
                    <thead>
582
                <thead>
581
                        <tr class="orange">
583
                <tr class="orange">
582
                            <th scope="col">Month</th>
584
                    <th scope="col">Month</th>
583
                            <th scope="col">Days</th>
585
                    <th scope="col">Days</th>
584
                        </tr>
586
                </tr>
585
                    </thead>
587
                </thead>
586
                    <tbody>
588
                <tbody>
587
                    #foreach($label of $labels)
589
                    #foreach($label in $labels)
588
                        <tr >
590
                    <tr>
589
                            <td class="details">$label</td>  
591
                        <td class="details">$label</td>
590
                            #if($monthOkDaysInvestmentMap.get($label))
592
                        #if($monthOkDaysInvestmentMap.get($label))
591
                            #if($monthOkDaysInvestmentMap.get($label) > 15)
593
                            #if($monthOkDaysInvestmentMap.get($label) > 15)
592
                            <td class="text-success">$monthOkDaysInvestmentMap.get($label)</td>
594
                                <td class="text-success">$monthOkDaysInvestmentMap.get($label)</td>
593
                            #else
595
                            #else
594
                               <td class="text-danger">$monthOkDaysInvestmentMap.get($label)</td>  
596
                                <td class="text-danger">$monthOkDaysInvestmentMap.get($label)</td>
595
                            #end
597
                            #end
596
                            #else
598
                        #else
597
                            <td>-</td>
599
                            <td>-</td>
598
                            #end
-
 
599
                        </tr>
-
 
600
                        #end
600
                        #end
601
                    </tbody>
601
                    </tr>
602
                </table>
-
 
603
            </div>
-
 
604
            <div class="col-4 mt-2">
-
 
605
                          
602
                    #end
606
              <canvas id="chartInvestmentJSContainer" width="auto" height="auto"></canvas>
-
 
607
                       
603
                </tbody>
608
            </div>
604
            </table>
609
        </div>
605
        </div>
-
 
606
        <div class="col-4 mt-2">
-
 
607
 
-
 
608
            <canvas id="chartInvestmentJSContainer" width="auto" height="auto"></canvas>
610
 
609
 
611
        <div class="row mt-2">
-
 
612
            <div class="col">
-
 
613
                <h6 class=" yellow p-1 text-center">Current Stock</h6>
-
 
614
            </div>
-
 
615
        </div>
610
        </div>
-
 
611
    </div>
-
 
612
 
-
 
613
    <div class="row mt-2">
616
        <div class="row">
614
        <div class="col">
-
 
615
            <h6 class=" yellow p-1 text-center">Current Stock</h6>
-
 
616
        </div>
-
 
617
    </div>
-
 
618
    <div class="row">
617
            <div class="col">
619
        <div class="col">
618
                <table class="table table-bordered table-sm">
620
            <table class="table table-bordered table-sm">
619
                    <thead>
621
                <thead>
620
                        <th scope="row"></th>
622
                <th scope="row"></th>
621
                        <td colspan="2" class="text-center">Current</td>
623
                <td colspan="2" class="text-center">Current</td>
622
                        <td></td>
624
                <td></td>
-
 
625
                <td colspan="2" class="text-center">GRN Pending</td>
623
                        <td colspan="2" class="text-center">Billed + Delivered</td>
626
                <td colspan="2" class="text-center">Pending Indent</td>
624
                    </thead>
627
                </thead>
625
                    <thead>
628
                <thead>
626
                        <tr class="orange">
629
                <tr class="orange">
627
                            <th scope="col">Brand</th>
630
                    <th scope="col">Brand</th>
628
                            <th scope="col">Value</th>
631
                    <th scope="col">Value</th>
629
                            <th scope="col">Units</th>
632
                    <th scope="col">Units</th>
630
                            <th scope="col">Brand status</th>
633
                    <th scope="col">Brand status</th>
631
                            <th scope="col">Value</th>
634
                    <th scope="col">Value</th>
632
                            <th scope="col">Units</th>
635
                    <th scope="col">Units</th>
633
                           
636
                    <th scope="col">Value</th>
634
                        </tr>
637
                    <th scope="col">Units</th>
-
 
638
 
635
                    </thead>
639
                </tr>
636
                    <tbody>
640
                </thead>
637
                    
641
                <tbody>
-
 
642
 
638
                     #foreach($brandsDisplay of $brandsDisplays) 
643
                    #foreach($brandsDisplay in $brandsDisplays)
639
                     #set($brand = $brandsDisplay.getName())
644
                        #set($brand = $brandsDisplay.getName())
640
                        <tr>
645
                    <tr>
641
                            <td class="details">$brand</td>
646
                        <td class="details">$brand</td>
642
                            #if($brandStockMap.get($brand))
647
                        #if($brandStockMap.get($brand))
643
                            <td class="currency $brandStockMap.get($brand).getColor()">$brandStockMap.get($brand).getTotalValue()</td>
648
                            <td class="currency $brandStockMap.get($brand).getColor()">$brandStockMap.get($brand).getTotalValue()</td>
644
                            <td>$brandStockMap.get($brand).getTotalQty()</td>
649
                            <td>$brandStockMap.get($brand).getTotalQty()</td>
645
                            #else
650
                        #else
646
                            <td class="$brandStockMap.get($brand).getColor()">0</td>
651
                            <td class="$brandStockMap.get($brand).getColor()">0</td>
647
                            <td>0</td>
652
                            <td>0</td>
648
                        
-
 
-
 
653
 
649
                            #end
654
                        #end
650
                            #if($retailerBlockBrands.get($brand))
655
                        #if($retailerBlockBrands.get($brand))
651
                            <td>Blocked</td>
656
                            <td>Blocked</td>
652
                            #else
657
                        #else
653
                            <td>ACTIVE</td>
658
                            <td>ACTIVE</td>
654
                            #end
659
                        #end
655
                            #if($grnPendingValue.get($brand))
660
                        #if($grnPendingValue.get($brand))
656
                            <td class= "currency">$grnPendingValue.get($brand)</td>
661
                            <td class="currency">$grnPendingValue.get($brand)</td>
657
                            <td>$grnPendingQty.get($brand)</td>
662
                            <td>$grnPendingQty.get($brand)</td>
658
                            #else
663
                        #else
659
                            <td>0</td>
664
                            <td>0</td>
660
                            <td>0</td>
665
                            <td>0</td>
661
                         
-
 
662
                            #end
-
 
663
 
666
 
664
                        </tr>
667
                        #end
-
 
668
                        #if($processingOrderMap.get($brand))
-
 
669
                            <td class="currency">$processingOrderMap.get($brand).get("val")</td>
-
 
670
                            <td class="currency">$processingOrderMap.get($brand).get("qty")</td>
-
 
671
 
665
                        
672
                        #else
-
 
673
                            <td>0</td>
-
 
674
                            <td>0</td>
666
                       #end
675
                        #end
-
 
676
 
-
 
677
                    </tr>
-
 
678
 
667
                       
679
                    #end
-
 
680
 
668
                       <tr>
681
                <tr>
669
                       <td> Total </td>
682
                    <td> Total</td>
670
                          <td class = "currency"> $totalStock</td>
683
                    <td class="currency"> $totalStock</td>
671
                             <td>$totalQty </td>
684
                    <td>$totalQty </td>
672
                                <td> </td>
685
                    <td></td>
673
                                 
-
 
-
 
686
 
674
                                 #if($totalGrnPendingStock)
687
                    #if($totalGrnPendingStock)
675
                                   <td class = "currency"> $totalGrnPendingStock</td>
688
                        <td class="currency"> $totalGrnPendingStock</td>
676
                                  #else
689
                    #else
677
                                   <td> </td>
690
                        <td></td>
678
                                 #end
691
                    #end
-
 
692
 
679
                                 
693
                    #if($totalGrnPendingQty)
680
                                 #if($$totalGrnPendingQty)
694
                        <td> $totalGrnPendingQty</td>
-
 
695
                    #else
681
                                      <td> $totalGrnPendingQty</td>
696
                        <td></td>
682
                                 #else
697
                    #end
683
                                    <td> </td>
698
                    #if($totalGrnPendingQty)
-
 
699
                        <td class="currency"> $totalPIValue</td>
684
                                 #end
700
                        <td> $totalPIQty</td>
685
                       
701
                    #else
-
 
702
                        <td></td>
686
                       </tr>
703
                        <td></td>
687
                 
704
                    #end
-
 
705
 
688
                    </tbody>
706
                </tr>
-
 
707
 
689
                </table>
708
                </tbody>
690
            </div>
709
            </table>
691
        </div>
710
        </div>
-
 
711
    </div>
692
 
712
 
693
        <div class="row">
713
    <div class="row">
694
            <div class="col bg-dark text-left px-3 py-2 border-bottom">
714
        <div class="col bg-dark text-left px-3 py-2 border-bottom">
695
                <h5 class="text-light mb-0">Sales & Income Trend</h5>
715
            <h5 class="text-light mb-0">Sales & Income Trend</h5>
696
            </div>
-
 
697
        </div>
716
        </div>
-
 
717
    </div>
698
 
718
 
699
        <div class="row mt-2">
719
    <div class="row mt-2">
700
            <div class="col">
720
        <div class="col">
701
                <ul class="nav nav-tabs" role="tablist">
721
            <ul class="nav nav-tabs" role="tablist">
702
                    <li class="nav-item">
722
                <li class="nav-item">
703
                        <a class="nav-link active" data-toggle="tab" href="#secondary">Secondary</a>
723
                    <a class="nav-link active" data-toggle="tab" href="#secondary">Secondary</a>
704
                    </li>
724
                </li>
705
                    <li class="nav-item">
725
                <li class="nav-item">
706
                        <a class="nav-link" data-toggle="tab" href="#tertiary">Tertiary</a>
726
                    <a class="nav-link" data-toggle="tab" href="#tertiary">Tertiary</a>
707
                    </li>
727
                </li>
708
                    <li class="nav-item">
728
                <li class="nav-item">
709
                        <a class="nav-link" data-toggle="tab" href="#earning">Earning</a>
729
                    <a class="nav-link" data-toggle="tab" href="#earning">Earning</a>
710
                    </li>
730
                </li>
711
                </ul>
731
            </ul>
712
 
732
 
713
                <!-- Tab panes -->
733
            <!-- Tab panes -->
714
                <div class="tab-content">
734
            <div class="tab-content">
715
 
735
 
716
                    <div id="secondary" class="container-fluid tab-pane active"><br>
736
                <div id="secondary" class="container-fluid tab-pane active"><br>
717
                        <div class="row">
737
                    <div class="row">
718
                            <div class="col-6">
738
                        <div class="col-6">
719
                                <div class="p-2 text-center">#if($lastPurchaseDays < 5)
739
                            <div class="p-2 text-center">#if($lastPurchaseDays < 5)
720
                                 <span class="text-success">Last Secondary:  $lastPurchaseDays days back </span>
740
                                <span class="text-success">Last Secondary:  $lastPurchaseDays days back </span>
721
                                #else                              
741
                            #else
722
                                <span class="text-danger">Last Secondary: $lastPurchaseDays days back </span>                               
742
                                <span class="text-danger">Last Secondary: $lastPurchaseDays days back </span>
723
                                #end
743
                            #end
724
                                </div>
744
                            </div>
725
                          
-
 
-
 
745
 
726
                                <table id = "partnerSecondary" class="table table-bordered table-sm">
746
                            <table id="partnerSecondary" class="table table-bordered table-sm">
727
                                    <thead>
747
                                <thead>
728
                                        <tr class="orange">
748
                                <tr class="orange">
729
                                            <th scope="col">Month</th>
749
                                    <th scope="col">Month</th>
730
                                             #foreach($label of $labels) 
750
                                    #foreach($label in $labels)
731
                                            <th scope="col">$label</th>
751
                                        <th scope="col">$label</th>
732
                                             #end
752
                                    #end
733
                                        </tr>
753
                                </tr>
734
                                    </thead>
754
                                </thead>
735
                                    <tbody>
755
                                <tbody>
736
                                    
-
 
737
                                        #foreach($allBrand of $allBrands) 
756
                                    #foreach($allBrand in $allBrands)
738
                                           #set($brand = $allBrand.getName())
757
                                        #set($brand = $allBrand.getName())
739
                                       #set($purchase = $purchaseMap.get($brand))
758
                                        #set($purchase = $purchaseMap.get($brand))
740
                                        <tr>
759
                                    <tr>
741
                                     
-
 
742
                                            <td  class="details brandFocusedStock" data-fofoid="$fofoId" data-brand="$brand"
760
                                        <td class="details brandFocusedStock" data-fofoid="$fofoId" data-brand="$brand"
743
                                                          data-toggle="modal" data-target="#itemWiseBrandStock">$brand</td>
761
                                            data-toggle="modal" data-target="#itemWiseBrandStock">$brand</td>
744
                                     
-
 
745
                                            
-
 
-
 
762
 
746
                                             #foreach($label of $labels) 
763
                                        #foreach($label in $labels)
747
                                               #if($brand.equals("Samsung"))
764
                                            #if($brand.equals("Samsung"))
748
                                                #if($purchase.get($label))
765
                                                #if($purchase.get($label))
749
                                                #if($purchase.get($label) >= 150000)
766
                                                    #if($purchase.get($label) >= 150000)
-
 
767
                                                        <td class="currency green " data-brand="$brand"
-
 
768
                                                            data-month="$label">$purchase.get($label)</td>
-
 
769
                                                    #else
-
 
770
                                                        <td class="currency red " data-brand="$brand"
750
                                                  <td class="currency green">$purchase.get($label)</td>
771
                                                            data-month="$label">$purchase.get($label)</td>
751
                                                 
772
                                                    #end
752
                                                #else
773
                                                #else
753
                                                  <td class="currency red">$purchase.get($label)</td>
774
                                                    <td data-brand="$brand"
-
 
775
                                                        data-month="$label">0
-
 
776
                                                    </td>
754
                                                #end
777
                                                #end
755
                                                #else
-
 
756
                                                  <td class="currency red">0</td> 
-
 
757
                                               #end
-
 
758
                                               
-
 
759
                                             #end
778
                                            #end
760
                                             
-
 
-
 
779
 
761
                                               #if($brand.equals("Xiaomi"))
780
                                            #if($brand.equals("Xiaomi"))
762
                                                #if($purchase.get($label))
781
                                                #if($purchase.get($label))
763
                                                #if($purchase.get($label) >= 100000)
782
                                                    #if($purchase.get($label) >= 100000)
-
 
783
                                                        <td class="currency green " data-brand="$brand"
-
 
784
                                                            data-month="$label">$purchase.get($label)</td>
-
 
785
                                                    #else
-
 
786
                                                        <td class="currency red " data-brand="$brand"
764
                                                  <td class="currency green">$purchase.get($label)</td>
787
                                                            data-month="$label">$purchase.get($label)</td>
-
 
788
                                                    #end
765
                                                #else
789
                                                #else
766
                                                  <td class="currency red">$purchase.get($label)</td>
790
                                                    <td data-brand="$brand"
-
 
791
                                                        data-month="$label">0
-
 
792
                                                    </td>
767
                                                #end
793
                                                #end
768
                                                #else
-
 
769
                                             <td>0 </td> 
-
 
770
                                               #end
-
 
771
                                               
-
 
772
                                             #end
794
                                            #end
773
                                             
-
 
-
 
795
 
774
                                                #if($brand.equals("Oppo") || $brand.equals("Vivo") )
796
                                            #if($brand.equals("Oppo") || $brand.equals("Vivo"))
775
                                                #if($purchase.get($label))
797
                                                #if($purchase.get($label))
776
                                                #if($purchase.get($label) >= 200000)
798
                                                    #if($purchase.get($label) >= 200000)
-
 
799
                                                        <td class="currency green " data-brand="$brand"
-
 
800
                                                            data-month="$label">$purchase.get($label)</td>
-
 
801
                                                    #else
-
 
802
                                                        <td class="currency red " data-brand="$brand"
777
                                                  <td class="currency green">$purchase.get($label)</td>
803
                                                            data-month="$label">$purchase.get($label)</td>
-
 
804
                                                    #end
778
                                                #else
805
                                                #else
779
                                                  <td class="currency red">$purchase.get($label)</td>
806
                                                    <td data-brand="$brand"
-
 
807
                                                        data-month="$label">0
-
 
808
                                                    </td>
780
                                                #end
809
                                                #end
781
                                                #else
-
 
782
                                             <td>0 </td> 
-
 
783
                                               #end
810
                                            #end
784
                                               
-
 
-
 
811
 
785
                                             #end
812
                                            #if(!$brand.equals("Oppo") && !$brand.equals("Vivo") && !$brand.equals(
786
                                             
-
 
787
                                              #if(!$brand.equals("Oppo") && !$brand.equals("Vivo") && !$brand.equals("Xiaomi") && !$brand.equals("Samsung") )
813
                                                "Xiaomi") && !$brand.equals("Samsung"))
788
                                                #if($purchase.get($label))
814
                                                #if($purchase.get($label))
789
                                            
815
                                                    <td class="currency " data-brand="$brand"
790
                                                  <td class= "currency">$purchase.get($label)</td>
816
                                                        data-month="$label">$purchase.get($label)</td>
791
                                                
-
 
792
                                                #else
817
                                                #else
793
                                                   <td>0 </td> 
818
                                                    <td data-brand="$brand"
794
                                               #end
819
                                                        data-month="$label">0
795
                                               #end
820
                                                    </td>
796
                                         
-
 
797
                                           
-
 
798
                                            
821
                                                #end
799
                                            #end
822
                                            #end
-
 
823
                                        #end
-
 
824
                                    </tr>
-
 
825
                                    #end
800
 
826
 
801
                                        </tr>
-
 
802
                                        
-
 
803
                                         #end
-
 
804
                                       
-
 
805
                                        
-
 
806
                           
-
 
807
                                      
-
 
808
                                        <tr class="font-weight-bold">
827
                                <tr class="font-weight-bold">
809
                                         <td class="details">Total</td>
828
                                    <td class="details">Total</td>
810
                                           #foreach($label of $labels) 
829
                                    #foreach($label in $labels)
811
                                           #if($yearMonthPurchase.get($label)) 
830
                                        #if($yearMonthPurchase.get($label))
812
                                          
-
 
813
                                            <td class= "currency">$yearMonthPurchase.get($label)</td>
831
                                            <td class="currency">$yearMonthPurchase.get($label)</td>
814
                                            #else
832
                                        #else
815
                                            <td> 0 </td>
833
                                            <td>0</td>
816
                                            #end
-
 
817
                                            #end
834
                                        #end
818
                                       
835
                                    #end
819
                                        </tr>
836
                                </tr>
820
                                        <tr>
-
 
-
 
837
 
821
                                       
838
                                <tr>
822
                                            <td class="details">Target</td>
839
                                    <td class="details">Target</td>
823
                                            
-
 
824
                                            #foreach($label of $labels) 
840
                                    #foreach($label in $labels)
825
                                            #if($monthlyTarget.get($label).getPurchaseTarget()) 
841
                                        #if($monthlyTarget.get($label).getPurchaseTarget())
826
                                            <td class="currency">$monthlyTarget.get($label).getPurchaseTarget()</td>
842
                                            <td class="currency">$monthlyTarget.get($label).getPurchaseTarget()</td>
-
 
843
                                        #else
-
 
844
                                            <td>0</td>
-
 
845
                                        #end
-
 
846
                                    #end
-
 
847
                                </tr>
-
 
848
 
-
 
849
                                <tr>
-
 
850
                                    <td class="details">% achvmt</td>
-
 
851
                                    #foreach($label in $labels)
-
 
852
                                        #if($yearMonthPurchase.get($label))
-
 
853
                                            #set($ymp = $yearMonthPurchase.get($label))
-
 
854
                                        #else
-
 
855
                                            #set($ymp = 0)
-
 
856
                                        #end
-
 
857
 
-
 
858
                                        #if($monthlyTarget.get($label).getPurchaseTarget())
-
 
859
                                            #set($mt = $monthlyTarget.get($label).getPurchaseTarget())
-
 
860
                                        #else
-
 
861
                                            #set($mt = 0)
-
 
862
                                        #end
-
 
863
 
-
 
864
                                        #set($div = ($ymp / $mt) * 100)
-
 
865
                                        #if($div)
-
 
866
                                            #if($div > 65)
-
 
867
                                                <td class="text-success">$math.roundTo(2, $div)%</td>
827
                                            #else
868
                                            #else
828
                                             <td>0</td>
869
                                                <td class="text-danger">$math.roundTo(2, $div)%</td>
829
                                            #end
-
 
830
                                          
-
 
831
                                            #end
870
                                            #end
-
 
871
                                        #else
-
 
872
                                            <td class="text-danger">-</td>
-
 
873
                                        #end
-
 
874
                                    #end
-
 
875
                                </tr>
-
 
876
                                </tbody>
-
 
877
                            </table>
-
 
878
                        </div>
-
 
879
                        <div id="rightTable" style="display: none;">
-
 
880
                            <h3 class="ms-10">Item wise sale quantity</h3>
-
 
881
                            <table class="table table-bordered table-sm  ps-5 ms-10">
-
 
882
                                <thead>
-
 
883
                                <tr>
-
 
884
 
-
 
885
                                    <th>Model</th>
-
 
886
                                    <th>Quantity</th>
-
 
887
                                </tr>
-
 
888
                                </thead>
-
 
889
                                <tbody id="rightTableBody">
-
 
890
                                </tbody>
-
 
891
                            </table>
-
 
892
                        </div>
-
 
893
                        <div class="col-6 mt-2">
832
 
894
 
833
                                        </tr>
-
 
834
                                        <tr>
-
 
835
                                         <td class="details">% achvmt</td>
-
 
836
                                              
-
 
837
                                          #foreach($label of $labels) 
-
 
838
                                           #if($yearMonthPurchase.get($label)) 
-
 
839
                                           #set($ymp = $yearMonthPurchase.get($label))
-
 
840
                                           #else
-
 
841
                                           #set($ymp = 0)
-
 
842
                                           #end
-
 
843
                                        	    
-
 
844
                                           #if($monthlyTarget.get($label).getPurchaseTarget()) 
-
 
-
 
895
 
845
                                           #set($mt = $monthlyTarget.get($label).getPurchaseTarget())
-
 
846
                                           #else
-
 
847
                                           #set($mt= 0 )
-
 
848
                                           #end
-
 
849
	                                       #set($div=  ($ymp/ $mt)* 100)
-
 
850
	                                       #if($div)
-
 
851
	                                       #if($div > 65)
-
 
852
	                                       <td class="text-success">$math.roundTo(2, $div)%</td>
-
 
853
	                                       #else
-
 
854
	                                       <td class="text-danger"> $math.roundTo(2, $div)%</td>
896
                            <canvas id="chartSecondaryJSContainer" width="auto" height="auto"></canvas>
-
 
897
 
855
	                                      #end
898
                        </div>
856
	                                      #else
-
 
-
 
899
 
-
 
900
 
857
	                                        <td class="text-danger">-</td>
901
                        <div id="itemWiseBrandStock" class="modal" role="dialog">
858
	                                      #end
-
 
859
                                           
-
 
860
                                       #end
-
 
861
                                            
-
 
862
                                          
-
 
863
                                        
-
 
864
                                        </tr>
-
 
865
                                    </tbody>
902
                            <div class="modal-dialog">
866
                                </table>
-
 
867
                            </div>
-
 
868
                            <div class="col-6 mt-2">
903
                                <div class="modal-content" style="width:140%">
869
                          
-
 
-
 
904
 
870
                                
905
                                </div>
871
                                  <canvas id="chartSecondaryJSContainer" width="auto" height="auto"></canvas>
-
 
872
            
-
 
873
                            </div>
906
                            </div>
874
                            
-
 
875
                                   
-
 
876
                                 <div id="itemWiseBrandStock" class="modal" role="dialog">
-
 
877
                                         <div class="modal-dialog">
-
 
878
                                         <div class="modal-content" style="width:140%">
-
 
879
 
-
 
880
                                         </div>
-
 
881
                                       </div>
-
 
882
                                 </div>   
-
 
883
                        </div>
907
                        </div>
884
                       
-
 
885
                    </div>
908
                    </div>
886
 
909
 
-
 
910
                </div>
887
 
911
 
888
 
912
 
889
                    <div id="tertiary" class="container-fluid tab-pane fade"><br>
913
                <div id="tertiary" class="container-fluid tab-pane fade"><br>
890
                        <div class="row">
914
                    <div class="row">
891
                            <div class="col-6">
915
                        <div class="col-6">
892
                               <div class="p-2  text-center">      
916
                            <div class="p-2  text-center">
893
                                #if($lastTertiaryDays < 5)
917
                                #if($lastTertiaryDays < 5)
894
                                <span class="text-success">Last tertiary: $lastTertiaryDays days back </span>                               
918
                                    <span class="text-success">Last tertiary: $lastTertiaryDays days back </span>
895
                                #else                               
919
                                #else
896
                                <span class="text-danger">Last tertiary: $lastTertiaryDays days back </span>              
920
                                    <span class="text-danger">Last tertiary: $lastTertiaryDays days back </span>
897
                                #end
921
                                #end
898
                                
-
 
-
 
922
 
899
                                 #if($lastUnbilledActivated > 0)
923
                                #if($lastUnbilledActivated > 0)
900
                                  <td class="text-danger">Unbilled Activated : $investment.getUnbilledAmount()</td>
924
                                    <td class="text-danger">Unbilled Activated : $investment.getUnbilledAmount()</td>
901
                              
-
 
902
                               
-
 
-
 
925
 
-
 
926
 
903
                                #else
927
                                #else
904
                                
-
 
-
 
928
 
905
                                  <td class="text-success"> Unbilled Activated : 0 </td>
929
                                    <td class="text-success"> Unbilled Activated : 0</td>
906
                                #end
930
                                #end
907
                               </div>
931
                            </div>
908
                                <table class="table table-bordered table-sm">
932
                            <table class="table table-bordered table-sm">
909
                                    <thead>
933
                                <thead>
910
                                        <tr class="orange">
934
                                <tr class="orange">
911
                                            <th scope="col">Month</th>
935
                                    <th scope="col">Month</th>
912
                                             #foreach($label of $labels) 
936
                                    #foreach($label in $labels)
913
                                            <th scope="col">$label</th>
937
                                        <th scope="col">$label</th>
914
                                             #end
938
                                    #end
915
                                        </tr>
939
                                </tr>
916
                                    </thead>
940
                                </thead>
917
                                    <tbody>
941
                                <tbody>
918
                                        #foreach($allBrand of $allBrands) 
942
                                    #foreach($allBrand in $allBrands)
919
                                           #set($brand = $allBrand.getName())
943
                                        #set($brand = $allBrand.getName())
920
                                             #set($tertiary= $tertiaryMap.get($brand))
944
                                        #set($tertiary= $tertiaryMap.get($brand))
921
                                        <tr>
945
                                    <tr>
922
                                     
-
 
-
 
946
 
923
                                            <td class="details">$brand</td>
947
                                        <td class="details">$brand</td>
924
                                             #foreach($label of $labels) 
948
                                        #foreach($label in $labels)
925
                                              #if($brand.equals("Samsung"))
949
                                            #if($brand.equals("Samsung"))
926
                                                #if($tertiary.get($label))
950
                                                #if($tertiary.get($label))
927
                                                #if($tertiary.get($label) >= 150000)
951
                                                    #if($tertiary.get($label) >= 150000)
928
                                                  <td class="currency green">$tertiary.get($label)</td>
952
                                                        <td class="currency green">$tertiary.get($label)</td>
-
 
953
                                                    #else
-
 
954
                                                        <td class="currency red">$tertiary.get($label)</td>
-
 
955
                                                    #end
929
                                                #else
956
                                                #else
930
                                                  <td class="currency red">$tertiary.get($label)</td>
957
                                                    <td>0</td>
931
                                                #end
958
                                                #end
932
                                                #else
-
 
933
                                             <td>0 </td> 
-
 
934
                                               #end
-
 
935
                                               
-
 
-
 
959
 
936
                                             #end
960
                                            #end
937
                                             
-
 
-
 
961
 
938
                                               #if($brand.equals("Xiaomi"))
962
                                            #if($brand.equals("Xiaomi"))
939
                                                #if($tertiary.get($label))
963
                                                #if($tertiary.get($label))
940
                                                #if($tertiary.get($label) >= 100000)
964
                                                    #if($tertiary.get($label) >= 100000)
941
                                                  <td class="currency green">$tertiary.get($label)</td>
965
                                                        <td class="currency green">$tertiary.get($label)</td>
-
 
966
                                                    #else
-
 
967
                                                        <td class="currency red">$tertiary.get($label)</td>
-
 
968
                                                    #end
942
                                                #else
969
                                                #else
943
                                                  <td class="currency red">$tertiary.get($label)</td>
970
                                                    <td>0</td>
944
                                                #end
971
                                                #end
945
                                                #else
-
 
946
                                             <td>0 </td> 
-
 
947
                                               #end
-
 
948
                                               
-
 
-
 
972
 
949
                                             #end
973
                                            #end
950
                                             
-
 
-
 
974
 
951
                                                #if($brand.equals("Oppo") || $brand.equals("Vivo") )
975
                                            #if($brand.equals("Oppo") || $brand.equals("Vivo") )
952
                                                #if($tertiary.get($label))
976
                                                #if($tertiary.get($label))
953
                                                #if($tertiary.get($label) >= 200000)
977
                                                    #if($tertiary.get($label) >= 200000)
954
                                                  <td class="currency green">$tertiary.get($label)</td>
978
                                                        <td class="currency green">$tertiary.get($label)</td>
-
 
979
                                                    #else
-
 
980
                                                        <td class="currency red">$tertiary.get($label)</td>
-
 
981
                                                    #end
955
                                                #else
982
                                                #else
956
                                                  <td class="currency red">$tertiary.get($label)</td>
983
                                                    <td>0</td>
957
                                                #end
984
                                                #end
958
                                                #else
-
 
959
                                             <td>0 </td> 
-
 
960
                                               #end
-
 
961
                                               
-
 
-
 
985
 
962
                                             #end
986
                                            #end
963
                                             
-
 
-
 
987
 
964
                                                #if(!$brand.equals("Oppo") && !$brand.equals("Vivo") && !$brand.equals("Xiaomi") && !$brand.equals("Samsung") )
988
                                            #if(!$brand.equals("Oppo") && !$brand.equals("Vivo") && !$brand.equals(
965
                                        
989
                                                "Xiaomi") && !$brand.equals("Samsung") )
-
 
990
 
966
                                                #if($tertiary.get($label))
991
                                                #if($tertiary.get($label))
967
                                            
-
 
-
 
992
 
968
                                                  <td class= "currency">$tertiary.get($label) </td>
993
                                                    <td class="currency">$tertiary.get($label) </td>
969
                                                
-
 
-
 
994
 
970
                                                #else
995
                                                #else
971
                                                   <td>0</td> 
996
                                                    <td>0</td>
972
                                               #end
-
 
973
                                         
-
 
974
                                               #end
997
                                                #end
975
                                           
-
 
976
                                            
-
 
-
 
998
 
977
                                            #end
999
                                            #end
978
 
1000
 
-
 
1001
 
979
                                        </tr>
1002
                                        #end
-
 
1003
 
980
                                        
1004
                                    </tr>
-
 
1005
 
981
                                         #end
1006
                                    #end
982
                
1007
 
983
                                        <tr class="font-weight-bold">
1008
                                <tr class="font-weight-bold">
984
                                            <td class="details">Total</td>
1009
                                    <td class="details">Total</td>
985
                                            #foreach($label of $labels) 
1010
                                    #foreach($label in $labels)
986
                                           #if($yearMonthTertiary.get($label)) 
1011
                                        #if($yearMonthTertiary.get($label))
987
                                          
-
 
-
 
1012
 
988
                                            <td class="currency">$yearMonthTertiary.get($label)</td>
1013
                                            <td class="currency">$yearMonthTertiary.get($label)</td>
989
                                            #else
1014
                                        #else
990
                                            <td> 0 </td>
1015
                                            <td> 0</td>
991
                                            #end
1016
                                        #end
992
                                            #end
1017
                                    #end
-
 
1018
 
-
 
1019
                                </tr>
-
 
1020
 
-
 
1021
 
-
 
1022
                                <tr class="font-weight-bold">
-
 
1023
                                    <td class="details"></td>
-
 
1024
                                    #foreach($label in $labels)
-
 
1025
                                        #if($yearMonthPartnerType.get($label))
993
 
1026
 
994
                                        </tr>
-
 
995
                                        
-
 
996
                                        
-
 
997
                                        
-
 
998
                                          <tr class="font-weight-bold">
-
 
999
                                            <td class="details"></td>
-
 
1000
                                            #foreach($label of $labels) 
-
 
1001
                                           #if($yearMonthPartnerType.get($label)) 
-
 
1002
                                          
-
 
1003
                                            <td>$yearMonthPartnerType.get($label).getValue()</td>
1027
                                            <td>$yearMonthPartnerType.get($label).getValue()</td>
1004
                                            #else
1028
                                        #else
1005
                                            <td> - </td>
1029
                                            <td> -</td>
1006
                                            #end
1030
                                        #end
1007
                                            #end
1031
                                    #end
1008
 
1032
 
1009
                                        </tr>
1033
                                </tr>
1010
                                        <tr>
1034
                                <tr>
1011
                                            <td class="details">Target</td>
1035
                                    <td class="details">Target</td>
1012
                                            #foreach($label of $labels)
1036
                                    #foreach($label in $labels)
1013
                                            #if($monthlyTarget.get($label).getSaleTarget()) 
1037
                                        #if($monthlyTarget.get($label).getSaleTarget())
1014
                                            <td class="currency"> $monthlyTarget.get($label).getSaleTarget()</td>
1038
                                            <td class="currency"> $monthlyTarget.get($label).getSaleTarget()</td>
1015
                                            #else
1039
                                        #else
1016
                                            <td>0</td>
1040
                                            <td>0</td>
-
 
1041
                                        #end
-
 
1042
 
-
 
1043
                                    #end
-
 
1044
 
-
 
1045
                                </tr>
-
 
1046
                                <tr>
-
 
1047
                                    <td class="details">% achvmt</td>
-
 
1048
 
-
 
1049
 
-
 
1050
 
-
 
1051
                                    #foreach($label in $labels)
-
 
1052
                                        #if($yearMonthTertiary.get($label))
-
 
1053
                                            #set($ymt = $yearMonthTertiary.get($label))
-
 
1054
                                        #else
-
 
1055
                                            #set($ymt = 0)
-
 
1056
                                        #end
-
 
1057
 
-
 
1058
                                        #if($monthlyTarget.get($label).getSaleTarget())
-
 
1059
                                            #set($mst = $monthlyTarget.get($label).getSaleTarget())
-
 
1060
                                        #else
-
 
1061
                                            #set($mst= 0 )
-
 
1062
                                        #end
-
 
1063
                                        #set($dit=  ($ymt/ $mst)* 100)
-
 
1064
                                        #if($dit)
-
 
1065
                                            #if($dit >65)
-
 
1066
                                                <td class="text-success">$math.roundTo(2, $dit)%</td>
-
 
1067
                                            #else
-
 
1068
                                                <td class="text-danger">$math.roundTo(2, $dit)%</td>
1017
                                            #end
1069
                                            #end
1018
                                          
1070
                                        #else
-
 
1071
                                            <td class="text-danger">-</td>
1019
                                            #end
1072
                                        #end
1020
 
1073
 
1021
                                        </tr>
-
 
1022
                                        <tr>
1074
                                    #end
1023
                                            <td class="details">% achvmt</td>
-
 
1024
                                
1075
                                </tr>
1025
                                            
1076
                                </tbody>
1026
                                                       
-
 
1027
                                          #foreach($label of $labels) 
-
 
1028
                                           #if($yearMonthTertiary.get($label)) 
-
 
1029
                                           #set($ymt = $yearMonthTertiary.get($label))
-
 
1030
                                           #else
-
 
1031
                                           #set($ymt = 0)
-
 
1032
                                           #end
1077
                            </table>
-
 
1078
 
1033
                                        	    
1079
                        </div>
1034
                                           #if($monthlyTarget.get($label).getSaleTarget()) 
-
 
1035
                                           #set($mst = $monthlyTarget.get($label).getSaleTarget())
-
 
1036
                                           #else
1080
                        <div class="col-6 mt-2">
1037
                                           #set($mst= 0 )
-
 
1038
                                           #end
-
 
1039
	                                        #set($dit=  ($ymt/ $mst)* 100)
-
 
1040
	                                        #if($dit)
-
 
1041
	                                        #if($dit >65)
-
 
1042
	                                        <td class="text-success">$math.roundTo(2, $dit)%</td>
-
 
1043
	                                        #else
-
 
-
 
1081
 
1044
	                                        <td class="text-danger">$math.roundTo(2, $dit)%</td>
1082
                            <canvas id="chartTertiaryJSContainer" width="auto" height="auto"></canvas>
1045
	                                        #end
-
 
1046
	                                        #else
-
 
1047
	                                         <td class="text-danger">-</td>
-
 
1048
	                                        #end
-
 
1049
                                           
-
 
1050
                                       #end
-
 
1051
                                        </tr>
-
 
1052
                                    </tbody>
-
 
1053
                                </table>
-
 
1054
 
1083
 
1055
                            </div>
-
 
1056
                            <div class="col-6 mt-2">
-
 
1057
                                
-
 
1058
                                <canvas id="chartTertiaryJSContainer"  width="auto" height="auto"></canvas>
-
 
1059
            
-
 
1060
                            </div>
-
 
1061
                        </div>
1084
                        </div>
1062
                        
-
 
1063
                    </div>
1085
                    </div>
-
 
1086
 
-
 
1087
                </div>
1064
                    <div id="earning" class="container-fluid tab-pane fade"><br>
1088
                <div id="earning" class="container-fluid tab-pane fade"><br>
1065
                        <div class="row">
1089
                    <div class="row">
1066
                            <div class="col-6">
1090
                        <div class="col-6">
1067
                                <table class="table table-bordered table-sm">
1091
                            <table class="table table-bordered table-sm">
1068
                                    <thead>
1092
                                <thead>
1069
                                        <tr class="orange">
1093
                                <tr class="orange">
1070
                                            <th scope="col">Month</th>
1094
                                    <th scope="col">Month</th>
1071
                                             #foreach($label of $labels) 
1095
                                    #foreach($label in $labels)
1072
                                            <th scope="col">$label</th>
1096
                                        <th scope="col">$label</th>
1073
                                             #end  
-
 
1074
                                       </tr>
-
 
1075
                                       
1097
                                    #end
1076
                                       
1098
                                </tr>
-
 
1099
 
-
 
1100
 
1077
                                    </thead>
1101
                                </thead>
1078
                                    <tbody>
1102
                                <tbody>
1079
                        
-
 
-
 
1103
 
1080
                                        #foreach($allBrand of $allBrands) 
1104
                                    #foreach($allBrand in $allBrands)
1081
                                           #set($brand = $allBrand.getName())
1105
                                        #set($brand = $allBrand.getName())
1082
                                            
-
 
-
 
1106
 
1083
                                        <tr>
1107
                                    <tr>
1084
                                     
-
 
-
 
1108
 
1085
                                         <td class="details">$brand</td>
1109
                                        <td class="details">$brand</td>
1086
                                           #foreach($label of $labels) 
1110
                                        #foreach($label in $labels)
1087
                                              #set($earning= $earningMap.get($label))
1111
                                            #set($earning= $earningMap.get($label))
1088
                                             #if($earning.get($brand))
1112
                                            #if($earning.get($brand))
1089
                                            <td class= "currency">$earning.get($brand)</td>
1113
                                                <td class="currency">$earning.get($brand)</td>
1090
                                            #else
1114
                                            #else
1091
                                             <td>0 </td> 
1115
                                                <td>0</td>
1092
                                            #end
-
 
1093
                                            #end
1116
                                            #end
-
 
1117
                                        #end
-
 
1118
 
-
 
1119
                                    </tr>
-
 
1120
 
-
 
1121
 
-
 
1122
                                    #end
-
 
1123
 
-
 
1124
                                <tr class="font-weight-bold">
-
 
1125
                                    <td class="details">Total</td>
-
 
1126
                                    #foreach($label in $labels)
-
 
1127
                                        #if($totalEarningPerMonth.get($label))
1094
 
1128
 
1095
                                        </tr>
-
 
1096
                                        
-
 
1097
                                            
-
 
1098
                                         #end   
-
 
1099
                                        
-
 
1100
                                          <tr class="font-weight-bold">
-
 
1101
                                            <td class="details">Total</td>
-
 
1102
                                            #foreach($label of $labels) 
-
 
1103
                                           #if($totalEarningPerMonth.get($label)) 
-
 
1104
                                          
-
 
1105
                                            <td class="currency">$totalEarningPerMonth.get($label)</td>
1129
                                            <td class="currency">$totalEarningPerMonth.get($label)</td>
1106
                                            #else
1130
                                        #else
1107
                                            <td> - </td>
1131
                                            <td> -</td>
1108
                                            #end
1132
                                        #end
1109
                                            #end
1133
                                    #end
1110
 
1134
 
1111
                                        </tr>
-
 
1112
                                       
1135
                                </tr>
-
 
1136
 
1113
                                    </tbody>
1137
                                </tbody>
1114
                                </table>
1138
                            </table>
1115
 
1139
 
1116
                            </div>
-
 
1117
                            <div class="col-6 mt-2">
-
 
1118
                            
-
 
1119
                               
-
 
1120
                                
-
 
1121
                                <canvas id="chartEarningJSContainer"  width="auto" height="auto"></canvas>
-
 
1122
            
-
 
1123
                               </div>
-
 
1124
                            
-
 
1125
                  
-
 
1126
                        </div>
1140
                        </div>
-
 
1141
                        <div class="col-6 mt-2">
-
 
1142
 
-
 
1143
 
-
 
1144
                            <canvas id="chartEarningJSContainer" width="auto" height="auto"></canvas>
-
 
1145
 
-
 
1146
                        </div>
-
 
1147
 
-
 
1148
 
1127
                    </div>
1149
                    </div>
1128
                </div>
1150
                </div>
1129
            </div>
1151
            </div>
1130
        </div>
1152
        </div>
1131
    </div>
1153
    </div>
-
 
1154
</div>
1132
 
1155
 
1133
 
1156
 
1134
    </div>
1157
</div>
1135
 
1158
 
1136
 
1159
 
1137
    <!-- Optional JavaScript -->
1160
<!-- Optional JavaScript -->
1138
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
1161
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
1139
 
1162
 
1140
 
1163
 
1141
    <script>
1164
<script>
1142
     var op = $chartInvestment;
1165
    var op = $chartInvestment;
1143
     var px = document.getElementById('chartInvestmentJSContainer').getContext('2d');
1166
    var px = document.getElementById('chartInvestmentJSContainer').getContext('2d');
1144
     var chart = new Chart1(px, op);
1167
    var chart = new Chart1(px, op);
1145
     chart.update();
1168
    chart.update();
1146
        
1169
 
1147
    
1170
 
1148
         
-
 
1149
     var ops = $chartPurchase;
1171
    var ops = $chartPurchase;
1150
     var pxs = document.getElementById('chartSecondaryJSContainer').getContext('2d');
1172
    var pxs = document.getElementById('chartSecondaryJSContainer').getContext('2d');
1151
     var chartSec = new Chart1(pxs, ops);
1173
    var chartSec = new Chart1(pxs, ops);
1152
     chartSec.update();
1174
    chartSec.update();
1153
     
1175
 
1154
     var opt = $chartTertiary;
1176
    var opt = $chartTertiary;
1155
     var pxt = document.getElementById('chartTertiaryJSContainer').getContext('2d');
1177
    var pxt = document.getElementById('chartTertiaryJSContainer').getContext('2d');
1156
     var chartTer = new Chart1(pxt, opt);
1178
    var chartTer = new Chart1(pxt, opt);
1157
     chartTer.update();
1179
    chartTer.update();
1158
     
1180
 
1159
     var ope = $chartEarning;
1181
    var ope = $chartEarning;
1160
     var pxe = document.getElementById('chartEarningJSContainer').getContext('2d');
1182
    var pxe = document.getElementById('chartEarningJSContainer').getContext('2d');
1161
     var chartEar = new Chart1(pxe, ope);
1183
    var chartEar = new Chart1(pxe, ope);
1162
     chartEar.update();
1184
    chartEar.update();
1163
    
-
 
1164
    </script>
1185
</script>
1165
   </body>
1186
</body>
1166
 
1187
 
1167
</html>
1188
</html>
-
 
1189
 
-
 
1190
<script>
-
 
1191
    document.querySelectorAll('#partnerSecondary tbody td.currency[data-brand][data-month]').forEach(function (cell) {
-
 
1192
        context = "${rc.contextPath}";
-
 
1193
        cell.addEventListener('click', function () {
-
 
1194
            const brandName = cell.getAttribute('data-brand');
-
 
1195
            const monthName = cell.getAttribute('data-month');
-
 
1196
 
-
 
1197
            const monthMap = {
-
 
1198
                'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,
-
 
1199
                'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12
-
 
1200
            };
-
 
1201
 
-
 
1202
            const monthPart = monthName.substring(0, 3);
-
 
1203
            const monthNumber = monthMap[monthPart];
-
 
1204
            const fofoId = "$!{request.getParameter('fofoId')}";
-
 
1205
 
-
 
1206
            const rightTable = document.getElementById('rightTable');
-
 
1207
            if (rightTable) {
-
 
1208
                rightTable.style.display = 'block';
-
 
1209
            }
-
 
1210
 
-
 
1211
            const contextPath = window.location.pathname.substring(0, window.location.pathname.indexOf("/", 2));
-
 
1212
            doGetAjaxRequestHandler(
-
 
1213
                    `${context}/getBrandItemwisePartnerSale?month=${monthNumber}&brand=${brandName}&fofoId=${fofoId}`,
-
 
1214
                    function (response) {
-
 
1215
                        console.log("getting the api response", response)
-
 
1216
                        const rightTableBody = document.getElementById('rightTableBody');
-
 
1217
                        if (rightTableBody) {
-
 
1218
                            rightTableBody.innerHTML = '';
-
 
1219
 
-
 
1220
                            response.forEach(function (item) {
-
 
1221
                                const row = document.createElement('tr');
-
 
1222
                                row.classList.add('clickable-brandrow');
-
 
1223
                                row.innerHTML =
-
 
1224
                                        '<td>' + item.brand + " " + item.modelNumber + '</td>' +
-
 
1225
                                        '<td>' + item.quantity + '</td>';
-
 
1226
 
-
 
1227
                                rightTableBody.appendChild(row);
-
 
1228
                            });
-
 
1229
                        }
-
 
1230
 
-
 
1231
                        const tableTitle = document.getElementById('tableTitle');
-
 
1232
                        if (tableTitle) {
-
 
1233
                            tableTitle.textContent = `${brandName} - ${monthName} Details`;
-
 
1234
                        }
-
 
1235
                    }
-
 
1236
            );
-
 
1237
        });
-
 
1238
    });
-
 
1239
</script>
1168
1240