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