Subversion Repositories SmartDukaan

Rev

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

Rev 30055 Rev 30225
Line 9... Line 9...
9
            </ol>
9
            </ol>
10
        </div>
10
        </div>
11
    </div>
11
    </div>
12
    
12
    
13
    <div class="row">
13
    <div class="row">
14
                		    <div class="form-group">
14
                		  <div class="form-group">
15
						      <label class="control-label col-lg-1" for="months" style="color:green;">Select Month</label>
15
						      <label class="control-label col-lg-1" for="months" style="color:green;">Select Month</label>
16
						      <div class="col-lg-2">
16
						      <div class="col-lg-2">
17
						        <select class="form-control input-sm" id = "month-wise-income"  name="month-wise-income" placeholder="months" style="margin:auto;">
17
						        <select class="form-control input-sm" id = "month-wise-income"  style="font-weight: bold;" name="month-wise-income" placeholder="months" style="margin:auto;">
18
								    <option value="" disabled selected>month</option>
18
								    <option value="" disabled selected>month</option>
19
									#foreach($mVM in $monthValueMap.entrySet())
19
									#foreach($mVM in $monthValueMap.entrySet())
20
										#if($mVM.getKey()== $month )
20
										#if($mVM.getKey()== $month )
21
					             		<option value="$mVM.getKey()" selected>$mVM.getValue()</option>
21
					             		<b><option value="$mVM.getKey()" selected>$mVM.getValue()</option>
22
					             		#else
22
					             		#else
23
					             		<option value="$mVM.getKey()">$mVM.getValue()</option>
23
					             		<b><option value="$mVM.getKey()">$mVM.getValue()</option>
24
					             		#end
24
					             		#end
25
				             		#end
25
				             		#end
26
						        </select> 
26
						        </select> 
27
						      </div>
27
						      </div>
28
						      
28
						      
29
						    <div class="col-lg-3" style="color: green;">
29
						    <div class="col-lg-3" style="color: green;">
30
						    <h4>Category Upgrade Margin
30
						    <h4>Category Upgrade Margin
31
						      <i class='far fa-arrow-alt-circle-up'></i>
31
						      <i class='far fa-arrow-alt-circle-up'></i>
32
						    </h4>
32
						    </h4>
33
					       </div> 
33
					       </div> 
34
			      </div>
34
			        </div>  
35
						   
-
 
36
						  
-
 
37
						    
-
 
38
	</div>
35
	</div>
39
    <div class="row">
36
    <div class="row">
40
      <div class="col-lg-4">
37
      <div class="col-lg-4">
41
        <table class="table table-border table-condensed table-bordered" id="lmiCreditedIncome">
38
        <table class="table table-border table-condensed table-bordered" id="lmiCreditedIncome">
42
 
39
 
43
      <thead class="row htable">
40
      <thead class="row htable">
44
 
41
 
45
            <tr style="color:black;">
42
            <tr style="color:black;">
46
            <th>Brand</th>
43
            <th>Brand</th>
47
             <th>Purchase Qty</th>
44
            <th>Purchase Qty</th>
48
            <th>Purchase Margin</th>
45
            <th>Purchase Margin</th>
49
             <th>Sale Qty</th>
46
            <th>Sale Qty</th>
50
            <th>Sale Margin</th>
47
            <th>Sale Margin</th>
51
             <th>Total Income</th>
48
            <th>Pending Sale Margin</th>
52
            
49
            <th>Total Income</th>
53
            </tr>
50
            </tr>
54
      </thead>
51
      </thead>
55
            <tbody>
52
            <tbody>
-
 
53
         
56
             #foreach($key in $keySet)
54
             #foreach($key in $keySet)
57
              <tr class="brand-wise-income" data-brand="$key" data-month="$month" data-status="$status">
55
              <tr class="brand-wise-income" data-brand="$key" data-month="$month" data-status="$status">
58
                    <td>$key</td>
56
                    <td>$key</td>
59
           
57
           
60
                #if($lastMonthPurchaseInMarginMap.get($key).getQty())
58
                #if($lastMonthPurchaseInMarginMap.get($key).getQty())
61
                    <td>$lastMonthPurchaseInMarginMap.get($key).getQty()</td>
59
                    <td>$lastMonthPurchaseInMarginMap.get($key).getQty()</td>
62
                #else
60
                #else
63
                   <td>--</td>
61
                   <td>0</td>
64
                #end
62
                #end
65
                #if($lastMonthPurchaseInMarginMap.get($key).getAmount())
63
                #if($lastMonthPurchaseInMarginMap.get($key).getAmount())
66
                   <td>$nf.format($lastMonthPurchaseInMarginMap.get($key).getAmount())</td>
64
                   <td>$nf.format($lastMonthPurchaseInMarginMap.get($key).getAmount())</td>
67
                #else
65
                #else
68
                   <td>-- </td>
66
                   <td>0 </td>
69
                #end
67
                #end
70
                #if($lastMonthSaleMarginMap.get($key).getQty())
68
                #if($lastMonthSaleMarginMap.get($key).getQty())
71
                  <td>$lastMonthSaleMarginMap.get($key).getQty()</td>
69
                  <td>$lastMonthSaleMarginMap.get($key).getQty()</td>
72
                #else
70
                #else
73
                  <td>--</td>
71
                  <td>0</td>
74
                #end
72
                #end
75
                #if($lastMonthCategoryUpgradeMarginMap.get($key))
73
                #if($lastMonthCategoryUpgradeMarginMap.get($key))
76
                
74
                
77
                     #if($lastMonthSaleMarginMap.get($key).getAmount())
75
                     #if($lastMonthSaleMarginMap.get($key).getAmount())
78
                
76
                
79
                        <td>$nf.format($lastMonthSaleMarginMap.get($key).getAmount()) <i class='far fa-arrow-alt-circle-up' style="color: green;" title="$nf.format($lastMonthCategoryUpgradeMarginMap.get($key)) Category Upgrade Additional Margin."></i></td>
77
                        <td>$nf.format($lastMonthSaleMarginMap.get($key).getAmount()) <i class='far fa-arrow-alt-circle-up' style="color: green;" title="$nf.format($lastMonthCategoryUpgradeMarginMap.get($key)) Category Upgrade Additional Margin."></i></td>
80
                    #else
78
                    #else
81
                        <td>-- <i class='far fa-arrow-alt-circle-up' style="color: green;" title="$nf.format($lastMonthCategoryUpgradeMarginMap.get($key)) Category Upgrade Additional Margin."></i></td>
79
                        <td>0<i class='far fa-arrow-alt-circle-up' style="color: green;" title="$nf.format($lastMonthCategoryUpgradeMarginMap.get($key)) Category Upgrade Additional Margin."></i></td>
82
                     #end
80
                     #end
83
                
81
                
84
                
82
                
85
                #else
83
                #else
86
                     #if($lastMonthSaleMarginMap.get($key).getAmount())
84
                     #if($lastMonthSaleMarginMap.get($key).getAmount())
87
                
85
                
88
                        <td >$nf.format($lastMonthSaleMarginMap.get($key).getAmount()) </td>
86
                        <td >$nf.format($lastMonthSaleMarginMap.get($key).getAmount()) </td>
89
                    #else
87
                    #else
90
                        <td>--</td>
88
                        <td>0</td>
91
                     #end
89
                     #end
92
                
90
                
93
                #end
91
                #end
-
 
92
                #if($lastMonthPendingIncomeMap.get($key).getAmount())
-
 
93
               <td>$nf.format($lastMonthPendingIncomeMap.get($key).getAmount())</td>
94
               
94
               
-
 
95
               #else
-
 
96
                <td>0</td>
-
 
97
               #end
95
             
98
             
96
                #if($totalAmountMap.get($key))
99
                #if($totalAmountMap.get($key))
97
                  
100
                  
98
                   <td>$nf.format($totalAmountMap.get($key))</td>
101
                   <td>$nf.format($totalAmountMap.get($key))</td>
99
                #else
102
                #else
100
                  <td>--</td>
103
                  <td>0</td>
101
                #end
104
                #end
102
                 
105
                 
103
                </tr>       
106
                </tr>       
104
             #end
107
             #end
-
 
108
             
105
              </tbody>
109
              </tbody>
-
 
110
              <tfoot>
-
 
111
            <tr>
-
 
112
               <td>Total</td>
-
 
113
               <td>-</td>
-
 
114
               <td id="purchase-total"></td>
-
 
115
               
-
 
116
                  <td>-</td>
-
 
117
                <td id="sale-total"></td>
-
 
118
               <td id="pending-total"></td>
-
 
119
               
-
 
120
                  <td id="sum-total"></td>
-
 
121
             
-
 
122
             </tr>
-
 
123
           </tfoot>
-
 
124
             
-
 
125
                 
-
 
126
           
-
 
127
             
-
 
128
             
106
        </table>          
129
        </table>          
107
        </div>
130
        </div>
108
        
131
        
109
     
132
     
110
     <div class="col-lg-8 brand-wise-income-container">  </div>
133
     <div class="col-lg-8 brand-wise-income-container">  </div>
Line 116... Line 139...
116
 
139
 
117
    
140
    
118
    </section>
141
    </section>
119
      
142
      
120
     
143
     
121
    <script>
144
    <script type="text/javascript">
122
 $(document).ready(function() {
145
 $(document).ready(function() {
123
          var table = $('#lmiCreditedIncome').DataTable();
146
          var table = $('#lmiCreditedIncome').DataTable();
124
 
147
 
125
    $('#lmiCreditedIncome tbody').on( 'click', 'tr', function () {
148
    $('#lmiCreditedIncome tbody').on( 'click', 'tr', function () {
126
        if ( $(this).hasClass('selected') ) {
149
        if ( $(this).hasClass('selected') ) {
Line 128... Line 151...
128
        }
151
        }
129
        else {
152
        else {
130
            table.$('tr.selected').removeClass('selected');
153
            table.$('tr.selected').removeClass('selected');
131
            $(this).addClass('selected');
154
            $(this).addClass('selected');
132
        }
155
        }
133
    } );
156
    });
134
 
157
    
-
 
158
        datatableSum();
135
    $('#button').click( function () {
159
		  table.on('search.dt', function () {
136
        table.row('.selected').remove().draw( false );
160
            console.log('Currently applied global search: ' + table.search());
-
 
161
            datatableSum();
-
 
162
           
-
 
163
 
137
    } );
164
        });
-
 
165
	
138
} );
166
});
-
 
167
	
-
 
168
	
-
 
169
	 function datatableSum() {
139
  
170
	 
-
 
171
	      var col_two_sum = $('#lmiCreditedIncome').DataTable().column(2,{page:'current'}).data().sum();
-
 
172
	         $('#purchase-total').html(col_two_sum);
-
 
173
	      
-
 
174
	       var col_four_sum = $('#lmiCreditedIncome').DataTable().column(4,{page:'current'}).data().sum();
-
 
175
	         console.log(col_four_sum)
-
 
176
	          $('#sale-total').html(col_four_sum);
-
 
177
		    
-
 
178
		   var col_five_sum = $('#lmiCreditedIncome').DataTable().column(5,{page:'current'}).data().sum();
-
 
179
	         $('#pending-total').html(col_five_sum);
-
 
180
	      
-
 
181
	      
-
 
182
	       var col_six_sum = $('#lmiCreditedIncome').DataTable().column(6,{page:'current'}).data().sum();
-
 
183
	         console.log(col_six_sum)
-
 
184
	          $('#sum-total').html(col_six_sum);
140
   
185
		    
-
 
186
	     }
-
 
187
	
141
    
188
    
142
    </script>
189
    </script>
143
   
190
   
144
191