Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23405 amit.gupta 1
<style>
2
	.btn:hover{
3
  		color: grey;
4
  		text-decoration: none;
5
	}
6
	.btn-primary:hover{
7
  		color: grey;
8
  		text-decoration: none;
9
	}
10
	.retailer-details{
11
		cursor:pointer;
12
	}
26176 tejbeer 13
	.indentMessage{
14
	text-transform: lowercase;
15
	display: inline-block;
16
	}
17
	.indentMessage:first-letter{
18
	text-transform: UpperCase;
19
	}
23405 amit.gupta 20
</style>
21
 
22
<section class="wrapper">            
23
	<div class="row">
24
		<div class="col-lg-12">
26721 tejbeer 25
		 #if ($isAdmin)
23786 amit.gupta 26
			<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit Allocation</h3>
23405 amit.gupta 27
			<ol class="breadcrumb">
28
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
23786 amit.gupta 29
				#if($retailerName)
30
				<script type="text/javascript">
31
					currentFofoId=${retailerId};
32
				</script>
33
				<li><i class="icon_document_alt"></i><b>Allocation for $retailerName (Counter Size - $counterSize)</b></li>
34
				#else
35
				<li><i class="icon_document_alt"></i><b>Standard Allocation (Counter Size - $counterSize)</b></li>
36
				#end
23405 amit.gupta 37
			</ol>
26721 tejbeer 38
		#else 
26176 tejbeer 39
			<h3 class="page-header"><i class="icon_document_alt"></i>My Business Plan <span style ="font-size:18px";>(Open from <b>26<sup>th</sup> to 7<sup>th</sup></b> of each Month)</span></h3>
26082 tejbeer 40
 
26721 tejbeer 41
		#end 
42
 
43
 
23405 amit.gupta 44
		</div>
26131 tejbeer 45
 
46
 
23405 amit.gupta 47
	</div>
48
 
49
    <div>
26721 tejbeer 50
    <!--	#if ($isAdmin)
23786 amit.gupta 51
    	<div class="row">
52
    		<div class="col-lg-3">
53
                <div class="input-group">
54
			    	<input id="partnerId" type="text" class="typeahead form-control form-control-sm" placeholder="Search Partner by Store" data-provide="typeahead" 
55
			    	 #if(${retailerName}) value="${retailerName}" #end
56
			    	 autocomplete="off"/>
57
	               	<div class="input-group-btn">
58
		    			<button class="create_indent btn btn-primary">Get Partner Allocation</button>
24229 amit.gupta 59
		    			<button class="download_indent btn btn-primary">Download</button>
23786 amit.gupta 60
		    		</div>
61
		    	</div>
62
    		</div>
63
		    <div class="col-lg-3">
64
			    <div class="dropdown">
65
			 		<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Change Counter Size
66
					  <span class="caret"></span></button>
67
					  <ul class="dropdown-menu">
68
					  #foreach($counterSiz in $counterSizes)
69
					    <li class="mk_counter_size #if(${counterSiz}==${counterSize}) active#end"><a href="javascript:void(0)">$counterSiz</a></li>
70
					  #end
71
			  		</ul>
72
				</div>
73
	    	</div>
74
    	</div>
23796 amit.gupta 75
    	#end
26721 tejbeer 76
    	-->
26176 tejbeer 77
 
78
    	<div class="row">
79
    		   <div class="col-lg-3" style="text-align:left;">
26721 tejbeer 80
		                 #if(!$isAdmin)
26176 tejbeer 81
						<button type="button" class="btn btn-default previous-month" aria-label="Previous" >
82
							$previousPlanningMonth</button> 
83
						<button type="button" class="btn btn-default current-month" aria-label="Current" >
84
							$currentPlanningMonth</button> 
26721 tejbeer 85
							#end
26176 tejbeer 86
	           	</div>
87
 
88
	         #if($freezed&&$planningMonth)
89
			<div style = "font-size:20px;font-weight:bold;color:red;"  class="indentMessage"> $planningMonth Month Planning is <b>Closed</b></div>
90
			#else
91
			<div style = "font-size:20px;font-weight:bold;color:Green;" >$planningMonth Month Planning is <b>Open</b></div>
92
			#end
93
    	</div>
23405 amit.gupta 94
	         <div class="row">
26176 tejbeer 95
 
25721 tejbeer 96
	    		<div class="col-lg-8" id="indent-container">
26176 tejbeer 97
 
23405 amit.gupta 98
	    			<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
99
		    			<thead>
100
				            <tr>
101
								<th>Id</th>
25721 tejbeer 102
	    						<th style="width:30%">Description</th>
24229 amit.gupta 103
	    						<th style="width:12%">DP</th>
23405 amit.gupta 104
	    						<th>MOP</th>
25721 tejbeer 105
	    						<th style="width:20%">Planned Qty</th>
26176 tejbeer 106
	    						#if($previousMonth||$mtd)
26131 tejbeer 107
	    						<th style="width:6%">Sale</th>
108
	    						#else		
25721 tejbeer 109
	    						<th style="width:6%">15 days sale</th>
26131 tejbeer 110
	    						#end
23855 amit.gupta 111
	    						<th style="width:9%">In Stock</th>
112
	    						<th style="width:9%">In Transit</th>
25721 tejbeer 113
	    						<th style="width:6%">Recommended</th>
114
	    						<th style="width:6%">Minimum</th>
115
 
26176 tejbeer 116
	    						<th>Remaining</th>
117
 
118
 
23405 amit.gupta 119
				            </tr>
120
				        </thead>
121
	    				<tbody>
24229 amit.gupta 122
	    					#foreach( $modelListing in $catalogTagListings )
23405 amit.gupta 123
	    					<tr>
24229 amit.gupta 124
	    						<td>$modelListing.getCatalogId()</td>
25701 amit.gupta 125
	    						<td>$modelListing.getItemDescription()</td>
24229 amit.gupta 126
	    						<td class="currency">$modelListing.getDp()</td>
127
	    						<td class="currency">$modelListing.getMop()</td>
26721 tejbeer 128
	    						#if($freezed&&$previousMonth || $isAdmin)
23796 amit.gupta 129
	    						<td>
26293 tejbeer 130
	    						<input type="number" min="0" max="40" 
24229 amit.gupta 131
	    						data-catalog-id="$modelListing.getCatalogId()"
132
	    						data-selling-price="$modelListing.getDp()"
25721 tejbeer 133
	    						data-brand-name="$modelListing.getBrand()"
24229 amit.gupta 134
	    						data-description="$modelListing.getItemDescription()" 
25721 tejbeer 135
	    						value="$modelListing.getAllocatedQuantity()" readonly/>
136
	    						</td>
26721 tejbeer 137
	    						#elseif($freezed || $isAdmin)
25721 tejbeer 138
	    						<td>
26293 tejbeer 139
	    						<input type="number" min="0" max="40" 
26131 tejbeer 140
	    						data-catalog-id="$modelListing.getCatalogId()"
141
	    						data-selling-price="$modelListing.getDp()"
142
	    						data-brand-name="$modelListing.getBrand()"
143
	    						data-description="$modelListing.getItemDescription()" 
144
	    						value="$modelListing.getAllocatedQuantity()" readonly/>
145
	    						</td>
146
	    						#else 
147
	    						<td>
26293 tejbeer 148
						    	<input type="number" min="0" max="40" 
25721 tejbeer 149
	    						data-catalog-id="$modelListing.getCatalogId()"
150
	    						data-selling-price="$modelListing.getDp()"
151
	    						data-brand-name="$modelListing.getBrand()"
152
	    						data-description="$modelListing.getItemDescription()" 
153
	    						value="$modelListing.getAllocatedQuantity()"/> 						
154
	    						</td>
23796 amit.gupta 155
	    						#end
26131 tejbeer 156
	    						#if($previousMonth)
157
	    						<td>$modelListing.getLastMonthSaleMap()</td>
26176 tejbeer 158
	    						#elseif($mtd)
159
	    						<td>$modelListing.getLast15DaysSale()</td>
26131 tejbeer 160
	    						#else
25721 tejbeer 161
	    						<td>$modelListing.getLast15DaysSale()</td>
26131 tejbeer 162
	    						#end
24229 amit.gupta 163
	    						<td>$modelListing.getStockInHand()</td>
164
	    						<td>$modelListing.getInTransitQuantity()</td>
25721 tejbeer 165
	    						<td>$modelListing.getRecommendedQty()</td>
166
	    						<td>$modelListing.getMinimumQty()</td>
26176 tejbeer 167
	    						#if($mtd)
168
	    						<td>$modelListing.getRemaining()</td>
169
	    						#else
170
	    						<td></td>
171
	    						#end
23405 amit.gupta 172
	    					</tr>
173
	    					#end
174
	    				</tbody>
175
	    			</table>
176
	    		</div>
23786 amit.gupta 177
	    		<div class="col-lg-7" id="indent-container1" style="display:none"></div>
178
	    		<div class="col-lg-4">
23405 amit.gupta 179
	    			<div class="panel panel-default">
25721 tejbeer 180
	    			#if(!$isAdmin)
181
	                <div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div>
23405 amit.gupta 182
	                  <div class="panel-content">
25721 tejbeer 183
		                  <div id="plansummary">
184
		                  </div>
185
		                  <div id="planbuttons">
186
					       <!--  <button class="btn btn-primary mk_submit_indent">Update Allocation</button>
187
					          <button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button> -->
188
 
26131 tejbeer 189
					          #if($freezed&&$previousMonth)
190
					           <button class="btn btn-primary confirm_indent" disabled>Confirm Update</button>
191
					          #elseif($freezed)
25721 tejbeer 192
					          <button class="btn btn-primary confirm_indent" disabled>Confirm Update</button>
193
					          #else
194
					           <button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>
195
					          #end
196
				          </div>
23405 amit.gupta 197
	                  </div>
198
                	</div>
23796 amit.gupta 199
                	#else
200
                	#set($diff=$totalAmount - $walletAmount)
201
	                <div class="panel-heading">PO Summary(Total Amount in Wallet - <span class="currency">$walletAmount</span>)</div>
202
	                  <div class="panel-content">
203
	                  	<table class="table table-sm" id="summary-table">
204
	                  		  <thead>
205
							    <tr>
206
							      <th class="col">#</th>
207
							      <th class="col">Total Pcs</th>
208
							      <th class="col">Amount to Pay</th>
209
							      <th class="col">Action</th>
210
							    </tr>
211
							  </thead>
212
							  <tbody>
213
							  #**
214
							    <tr>
215
							      <th class="row">Partial PO</th>
216
							      <td>$partialPcs</td>
217
							      <td>$partialAmount</td>
218
							      <td><button class="btn btn-sm btn-primary confirm_indent #if(${diff} > 0)disabled#end"
219
							      >Raise Partial PO</button></td>
220
							    </tr>
221
							   **#
222
							    <tr>
223
							      <th class="row">Complete PO</th>
224
							      <td>$totalPcs</td>
225
							      <td class="currency">$totalAmount</td>
226
							      #if($totalPcs)
227
							      <td><button class="btn btn-primary raise_po#if($diff > 0) disabled#end">Raise Complete PO</button></td>
228
							      #else
229
							      <td>Nothing to order!</td>
230
							      #end
231
							    </tr>
232
							  </tbody>	
233
	                  	</table>
234
	                  #if($diff>0)
235
	                  	<div class="alert alert-warning">
236
							<medium>Please add Rs.<span class="currency">$diff</span> to complete this transaction.</meduim>
237
						</div>
238
					  #end
239
	                  </div>
240
                	</div>
241
                	#end
25736 tejbeer 242
 
243
 
244
    	         	<div class="panel panel-default">
26721 tejbeer 245
 
25736 tejbeer 246
	                <div class="panel-heading">Brand Stock</div>
247
	                  <div class="panel-content">
248
		                 <table class="table table-sm" id="stock-table">
249
	                  		  <thead>
250
							    <tr>
251
							      <th>Brand</th>
252
							      <th>Qty(pc)</th>
253
							      <th>Value</th>
254
 
255
							    </tr>
256
							  </thead>
257
							  <tbody>
258
 
259
							   #foreach( $brandStockPrice in $brandStockPrices )
260
			    				<tr class="stockInfo" >
261
			    					<td>$brandStockPrice.getBrand()</td>
262
			    					<td>$brandStockPrice.getTotalQty()</td>
263
			    					<td><span class="currency">$brandStockPrice.getTotalValue()</span></td>
264
							    </tr>
265
							    #end
266
							   </tbody>
267
							</table>
268
	                  </div>
269
                  	</div>
26721 tejbeer 270
 
25736 tejbeer 271
    	        </div>
272
 
26721 tejbeer 273
                	<!-- #if($isAdmin)
23786 amit.gupta 274
                	<div class="panel panel-default">
275
                		<div class="panel-heading">Brandwise Target and Performance</div>
276
                		<div class="panel-content">
277
                		<ul class="nav nav-tabs">
278
						  <li role="presentation" class="active brandLi"><a href="javascript:void(0)">Mobiles</a></li>
279
						  <li role="presentation" class="brandLi"><a href="javascript:void(0)">Accessories</a></li>
280
						</ul>
281
 
282
						<table class="brandPerformance table table-striped table-condensed table-bordered">
283
							<thead>
284
								<tr>
285
									<th rowspan="2">Brand Name</th>
286
									<th rowspan="2" align="center">Target Value</th>
287
									<th colspan="2" align="center">Achieved</th>
288
									<th colspan="2">Brand Share(%)</th>
289
								</tr>
290
								<tr>
291
									<th>Value</th>
292
									<th>Percentage</th>
293
									<th>Target</th>
294
									<th>Achieved</th>
295
								</tr>
296
							</thead>
297
							<tbody>
298
							#foreach($brandPerformance in $brandPerformanceList)
299
								<tr>
300
									<th>$brandPerformance.getBrandName()</th>
301
									<td class="currency">$brandPerformance.getTarget()</td>
302
									<td class="currency">$brandPerformance.getAchieved()</td>
303
									<td>$brandPerformance.getAchievedPercentage()%</td>
304
									<td>$brandPerformance.getBrandTargetShare()</td>
305
									<td>$brandPerformance.getBrandAchievedShare()</td>
306
								</tr>
307
							#end
308
							<tbody>
309
							</tbody>
310
						</table>
311
						<table style="display:none" class="table brandPerformance table-striped table-condensed table-bordered">
312
							<thead>
313
								<tr>
314
									<th rowspan="2">Brand Name</th>
315
									<th rowspan="2" align="center">Target Value</th>
316
									<th colspan="2" align="center">Achieved</th>
317
									<th colspan="2">Brand Share(%)</th>
318
								</tr>
319
								<tr>
320
									<th>Value</th>
321
									<th>Percentage</th>
322
									<th>Target</th>
323
									<th>Achieved</th>
324
								</tr>
325
							</thead>
326
							<tbody>
327
							#foreach($brandPerformance in $accsBrandPerformanceList)
328
								<tr>
329
									<th>$brandPerformance.getBrandName()</th>
330
									<td>$brandPerformance.getTarget()</td>
331
									<td>$brandPerformance.getAchieved()</td>
332
									<td>$brandPerformance.getAchievedPercentage()%</td>
333
									<td>$brandPerformance.getBrandTargetShare()</td>
334
									<td>$brandPerformance.getBrandAchievedShare()</td>
335
								</tr>
336
							#end
337
							<tbody>
338
							</tbody>
339
						</table>
340
                		</div>
341
 
342
                	</div>
26721 tejbeer 343
                	#end -->
23405 amit.gupta 344
	    		</div>
345
	    	</div>
346
    	</div>
25736 tejbeer 347
 
348
 
23405 amit.gupta 349
</section>
350
<script type="text/javascript">
23796 amit.gupta 351
totalAmount = $totalAmount;
23405 amit.gupta 352
/* Create an array with the values of all the input boxes in a column */
353
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
354
{
355
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
356
        return $('input', td).val();
357
    } );
358
}
359
 
360
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
361
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
362
{
363
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
364
        return $('input', td).val() * 1;
365
    } );
366
}
367
 
368
/* Create an array with the values of all the select options in a column */
369
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
370
{
371
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
372
        return $('select', td).val();
373
    } );
374
}
375
 
376
/* Create an array with the values of all the checkboxes in a column */
377
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
378
{
379
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
380
        return $('input', td).prop('checked') ? '1' : '0';
381
    } );
382
}
383
 
384
/* Initialise the table with the required column ordering data types */
23786 amit.gupta 385
var customRetailers = ${customRetailers};
23405 amit.gupta 386
$(document).ready(function() {
26176 tejbeer 387
 
23405 amit.gupta 388
    indentTable = $('#entire-catalog-table').DataTable({
23786 amit.gupta 389
    	"scrollY":"600px",
23405 amit.gupta 390
    	"columns": [
25736 tejbeer 391
 
392
 
393
            { "visible": false }, null,null, null,
26176 tejbeer 394
            { "orderDataType": "dom-text-numeric" }, null, null, null,null,null,null
23786 amit.gupta 395
        ],
23796 amit.gupta 396
        "lengthMenu":[[25,50],[25,50]],
397
        "order": []
23405 amit.gupta 398
	});
26176 tejbeer 399
 
23405 amit.gupta 400
	indentMap = {};
401
	indentTable.rows().data().each(function(arr){
23796 amit.gupta 402
		var $input = $(arr[4]);
23405 amit.gupta 403
		quantity = parseInt($input.val(), 10);
404
		if(quantity > 0){
25721 tejbeer 405
			 var brandName = arr[1].split(" ")[0];
406
			 if(indentMap[brandName] == undefined) {
407
				 indentMap[brandName] = {};
408
			 }
409
			 indentMap[brandName][parseInt(arr[0])] 
410
			 					= {"initialQuantity": quantity, "quantity": quantity, 
411
			 					"sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
23405 amit.gupta 412
	    }
25721 tejbeer 413
	})
23884 amit.gupta 414
	$("#partnerId").typeahead({
23786 amit.gupta 415
	  source: customRetailers,
416
	  autoSelect: true,
417
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
418
	  afterSelect:	function(currentItem){
419
	  					currentFofoId = currentItem.partnerId;
420
	  				}
421
	});
25701 amit.gupta 422
	populateIndentSummary();
23405 amit.gupta 423
});
424
 
425
</script>