Subversion Repositories SmartDukaan

Rev

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