Subversion Repositories SmartDukaan

Rev

Rev 33400 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
25093 amit.gupta 1
var saleSearchObj = saleSearchObj || {};
2
saleSearchObj.searchText = "";
3
saleSearchObj.searchType = "";
4
saleSearchObj.startTime = "";
5
saleSearchObj.endTime = "";
23343 ashik.ali 6
 
7
$(function() {
23973 govind 8
 
27754 amit.gupta 9
	$(document).on('click', ".pending_fofo_order", function() {
28422 tejbeer 10
		mouAcceptance()
11
	});
28420 tejbeer 12
 
13
 
28422 tejbeer 14
	$(document).on('click', ".pending_order_dashboard", function() {
15
		mouAcceptance()
26647 tejbeer 16
	});
17
 
28420 tejbeer 18
 
28358 tejbeer 19
	$(document).on('click', ".online-order", function() {
20
		loadOnlineOrder("main-content");
21
	});
22
 
33305 ranu 23
 
24
	$(document).on('click', ".b2c-customer-list", function () {
25
		loadAllB2CUsersList("main-content");
26
	});
27
 
28
	$(document).on('click', ".fetch-data", function () {
29
		loadAllB2CUsersListByDate("main-content");
30
	});
31
 
28339 tejbeer 32
	$(document).on('click', ".billed_order_item", function() {
33
		console.log("Helloo")
34
		loadBilledOrder("main-content");
35
	});
36
 
37
	$(document).on('click', ".unsettled_order_item", function() {
28350 tejbeer 38
 
28339 tejbeer 39
		loadUnsettledOrder("main-content");
40
	});
41
 
42
	$(document).on('click', ".settled_order_item", function() {
28350 tejbeer 43
 
28339 tejbeer 44
		loadSettledOrder("main-content");
45
	});
28422 tejbeer 46
	$(document).on('click', ".total_sale_dashboard", function() {
28339 tejbeer 47
 
28413 tejbeer 48
		loadSettledOrder("main-content");
49
	});
28339 tejbeer 50
 
28413 tejbeer 51
 
28339 tejbeer 52
	$(document).on('click', ".claim_raised_order_item", function() {
53
		console.log("Helloo")
54
		loadClaimedOrder("main-content");
55
	});
56
 
28358 tejbeer 57
 
58
	$(document).on('click', ".online-order-submit",
59
		function() {
60
			var status = $("#status").val();
61
 
35458 amit 62
			if (status === null) {
63
				alert("Please select status");
28358 tejbeer 64
				return false;
65
			}
28420 tejbeer 66
 
35458 amit 67
			if (status === "CANCELLED" || status === "FAILED" || status === "DELIVERED" || status === "SETTLED") {
33233 amit.gupta 68
				let pickerElement = getDatesFromPicker($('input[name="dateRange"]'))
28420 tejbeer 69
				doGetAjaxRequestHandler(context
33233 amit.gupta 70
					+ "/getAllOrdersByStatus?status=" + status + "&startTime=" + pickerElement.startDate + "&endTime=" + pickerElement.endDate, function(
28420 tejbeer 71
						response) {
72
					$('.order-item-detail').html(response);
73
				});
74
 
75
			} else {
76
 
77
				doGetAjaxRequestHandler(context
78
					+ "/getAllOrdersByStatus?status=" + status, function(
79
						response) {
80
					$('.order-item-detail').html(response);
81
				});
28358 tejbeer 82
			}
83
		});
84
 
28377 tejbeer 85
	$(document).on('click', ".online-all-order-item",
86
		function() {
87
 
88
 
89
			doGetAjaxRequestHandler(context
90
				+ "/getAllOnlineOrder", function(
91
					response) {
92
				$('#' + "main-content").html(response);
93
			});
94
		});
95
 
96
 
97
	$(document).on('click', ".all-online-order",
98
		function() {
99
 
100
			var date = $(".order-date").val();
101
 
102
 
103
			doGetAjaxRequestHandler(context
104
				+ "/getAllOnlineOrder?date=" + date, function(
105
					response) {
106
				$('#' + "main-content").html(response);
107
			});
108
		});
109
 
27755 amit.gupta 110
	$(document).on('click', "button.pendingOrderDetail",
27819 tejbeer 111
		function() {
112
			doGetAjaxRequestHandler(context
113
				+ "/getPendingOrderItem?orderId=" + $(this).data('orderid'), function(
114
					response) {
115
				$('.pending-order-container').html(response);
26647 tejbeer 116
			});
27819 tejbeer 117
		});
26647 tejbeer 118
 
27755 amit.gupta 119
	$(document).on('click', ".pendingOrderCancel",
27819 tejbeer 120
		function() {
121
			var orderId = $(this).data('orderid');
35458 amit 122
			if (confirm("Are you sure you want to cancel the order!") === true) {
27819 tejbeer 123
				doPostAjaxRequestHandler(context
124
					+ "/cancelPendingOrder?id=" + orderId,
125
					function(response) {
35458 amit 126
						if (response === 'true') {
127
							alert("Successfully cancelled");
27819 tejbeer 128
							loadPendingOrder("main-content");
26721 tejbeer 129
						}
130
					});
27819 tejbeer 131
				return false;
132
			}
133
		});
134
 
26721 tejbeer 135
 
28339 tejbeer 136
	$(document).on('click', ".pendingOrderItemDelivered",
137
		function() {
138
			var orderItemId = $(this).data('poitemid');
35458 amit 139
			if (confirm("Are you sure you want to deliver the order item!") === true) {
28339 tejbeer 140
				doPostAjaxRequestHandler(context
141
					+ "/deliveredPendingOrderItem?id="
142
					+ orderItemId, function(response) {
35458 amit 143
						if (response === 'true') {
144
							alert("Successfully marked as delivered");
28339 tejbeer 145
							loadBilledOrder("main-content");
146
						}
147
					});
148
				return false;
149
			}
150
		});
151
 
152
	$(document).on('click', ".raiseClaim",
153
		function() {
154
			var orderItemId = $(this).data('poitemid');
35458 amit 155
			if (confirm("Are you sure you want to raise the claim!") === true) {
28339 tejbeer 156
				doPostAjaxRequestHandler(context
157
					+ "/raiseClaimOrderItem?id="
158
					+ orderItemId, function(response) {
35458 amit 159
						if (response === 'true') {
160
							alert("Claim raised successfully");
28339 tejbeer 161
							loadClaimedOrder("main-content");
162
						}
163
					});
164
				return false;
165
			}
166
		});
167
 
28350 tejbeer 168
	$(document).on('click', ".verify-order-item",
169
		function() {
170
			var orderItemId = $(this).data('poitemid');
35458 amit 171
			if (confirm("Are you sure you want to verify the order!") === true) {
28350 tejbeer 172
				doPostAjaxRequestHandler(context
173
					+ "/verifyOrderItem?id="
174
					+ orderItemId, function(response) {
35458 amit 175
						if (response === 'true') {
176
							alert("Successfully verified");
28362 tejbeer 177
							$('.online-order-submit').click();
28350 tejbeer 178
						}
179
					});
180
				return false;
181
			}
182
		});
183
 
33400 ranu 184
	$(document).on('click', ".claimed-payment",
185
		function () {
186
			var orderItemId = $(this).data('poitemid');
35458 amit 187
			if (confirm("Are you sure you want to add this payment to retailer wallet?") === true) {
33400 ranu 188
				doPostAjaxRequestHandler(context
189
					+ "/onlinePaymentAddToPartnerWallet?id="
190
					+ orderItemId, function (response) {
35458 amit 191
					if (response === 'true') {
192
						alert("Successfully added to wallet");
33400 ranu 193
						$('.online-order-submit').click();
194
					}
195
				});
196
				return false;
197
			}
198
		});
199
 
28352 tejbeer 200
	$(document).on('click', ".cancel-order-item",
201
		function() {
202
 
203
			var orderItemId = $(this).data('poitemid');
204
			doGetAjaxRequestHandler(context
205
				+ "/getPendingOrderItemById?id=" + orderItemId, function(response) {
206
					$('.cancel-online-order-container .modal-content').html(response);
207
				});
208
		});
209
 
28437 tejbeer 210
	$(document).on('click', ".change-partner",
211
		function() {
28352 tejbeer 212
 
28437 tejbeer 213
			var orderId = $(this).data('poid');
33367 ranu 214
            var pinCode = $(this).data('pincode');
28437 tejbeer 215
			doGetAjaxRequestHandler(context
33367 ranu 216
                + "/getPendingOrderChangePartnerById?id=" + orderId + "&&pinCode=" + pinCode, function (response) {
28437 tejbeer 217
					$('.change-partner-online-order-container  .modal-content').html(response);
218
				});
219
		});
220
 
221
 
222
	$(document).on('click', ".change-partner-po",
223
		function() {
224
			var orderId = $(this).data('poid');
225
			var fofoId = $("#fofo-users").val();
35458 amit 226
			if (confirm("Are you sure you want to change the partner!") === true) {
28437 tejbeer 227
				doPostAjaxRequestHandler(context
228
					+ "/changePendingOrderPartner?id="
229
					+ orderId + "&fofoId=" + fofoId, function(response) {
35458 amit 230
						if (response === 'true') {
231
							alert("Partner changed successfully");
28437 tejbeer 232
							$('#changePartnerOnlineOrder').modal('hide');
233
							$('.modal-backdrop').remove();
234
							$('.online-order-submit').click();
235
						}
236
					});
237
				return false;
238
			}
239
		});
240
 
28352 tejbeer 241
	$(document).on('click', ".cancel-pending-order",
242
		function() {
243
			var orderItemId = $(this).data('poitemid');
244
			var reason = $('#selectCancelreason').val();
245
 
35458 amit 246
			if (!reason) {
28352 tejbeer 247
				alert("Reason is required");
248
				return false;
249
			}
35458 amit 250
			if (confirm("Are you sure you want to cancel the order!") === true) {
28352 tejbeer 251
				doPostAjaxRequestHandler(context
252
					+ "/cancelPendingOrderItem?id="
253
					+ orderItemId + "&reason=" + reason, function(response) {
35458 amit 254
						if (response === 'true') {
255
							alert("Successfully cancelled");
28352 tejbeer 256
							$('#cancelOnlineOrder').modal('hide');
257
							$('.modal-backdrop').remove();
28362 tejbeer 258
							$('.online-order-submit').click();
28352 tejbeer 259
						}
260
					});
261
				return false;
262
			}
263
		});
264
 
27754 amit.gupta 265
	$(document).on('click', ".sale-history", function() {
30611 tejbeer 266
		saleHistory("main-content", "", "", "", "");
23343 ashik.ali 267
	});
24880 govind 268
 
27754 amit.gupta 269
	$(document).on('click', ".insurance-policy-details", function() {
24880 govind 270
		insurancePolicyDetails("main-content");
271
	});
272
 
27861 tejbeer 273
	$(document).on('change', '.fofoLineItemAmount',
274
		function() {
275
			var amount = 0;
35458 amit 276
			$('#fofo-item-table').find('tr').each(function() {
277
				var currentRow = $(this).closest("tr");
278
				var col5 = currentRow.find("td:eq(3)  input[type='number']").val();
279
				if (col5 !== undefined && col5 !== 0) {
280
					amount = amount + parseInt(col5, 10);
281
				}
282
			});
27861 tejbeer 283
			$("#totalAmount").text(amount);
284
		});
285
 
27755 amit.gupta 286
	$(document).on('click', ".updatePaymentDetails",
27819 tejbeer 287
		function() {
27861 tejbeer 288
			var paymentOptionsTotalAmount = 0;
27819 tejbeer 289
			var invoiceNumber = $(this).data('invoicenumber');
290
			var fofoId = $(this).data('fofoid');
27861 tejbeer 291
			var totalAmount = $('#editAmount').val();
27819 tejbeer 292
			var totalNumberOfPaymentOptionId = $(this).data(
293
				'totalnumberofpaymentoptionid');
294
			console.log("totalNumberOfPaymentOptionId"
295
				+ totalNumberOfPaymentOptionId);
296
			var referenceId = $(this).data('orderid');
297
			var referenceType = "ORDER";
298
			var createdTimeStamp = $(this).data('createddatetime');
299
			var paymentOptionTransactionModels = [];
27861 tejbeer 300
			var jsonObject = {};
27819 tejbeer 301
			var inputvalues = {};
35458 amit 302
			$('.paymentOptions input').each(function() {
303
				paymentOptionsTotalAmount += parseInt($(this).val(), 10);
304
				if (!isFinite($(this).val())) {
305
					return;
306
				}
307
				var inputvalues = {};
308
				inputvalues['paymentOptionId'] = $(this).data('payment-option-id');
309
				inputvalues['amount'] = $(this).val();
310
				inputvalues['createdTimeStamp'] = createdTimeStamp;
311
				if (!inputvalues['amount']) {
312
					inputvalues['amount'] = "0";
313
				}
314
				paymentOptionTransactionModels.push(inputvalues);
315
			});
316
			if (paymentOptionTransactionModels.length !== totalNumberOfPaymentOptionId) {
27819 tejbeer 317
				alert("Sending less or more paymentOptionIds for"
318
					+ fofoId);
319
				return false;
320
			}
27861 tejbeer 321
 
322
 
323
 
324
			var ItemIdsAmountArray = [];
35458 amit 325
			$('#fofo-item-table').find('tr').each(function() {
326
				var currentRow = $(this).closest("tr");
327
				var itemId = currentRow.find("td:eq(0)").html();
328
				var col5 = currentRow.find("td:eq(3)  input[type='number']").val();
329
				var fofoItemId = currentRow.find("td:eq(3)  input[type='hidden']").val();
330
				if (col5 !== undefined && col5 !== 0) {
331
					var itemIdsAmount = {
332
						"fofoItemId": fofoItemId,
333
						"amount": col5,
334
						"itemId": itemId
335
					};
336
					ItemIdsAmountArray.push(itemIdsAmount);
337
				}
338
			});
27861 tejbeer 339
 
340
 
341
			var totalAmount = $("#totalAmount").html();
35458 amit 342
			if (paymentOptionsTotalAmount !== parseInt(totalAmount, 10)) {
27861 tejbeer 343
				alert("Payment Options and Total Amount are not Same");
344
				return false;
345
			}
346
 
347
			jsonObject['paymentOptionTransactionModel'] = paymentOptionTransactionModels;
348
			jsonObject['itemAmountModel'] = ItemIdsAmountArray;
349
 
35458 amit 350
			if (confirm("Are you sure you want to update payment transaction?") === true) {
27819 tejbeer 351
				doPutAjaxRequestWithJsonHandler(
352
					context
353
					+ "/updatePaymentTransaction?referenceId="
354
					+ referenceId + "&referenceType="
355
					+ referenceType + "&fofoId="
27861 tejbeer 356
					+ fofoId + "&totalAmount=" + totalAmount,
27819 tejbeer 357
					JSON
27861 tejbeer 358
						.stringify(jsonObject),
27819 tejbeer 359
					function(response) {
360
						if (response === 'true') {
361
							alert("successfully added");
362
							loadSearchOrderDetails(
363
								invoiceNumber,
364
								"search-order-details-container");
24105 govind 365
						}
366
					});
27819 tejbeer 367
			}
24105 govind 368
 
27819 tejbeer 369
		});
370
 
27755 amit.gupta 371
	$(document).on('change', '#searchType',
27819 tejbeer 372
		function() {
373
			var searchType = $("#searchType option:selected").val();
374
			saleSearchObj.searchType = searchType;
35458 amit 375
			saleHistory("main-content", saleSearchObj.searchType, "", "", "");
27819 tejbeer 376
			$("#sale-history-search-text").val('');
377
		});
23973 govind 378
 
27755 amit.gupta 379
	$(document).on('click', "#sale-history-search-button",
27819 tejbeer 380
		function() {
381
			var searchType = $("#searchType option:selected").val();
382
			$("#searchType").removeClass("border-highlight");
35458 amit 383
			saleSearchObj.searchText = $("#sale-history-search-text").val();
27819 tejbeer 384
			saleSearchObj.searchType = searchType;
30628 tejbeer 385
 
35458 amit 386
			if (searchType === "Date-Range") {
30628 tejbeer 387
				let saleDuration = getDatesFromPicker("#saleDuration");
388
				saleSearchObj.startTime = saleDuration.startDate;
389
				saleSearchObj.endTime = saleDuration.endDate;
390
			} else {
391
 
392
				saleSearchObj.startTime = "";
393
				saleSearchObj.endTime = "";
394
 
395
			}
35458 amit 396
			if (typeof (saleSearchObj.searchText) === "undefined" || !saleSearchObj.searchText) {
27819 tejbeer 397
				saleSearchObj.searchText = "";
398
			}
35458 amit 399
			saleHistorySearchInfo(saleSearchObj.searchType, saleSearchObj.searchText,
27819 tejbeer 400
				saleSearchObj.startTime, saleSearchObj.endTime);
401
		});
35458 amit 402
 
27755 amit.gupta 403
	$(document).on('click', "#invoice-download-button",
27819 tejbeer 404
		function() {
405
			var searchType = $("#searchType option:selected").val();
406
			$("#searchType").removeClass("border-highlight");
35458 amit 407
			saleSearchObj.searchText = $("#sale-history-search-text").val();
27819 tejbeer 408
			saleSearchObj.searchType = searchType;
35458 amit 409
			var saleDuration = getDatesFromPicker("#saleDuration");
30607 amit.gupta 410
			saleSearchObj.startTime = saleDuration.startDate;
411
			saleSearchObj.endTime = saleDuration.endDate;
35458 amit 412
			if (typeof (saleSearchObj.searchText) === "undefined" || !saleSearchObj.searchText) {
27819 tejbeer 413
				saleSearchObj.searchText = "";
414
			}
415
			downloadInvoices(saleSearchObj.searchType,
416
				saleSearchObj.searchText,
417
				saleSearchObj.startTime, saleSearchObj.endTime);
418
		});
23973 govind 419
 
27754 amit.gupta 420
	$(document).on('click', ".search-order", function() {
23584 ashik.ali 421
		loadSearchOrder("main-content");
23973 govind 422
	});
423
 
27819 tejbeer 424
	$(document).on('click', ".invoices-cancel", function() {
425
		loadInvoiceSearchOrder("main-content");
426
	});
427
 
35458 amit 428
	$(document).on('click', "#search-order-button", function() {
429
		var invoiceNumber = $("#search-order-text").val();
430
		loadSearchOrderDetails(invoiceNumber, "search-order-details-container");
431
	});
23973 govind 432
 
35458 amit 433
	$(document).on('click', "#search-invoice-button", function() {
434
		var invoiceNumber = $("#search-invoice-text").val();
435
		loadSearchOrderDetails(invoiceNumber, "search-order-details-container");
436
	});
27819 tejbeer 437
 
438
 
439
 
440
	$(document).on('click', "#cancel-invoice-button",
441
		function() {
442
			var invoiceNumber = $("#search-invoice-text").val();
35458 amit 443
			if (confirm("Are you sure you want to cancel the order?") === true) {
27819 tejbeer 444
				doPostAjaxRequestHandler(context
445
					+ "/cancelOrderByInvoice?invoiceNumbers="
446
					+ invoiceNumber, function(response) {
35458 amit 447
						if (response === 'true') {
448
							alert("Successfully cancelled");
27819 tejbeer 449
							loadInvoiceSearchOrder("main-content");
450
						}
451
					});
452
				return false;
453
			}
454
		});
455
 
27755 amit.gupta 456
	$(document).on('click', "#sale-history-paginated .next",
27819 tejbeer 457
		function() {
458
			var params = {};
459
			params['searchType'] = saleSearchObj.searchType;
460
			params['searchValue'] = saleSearchObj.searchText;
461
			params['startTime'] = walletHistory.startTime;
462
			params['endTime'] = walletHistory.endTime;
463
			loadPaginatedNextItems('/getPaginatedSaleHistory', params,
464
				'sale-history-paginated', 'sale-history-table',
465
				'sale-details-container');
466
			$(this).blur();
467
		});
27755 amit.gupta 468
	$(document).on('click', "#insurance-paginated .next",
27819 tejbeer 469
		function() {
470
			loadPaginatedNextItems('/insuranceDetailsPaginated', null,
471
				'insurance-paginated', 'insurance-details-table',
472
				'insurance-policy-details-container');
473
			$(this).blur();
474
		});
27755 amit.gupta 475
	$(document).on('click', "#insurance-paginated .previous",
27819 tejbeer 476
		function() {
477
			loadPaginatedNextItems('/insuranceDetailsPaginated', null,
478
				'insurance-paginated', 'insurance-details-table',
479
				'insurance-policy-details-container');
480
			$(this).blur();
481
		});
23973 govind 482
 
27755 amit.gupta 483
	$(document).on('click', "#sale-history-paginated .previous",
27819 tejbeer 484
		function() {
485
			var params = {};
486
			params['searchType'] = saleSearchObj.searchType;
487
			params['searchValue'] = saleSearchObj.searchText;
488
			params['startTime'] = walletHistory.startTime;
489
			params['endTime'] = walletHistory.endTime;
490
			loadPaginatedPreviousItems('/getPaginatedSaleHistory', params,
491
				'sale-history-paginated', 'sale-history-table',
492
				'sale-details-container');
493
			$(this).blur();
494
		});
23973 govind 495
 
27754 amit.gupta 496
	$(document).on('click', ".sale-details", function() {
35458 amit 497
		var orderId = $(this).attr('data');
23973 govind 498
		loadSaleDetails(orderId, "sale-details-container");
23343 ashik.ali 499
	});
27861 tejbeer 500
 
501
	$(document).on('click', "#editamountbutton", function() {
502
		$('#editAmount').show();
503
	});
504
 
33319 ranu 505
	$(document).on('click', '.downloadB2CList-mk', function () {
506
		var startDate = $("#startDate-b2c-user").val();
507
		var endDate = $("#endDate-b2c-user").val();
35458 amit 508
		if (!startDate) {
509
			alert("Start date cannot be empty");
33319 ranu 510
			return;
511
		}
35458 amit 512
		if (!endDate) {
513
			alert("End date cannot be empty");
33319 ranu 514
			return;
515
		}
516
 
517
		let endPoint = `${context}/downloadB2CUsersList?startDate=${startDate}&endDate=${endDate}`;
518
 
519
		window.location.href = endPoint;
520
 
521
 
522
	});
523
 
23343 ashik.ali 524
});
525
 
23973 govind 526
function loadSaleDetails(orderId, domId) {
527
	doGetAjaxRequestHandler(context + "/saleDetails?orderId=" + orderId,
27819 tejbeer 528
		function(response) {
529
			$('#' + domId).html(response);
530
		});
23343 ashik.ali 531
}
532
 
28358 tejbeer 533
function loadOnlineOrder(domId) {
534
	doGetAjaxRequestHandler(context + "/getOnlineOrder", function(response) {
535
		$('#' + domId).html(response);
536
 
537
	});
538
}
539
 
26647 tejbeer 540
function loadPendingOrder(domId) {
541
	doGetAjaxRequestHandler(context + "/pendingOrders", function(response) {
542
		$('#' + domId).html(response);
543
 
544
	});
545
}
546
 
28339 tejbeer 547
function loadClaimedOrder(domId) {
548
	doGetAjaxRequestHandler(context + "/claimedOrders", function(response) {
549
		$('#' + domId).html(response);
550
 
551
	});
552
}
553
 
28420 tejbeer 554
function statusChangeAction() {
555
	var val = $('#status').val();
35458 amit 556
	if (val === "CANCELLED" || val === "FAILED" || val === "DELIVERED" || val === "SETTLED") {
28420 tejbeer 557
		$("#daterangerequ").show();
558
	} else {
559
		$("#daterangerequ").hide();
560
	}
561
}
562
 
563
 
28339 tejbeer 564
function loadBilledOrder(domId) {
565
	doGetAjaxRequestHandler(context + "/billedOrders", function(response) {
566
		$('#' + domId).html(response);
567
 
568
	});
569
}
570
 
571
 
33305 ranu 572
function loadAllB2CUsersList(domId) {
28339 tejbeer 573
 
33305 ranu 574
	doGetAjaxRequestHandler(`${context}/getB2cUserslist`, function (response) {
575
		$('#' + domId).html(response);
576
 
577
	});
578
}
579
 
580
function loadAllB2CUsersListByDate(domId) {
581
	var startDate = $("#startDate-b2c-user").val();
582
	var endDate = $("#endDate-b2c-user").val();
35458 amit 583
	if (!startDate) {
584
		alert("Start date cannot be empty");
33305 ranu 585
		return;
586
	}
35458 amit 587
	if (!endDate) {
588
		alert("End date cannot be empty");
33305 ranu 589
		return;
590
	}
591
	doGetAjaxRequestHandler(`${context}/getB2cUserslistByDate?startDate=${startDate}&endDate=${endDate}`, function (response) {
592
		$('#' + domId).html(response);
593
 
594
	});
595
}
596
 
597
 
28339 tejbeer 598
function loadUnsettledOrder(domId) {
599
	doGetAjaxRequestHandler(context + "/unsettledOrders", function(response) {
600
		$('#' + domId).html(response);
601
 
602
	});
603
}
604
 
605
 
606
function loadSettledOrder(domId) {
607
	doGetAjaxRequestHandler(context + "/settledOrders", function(response) {
608
		$('#' + domId).html(response);
609
 
610
	});
611
}
23973 govind 612
function loadSearchOrder(domId) {
613
	doGetAjaxRequestHandler(context + "/getSearchOrder", function(response) {
23584 ashik.ali 614
		$('#' + domId).html(response);
615
	});
616
}
617
 
27819 tejbeer 618
function loadInvoiceSearchOrder(domId) {
619
	doGetAjaxRequestHandler(context + "/getInvoiceSearchOrder", function(response) {
23584 ashik.ali 620
		$('#' + domId).html(response);
621
	});
622
}
623
 
27819 tejbeer 624
function loadSearchOrderDetails(invoiceNumber, domId) {
625
	doGetAjaxRequestHandler(context + "/searchOrderDetails?invoiceNumber="
626
		+ invoiceNumber, function(response) {
627
			$('#' + domId).html(response);
27861 tejbeer 628
			$('#editAmount').hide();
629
 
27819 tejbeer 630
		});
631
}
632
 
23973 govind 633
function saleHistory(domId, searchType, searchValue, startTime, endTime) {
634
	doGetAjaxRequestHandler(context + "/saleHistory?searchType=" + searchType
27819 tejbeer 635
		+ "&searchValue=" + searchValue + "&startTime=" + startTime
636
		+ "&endTime=" + endTime, function(response) {
637
			$('#' + domId).html(response);
638
		});
23343 ashik.ali 639
}
640
 
23973 govind 641
function saleHistorySearchInfo(searchType, searchText, startTime, endTime) {
23343 ashik.ali 642
	saleHistory("main-content", searchType, searchText, startTime, endTime);
24105 govind 643
 
644
}
24880 govind 645
function insurancePolicyDetails(domId) {
646
	doGetAjaxRequestHandler(context + "/insuranceDetails", function(response) {
647
		$('#' + domId).html(response);
648
	});
649
}
25093 amit.gupta 650
 
651
function downloadInvoices(searchType, searchValue, startTime, endTime) {
652
	doAjaxGetDownload(context + "/downloadInvoices?searchType=" + searchType
27819 tejbeer 653
		+ "&searchValue=" + searchValue + "&startTime=" + startTime
654
		+ "&endTime=" + endTime, "invoices.pdf");
25093 amit.gupta 655
}
28422 tejbeer 656
function mouAcceptance() {
657
	doGetAjaxRequestHandler(context + "/getMouForm", function(response) {
35458 amit 658
		if (response === 'true') {
28422 tejbeer 659
			loadPendingOrder("main-content");
660
		} else {
661
			bootbox.confirm({
662
				message: "<h4 style='text-align:center'>MEMORANDUM OF UNDERSTANDING</h4>" +
663
					" <br> <p style='text-align:justify'>The Smartdukaan has introduced a scheme which shall increase the reach of franchisee partner location by making them accessible online. The Company has started an application of 'smartdukaan online store' whereby the customers can book their products online on website namely <a href=''>store.smartdukaan.com</a>." +
664
					"The order booked under the relevant area pin code committed by franchisee shall be executed/fulfilled and delivered by said franchisee." +
665
					"<br> <b>WHEREAS</b> the franchisee has agreed to participate under said scheme on terms and condition mutually accepted as here under:-" +
666
					"<br><br> <b>NOW THIS MOU STATES THE TERMS AND CONDITIONS DETAILED HEREUNDER;</b>" +
667
					" </p>" +
668
					"<ol style='text-align:justify'>" +
669
					"<li>The Company has launched a web application namely 'smartdukaan online store' whereby the customers can book their products online on website namely <a href=''>store.smartdukaan.com</a>. The products available at the specific store location of franchisee shall be accessible by customer based on area pin code and can be ordered online. The said order once placed shall be duly delivered and executed by respective franchisee with full rigor and spontaneity.</li>" +
670
					"<li>The Company operates an online marketplace program on the its website <a href=''>store.smartdukaan.com</a> which enables franchisee  to sell their products alongside at their store and, once an order is placed, to ship such franchisee' products directly to the customer. Any use of the Company website is subject to the following additional terms:</li>" +
671
					"<ol type='I' style = 'text-align:justify'>" +
672
					"<li>When we say 'franchisee,' we mean an entity or retailer titled as franchisee above that operates a Smartdukaan at designated location and sells goods or services in the through the Company Sites.</li>" +
673
					"<li>By purchasing a product from our website, franchisee acknowledges that all said orders will be fulfilled by the franchisee and not Company. The franchisee (and not Company) will be responsible for all processing, shipping, returns, and customer service related to customer order received online. Products purchased from a franchisee can only be returned to that franchisee in accordance with its return policy. The franchisee shall make the customer aware of same while making due delivery of product. </li>" +
674
					"<li>To the fullest extent provided by applicable law, Company has no responsibility or liability for any franchisee, their products, or representations.</li>" +
675
					"<li>Once order has been placed on Company site by customer for delivery. The Company will send franchisee an order acknowledgment by email setting out what has been ordered. This is not an order confirmation or acceptance from us. Due shipment and delivery times shall be displayed on the website and franchisee shall ensure due fluffiness of order within said timelines. The Company is not responsible for delayed delivery and the same shall be sole responsibility of franchisee.</li>" +
676
					"</ol>" +
28350 tejbeer 677
 
28422 tejbeer 678
					"<li>The franchisee operates a smartdukaan at its location and has agreed to cover services within area PIN Code as per Annexure 1,adjoining its location for fulfilling customer orders received online. </li>" +
679
					"<li>The franchisee holds responsibility to update its stock immediately on execution of customer order so that the website can be duly updated for relevant stock available in particular PIN Code. </li>" +
680
					"<li>The customers are given various payment options online including Cash on delivery and payment via EMI apart from online digital mode of payment Via Credit card, wallet etc. The franchisee agrees that if a customer opts for making payment via 'cash on delivery' against the product ordered online, the same shall be collected by franchisee against due delivery of product at his sole responsibility. </li>" +
681
					"<li>The franchisee holds responsibility to activate the handset at the time of delivery to the customer so as to be eligible for the activation scheme. </li>" +
682
					"<li>The franchisee shall adopt best of practices in customer service and shall not involve itself in erroneous or fraudulent activities which if found shall be sole responsibility of franchisee and NSSPL shall not be help responsibility for same.</li>" +
683
					"<li>The current scheme is merely a visual representation for franchisee to sell its products online and in case there remains any dispute pertaining to product, delivery , poor services or payment dispute etc of whatsoever nature, the same shall be sole responsibility of franchisee and the Company/NSSPL shall not be held responsible for same.The Company/NSSPL may upload and update these Terms of Use from time to time by notifying changes by any reasonable means, including by posting a revised Terms of Use through its website. The franchisee agrees that it his responsibility to regularly check <a href=''>store.smartdukaan.com</a> for any updated Terms of Use and ensure that himself as well customers are regularly advised on said basis. </li>" +
684
					"<li>The product displayed online are for retail use & distribution only to end customer. Website cannot mis utilized to make wholesale to any sub-dealer nor franchisee can use the online mode to make wholesale of its product.</li>" +
685
					"<li>The franchisee agrees that he shall charge the same amount as displayed online by Company on behalf of franchisee. Thus, shall not involve itself in practices of overcharging , blackmarketing or hoarding etc , which if found shall be at sole peril of franchisee and Company disclaims from same.</li>" +
686
					"<li>The franchisee certify that the stock update provided by them on or through the website is accurate and that the information you provide on or through the Smartdukaan online store is complete. Franchisee and customers are solely responsible for maintaining the confidentiality and security of account including username, password, and PIN. The Company/NSSPL is not responsible for any losses arising out of the unauthorized use of your account. </li>" +
687
					"<li>The Company will have the right (but not the obligation), in its sole discretion, to monitor, evaluate, and analyse Content, and any use of and access to the Company websites, including to determine compliance with these Terms of Use and any other operating rules that may be established by Company from time to time.</li>" +
688
					"<li>The company will also have the right (but not the obligation), in its sole discretion, to edit, move, delete, or refuse to make available any Content made available through, the its Sites, for any reason, including violation of these Terms of Use, whether for legal or other reasons. Despite this right of Company, franchiseeis solely responsible for any stock information that and content thathe make available, and agrees to indemnify Company/NSSPL for all claims resulting from any information thathe has made available or services conducted by franchisee post receipt of order on Company website</li>" +
689
					"<li>The <a href=''>store.smartdukaan.com</a> may make available listings, descriptions, and images of goods and services (collectively, “Products”). The Company makes no representations as to the completeness, accuracy, reliability, validity, or timeliness of such listings, descriptions, or images (including any features, specifications, and prices contained on the Sites) and franchisee shall advise the customer about its proper usage, if required. Such information and the availability of any Product are subject to change at any time without notice.</li>" +
690
					"<li>The company have made efforts to accurately display the attributes of Products, including the applicable colors. However, as the actual colors seen will depend on customers monitor, the company cannot guarantee the monitor's display of any color will accurately reflect actual product color or finish. In addition, certain weights, measures, and similar descriptions are approximate and are for convenience only. </li>" +
691
					"<li>The franchisee holds sole responsibility to advise the customer on same.</li>" +
692
					"<li>The Companywebsite and all Materials, and all copyrights, trademarks, trade dress, and other intellectual property rights there (collectively, the 'IP') are owned or controlled by or licensed to Company, and are protected by Indian law and trademark, copyright, and other intellectual property laws. Subject to compliance with this MOU,  Terms of Use, and solely for so long as is permitted by Company to use the Company's Sites, one may access, view, download, and print the Materials for their personal, non-commercial use only; provided, however, that (1) One retains all copyright, trademark, or other proprietary designations contained on all Materials; (2) do not modify or alter the Materials in any way; and (3) do not provide or make available the Materials to any third party in a commercial manner.</li>" +
693
					"<li>No license, right, title, or interest in the websites or any Materials is transferred as a result of use of the Company Sites or one's accessing, viewing, downloading, or printing of the Materials. One may not reproduce (except as noted above), publish, transmit, distribute, display, modify, create derivative works from, sell, or participate in any sale of or exploit in any way, in whole or in part, any of the Materials or the its websites. The Companywebsites and Materials may be used only as a personal shopping resource. Any other use, including the reproduction, modification, distribution, transmission, republication, display, or performance, of the Company websites and the Materials is strictly prohibited.</li>" +
694
					"<li>Pricing for product Pickup and delivery items will be the same prices as if customer has shopped in the store that packs and delivers the items. If an item's price changes between the time customer placestheir order and the day your order is packed for delivery, franchisee will charge customer the lower price.  </li>" +
695
					"<li>Franchisee agree to defend, indemnify, and hold the Company harmless from and against any and all liabilities, claims, damages, costs, and expenses, including attorneys' fees and costs, arising from or related to your misuse of the Company Site or any breach of thus MOU, Terms of Use or from any deficient service claimed by customer against the franchisee& Company while execution of a particular order. </li>" +
696
					"<li> THE WEBSITE, AND ALL CONTENT, MATERIALS, PRODUCTS, SERVICES, FUNCTIONALITY, AND OTHER ITEMS INCLUDED ON OR OTHERWISE MADE AVAILABLE THROUGH THE WEBSITE, AND/OR SMARTDUKAAN STORE LOCATIONS, ARE PROVIDED BY COMPANY ON AN 'AS IS' AND 'AS AVAILABLE' BASIS UPDATED BY FRANCHISEE. THE COMPANY DOES NOT MAKE ANY REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE OPERATION OF THE WEBSITE OR THE CONTENT, MATERIALS, PRODUCTS, SERVICES, FUNCTIONALITY, OR OTHER ITEMS INCLUDED ON OR OTHERWISE MADE AVAILABLE TO CUSTOMERS. TO THE FULLEST EXTENT PERMISSIBLE BY APPLICABLE LAW, THE COMPANY DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WITHOUT LIMITING THE FOREGOING, THE COMPANY DISCLAIM ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, FOR ANY PRODUCT OFFERED. THE CUSTOMER AND FRANCHISEE ACKNOWLEDGE THAT, TO THE FULLEST EXTENT PROVIDED BY APPLICABLE LAW, THE USE OF THE COMPANY SITES IS AT YOUR SOLE RISK." +
697
					" <br> TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, COMPANY IS NOT IS RESPONSIBLE FOR ANY LOSS OR DAMAGE TO PROPERTY OR DATA THAT RESULTS FROM ANY MATERIALS YOU ACCESS OR DOWNLOAD FROM THE WEBSITE.</li>" +
698
					"<li>This agreement is co terminus with franchisee agreement executed by franchisee with the Company /NSSPL.The parties agree that this MOU shall be governed by standard terms and condition which are mentioned under the franchise agreement executed among the parties and not covered under this MOU.</li>" +
699
					"</ol>" +
700
					"<ul><li>I understand and accepted the terms and conditions.</li></ul>"
701
				,
702
				buttons: {
703
					confirm: {
704
						label: 'I agree',
705
						className: 'btn-success'
706
					},
707
					cancel: {
708
						label: 'I disagree',
709
						className: 'btn-danger'
710
					}
711
				},
712
				callback: function(result) {
35458 amit 713
					if (result === true) {
28422 tejbeer 714
						loadPendingOrder("main-content");
715
					}
716
				}
717
			}).find("div.modal-body").css({ "height": "700px", "overflow-y": "auto" });
718
		}
719
	});
28358 tejbeer 720
 
28422 tejbeer 721
}