Subversion Repositories SmartDukaan

Rev

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