| 23783 |
ashik.ali |
1 |
$(function() {
|
|
|
2 |
$(".create-item").live('click', function() {
|
|
|
3 |
loadCreateItem("main-content");
|
|
|
4 |
});
|
|
|
5 |
|
|
|
6 |
$(".scan-in-items").live('click', function() {
|
| 24168 |
amit.gupta |
7 |
getAuthorisedWarehouses(function(warehouseId){
|
|
|
8 |
loadScanInItems(warehouseId, "main-content");
|
|
|
9 |
});
|
| 23783 |
ashik.ali |
10 |
});
|
|
|
11 |
|
|
|
12 |
$(".scan-in-partner-items").live('click', function() {
|
|
|
13 |
loadScanInPartnerItems("main-content");
|
|
|
14 |
});
|
| 23882 |
ashik.ali |
15 |
|
|
|
16 |
$(".scan-out-partner-items").live('click', function() {
|
|
|
17 |
loadScanOutPartnerItems("main-content");
|
|
|
18 |
});
|
| 23783 |
ashik.ali |
19 |
|
|
|
20 |
$("#scanInPartnerItemButton").live('click', function() {
|
| 23882 |
ashik.ali |
21 |
var deliveryNoteId = $("#scanInPartnerItemModel .deliveryNoteId").text();
|
|
|
22 |
var itemIdSerialNumbersMap = {};
|
|
|
23 |
var itemIdQuantityMap = {};
|
|
|
24 |
$('.itemIdSerialNumbersContainer').each(function(){
|
|
|
25 |
var itemId = $(this).find('.itemId').attr('itemId');
|
|
|
26 |
console.log("itemId : "+itemId);
|
|
|
27 |
var itemType = $(this).find('.itemId').attr('itemType');
|
|
|
28 |
if(itemType == 'SERIALIZED'){
|
|
|
29 |
$(this).find('.serialNumber').each(function(){
|
|
|
30 |
var serialNumber = $(this).val();
|
|
|
31 |
console.log(serialNumber);
|
|
|
32 |
if(itemIdSerialNumbersMap[itemId] == undefined){
|
|
|
33 |
itemIdSerialNumbersMap[itemId] = [];
|
|
|
34 |
}
|
|
|
35 |
itemIdSerialNumbersMap[itemId].push(serialNumber);
|
|
|
36 |
});
|
|
|
37 |
}else{
|
|
|
38 |
var quantity = $(this).find('.quantity').text();
|
|
|
39 |
console.log(quantity);
|
|
|
40 |
itemIdQuantityMap[itemId] = parseInt(quantity);
|
|
|
41 |
}
|
|
|
42 |
});
|
|
|
43 |
//console.log(itemIdSerialNumbersMap);
|
|
|
44 |
//console.log(itemIdQuantityMap);
|
|
|
45 |
var scanInPartnerItemRequest = {'deliveryNoteId' : deliveryNoteId, 'itemIdSerialNumbersMap' : itemIdSerialNumbersMap, 'itemIdQuantityMap' : itemIdQuantityMap};
|
|
|
46 |
console.log(scanInPartnerItemRequest);
|
|
|
47 |
submitScanInPartnerItem(scanInPartnerItemRequest);
|
| 23783 |
ashik.ali |
48 |
return false;
|
|
|
49 |
});
|
| 23882 |
ashik.ali |
50 |
|
|
|
51 |
$("#scanOutPartnerItemButton").live('click', function() {
|
|
|
52 |
var itemId = $("#scanOutPartnerItemModel .itemId").val();
|
|
|
53 |
var itemType = $("#scanOutPartnerItemModel .itemType").val();
|
|
|
54 |
var serialNumber = null;
|
|
|
55 |
if(itemType == 'SERIALIZED'){
|
|
|
56 |
serialNumber = $("#itemSerialNumbers option:selected").val();
|
|
|
57 |
}
|
|
|
58 |
var firstName = $("#scanOutPartnerItemModel .firstName").val();
|
|
|
59 |
if(firstName == ''){
|
|
|
60 |
alert('Please enter first Name');
|
|
|
61 |
//$("#scanOutPartnerItemModel .close").click();
|
|
|
62 |
return;
|
|
|
63 |
}
|
|
|
64 |
var lastName = $("#scanOutPartnerItemModel .lastName").val();
|
|
|
65 |
if(lastName == ""){
|
|
|
66 |
alert('Please enter first Name');
|
|
|
67 |
return;
|
|
|
68 |
}
|
|
|
69 |
var emailId = $("#scanOutPartnerItemModel .emailId").val();
|
|
|
70 |
if(emailId == ""){
|
|
|
71 |
alert('Please enter email Id');
|
|
|
72 |
return;
|
|
|
73 |
}
|
|
|
74 |
var mobileNumber = $("#scanOutPartnerItemModel .mobileNumber").val();
|
|
|
75 |
if(mobileNumber == ""){
|
|
|
76 |
alert('Please enter mobile Number');
|
|
|
77 |
}
|
|
|
78 |
var line1 = $("#scanOutPartnerItemModel .line1").val();
|
|
|
79 |
if(line1 == ""){
|
|
|
80 |
alert('Please enter line1 address');
|
|
|
81 |
}
|
|
|
82 |
var line2 = $("#scanOutPartnerItemModel .line2").val();
|
|
|
83 |
var landmark = $("#scanOutPartnerItemModel .landmark").val();
|
|
|
84 |
var pinCode = $("#scanOutPartnerItemModel .pinCode").val();
|
|
|
85 |
if(pinCode == ""){
|
|
|
86 |
alert('Please enter pinCode');
|
|
|
87 |
}
|
|
|
88 |
var city = $("#scanOutPartnerItemModel .city").val();
|
|
|
89 |
if(city == ""){
|
|
|
90 |
alert('Please enter city name');
|
|
|
91 |
}
|
|
|
92 |
var state = $("#scanOutPartnerItemModel .state option:selected").val();
|
|
|
93 |
if(state == ""){
|
|
|
94 |
alert('Please choose state name');
|
|
|
95 |
}
|
|
|
96 |
var customerDetails = {};
|
|
|
97 |
customerDetails['firstName'] = firstName;
|
|
|
98 |
customerDetails['lastName'] = lastName;
|
|
|
99 |
customerDetails['emailId'] = emailId;
|
|
|
100 |
customerDetails['mobileNumber'] = mobileNumber;
|
|
|
101 |
var address = {};
|
|
|
102 |
address['name'] = firstName + ' ' + lastName;
|
|
|
103 |
address['line1'] = line1;
|
|
|
104 |
address['line2'] = line2;
|
|
|
105 |
address['landmark'] = landmark;
|
|
|
106 |
address['pinCode'] = pinCode;
|
|
|
107 |
address['city'] = city;
|
|
|
108 |
address['state'] = state;
|
|
|
109 |
address['phoneNumber'] = mobileNumber;
|
|
|
110 |
customerDetails['address'] = address;
|
|
|
111 |
submitScanOutPartnerItem(itemId, serialNumber, customerDetails);
|
|
|
112 |
return false;
|
|
|
113 |
});
|
|
|
114 |
|
|
|
115 |
$("#scanOutPartnerItemResetButton").live('click', function() {
|
|
|
116 |
$("#scanOutPartnerItemModel .firstName").val("");
|
|
|
117 |
$("#scanOutPartnerItemModel .lastName").val("");
|
|
|
118 |
$("#scanOutPartnerItemModel .emailId").val("");
|
|
|
119 |
$("#scanOutPartnerItemModel .mobileNumber").val("");
|
|
|
120 |
$("#scanOutPartnerItemModel .line1").val('');
|
|
|
121 |
$("#scanOutPartnerItemModel .line2").val('');
|
|
|
122 |
$("#scanOutPartnerItemModel .landmark").val('');
|
|
|
123 |
$("#scanOutPartnerItemModel .pinCode").val('');
|
|
|
124 |
$("#scanOutPartnerItemModel .city").val('');
|
|
|
125 |
return false;
|
|
|
126 |
});
|
| 23783 |
ashik.ali |
127 |
|
|
|
128 |
$("#deliveryNoteId").live("keyup", function(e) {
|
|
|
129 |
var keyCode = e.keyCode || e.which;
|
|
|
130 |
if(keyCode == 13){
|
|
|
131 |
scanInPartnerItemDialog();
|
|
|
132 |
}
|
|
|
133 |
});
|
|
|
134 |
|
|
|
135 |
$("#scanInItemButton").live('click', function() {
|
|
|
136 |
var imeis = [];
|
|
|
137 |
var error = false;
|
|
|
138 |
var errorText = "";
|
|
|
139 |
$("#serialNumberContainer :input").each(function(){
|
|
|
140 |
var input = $(this).val().trim();
|
|
|
141 |
if (imeis.indexOf(input) !=-1 || !input){
|
|
|
142 |
error = true;
|
|
|
143 |
if (!input){
|
|
|
144 |
$(this).addClass("border-highlight");
|
|
|
145 |
}
|
|
|
146 |
}
|
|
|
147 |
imeis.push(input);
|
|
|
148 |
|
|
|
149 |
});
|
|
|
150 |
if (error){
|
|
|
151 |
return false;
|
|
|
152 |
}
|
|
|
153 |
console.log("imeis : "+imeis);
|
|
|
154 |
var itemId = $("#scanInItemModel .itemId").val();
|
| 23882 |
ashik.ali |
155 |
var warehouseId = $('#scanInItemModel .warehouseId').val();
|
| 23783 |
ashik.ali |
156 |
var quantity = $(".modal-body .itemQuantity>span").text();
|
| 23882 |
ashik.ali |
157 |
submitScanInItem(itemId, warehouseId, quantity, imeis);
|
| 23783 |
ashik.ali |
158 |
|
|
|
159 |
return false;
|
|
|
160 |
});
|
|
|
161 |
|
| 23882 |
ashik.ali |
162 |
$('#admin-warehouses').live('change', function(){
|
| 23783 |
ashik.ali |
163 |
var warehouseId = $(this).val();
|
| 23882 |
ashik.ali |
164 |
loadWarehouseInstructionItemsByWarehouseId("warehouse-instruction-items-container", warehouseId);
|
| 23783 |
ashik.ali |
165 |
});
|
|
|
166 |
|
|
|
167 |
$(".scan-out-items").live('click', function() {
|
| 24168 |
amit.gupta |
168 |
getAuthorisedWarehouses(function(warehouseId){
|
|
|
169 |
loadScanOutItems(warehouseId, "main-content");
|
|
|
170 |
});
|
| 23783 |
ashik.ali |
171 |
});
|
|
|
172 |
|
|
|
173 |
$("#scanOutItemButton").live('click', function() {
|
|
|
174 |
var warehouseId = $("#scanOutItemModel .warehouseId").val();
|
|
|
175 |
if(warehouseId == ""){
|
|
|
176 |
alert("Please choose warehouse");
|
|
|
177 |
$("#scanOutItemModel .close").click();
|
|
|
178 |
return;
|
|
|
179 |
}
|
|
|
180 |
var userId = $("#scanOutItemModel .userId").val();
|
|
|
181 |
if(userId == ""){
|
|
|
182 |
alert("Please choose user");
|
|
|
183 |
$("#scanOutItemModel .close").click();
|
|
|
184 |
return;
|
|
|
185 |
}
|
| 23882 |
ashik.ali |
186 |
var instructionItemIdInstructionItemDetailMap = {};
|
|
|
187 |
var instructionItemIds = [];
|
|
|
188 |
var itemIdSerialNumbersMap = {};
|
|
|
189 |
$("#instructionItemsContainer .instruction-item").each(function() {
|
|
|
190 |
var $instructionItem = $(this);
|
|
|
191 |
var instructionItemId = $instructionItem.find('.instructionItemId').text();
|
|
|
192 |
console.log("instructionItemId : "+instructionItemId);
|
|
|
193 |
instructionItemIds.push(instructionItemId);
|
|
|
194 |
$instructionItem.find('.instruction-item-detail').each(function(){
|
|
|
195 |
var $instructionItemDetail = $(this);
|
|
|
196 |
var itemId = $instructionItemDetail.find('.itemId').attr('itemId');
|
|
|
197 |
console.log("itemId : "+itemId);
|
|
|
198 |
var itemType = $instructionItemDetail.find('.itemId').attr('itemType');
|
|
|
199 |
console.log("itemType : "+itemType);
|
|
|
200 |
if(itemType == 'SERIALIZED'){
|
|
|
201 |
$instructionItemDetail.find('.serialNumber').each(function(){
|
|
|
202 |
var serialNumber = $(this).val();
|
|
|
203 |
console.log("serialNumber : "+serialNumber);
|
|
|
204 |
if(itemIdSerialNumbersMap[itemId] == undefined){
|
|
|
205 |
//var serialNumbers = [];
|
|
|
206 |
//serialNumbers.push(serialNumber);
|
|
|
207 |
itemIdSerialNumbersMap[itemId] = [];
|
|
|
208 |
}
|
|
|
209 |
itemIdSerialNumbersMap[itemId].push(serialNumber);
|
|
|
210 |
|
|
|
211 |
});
|
|
|
212 |
}else{
|
|
|
213 |
itemIdSerialNumbersMap[itemId] = [];
|
|
|
214 |
}
|
|
|
215 |
});
|
|
|
216 |
});
|
|
|
217 |
console.log(instructionItemIds);
|
|
|
218 |
console.log(itemIdSerialNumbersMap);
|
|
|
219 |
var scanOutItemRequest = {
|
|
|
220 |
"warehouseId":parseInt(warehouseId),
|
|
|
221 |
"userId":parseInt(userId),
|
|
|
222 |
"instructionItemIds":instructionItemIds,
|
|
|
223 |
"itemIdSerialNumbersMap":itemIdSerialNumbersMap
|
|
|
224 |
};
|
|
|
225 |
console.log(scanOutItemRequest);
|
|
|
226 |
submitScanOutItem(scanOutItemRequest);
|
| 23783 |
ashik.ali |
227 |
|
|
|
228 |
return false;
|
|
|
229 |
});
|
|
|
230 |
|
|
|
231 |
$("#items-paginated .next").live('click', function() {
|
|
|
232 |
loadPaginatedNextItems('/getPaginatedItems', null, 'items-paginated', 'items-table', null);
|
|
|
233 |
$(this).blur();
|
|
|
234 |
});
|
|
|
235 |
|
|
|
236 |
$("#items-paginated .previous").live('click', function() {
|
|
|
237 |
loadPaginatedPreviousItems('/getPaginatedItems', null, 'items-paginated', 'items-table', null);
|
|
|
238 |
$(this).blur();
|
|
|
239 |
});
|
|
|
240 |
|
|
|
241 |
$("#scan-in-items-paginated .next").live('click', function() {
|
| 24168 |
amit.gupta |
242 |
var warehouseId = $('input[name="warehouseId]');
|
|
|
243 |
loadPaginatedNextItems('/getPaginatedScanInItems/' + warehouseId, null, 'scan-in-items-paginated', 'scan-in-items-table', null);
|
| 23783 |
ashik.ali |
244 |
$(this).blur();
|
|
|
245 |
});
|
|
|
246 |
|
|
|
247 |
$("#scan-in-items-paginated .previous").live('click', function() {
|
|
|
248 |
loadPaginatedPreviousItems('/getPaginatedScanInItems', null, 'scan-in-items-paginated', 'scan-in-items-table', null);
|
|
|
249 |
$(this).blur();
|
|
|
250 |
});
|
|
|
251 |
|
|
|
252 |
$("#scan-out-items-paginated .next").live('click', function() {
|
|
|
253 |
loadPaginatedNextItems('/getPaginatedScanOutItems', null, 'scan-out-items-paginated', 'scan-out-items-table', null);
|
|
|
254 |
$(this).blur();
|
|
|
255 |
});
|
|
|
256 |
|
|
|
257 |
$("#scan-out-items-paginated .previous").live('click', function() {
|
|
|
258 |
loadPaginatedPreviousItems('/getPaginatedScanOutItems', null, 'scan-out-items-paginated', 'scan-out-items-table', null);
|
|
|
259 |
$(this).blur();
|
|
|
260 |
});
|
|
|
261 |
|
|
|
262 |
$("#scan-in-partner-items-paginated .next").live('click', function() {
|
|
|
263 |
loadPaginatedNextItems('/getPaginatedScanInPartnerItems', null, 'scan-in-partner-items-paginated', 'scan-in-partner-items-table', null);
|
|
|
264 |
$(this).blur();
|
|
|
265 |
});
|
|
|
266 |
|
|
|
267 |
$("#scan-in-partner-items-paginated .previous").live('click', function() {
|
|
|
268 |
loadPaginatedPreviousItems('/getPaginatedScanInPartnerItems', null, 'scan-in-partner-items-paginated', 'scan-in-partner-items-table', null);
|
|
|
269 |
$(this).blur();
|
|
|
270 |
});
|
| 23882 |
ashik.ali |
271 |
|
|
|
272 |
$("#scan-out-partner-items-paginated .next").live('click', function() {
|
|
|
273 |
loadPaginatedNextItems('/getPaginatedScanOutPartnerItems', null, 'scan-out-partner-items-paginated', 'scan-out-partner-items-table', null);
|
|
|
274 |
$(this).blur();
|
|
|
275 |
});
|
|
|
276 |
|
|
|
277 |
$("#scan-out-partner-items-paginated .previous").live('click', function() {
|
|
|
278 |
loadPaginatedPreviousItems('/getPaginatedScanOutPartnerItems', null, 'scan-out-partner-items-paginated', 'scan-out-partner-items-table', null);
|
|
|
279 |
$(this).blur();
|
|
|
280 |
});
|
| 23783 |
ashik.ali |
281 |
});
|
|
|
282 |
|
|
|
283 |
function scanInItemDialog(){
|
|
|
284 |
var itemId = $('#items-for-scan-in').val();
|
|
|
285 |
var itemDescription = $('#items-for-scan-in option:selected').text();
|
| 24168 |
amit.gupta |
286 |
var warehouseId = $('#warehouseId').val();
|
|
|
287 |
var warehouseName = $('#warehouseName').val();
|
| 23783 |
ashik.ali |
288 |
var itemType = $('#items-for-scan-in option:selected').attr('itemType');
|
|
|
289 |
var quantity = parseInt($('#quantity').val());
|
|
|
290 |
if(quantity == undefined || quantity == "" || quantity <= 0 || isNaN(quantity)){
|
|
|
291 |
quantity = 1;
|
|
|
292 |
}
|
|
|
293 |
$("#scanInItemModel .itemId").val(itemId);
|
| 23882 |
ashik.ali |
294 |
$("#scanInItemModel .warehouseId").val(warehouseId);
|
| 23783 |
ashik.ali |
295 |
|
|
|
296 |
$(".modal-body .itemInformation>span").text(itemDescription);
|
| 23882 |
ashik.ali |
297 |
$(".modal-body .warehouseName>span").text(warehouseName);
|
|
|
298 |
|
| 23783 |
ashik.ali |
299 |
$(".modal-body .itemQuantity>span").text(quantity);
|
|
|
300 |
$( "#serialNumberContainer" ).empty();
|
|
|
301 |
|
|
|
302 |
if(itemType == "SERIALIZED"){
|
|
|
303 |
$(".modal-body .modal-title").text("Enter Serial Numbers");
|
|
|
304 |
var qty = parseInt(quantity);
|
|
|
305 |
var divCode = '<div class="row">CONTENT</div><p></p>';
|
|
|
306 |
var innerDiv = '<div class="col-sm-3">'+
|
|
|
307 |
'<div class="input-group">'+
|
|
|
308 |
'<input type="text" class="form-control">'+
|
|
|
309 |
'</div>'+
|
|
|
310 |
'</div>';
|
|
|
311 |
while(qty!=0){
|
|
|
312 |
var divText = "";
|
|
|
313 |
if (qty < 4){
|
|
|
314 |
var cp = qty;
|
|
|
315 |
for (var i=0;i<cp;i++ ){
|
|
|
316 |
divText = divText + innerDiv;
|
|
|
317 |
qty = qty - 1;
|
|
|
318 |
}
|
|
|
319 |
}else{
|
|
|
320 |
for(var i=0;i<4;i++){
|
|
|
321 |
divText = divText + innerDiv;
|
|
|
322 |
qty = qty - 1;
|
|
|
323 |
}
|
|
|
324 |
}
|
|
|
325 |
divText = divCode.replace("CONTENT", divText);
|
|
|
326 |
$("#serialNumberContainer")
|
|
|
327 |
.append(divText)
|
|
|
328 |
}
|
|
|
329 |
}else{
|
|
|
330 |
$(".modal-body .modal-title").text("");
|
|
|
331 |
}
|
|
|
332 |
|
|
|
333 |
}
|
|
|
334 |
|
| 23882 |
ashik.ali |
335 |
function submitScanInItem(itemId, warehouseId, quantity, serialNumbers){
|
|
|
336 |
var postData = JSON.stringify({"itemId":parseInt(itemId), "warehouseId":parseInt(warehouseId), "quantity":parseInt(quantity), "serialNumbers":serialNumbers});
|
|
|
337 |
console.log(postData);
|
| 23783 |
ashik.ali |
338 |
doPostAjaxRequestWithJsonHandler(context+"/scanInItems", postData, function(response){
|
|
|
339 |
$('#main-content').html(response);
|
|
|
340 |
alert("Scanned in successfully");
|
|
|
341 |
});
|
|
|
342 |
}
|
|
|
343 |
|
|
|
344 |
function scanOutItemDialog(){
|
| 23882 |
ashik.ali |
345 |
var warehouseId = $('#admin-warehouses-for-scan-out').val();
|
|
|
346 |
var warehouseName = $('#admin-warehouses-for-scan-out option:selected').text();
|
| 23783 |
ashik.ali |
347 |
var userId = $('#fofo-users').val();
|
|
|
348 |
var emailId = $('#fofo-users option:selected').text();
|
|
|
349 |
console.log("warehouseId : "+warehouseId);
|
|
|
350 |
console.log("warehouseName : "+warehouseName);
|
|
|
351 |
console.log("userId : "+userId);
|
|
|
352 |
console.log("emailId : "+emailId);
|
|
|
353 |
|
|
|
354 |
$("#scanOutItemModel .warehouseId").val(warehouseId);
|
|
|
355 |
$("#scanOutItemModel .userId").val(userId);
|
|
|
356 |
|
|
|
357 |
$(".modal-body .warehouseInformation>span").text(warehouseName);
|
|
|
358 |
$(".modal-body .userInformation>span").text(emailId);
|
| 23882 |
ashik.ali |
359 |
$( "#instructionItemsContainer" ).empty();
|
| 23783 |
ashik.ali |
360 |
|
| 23882 |
ashik.ali |
361 |
loadPendingInstructionItemsByWarehouseIdAndUserId('instructionItemsContainer', warehouseId, userId);
|
| 23783 |
ashik.ali |
362 |
|
|
|
363 |
}
|
|
|
364 |
|
| 23882 |
ashik.ali |
365 |
function submitScanOutItem(scanOutItemRequest){
|
|
|
366 |
var postData = JSON.stringify(scanOutItemRequest);
|
| 23783 |
ashik.ali |
367 |
doPostAjaxRequestWithJsonHandler(context+"/scanOutItems", postData, function(response){
|
|
|
368 |
$('#main-content').html(response);
|
|
|
369 |
alert("Scanned out successfully");
|
|
|
370 |
});
|
|
|
371 |
}
|
|
|
372 |
|
|
|
373 |
function scanInPartnerItemDialog(){
|
|
|
374 |
var deliveryNoteId = $('#deliveryNoteId').val();
|
|
|
375 |
|
|
|
376 |
console.log("deliveryNoteId : "+deliveryNoteId);
|
|
|
377 |
|
| 23882 |
ashik.ali |
378 |
loadAdminDeliveryNoteDetails("delivery-note-details-container", deliveryNoteId);
|
| 23783 |
ashik.ali |
379 |
}
|
|
|
380 |
|
| 23882 |
ashik.ali |
381 |
function submitScanInPartnerItem(scanInPartnerItemRequest){
|
|
|
382 |
doPostAjaxRequestWithJsonHandler(context+'/scanInPartnerItems', JSON.stringify(scanInPartnerItemRequest), function(response){
|
| 23783 |
ashik.ali |
383 |
$('#main-content').html(response);
|
|
|
384 |
alert("Scanned in successfully");
|
|
|
385 |
});
|
|
|
386 |
}
|
|
|
387 |
|
| 23882 |
ashik.ali |
388 |
function scanOutPartnerItemDialog(){
|
|
|
389 |
var itemId = $('#scan-out-partner-items').val();
|
|
|
390 |
var itemDescription = $('#scan-out-partner-items option:selected').text();
|
|
|
391 |
var itemType = $('#scan-out-partner-items option:selected').attr('itemType');
|
|
|
392 |
var quantity = $('#scan-out-partner-items option:selected').attr('quantity');
|
|
|
393 |
|
|
|
394 |
console.log("itemId : "+itemId);
|
|
|
395 |
console.log("itemDescription : "+itemDescription);
|
|
|
396 |
console.log("itemType : "+itemType);
|
|
|
397 |
console.log("quantity : "+quantity);
|
|
|
398 |
|
|
|
399 |
$("#scanOutPartnerItemModel .itemId").val(itemId);
|
|
|
400 |
$("#scanOutPartnerItemModel .itemType").val(itemType);
|
|
|
401 |
|
|
|
402 |
$(".modal-body .itemInformation>span").text(itemDescription);
|
|
|
403 |
$( "#serialNumberContainer" ).empty();
|
|
|
404 |
|
|
|
405 |
if(itemType == "SERIALIZED"){
|
|
|
406 |
$(".modal-body .modal-title").text("Enter Serial Numbers");
|
|
|
407 |
var qty = parseInt(quantity);
|
|
|
408 |
var divCode = '<div class="row">CONTENT</div><p></p>';
|
|
|
409 |
var innerDiv = '<div class="col-sm-3">'+
|
|
|
410 |
'<div class="input-group">'+
|
|
|
411 |
'<input type="text" class="form-control">'+
|
|
|
412 |
'</div>'+
|
|
|
413 |
'</div>';
|
|
|
414 |
while(qty!=0){
|
|
|
415 |
var divText = "";
|
|
|
416 |
if (qty < 4){
|
|
|
417 |
var cp = qty;
|
|
|
418 |
for (var i=0;i<cp;i++ ){
|
|
|
419 |
divText = divText + innerDiv;
|
|
|
420 |
qty = qty - 1;
|
|
|
421 |
}
|
|
|
422 |
}else{
|
|
|
423 |
for(var i=0;i<4;i++){
|
|
|
424 |
divText = divText + innerDiv;
|
|
|
425 |
qty = qty - 1;
|
|
|
426 |
}
|
|
|
427 |
}
|
|
|
428 |
divText = divCode.replace("CONTENT", divText);
|
|
|
429 |
$("#serialNumberContainer")
|
|
|
430 |
.append(divText)
|
|
|
431 |
}
|
|
|
432 |
//loadItemSerialNumbers('serialNumberContainer', itemId);
|
|
|
433 |
}else{
|
|
|
434 |
$(".modal-body .modal-title").text("Quantity : "+quantity);
|
|
|
435 |
}
|
|
|
436 |
|
|
|
437 |
}
|
|
|
438 |
|
|
|
439 |
function submitScanOutPartnerItem(itemId, serialNumber, customerDetails){
|
|
|
440 |
var postData = JSON.stringify({"itemId":parseInt(itemId), "serialNumber":serialNumber, "customerDetails":customerDetails});
|
|
|
441 |
doPostAjaxRequestWithJsonHandler(context+"/scanOutPartnerItem", postData, function(response){
|
|
|
442 |
$('#main-content').html(response);
|
|
|
443 |
alert("Scanned out successfully");
|
|
|
444 |
});
|
|
|
445 |
}
|
|
|
446 |
|
| 23783 |
ashik.ali |
447 |
function loadCreateItem(domId){
|
|
|
448 |
doGetAjaxRequestHandler(context+"/createItem", function(response){
|
|
|
449 |
$('#' + domId).html(response);
|
|
|
450 |
});
|
|
|
451 |
}
|
|
|
452 |
|
| 24168 |
amit.gupta |
453 |
function loadScanInItems(warehouseId, domId){
|
|
|
454 |
doGetAjaxRequestHandler(context+"/getScanInItems/" + warehouseId, function(response){
|
| 23783 |
ashik.ali |
455 |
$('#' + domId).html(response);
|
|
|
456 |
});
|
|
|
457 |
}
|
|
|
458 |
|
|
|
459 |
function loadScanInPartnerItems(domId){
|
|
|
460 |
doGetAjaxRequestHandler(context+"/getScanInPartnerItems", function(response){
|
|
|
461 |
$('#' + domId).html(response);
|
|
|
462 |
});
|
|
|
463 |
}
|
|
|
464 |
|
| 23882 |
ashik.ali |
465 |
function loadScanOutPartnerItems(domId){
|
|
|
466 |
doGetAjaxRequestHandler(context+"/getScanOutPartnerItems", function(response){
|
|
|
467 |
$('#' + domId).html(response);
|
|
|
468 |
});
|
|
|
469 |
}
|
|
|
470 |
|
|
|
471 |
|
| 24168 |
amit.gupta |
472 |
function loadScanOutItems(warehouseId, domId){
|
|
|
473 |
doGetAjaxRequestHandler(context+"/getScanOutItems/" + warehouseId, function(response){
|
| 23783 |
ashik.ali |
474 |
$('#' + domId).html(response);
|
|
|
475 |
});
|
|
|
476 |
}
|
|
|
477 |
|
| 23882 |
ashik.ali |
478 |
function loadWarehouseItemSerialNumbers(domId, itemId, warehouseId){
|
|
|
479 |
doGetAjaxRequestHandler(context+"/getSerialNumbersByItemIdWarehouseId?itemId="+itemId+"&warehouseId="+warehouseId, function(response){
|
| 23783 |
ashik.ali |
480 |
$('#' + domId).html(response);
|
|
|
481 |
configureItemSerialNumbersDropDown();
|
|
|
482 |
});
|
|
|
483 |
}
|
|
|
484 |
|
| 23882 |
ashik.ali |
485 |
function loadPendingInstructionItemsByWarehouseIdAndUserId(domId, warehouseId, userId){
|
|
|
486 |
doGetAjaxRequestHandler(context+"/getPendingInstructionItems?userId="+userId+"&warehouseId="+warehouseId, function(response){
|
|
|
487 |
$('#' + domId).html(response);
|
| 23783 |
ashik.ali |
488 |
});
|
|
|
489 |
}
|
|
|
490 |
|
| 23882 |
ashik.ali |
491 |
function loadItemSerialNumbers(domId, itemId){
|
|
|
492 |
doGetAjaxRequestHandler(context+"/getSerialNumbersByItemId?itemId="+itemId, function(response){
|
|
|
493 |
$('#' + domId).html(response);
|
|
|
494 |
configureItemSerialNumbersDropDown();
|
|
|
495 |
});
|
|
|
496 |
}
|
|
|
497 |
|
|
|
498 |
function loadAdminDeliveryNoteDetails(domId, deliveryNoteId){
|
|
|
499 |
doGetAjaxRequestHandler(context+"/deliveryNoteDetails?deliveryNoteId="+deliveryNoteId, function(response){
|
| 23783 |
ashik.ali |
500 |
$('#' + domId).html(response);
|
|
|
501 |
});
|
|
|
502 |
}
|
|
|
503 |
|
|
|
504 |
function configureVendorsDropDown(){
|
|
|
505 |
$(document).ready(function() {
|
|
|
506 |
$('#vendors').multiselect({
|
|
|
507 |
multiple:false,
|
|
|
508 |
includeSelectAllOption: true,
|
|
|
509 |
maxHeight: 200,
|
|
|
510 |
buttonWidth: '270px',
|
|
|
511 |
numberDisplayed: 1,
|
|
|
512 |
nonSelectedText: 'Vendors',
|
|
|
513 |
nSelectedText: ' - Vendors Selected',
|
|
|
514 |
allSelectedText: 'All Vendors Selected',
|
|
|
515 |
enableFiltering: true
|
|
|
516 |
});
|
|
|
517 |
});
|
|
|
518 |
}
|
|
|
519 |
|
| 23882 |
ashik.ali |
520 |
function configureScanOutPartnerItemsDropDown(){
|
|
|
521 |
$(document).ready(function() {
|
|
|
522 |
$('#scan-out-partner-items').multiselect({
|
|
|
523 |
multiple:false,
|
|
|
524 |
includeSelectAllOption: true,
|
|
|
525 |
maxHeight: 200,
|
|
|
526 |
buttonWidth: '280px',
|
|
|
527 |
numberDisplayed: 1,
|
|
|
528 |
nonSelectedText: 'Items',
|
|
|
529 |
nSelectedText: ' - Items Selected',
|
|
|
530 |
allSelectedText: 'All Items Selected',
|
|
|
531 |
enableFiltering: true
|
|
|
532 |
});
|
|
|
533 |
});
|
|
|
534 |
}
|
|
|
535 |
|
| 23783 |
ashik.ali |
536 |
function configureItemsForScanInDropDown(){
|
|
|
537 |
$(document).ready(function() {
|
|
|
538 |
$('#items-for-scan-in').multiselect({
|
|
|
539 |
multiple:false,
|
|
|
540 |
includeSelectAllOption: true,
|
|
|
541 |
maxHeight: 200,
|
|
|
542 |
buttonWidth: '280px',
|
|
|
543 |
numberDisplayed: 1,
|
|
|
544 |
nonSelectedText: 'Items',
|
|
|
545 |
nSelectedText: ' - Items Selected',
|
|
|
546 |
allSelectedText: 'All Items Selected',
|
|
|
547 |
enableFiltering: true
|
|
|
548 |
});
|
|
|
549 |
});
|
|
|
550 |
}
|
|
|
551 |
|
|
|
552 |
function configureWarehouseItemsDropDown(){
|
|
|
553 |
$(document).ready(function() {
|
|
|
554 |
$('#warehouse-items').multiselect({
|
| 23882 |
ashik.ali |
555 |
multiple:true,
|
| 23783 |
ashik.ali |
556 |
includeSelectAllOption: true,
|
|
|
557 |
maxHeight: 200,
|
|
|
558 |
buttonWidth: '200px',
|
|
|
559 |
numberDisplayed: 1,
|
|
|
560 |
nonSelectedText: 'Items',
|
|
|
561 |
nSelectedText: ' - Items Selected',
|
|
|
562 |
allSelectedText: 'All Items Selected',
|
|
|
563 |
enableFiltering: true
|
|
|
564 |
});
|
|
|
565 |
});
|
|
|
566 |
}
|
|
|
567 |
|
| 23882 |
ashik.ali |
568 |
function configureWarehousesForScanInDropDown(){
|
| 23783 |
ashik.ali |
569 |
$(document).ready(function() {
|
| 23882 |
ashik.ali |
570 |
$('#warehouses-for-scan-in').multiselect({
|
| 23783 |
ashik.ali |
571 |
multiple:false,
|
|
|
572 |
includeSelectAllOption: true,
|
|
|
573 |
maxHeight: 200,
|
|
|
574 |
buttonWidth: '200px',
|
|
|
575 |
numberDisplayed: 1,
|
|
|
576 |
nonSelectedText: 'Warehouses',
|
|
|
577 |
nSelectedText: ' - Warehouses Selected',
|
|
|
578 |
allSelectedText: 'All Warehouses Selected',
|
|
|
579 |
enableFiltering: true
|
|
|
580 |
});
|
|
|
581 |
});
|
|
|
582 |
}
|
|
|
583 |
|
| 23882 |
ashik.ali |
584 |
function configureWarehousesForScanOutDropDown(){
|
|
|
585 |
$(document).ready(function() {
|
|
|
586 |
$('#admin-warehouses-for-scan-out').multiselect({
|
|
|
587 |
multiple:false,
|
|
|
588 |
includeSelectAllOption: true,
|
|
|
589 |
maxHeight: 200,
|
|
|
590 |
buttonWidth: '200px',
|
|
|
591 |
numberDisplayed: 1,
|
|
|
592 |
nonSelectedText: 'Warehouses',
|
|
|
593 |
nSelectedText: ' - Warehouses Selected',
|
|
|
594 |
allSelectedText: 'All Warehouses Selected',
|
|
|
595 |
enableFiltering: true
|
|
|
596 |
});
|
|
|
597 |
});
|
|
|
598 |
}
|
|
|
599 |
|
| 23783 |
ashik.ali |
600 |
function configureFofoUsersDropDown(){
|
|
|
601 |
$(document).ready(function() {
|
|
|
602 |
$('#fofo-users').multiselect({
|
|
|
603 |
multiple:false,
|
|
|
604 |
includeSelectAllOption: true,
|
|
|
605 |
maxHeight: 200,
|
|
|
606 |
buttonWidth: '200px',
|
|
|
607 |
numberDisplayed: 1,
|
|
|
608 |
nonSelectedText: 'Users',
|
|
|
609 |
nSelectedText: ' - Users Selected',
|
|
|
610 |
allSelectedText: 'All Users Selected',
|
|
|
611 |
enableFiltering: true
|
|
|
612 |
});
|
|
|
613 |
});
|
|
|
614 |
}
|
|
|
615 |
|
|
|
616 |
function configureItemSerialNumbersDropDown(){
|
|
|
617 |
$(document).ready(function() {
|
|
|
618 |
$('#itemSerialNumbers').multiselect({
|
|
|
619 |
includeSelectAllOption: true,
|
|
|
620 |
multiple:true,
|
|
|
621 |
maxHeight: 200,
|
|
|
622 |
buttonWidth: '350px',
|
|
|
623 |
numberDisplayed: 1,
|
|
|
624 |
nonSelectedText: 'Serial Numbers',
|
|
|
625 |
nSelectedText: ' - Serial Numbers Selected',
|
|
|
626 |
allSelectedText: 'All Serial Numbers Selected',
|
|
|
627 |
enableFiltering: true
|
|
|
628 |
});
|
|
|
629 |
});
|
|
|
630 |
}
|