Subversion Repositories SmartDukaan

Rev

Rev 23405 | Rev 23796 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23405 Rev 23786
Line 13... Line 13...
13
</style>
13
</style>
14
 
14
 
15
<section class="wrapper">            
15
<section class="wrapper">            
16
	<div class="row">
16
	<div class="row">
17
		<div class="col-lg-12">
17
		<div class="col-lg-12">
18
			<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit Indent</h3>
18
			<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit Allocation</h3>
19
			<ol class="breadcrumb">
19
			<ol class="breadcrumb">
20
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
20
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
-
 
21
				#if($retailerName)
-
 
22
				<script type="text/javascript">
-
 
23
					currentFofoId=${retailerId};
-
 
24
				</script>
-
 
25
				<li><i class="icon_document_alt"></i><b>Allocation for $retailerName (Counter Size - $counterSize)</b></li>
-
 
26
				#else
21
				<li><i class="icon_document_alt"></i>Create/Edit Indent</li>
27
				<li><i class="icon_document_alt"></i><b>Standard Allocation (Counter Size - $counterSize)</b></li>
-
 
28
				#end
22
			</ol>
29
			</ol>
23
		</div>
30
		</div>
24
	</div>
31
	</div>
25
	
32
	
26
    <div>
33
    <div>
-
 
34
    	<div class="row">
-
 
35
	    	<!--<div class="col-lg-3">
-
 
36
                <div class="input-group">
-
 
37
                    <input type="text" class="form-control">
-
 
38
                    <div class="input-group-btn">
-
 
39
                        <button type="button" class="btn btn-default">Get Partner Allocation</span></button>
-
 
40
                    </div>
-
 
41
                </div>
-
 
42
            </div>-->
-
 
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>
-
 
50
		    		</div>
-
 
51
		    	</div>
-
 
52
    		</div>
-
 
53
		    <div class="col-lg-3">
-
 
54
			    <div class="dropdown">
-
 
55
			 		<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Change Counter Size
-
 
56
					  <span class="caret"></span></button>
-
 
57
					  <ul class="dropdown-menu">
-
 
58
					  #foreach($counterSiz in $counterSizes)
-
 
59
					    <li class="mk_counter_size #if(${counterSiz}==${counterSize}) active#end"><a href="javascript:void(0)">$counterSiz</a></li>
-
 
60
					  #end
-
 
61
			  		</ul>
-
 
62
				</div>
-
 
63
	    	</div>
-
 
64
    	</div>
27
	         <div class="row">
65
	         <div class="row">
28
	    		<div class="col-lg-8" id="indent-container">
66
	    		<div class="col-lg-7" id="indent-container">
29
	    			<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
67
	    			<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
30
		    			<thead>
68
		    			<thead>
31
				            <tr>
69
				            <tr>
32
								<th>Id</th>
70
								<th>Id</th>
33
	    						<th>Description</th>
71
	    						<th>Description</th>
34
	    						<th>Selling Price</th>
72
	    						<th>Selling Price</th>
35
	    						<th>MOP</th>
73
	    						<th>MOP</th>
36
	    						<th>Stock</th>
74
	    						<th>Stock</th>
37
	    						<th>30 days Sale</th>
75
	    						<th>30 days Sale</th>
38
	    						<th>Required Quantity</th>
76
	    						<th>Allocated Quantity</th>
39
				            </tr>
77
				            </tr>
40
				        </thead>
78
				        </thead>
41
	    				<tbody>
79
	    				<tbody>
42
	    					#foreach( $tagListing in $tagListings )
80
	    					#foreach( $tagListing in $tagListings )
43
		    					#set($requestedQty=0)
-
 
44
								#if($itemIndentMap.get($tagListing.getItemId()) and $itemIndentMap.get($tagListing.getItemId()).getRequestedQuantity() > 0 )
-
 
45
			    					#set($requestedQty=$itemIndentMap.get($tagListing.getItemId()).getRequestedQuantity())
-
 
46
								#end
-
 
47
	    					<tr>
81
	    					<tr>
48
	    						<td>$tagListing.getItemId()</td>
82
	    						<td>$tagListing.getItemId()</td>
49
	    						<td>$tagListing.getItemDescription()</td>
83
	    						<td>$tagListing.getItemDescription()</td>
50
	    						<td>$tagListing.getSellingPrice()</td>
84
	    						<td class="currency">$tagListing.getSellingPrice()</td>
51
	    						<td>$tagListing.getMop()</td>
85
	    						<td class="currency">$tagListing.getMop()</td>
52
	    						<td>$tagListing.getStockInHand()</td>
86
	    						<td>$tagListing.getStockInHand()</td>
53
	    						<td>$tagListing.getLast30DaysSale()</td>
87
	    						<td>$tagListing.getLast30DaysSale()</td>
54
	    						<td><input type="number" min="0" max="10" 
88
	    						<td><input type="number" min="0" max="10" 
55
	    						data-item-id="$tagListing.getItemId()"
89
	    						data-item-id="$tagListing.getItemId()"
56
	    						data-selling-price="$tagListing.getSellingPrice()"
90
	    						data-selling-price="$tagListing.getSellingPrice()"
57
	    						data-description="$tagListing.getItemDescription()" 
91
	    						data-description="$tagListing.getItemDescription()" 
58
	    						value="$requestedQty"/></td>
92
	    						value="$tagListing.getAllocatedQuantity()"/></td>
59
	    					</tr>
93
	    					</tr>
60
	    					#end
94
	    					#end
61
	    				</tbody>
95
	    				</tbody>
62
	    			</table>
96
	    			</table>
63
	    		</div>
97
	    		</div>
64
	    		<div class="col-lg-8" id="indent-container1" style="display:none"></div>
98
	    		<div class="col-lg-7" id="indent-container1" style="display:none"></div>
65
	    		<div class="col-lg-3">
99
	    		<div class="col-lg-4">
66
	    			<div class="panel panel-default">
100
	    			<div class="panel panel-default">
67
	                  <div class="panel-heading">Indent Summary</div>
101
	                  <div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div>
68
	                  <div class="panel-content">
102
	                  <div class="panel-content">
-
 
103
	                  	<table class="table table-sm" id="summary-table">
69
	                  	<ul class="list-group">
104
	                  		  <thead>
-
 
105
							    <tr>
-
 
106
							      <th class="col">#</th>
70
			                <li class="list-group-item">Total Items - <span id="itemCount"></span></li>
107
							      <th class="col">Items</th>
71
			                <li class="list-group-item">Total Qty - <span id="totalItemQty"></span> pcs</li>
108
							      <th class="col">Quantity</th>
-
 
109
							      <th class="col">Amount</th>
-
 
110
							    </tr>
-
 
111
							  </thead>
-
 
112
							  <tbody>
-
 
113
							    <tr>
72
			                <li class="list-group-item">Total Amount - Rs.<span id="totalAmount"></span> </li>
114
							      <th class="row">Initial</th>
-
 
115
							      <td></td>
-
 
116
							      <td></td>
-
 
117
							      <td></th>
-
 
118
							    </tr>
-
 
119
							    <tr>
-
 
120
							      <th class="row">Added</th>
-
 
121
							      <td></td>
-
 
122
							      <td></td>
-
 
123
							      <td></th>
-
 
124
							    </tr>
-
 
125
							    <tr>
-
 
126
							      <th class="row">Removed</th>
-
 
127
							      <td></td>
-
 
128
							      <td></td>
-
 
129
							      <td></th>
-
 
130
							    </tr>
-
 
131
							    <tr>
-
 
132
							      <th class="row">Final</th>
-
 
133
							      <td></td>
-
 
134
							      <td></td>
-
 
135
							      <td></th>
-
 
136
							    </tr>
-
 
137
							  <tbody>
73
	                  	</ul>
138
	                  	</table>
74
			          <button class="btn btn-primary mk_submit_indent">Submit Indent</button>
139
			          <button class="btn btn-primary mk_submit_indent">Update Allocation</button>
75
			          <button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button>
140
			          <button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button>
76
			          <button class="btn btn-primary confirm_indent" style="display:none">Confirm Indent</button>
141
			          <button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>
77
	                  </div>
142
	                  </div>
78
                	</div>
143
                	</div>
-
 
144
                	<div class="panel panel-default">
-
 
145
                		<div class="panel-heading">Brandwise Target and Performance</div>
-
 
146
                		<div class="panel-content">
-
 
147
                		<ul class="nav nav-tabs">
-
 
148
						  <li role="presentation" class="active brandLi"><a href="javascript:void(0)">Mobiles</a></li>
-
 
149
						  <li role="presentation" class="brandLi"><a href="javascript:void(0)">Accessories</a></li>
-
 
150
						</ul>
-
 
151
 
-
 
152
						<table class="brandPerformance table table-striped table-condensed table-bordered">
-
 
153
							<thead>
-
 
154
								<tr>
-
 
155
									<th rowspan="2">Brand Name</th>
-
 
156
									<th rowspan="2" align="center">Target Value</th>
-
 
157
									<th colspan="2" align="center">Achieved</th>
-
 
158
									<th colspan="2">Brand Share(%)</th>
-
 
159
								</tr>
-
 
160
								<tr>
-
 
161
									<th>Value</th>
-
 
162
									<th>Percentage</th>
-
 
163
									<th>Target</th>
-
 
164
									<th>Achieved</th>
-
 
165
								</tr>
-
 
166
							</thead>
-
 
167
							<tbody>
-
 
168
							#foreach($brandPerformance in $brandPerformanceList)
-
 
169
								<tr>
-
 
170
									<th>$brandPerformance.getBrandName()</th>
-
 
171
									<td class="currency">$brandPerformance.getTarget()</td>
-
 
172
									<td class="currency">$brandPerformance.getAchieved()</td>
-
 
173
									<td>$brandPerformance.getAchievedPercentage()%</td>
-
 
174
									<td>$brandPerformance.getBrandTargetShare()</td>
-
 
175
									<td>$brandPerformance.getBrandAchievedShare()</td>
-
 
176
								</tr>
-
 
177
							#end
-
 
178
							<tbody>
-
 
179
							</tbody>
-
 
180
						</table>
-
 
181
						<table style="display:none" class="table brandPerformance table-striped table-condensed table-bordered">
-
 
182
							<thead>
-
 
183
								<tr>
-
 
184
									<th rowspan="2">Brand Name</th>
-
 
185
									<th rowspan="2" align="center">Target Value</th>
-
 
186
									<th colspan="2" align="center">Achieved</th>
-
 
187
									<th colspan="2">Brand Share(%)</th>
-
 
188
								</tr>
-
 
189
								<tr>
-
 
190
									<th>Value</th>
-
 
191
									<th>Percentage</th>
-
 
192
									<th>Target</th>
-
 
193
									<th>Achieved</th>
-
 
194
								</tr>
-
 
195
							</thead>
-
 
196
							<tbody>
-
 
197
							#foreach($brandPerformance in $accsBrandPerformanceList)
-
 
198
								<tr>
-
 
199
									<th>$brandPerformance.getBrandName()</th>
-
 
200
									<td>$brandPerformance.getTarget()</td>
-
 
201
									<td>$brandPerformance.getAchieved()</td>
-
 
202
									<td>$brandPerformance.getAchievedPercentage()%</td>
-
 
203
									<td>$brandPerformance.getBrandTargetShare()</td>
-
 
204
									<td>$brandPerformance.getBrandAchievedShare()</td>
-
 
205
								</tr>
-
 
206
							#end
-
 
207
							<tbody>
-
 
208
							</tbody>
-
 
209
						</table>
-
 
210
                		</div>
-
 
211
                		
-
 
212
                	</div>
79
	    		</div>
213
	    		</div>
80
	    	</div>
214
	    	</div>
81
    	</div>
215
    	</div>
82
</section>
216
</section>
83
<script type="text/javascript">
217
<script type="text/javascript">
Line 112... Line 246...
112
        return $('input', td).prop('checked') ? '1' : '0';
246
        return $('input', td).prop('checked') ? '1' : '0';
113
    } );
247
    } );
114
}
248
}
115
 
249
 
116
/* Initialise the table with the required column ordering data types */
250
/* Initialise the table with the required column ordering data types */
-
 
251
var customRetailers = ${customRetailers};
117
$(document).ready(function() {
252
$(document).ready(function() {
118
    indentTable = $('#entire-catalog-table').DataTable({
253
    indentTable = $('#entire-catalog-table').DataTable({
-
 
254
    	"scrollY":"600px",
119
    	"columns": [
255
    	"columns": [
120
            null,null, null, null, null, null,
256
            null,null, null, null, null, null,
121
            { "orderDataType": "dom-text-numeric" }
257
            { "orderDataType": "dom-text-numeric" }
122
        ]
258
        ],
-
 
259
        "lengthMenu":[[25,50],[25,50]]
123
	});
260
	});
124
	indentMap = {};
261
	indentMap = {};
125
	indentTable.rows().data().each(function(arr){
262
	indentTable.rows().data().each(function(arr){
126
		var $input = $(arr[6]);
263
		var $input = $(arr[6]);
127
		quantity = parseInt($input.val(), 10);
264
		quantity = parseInt($input.val(), 10);
128
		if(quantity > 0){
265
		if(quantity > 0){
129
			indentMap[parseInt(arr[0])] = {"quantity": quantity, "sellingPrice":parseInt(arr[2]), "description": arr[1]}
266
			indentMap[parseInt(arr[0])] = {"initialQuantity": quantity, "quantity": quantity, "sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
130
	    }
267
	    }
131
	});
268
	});
-
 
269
	$(".typeahead").typeahead({
-
 
270
	  source: customRetailers,
-
 
271
	  autoSelect: true,
-
 
272
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
-
 
273
	  afterSelect:	function(currentItem){
-
 
274
	  					currentFofoId = currentItem.partnerId;
-
 
275
	  				}
-
 
276
	});
132
	populateIndentSummary();
277
	populateIndentSummary();
133
	
-
 
134
});
278
});
135
 
279
 
136
</script>
280
</script>
137
281