Subversion Repositories SmartDukaan

Rev

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

Rev 23547 Rev 23638
Line 1... Line 1...
1
<style>
1
<style>
-
 
2
	.pointer {
-
 
3
		cursor:pointer;
-
 
4
	}
2
	.modal-content{
5
	.modal-content{
3
		background : white;
6
		background : white;
4
	}
7
	}
5
	.modelHeaderCustom{
8
	.modelHeaderCustom{
6
		font-size:14px;
9
		font-size:14px;
Line 25... Line 28...
25
	.right{
28
	.right{
26
		float:right;
29
		float:right;
27
	}
30
	}
28
	.form-control{
31
	.form-control{
29
		color:black;
32
		color:black;
30
		text-transform:uppercase;
-
 
31
	}
33
	}
32
	.bold-details {
34
	.bold-details {
33
		text-transform:capitalize;
35
		text-transform:capitalize;
34
		font-weight:600;
36
		font-weight:600;
35
		color:#212121;
37
		color:#212121;
Line 102... Line 104...
102
					<th>Unit Price</th>
104
					<th>Unit Price</th>
103
					<th>Quantity</th>
105
					<th>Quantity</th>
104
					<th>Total Price</th>
106
					<th>Total Price</th>
105
					<th>Prebooking Quantity</th>
107
					<th>Prebooking Quantity</th>
106
					<th>Prebooking Amount</th>
108
					<th>Prebooking Amount</th>
-
 
109
					<th></th>
107
				</tr>
110
				</tr>
-
 
111
				 <script type="text/javascript">
-
 
112
				 	fofoLineItemsMap = $fofoOrderItemIdLineItemMap;
-
 
113
				 </script>
108
				 #foreach( $fofoLineItem in $fofoLineItems )
114
				 #foreach( $fofoLineItem in $fofoLineItems )
109
				 #set ($total = $fofoLineItem.getSellingPrice() * $fofoLineItem.getQuantity())
115
				 #set ($total = $fofoLineItem.getSellingPrice() * $fofoLineItem.getQuantity())
110
				 	<tr>
116
				 	<tr>
111
				 		<td>$fofoLineItem.getItemId()</td>
117
				 		<td>$fofoLineItem.getItemId()</td>
112
				 		<td>
118
				 		<td>
Line 120... Line 126...
120
							<td>$itemIdPrebookingOrderItemMap.get($fofoLineItem.getItemId()).getAdvanceAmount()</td>
126
							<td>$itemIdPrebookingOrderItemMap.get($fofoLineItem.getItemId()).getAdvanceAmount()</td>
121
						#else
127
						#else
122
							<td>0</td>
128
							<td>0</td>
123
							<td>0</td>
129
							<td>0</td>
124
						#end
130
						#end
-
 
131
						#if($itemsMap.get($fofoLineItem.getItemId()).getCategoryId()==10006)
-
 
132
							#if($markDoa)
-
 
133
								<td><a class="pointer" data-li="$fofoLineItem.getId()" data-itemdesc="$itemsMap.get($fofoLineItem.getItemId()).getItemDescription()" data-target=".bs-example-modal-sm" data-toggle="modal">Mark DOA</a></td>
-
 
134
							#else
-
 
135
								<td></td>
-
 
136
							#end
-
 
137
						#else
-
 
138
							#if($markDefective)
-
 
139
								<td><a class="pointer" data-li="$fofoLineItem.getId()" data-itemdesc="$itemsMap.get($fofoLineItem.getItemId()).getItemDescription()" data-target=".bs-example-modal-sm" data-toggle="modal">Mark Defective</a></td>
-
 
140
							#else
-
 
141
								<td></td>
-
 
142
							#end
-
 
143
						#end
-
 
144
						<td></td>
125
				 	</tr>
145
				 	</tr>
126
				 #end
146
				 #end
127
			</tbody>
147
			</tbody>
128
		</table>
148
		</table>
129
	</div>
149
	</div>
-
 
150
	<!-- Small modal -->
-
 
151
	<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" id="exampleModal">
-
 
152
	  <div class="modal-dialog modal-md" role="document">
-
 
153
	    <div class="modal-content">
-
 
154
	    <div class="modal-header">
-
 
155
	    	<p class="modal-title"></p>
-
 
156
	    </div>
-
 
157
	    <div class="modal-body">
-
 
158
	    	
-
 
159
	    </div>
-
 
160
	    <div class="modal-footer">
-
 
161
	    	<button type="button" class="return-submit btn btn-primary">Submit</button>
-
 
162
	    </div>
-
 
163
	    </div>
-
 
164
	  </div>
-
 
165
	</div>
130
</div>
166
</div>
131
 
167
 
132
<div class="row">
168
<div class="row">
133
	#if(!$insurancePolicies.isEmpty())
169
	#if(!$insurancePolicies.isEmpty())
134
		<div class="col-lg-8">
170
		<div class="col-lg-8">
Line 180... Line 216...
180
		 </div>
216
		 </div>
181
	</div>
217
	</div>
182
</div>
218
</div>
183
 
219
 
184
</section>
220
</section>
-
 
221
 
-
 
222
<script type="text/javascript">
-
 
223
	$('#exampleModal').on('show.bs.modal', function (event) {
-
 
224
		var link = $(event.relatedTarget); // Button that triggered the modal
-
 
225
  		var itemDesc = link.data('itemdesc'); // Extract info from data-* attributes
-
 
226
  		var foitem = link.data('li'); // Extract info from data-* attributes
-
 
227
  		li = fofoLineItemsMap[foitem]
-
 
228
  		var modal = $(this);
-
 
229
  		modal.find(".modal-title").html(link.html() + "-" + itemDesc);
-
 
230
  		htmlArr = [];
-
 
231
  		htmlArr.push('<div> <ul data-foi="' + foitem + '">');
-
 
232
  		var i;
-
 
233
  		if(link.html()=="Mark Defective"){
-
 
234
  			for( i=0;i<li.length;i++) {
-
 
235
  				htmlArr.push('<li class="row">');
-
 
236
  				htmlArr.push('<div class="col-sm-6 checkbox"><label><input type="checkbox" value="' + li[i].inventoryItemId +'">Defective</label></div>');
-
 
237
  				htmlArr.push('<div class="col-sm-6 form-group"><label for="comment">Remarks</label><textarea class="form-control" rows="2" id="comment"></textarea></div>');
-
 
238
  				htmlArr.push('</li>');
-
 
239
  			}	
-
 
240
  		} else if (link.html()== "Mark DOA") {
-
 
241
  			for(i=0;i<li.length;i++) {
-
 
242
  				htmlArr.push('<li class="row">');
-
 
243
  				htmlArr.push('<div class="checkbox col-sm-6"><label><input type="checkbox" value="' + li[i].inventoryItemId +'">DOA Certificate Valid for IMEI - ' + li[i].serialNumber + '</label></div>');
-
 
244
  				htmlArr.push('<div class="form-group col-sm-6"><label for="comment">Remarks</label><textarea class="form-control" rows="2" id="comment"></textarea></div>');
-
 
245
  				htmlArr.push('</li>');
-
 
246
  			}	
-
 
247
  		}
-
 
248
  		modal.find(".modal-body").html(htmlArr.join(""));
-
 
249
	});
-
 
250
  		
-
 
251
  	$(".return-submit").on('click', function(){
-
 
252
  		var showAlert = false;
-
 
253
  		var checkedInventory = $('.modal-body').find('input:checked');
-
 
254
  		if(checkedInventory.length==0){
-
 
255
  			alert("Check the defective and provide remarks");
-
 
256
  			return;
-
 
257
  		}
-
 
258
  		checkedInventory.each(function(i,v){
-
 
259
  			if($(v).closest('li').find('textarea').val()==''){
-
 
260
  				showAlert = true;
-
 
261
  			}
-
 
262
  		});
-
 
263
  		if(showAlert) {
-
 
264
  			alert('Please add remarks');
-
 
265
  			return;
-
 
266
  		} else {
-
 
267
	  		var foi = $(checkedInventory).closest('ul').data('foi');
-
 
268
	  		var markedBadArr = [];
-
 
269
	  		checkedInventory.each(function(i,v){
-
 
270
	  			markedBadArr.push({"remarks" : $(v).closest('li').find('textarea').val(), 
-
 
271
	  								"inventoryItemId":$(v).val()});
-
 
272
	  		});
-
 
273
	  		var json = {"fofoOrderItemId":foi, "markedBadArr":markedBadArr};
-
 
274
  			doPostAjaxRequestWithJsonHandler('${rc.contextPath}/order/bad_return', JSON.stringify(json), function(data){
-
 
275
  				alert(data);
-
 
276
  			});
-
 
277
  		}
-
 
278
  	});	
-
 
279
</script>
185
280