Subversion Repositories SmartDukaan

Rev

Rev 24406 | Rev 25721 | 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">
23786 amit.gupta 65
	    		<div class="col-lg-7" 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>
23796 amit.gupta 70
	    						<th style="width:40%">Description</th>
24229 amit.gupta 71
	    						<th style="width:12%">DP</th>
23405 amit.gupta 72
	    						<th>MOP</th>
23855 amit.gupta 73
	    						<th style="width:20%">Allocated Quantity</th>
74
	    						<th style="width:9%">In Stock</th>
75
	    						<th style="width:9%">In Transit</th>
76
	    						<th style="width:9%">To be Ordered</th>
23405 amit.gupta 77
				            </tr>
78
				        </thead>
79
	    				<tbody>
24229 amit.gupta 80
	    					#foreach( $modelListing in $catalogTagListings )
23405 amit.gupta 81
	    					<tr>
24229 amit.gupta 82
	    						<td>$modelListing.getCatalogId()</td>
25701 amit.gupta 83
	    						<td>$modelListing.getItemDescription()</td>
24229 amit.gupta 84
	    						<td class="currency">$modelListing.getDp()</td>
85
	    						<td class="currency">$modelListing.getMop()</td>
23796 amit.gupta 86
	    						<td>
25701 amit.gupta 87
	    						#if(!$isAdmin)
24229 amit.gupta 88
	    						<input type="number" min="0" max="20" 
89
	    						data-catalog-id="$modelListing.getCatalogId()"
90
	    						data-selling-price="$modelListing.getDp()"
91
	    						data-description="$modelListing.getItemDescription()" 
92
	    						value="$modelListing.getAllocatedQuantity()"/>
23796 amit.gupta 93
	    						#else
24229 amit.gupta 94
								$modelListing.getAllocatedQuantity()	    						
23796 amit.gupta 95
	    						#end
96
	    						</td>
24229 amit.gupta 97
	    						<td>$modelListing.getStockInHand()</td>
98
	    						<td>$modelListing.getInTransitQuantity()</td>
99
	    						<td>$modelListing.getToBeOrdered()</td>
23405 amit.gupta 100
	    					</tr>
101
	    					#end
102
	    				</tbody>
103
	    			</table>
104
	    		</div>
23786 amit.gupta 105
	    		<div class="col-lg-7" id="indent-container1" style="display:none"></div>
106
	    		<div class="col-lg-4">
23405 amit.gupta 107
	    			<div class="panel panel-default">
23796 amit.gupta 108
	    			#if($isAdmin)
23786 amit.gupta 109
	                  <div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div>
23405 amit.gupta 110
	                  <div class="panel-content">
23786 amit.gupta 111
	                  	<table class="table table-sm" id="summary-table">
112
	                  		  <thead>
113
							    <tr>
114
							      <th class="col">#</th>
115
							      <th class="col">Items</th>
116
							      <th class="col">Quantity</th>
117
							      <th class="col">Amount</th>
118
							    </tr>
119
							  </thead>
120
							  <tbody>
121
							    <tr>
122
							      <th class="row">Initial</th>
123
							      <td></td>
124
							      <td></td>
23796 amit.gupta 125
							      <td></td>
23786 amit.gupta 126
							    </tr>
127
							    <tr>
128
							      <th class="row">Added</th>
129
							      <td></td>
130
							      <td></td>
23796 amit.gupta 131
							      <td></td>
23786 amit.gupta 132
							    </tr>
133
							    <tr>
134
							      <th class="row">Removed</th>
135
							      <td></td>
136
							      <td></td>
23796 amit.gupta 137
							      <td></td>
23786 amit.gupta 138
							    </tr>
139
							    <tr>
140
							      <th class="row">Final</th>
141
							      <td></td>
142
							      <td></td>
23796 amit.gupta 143
							      <td></td>
23786 amit.gupta 144
							    </tr>
145
							  <tbody>
146
	                  	</table>
147
			          <button class="btn btn-primary mk_submit_indent">Update Allocation</button>
23405 amit.gupta 148
			          <button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button>
23786 amit.gupta 149
			          <button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>
23405 amit.gupta 150
	                  </div>
151
                	</div>
23796 amit.gupta 152
                	#else
153
                	#set($diff=$totalAmount - $walletAmount)
154
	                <div class="panel-heading">PO Summary(Total Amount in Wallet - <span class="currency">$walletAmount</span>)</div>
155
	                  <div class="panel-content">
156
	                  	<table class="table table-sm" id="summary-table">
157
	                  		  <thead>
158
							    <tr>
159
							      <th class="col">#</th>
160
							      <th class="col">Total Pcs</th>
161
							      <th class="col">Amount to Pay</th>
162
							      <th class="col">Action</th>
163
							    </tr>
164
							  </thead>
165
							  <tbody>
166
							  #**
167
							    <tr>
168
							      <th class="row">Partial PO</th>
169
							      <td>$partialPcs</td>
170
							      <td>$partialAmount</td>
171
							      <td><button class="btn btn-sm btn-primary confirm_indent #if(${diff} > 0)disabled#end"
172
							      >Raise Partial PO</button></td>
173
							    </tr>
174
							   **#
175
							    <tr>
176
							      <th class="row">Complete PO</th>
177
							      <td>$totalPcs</td>
178
							      <td class="currency">$totalAmount</td>
179
							      #if($totalPcs)
180
							      <td><button class="btn btn-primary raise_po#if($diff > 0) disabled#end">Raise Complete PO</button></td>
181
							      #else
182
							      <td>Nothing to order!</td>
183
							      #end
184
							    </tr>
185
							  </tbody>	
186
	                  	</table>
187
	                  #if($diff>0)
188
	                  	<div class="alert alert-warning">
189
							<medium>Please add Rs.<span class="currency">$diff</span> to complete this transaction.</meduim>
190
						</div>
191
					  #end
192
	                  </div>
193
                	</div>
194
                	#end
195
                	#if($isAdmin)
23786 amit.gupta 196
                	<div class="panel panel-default">
197
                		<div class="panel-heading">Brandwise Target and Performance</div>
198
                		<div class="panel-content">
199
                		<ul class="nav nav-tabs">
200
						  <li role="presentation" class="active brandLi"><a href="javascript:void(0)">Mobiles</a></li>
201
						  <li role="presentation" class="brandLi"><a href="javascript:void(0)">Accessories</a></li>
202
						</ul>
203
 
204
						<table class="brandPerformance table table-striped table-condensed table-bordered">
205
							<thead>
206
								<tr>
207
									<th rowspan="2">Brand Name</th>
208
									<th rowspan="2" align="center">Target Value</th>
209
									<th colspan="2" align="center">Achieved</th>
210
									<th colspan="2">Brand Share(%)</th>
211
								</tr>
212
								<tr>
213
									<th>Value</th>
214
									<th>Percentage</th>
215
									<th>Target</th>
216
									<th>Achieved</th>
217
								</tr>
218
							</thead>
219
							<tbody>
220
							#foreach($brandPerformance in $brandPerformanceList)
221
								<tr>
222
									<th>$brandPerformance.getBrandName()</th>
223
									<td class="currency">$brandPerformance.getTarget()</td>
224
									<td class="currency">$brandPerformance.getAchieved()</td>
225
									<td>$brandPerformance.getAchievedPercentage()%</td>
226
									<td>$brandPerformance.getBrandTargetShare()</td>
227
									<td>$brandPerformance.getBrandAchievedShare()</td>
228
								</tr>
229
							#end
230
							<tbody>
231
							</tbody>
232
						</table>
233
						<table style="display:none" class="table brandPerformance table-striped table-condensed table-bordered">
234
							<thead>
235
								<tr>
236
									<th rowspan="2">Brand Name</th>
237
									<th rowspan="2" align="center">Target Value</th>
238
									<th colspan="2" align="center">Achieved</th>
239
									<th colspan="2">Brand Share(%)</th>
240
								</tr>
241
								<tr>
242
									<th>Value</th>
243
									<th>Percentage</th>
244
									<th>Target</th>
245
									<th>Achieved</th>
246
								</tr>
247
							</thead>
248
							<tbody>
249
							#foreach($brandPerformance in $accsBrandPerformanceList)
250
								<tr>
251
									<th>$brandPerformance.getBrandName()</th>
252
									<td>$brandPerformance.getTarget()</td>
253
									<td>$brandPerformance.getAchieved()</td>
254
									<td>$brandPerformance.getAchievedPercentage()%</td>
255
									<td>$brandPerformance.getBrandTargetShare()</td>
256
									<td>$brandPerformance.getBrandAchievedShare()</td>
257
								</tr>
258
							#end
259
							<tbody>
260
							</tbody>
261
						</table>
262
                		</div>
263
 
264
                	</div>
23796 amit.gupta 265
                	#end
23405 amit.gupta 266
	    		</div>
267
	    	</div>
268
    	</div>
269
</section>
270
<script type="text/javascript">
23796 amit.gupta 271
totalAmount = $totalAmount;
23405 amit.gupta 272
/* Create an array with the values of all the input boxes in a column */
273
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
274
{
275
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
276
        return $('input', td).val();
277
    } );
278
}
279
 
280
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
281
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
282
{
283
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
284
        return $('input', td).val() * 1;
285
    } );
286
}
287
 
288
/* Create an array with the values of all the select options in a column */
289
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
290
{
291
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
292
        return $('select', td).val();
293
    } );
294
}
295
 
296
/* Create an array with the values of all the checkboxes in a column */
297
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
298
{
299
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
300
        return $('input', td).prop('checked') ? '1' : '0';
301
    } );
302
}
303
 
304
/* Initialise the table with the required column ordering data types */
23786 amit.gupta 305
var customRetailers = ${customRetailers};
23405 amit.gupta 306
$(document).ready(function() {
307
    indentTable = $('#entire-catalog-table').DataTable({
23786 amit.gupta 308
    	"scrollY":"600px",
23405 amit.gupta 309
    	"columns": [
23796 amit.gupta 310
            null, null, null, null,
311
            { "orderDataType": "dom-text-numeric" }, null, null, null
23786 amit.gupta 312
        ],
23796 amit.gupta 313
        "lengthMenu":[[25,50],[25,50]],
314
        "order": []
23405 amit.gupta 315
	});
316
	indentMap = {};
317
	indentTable.rows().data().each(function(arr){
23796 amit.gupta 318
		var $input = $(arr[4]);
23405 amit.gupta 319
		quantity = parseInt($input.val(), 10);
320
		if(quantity > 0){
23786 amit.gupta 321
			indentMap[parseInt(arr[0])] = {"initialQuantity": quantity, "quantity": quantity, "sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
23405 amit.gupta 322
	    }
323
	});
23884 amit.gupta 324
	$("#partnerId").typeahead({
23786 amit.gupta 325
	  source: customRetailers,
326
	  autoSelect: true,
327
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
328
	  afterSelect:	function(currentItem){
329
	  					currentFofoId = currentItem.partnerId;
330
	  				}
331
	});
25701 amit.gupta 332
	populateIndentSummary();
23405 amit.gupta 333
});
334
 
335
</script>