Subversion Repositories SmartDukaan

Rev

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