Subversion Repositories SmartDukaan

Rev

Rev 28420 | Rev 28437 | 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
 
28339 tejbeer 23
	$(document).on('click', ".billed_order_item", function() {
24
		console.log("Helloo")
25
		loadBilledOrder("main-content");
26
	});
27
 
28
	$(document).on('click', ".unsettled_order_item", function() {
28350 tejbeer 29
 
28339 tejbeer 30
		loadUnsettledOrder("main-content");
31
	});
32
 
33
	$(document).on('click', ".settled_order_item", function() {
28350 tejbeer 34
 
28339 tejbeer 35
		loadSettledOrder("main-content");
36
	});
28422 tejbeer 37
	$(document).on('click', ".total_sale_dashboard", function() {
28339 tejbeer 38
 
28413 tejbeer 39
		loadSettledOrder("main-content");
40
	});
28339 tejbeer 41
 
28413 tejbeer 42
 
28339 tejbeer 43
	$(document).on('click', ".claim_raised_order_item", function() {
44
		console.log("Helloo")
45
		loadClaimedOrder("main-content");
46
	});
47
 
28358 tejbeer 48
 
49
	$(document).on('click', ".online-order-submit",
50
		function() {
51
			var status = $("#status").val();
52
 
53
			if (status == null) {
54
				alert("please select status")
55
				return false;
56
			}
28420 tejbeer 57
 
58
 
59
			if (status == "CANCELLED" || status == "FAILED" || status == "DELIVERED" || status == "SETTLED") {
60
				console.log(startDate)
61
				console.log(endDate)
62
				doGetAjaxRequestHandler(context
63
					+ "/getAllOrdersByStatus?status=" + status + "&startTime=" + startDate + "&endTime=" + endDate, function(
64
						response) {
65
					$('.order-item-detail').html(response);
66
				});
67
 
68
			} else {
69
 
70
				doGetAjaxRequestHandler(context
71
					+ "/getAllOrdersByStatus?status=" + status, function(
72
						response) {
73
					$('.order-item-detail').html(response);
74
				});
28358 tejbeer 75
			}
76
		});
77
 
78
 
28377 tejbeer 79
	$(document).on('click', ".online-all-order-item",
80
		function() {
81
 
82
 
83
			doGetAjaxRequestHandler(context
84
				+ "/getAllOnlineOrder", function(
85
					response) {
86
				$('#' + "main-content").html(response);
87
			});
88
		});
89
 
90
 
91
	$(document).on('click', ".all-online-order",
92
		function() {
93
 
94
			var date = $(".order-date").val();
95
 
96
 
97
			doGetAjaxRequestHandler(context
98
				+ "/getAllOnlineOrder?date=" + date, function(
99
					response) {
100
				$('#' + "main-content").html(response);
101
			});
102
		});
103
 
27755 amit.gupta 104
	$(document).on('click', "button.pendingOrderDetail",
27819 tejbeer 105
		function() {
106
			doGetAjaxRequestHandler(context
107
				+ "/getPendingOrderItem?orderId=" + $(this).data('orderid'), function(
108
					response) {
109
				$('.pending-order-container').html(response);
26647 tejbeer 110
			});
27819 tejbeer 111
		});
26647 tejbeer 112
 
27755 amit.gupta 113
	$(document).on('click', ".pendingOrderCancel",
27819 tejbeer 114
		function() {
26721 tejbeer 115
 
27819 tejbeer 116
			var orderId = $(this).data('orderid');
117
			console.log(orderId);
118
			if (confirm("Are you sure you want to cancel the order!") == true) {
119
				doPostAjaxRequestHandler(context
120
					+ "/cancelPendingOrder?id=" + orderId,
121
					function(response) {
122
						if (response == 'true') {
123
							alert("successfully Cancel");
124
							loadPendingOrder("main-content");
26721 tejbeer 125
						}
126
					});
127
 
27819 tejbeer 128
				return false;
129
			}
130
 
131
		});
132
 
26721 tejbeer 133
 
28339 tejbeer 134
	$(document).on('click', ".pendingOrderItemDelivered",
135
		function() {
136
 
137
			var orderItemId = $(this).data('poitemid');
138
			if (confirm("Are you sure you want to delivered the order item!") == true) {
139
				doPostAjaxRequestHandler(context
140
					+ "/deliveredPendingOrderItem?id="
141
					+ orderItemId, function(response) {
142
						if (response == 'true') {
143
							alert("successfully delivered marked");
144
							loadBilledOrder("main-content");
145
						}
146
					});
147
 
148
				return false;
149
			}
150
 
151
		});
152
 
153
	$(document).on('click', ".raiseClaim",
154
		function() {
155
 
156
			var orderItemId = $(this).data('poitemid');
157
			if (confirm("Are you sure you want to raise the claim!") == true) {
158
				doPostAjaxRequestHandler(context
159
					+ "/raiseClaimOrderItem?id="
160
					+ orderItemId, function(response) {
161
						if (response == 'true') {
162
							alert("successfully claim raised");
163
							loadClaimedOrder("main-content");
164
						}
165
					});
166
 
167
				return false;
168
			}
169
 
170
		});
171
 
28350 tejbeer 172
	$(document).on('click', ".verify-order-item",
173
		function() {
174
 
175
			var orderItemId = $(this).data('poitemid');
176
			if (confirm("Are you sure you want to verify the order!") == true) {
177
				doPostAjaxRequestHandler(context
178
					+ "/verifyOrderItem?id="
179
					+ orderItemId, function(response) {
180
						if (response == 'true') {
181
							alert("successfully verified");
28362 tejbeer 182
							$('.online-order-submit').click();
183
 
28350 tejbeer 184
						}
185
					});
186
 
187
				return false;
188
			}
189
 
190
		});
191
 
28352 tejbeer 192
	$(document).on('click', ".cancel-order-item",
193
		function() {
194
 
195
			var orderItemId = $(this).data('poitemid');
196
			doGetAjaxRequestHandler(context
197
				+ "/getPendingOrderItemById?id=" + orderItemId, function(response) {
198
					$('.cancel-online-order-container .modal-content').html(response);
199
				});
200
		});
201
 
202
 
203
	$(document).on('click', ".cancel-pending-order",
204
		function() {
205
			var orderItemId = $(this).data('poitemid');
206
			var reason = $('#selectCancelreason').val();
207
			console.log(reason)
208
 
209
			if (reason === "") {
210
				alert("Reason is required");
211
				return false;
212
			}
213
			if (reason == null) {
214
				alert("Reason is required");
215
				return false;
216
			}
217
			if (confirm("Are you sure you want to cancel the order!") == true) {
218
				doPostAjaxRequestHandler(context
219
					+ "/cancelPendingOrderItem?id="
220
					+ orderItemId + "&reason=" + reason, function(response) {
221
						if (response == 'true') {
222
							alert("successfully cancel");
223
							$('#cancelOnlineOrder').modal('hide');
224
							$('.modal-backdrop').remove();
28362 tejbeer 225
							$('.online-order-submit').click();
28352 tejbeer 226
 
227
						}
228
					});
229
 
230
				return false;
231
 
232
			}
233
 
234
		});
235
 
27754 amit.gupta 236
	$(document).on('click', ".sale-history", function() {
23343 ashik.ali 237
		console.log("Sale History Button Clicked...")
23973 govind 238
		saleHistory("main-content", "", "", startDate, endDate);
23343 ashik.ali 239
	});
24880 govind 240
 
27754 amit.gupta 241
	$(document).on('click', ".insurance-policy-details", function() {
24880 govind 242
		console.log("insurance-policy-details");
243
		insurancePolicyDetails("main-content");
244
	});
245
 
27861 tejbeer 246
	$(document).on('change', '.fofoLineItemAmount',
247
		function() {
248
			var amount = 0;
249
			var oldtotalAmount = 0;
250
			console.log(oldtotalAmount)
251
			$('#fofo-item-table')
252
				.find('tr')
253
				.each(
254
					function() {
255
						var row = $(this);
256
						console.log(row);
257
 
258
						var currentRow = $(this)
259
							.closest("tr");
260
 
261
						var col5 = currentRow.find(
262
							"td:eq(3)  input[type='number']").val();
263
 
264
 
265
						oldtotalAmount = currentRow.find(
266
							"td:eq(5)").html();
267
 
268
						console.log(col5);
269
						if (col5 != undefined) {
270
							if (col5 != 0) {
271
								amount = amount + parseInt(col5, 10);
272
 
273
							}
274
						}
275
					});
276
 
277
 
278
 
279
			$("#totalAmount").text(amount);
280
 
281
		});
282
 
27755 amit.gupta 283
	$(document).on('click', ".updatePaymentDetails",
27819 tejbeer 284
		function() {
285
			console
286
				.log("updatePaymentDetails target Button Clicked...");
287
			var i = 1;
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
			console.log(createdTimeStamp);
300
			console.log(fofoId);
301
			console.log(referenceId);
302
			console.log(invoiceNumber);
303
			console.log(referenceType);
304
			var paymentOptionTransactionModels = [];
27861 tejbeer 305
			var jsonObject = {};
27819 tejbeer 306
			var inputvalues = {};
307
			$('.paymentOptions input')
308
				.each(
24105 govind 309
					function() {
27819 tejbeer 310
						console.log($(this).val())
27861 tejbeer 311
						paymentOptionsTotalAmount += parseInt($(this).val(), 10)
27819 tejbeer 312
						if (!isFinite($(this).val())) {
313
							return;
314
						}
315
						inputvalues = {};
316
						inputvalues['paymentOptionId'] = $(
317
							this).data(
318
								'payment-option-id');
319
						inputvalues['amount'] = $(this)
320
							.val();
321
						inputvalues['createdTimeStamp'] = createdTimeStamp;
24105 govind 322
						console
27819 tejbeer 323
							.log(inputvalues['createdTimeStamp']);
324
						if (!inputvalues['amount']) {
325
							inputvalues['amount'] = "0";
24880 govind 326
						}
27819 tejbeer 327
						console.log("inputvalues['amount']"
328
							+ inputvalues['amount']);
329
						paymentOptionTransactionModels
330
							.push(inputvalues);
331
					});
332
			if (paymentOptionTransactionModels.length != totalNumberOfPaymentOptionId) {
333
				alert("Sending less or more paymentOptionIds for"
334
					+ fofoId);
335
				return false;
336
			}
27861 tejbeer 337
 
338
 
339
 
340
			var ItemIdsAmountArray = [];
341
			var itemIdsAmount;
342
			$('#fofo-item-table')
343
				.find('tr')
344
				.each(
345
					function() {
346
						var row = $(this);
347
						console.log(row);
348
 
349
 
350
 
351
						var currentRow = $(this)
352
							.closest("tr");
353
 
354
						var itemId = currentRow.find(
355
							"td:eq(0)").html();
356
 
357
						var col5 = currentRow.find(
358
							"td:eq(3)  input[type='number']").val();
359
						var fofoItemId = currentRow.find(
360
							"td:eq(3)  input[type='hidden']").val();
361
						console.log(itemId)
362
 
363
						console.log(col5);
364
						if (col5 != undefined) {
365
							if (col5 != 0) {
366
 
367
								itemIdsAmount = {
368
									"fofoItemId": fofoItemId,
369
									"amount": col5,
370
									"itemId": itemId
371
 
372
								}
373
								console.log(itemIdsAmount);
374
								ItemIdsAmountArray.push(itemIdsAmount);
375
 
376
								console.log(ItemIdsAmountArray)
377
							}
378
						}
379
					});
380
 
381
 
382
			var totalAmount = $("#totalAmount").html();
383
			console.log(totalAmount)
384
			console.log(paymentOptionsTotalAmount)
385
			if (paymentOptionsTotalAmount != totalAmount) {
386
				alert("Payment Options and Total Amount are not Same");
387
				return false;
388
			}
389
 
27819 tejbeer 390
			console.log(paymentOptionTransactionModels);
27861 tejbeer 391
			jsonObject['paymentOptionTransactionModel'] = paymentOptionTransactionModels;
392
			jsonObject['itemAmountModel'] = ItemIdsAmountArray;
393
 
394
			console.log(jsonObject);
27819 tejbeer 395
			if (confirm("Are you sure you want to update paymentTransaction!") == true) {
396
				doPutAjaxRequestWithJsonHandler(
397
					context
398
					+ "/updatePaymentTransaction?referenceId="
399
					+ referenceId + "&referenceType="
400
					+ referenceType + "&fofoId="
27861 tejbeer 401
					+ fofoId + "&totalAmount=" + totalAmount,
27819 tejbeer 402
					JSON
27861 tejbeer 403
						.stringify(jsonObject),
27819 tejbeer 404
					function(response) {
405
						if (response === 'true') {
406
							alert("successfully added");
407
							loadSearchOrderDetails(
408
								invoiceNumber,
409
								"search-order-details-container");
24105 govind 410
						}
411
					});
27819 tejbeer 412
			}
24105 govind 413
 
27819 tejbeer 414
		});
415
 
27755 amit.gupta 416
	$(document).on('change', '#searchType',
27819 tejbeer 417
		function() {
418
			var searchType = $("#searchType option:selected").val();
419
			var searchTypevalue = $(this).find('option:selected').text();
420
			;
421
			saleSearchObj.searchType = searchType;
422
			console.log("selected searchType = " + searchType);
24105 govind 423
 
27819 tejbeer 424
			saleHistory("main-content", saleSearchObj.searchType, "",
425
				startDate, endDate);
24105 govind 426
 
27819 tejbeer 427
			$("#sale-history-search-text").val('');
428
		});
23973 govind 429
 
27755 amit.gupta 430
	$(document).on('click', "#sale-history-search-button",
27819 tejbeer 431
		function() {
432
			var searchType = $("#searchType option:selected").val();
433
			console.log("searchType = " + searchType);
434
			$("#searchType").removeClass("border-highlight");
435
			saleSearchObj.searchText = $(
436
				"#sale-history-search-text").val();
437
			saleSearchObj.searchType = searchType;
438
			saleSearchObj.startTime = startDate;
439
			saleSearchObj.endTime = endDate;
440
			if (typeof (saleSearchObj.searchText) == "undefined"
441
				|| !saleSearchObj.searchText) {
442
				saleSearchObj.searchText = "";
443
			}
444
			saleHistorySearchInfo(saleSearchObj.searchType,
445
				saleSearchObj.searchText,
446
				saleSearchObj.startTime, saleSearchObj.endTime);
447
		});
27755 amit.gupta 448
	$(document).on('click', "#invoice-download-button",
27819 tejbeer 449
		function() {
450
			var searchType = $("#searchType option:selected").val();
451
			console.log("searchType = " + searchType);
452
			$("#searchType").removeClass("border-highlight");
453
			saleSearchObj.searchText = $(
454
				"#sale-history-search-text").val();
455
			saleSearchObj.searchType = searchType;
456
			saleSearchObj.startTime = startDate;
457
			saleSearchObj.endTime = endDate;
458
			if (typeof (saleSearchObj.searchText) == "undefined"
459
				|| !saleSearchObj.searchText) {
460
				saleSearchObj.searchText = "";
461
			}
462
			downloadInvoices(saleSearchObj.searchType,
463
				saleSearchObj.searchText,
464
				saleSearchObj.startTime, saleSearchObj.endTime);
465
		});
23973 govind 466
 
27754 amit.gupta 467
	$(document).on('click', ".search-order", function() {
23584 ashik.ali 468
		console.log("search-order clicked")
469
		loadSearchOrder("main-content");
23973 govind 470
	});
471
 
27819 tejbeer 472
	$(document).on('click', ".invoices-cancel", function() {
473
		console.log("searc-order clicked")
474
		loadInvoiceSearchOrder("main-content");
475
	});
476
 
27755 amit.gupta 477
	$(document).on('click', "#search-order-button",
27819 tejbeer 478
		function() {
479
			console.log("search-order-button clicked")
480
			var invoiceNumber = $("#search-order-text").val();
481
			loadSearchOrderDetails(invoiceNumber,
482
				"search-order-details-container");
483
		});
23973 govind 484
 
27819 tejbeer 485
	$(document).on('click', "#search-invoice-button",
486
		function() {
487
			console.log("search-order-button clicked")
488
			var invoiceNumber = $("#search-invoice-text").val();
489
			console.log(invoiceNumber);
490
			loadSearchOrderDetails(invoiceNumber,
491
				"search-order-details-container");
492
		});
493
 
494
 
495
 
496
	$(document).on('click', "#cancel-invoice-button",
497
		function() {
498
			var invoiceNumber = $("#search-invoice-text").val();
499
			console.log(invoiceNumber);
500
			if (confirm("Are you sure you want to cancel the order !") == true) {
501
				doPostAjaxRequestHandler(context
502
					+ "/cancelOrderByInvoice?invoiceNumbers="
503
					+ invoiceNumber, function(response) {
504
						if (response == 'true') {
505
							alert("Successfully Cancel");
506
							loadInvoiceSearchOrder("main-content");
507
						}
508
					});
509
 
510
				return false;
511
			}
512
		});
513
 
27755 amit.gupta 514
	$(document).on('click', "#sale-history-paginated .next",
27819 tejbeer 515
		function() {
516
			var params = {};
517
			params['searchType'] = saleSearchObj.searchType;
518
			params['searchValue'] = saleSearchObj.searchText;
519
			params['startTime'] = walletHistory.startTime;
520
			params['endTime'] = walletHistory.endTime;
521
			loadPaginatedNextItems('/getPaginatedSaleHistory', params,
522
				'sale-history-paginated', 'sale-history-table',
523
				'sale-details-container');
524
			$(this).blur();
525
		});
27755 amit.gupta 526
	$(document).on('click', "#insurance-paginated .next",
27819 tejbeer 527
		function() {
528
			loadPaginatedNextItems('/insuranceDetailsPaginated', null,
529
				'insurance-paginated', 'insurance-details-table',
530
				'insurance-policy-details-container');
531
			$(this).blur();
532
		});
27755 amit.gupta 533
	$(document).on('click', "#insurance-paginated .previous",
27819 tejbeer 534
		function() {
535
			loadPaginatedNextItems('/insuranceDetailsPaginated', null,
536
				'insurance-paginated', 'insurance-details-table',
537
				'insurance-policy-details-container');
538
			$(this).blur();
539
		});
23973 govind 540
 
27755 amit.gupta 541
	$(document).on('click', "#sale-history-paginated .previous",
27819 tejbeer 542
		function() {
543
			var params = {};
544
			params['searchType'] = saleSearchObj.searchType;
545
			params['searchValue'] = saleSearchObj.searchText;
546
			params['startTime'] = walletHistory.startTime;
547
			params['endTime'] = walletHistory.endTime;
548
			loadPaginatedPreviousItems('/getPaginatedSaleHistory', params,
549
				'sale-history-paginated', 'sale-history-table',
550
				'sale-details-container');
551
			$(this).blur();
552
		});
23973 govind 553
 
554
	// grn-details
555
 
27754 amit.gupta 556
	$(document).on('click', ".sale-details", function() {
23654 amit.gupta 557
		orderId = $(this).attr('data');
23973 govind 558
		console.log("orderId = " + orderId);
559
		loadSaleDetails(orderId, "sale-details-container");
23343 ashik.ali 560
	});
27861 tejbeer 561
 
562
	$(document).on('click', "#editamountbutton", function() {
563
		$('#editAmount').show();
564
	});
565
 
23343 ashik.ali 566
});
567
 
23973 govind 568
function loadSaleDetails(orderId, domId) {
569
	doGetAjaxRequestHandler(context + "/saleDetails?orderId=" + orderId,
27819 tejbeer 570
		function(response) {
571
			$('#' + domId).html(response);
572
		});
23343 ashik.ali 573
}
574
 
28358 tejbeer 575
function loadOnlineOrder(domId) {
576
	doGetAjaxRequestHandler(context + "/getOnlineOrder", function(response) {
577
		$('#' + domId).html(response);
578
 
579
	});
580
}
581
 
26647 tejbeer 582
function loadPendingOrder(domId) {
583
	doGetAjaxRequestHandler(context + "/pendingOrders", function(response) {
584
		$('#' + domId).html(response);
585
 
586
	});
587
}
588
 
28339 tejbeer 589
function loadClaimedOrder(domId) {
590
	doGetAjaxRequestHandler(context + "/claimedOrders", function(response) {
591
		$('#' + domId).html(response);
592
 
593
	});
594
}
595
 
28420 tejbeer 596
function statusChangeAction() {
597
	var val = $('#status').val();
598
	if (val == "CANCELLED" || val == "FAILED" || val == "DELIVERED" || val == "SETTLED") {
599
		console.log("show")
600
		$("#daterangerequ").show();
601
	} else {
602
		$("#daterangerequ").hide();
603
	}
28339 tejbeer 604
 
28420 tejbeer 605
}
606
 
607
 
28339 tejbeer 608
function loadBilledOrder(domId) {
609
	doGetAjaxRequestHandler(context + "/billedOrders", function(response) {
610
		$('#' + domId).html(response);
611
 
612
	});
613
}
614
 
615
 
616
 
617
function loadUnsettledOrder(domId) {
618
	doGetAjaxRequestHandler(context + "/unsettledOrders", function(response) {
619
		$('#' + domId).html(response);
620
 
621
	});
622
}
623
 
624
 
625
function loadSettledOrder(domId) {
626
	doGetAjaxRequestHandler(context + "/settledOrders", function(response) {
627
		$('#' + domId).html(response);
628
 
629
	});
630
}
23973 govind 631
function loadSearchOrder(domId) {
632
	doGetAjaxRequestHandler(context + "/getSearchOrder", function(response) {
23584 ashik.ali 633
		$('#' + domId).html(response);
634
	});
635
}
636
 
27819 tejbeer 637
function loadInvoiceSearchOrder(domId) {
638
	console.log("Hello");
639
	doGetAjaxRequestHandler(context + "/getInvoiceSearchOrder", function(response) {
23584 ashik.ali 640
		$('#' + domId).html(response);
641
	});
642
}
643
 
27819 tejbeer 644
function loadSearchOrderDetails(invoiceNumber, domId) {
645
	doGetAjaxRequestHandler(context + "/searchOrderDetails?invoiceNumber="
646
		+ invoiceNumber, function(response) {
647
			$('#' + domId).html(response);
27861 tejbeer 648
			$('#editAmount').hide();
649
 
27819 tejbeer 650
		});
651
}
652
 
23973 govind 653
function saleHistory(domId, searchType, searchValue, startTime, endTime) {
654
	doGetAjaxRequestHandler(context + "/saleHistory?searchType=" + searchType
27819 tejbeer 655
		+ "&searchValue=" + searchValue + "&startTime=" + startTime
656
		+ "&endTime=" + endTime, function(response) {
657
			$('#' + domId).html(response);
658
		});
23343 ashik.ali 659
}
660
 
23973 govind 661
function saleHistorySearchInfo(searchType, searchText, startTime, endTime) {
23343 ashik.ali 662
	saleHistory("main-content", searchType, searchText, startTime, endTime);
24105 govind 663
 
664
}
24880 govind 665
function insurancePolicyDetails(domId) {
666
	doGetAjaxRequestHandler(context + "/insuranceDetails", function(response) {
667
		$('#' + domId).html(response);
668
	});
669
}
25093 amit.gupta 670
 
671
function downloadInvoices(searchType, searchValue, startTime, endTime) {
672
	doAjaxGetDownload(context + "/downloadInvoices?searchType=" + searchType
27819 tejbeer 673
		+ "&searchValue=" + searchValue + "&startTime=" + startTime
674
		+ "&endTime=" + endTime, "invoices.pdf");
25093 amit.gupta 675
}
28422 tejbeer 676
function mouAcceptance() {
677
	doGetAjaxRequestHandler(context + "/getMouForm", function(response) {
678
		console.log(response)
679
		if (response == 'true') {
680
			loadPendingOrder("main-content");
681
		} else {
682
			bootbox.confirm({
683
				message: "<h4 style='text-align:center'>MEMORANDUM OF UNDERSTANDING</h4>" +
684
					" <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>." +
685
					"The order booked under the relevant area pin code committed by franchisee shall be executed/fulfilled and delivered by said franchisee." +
686
					"<br> <b>WHEREAS</b> the franchisee has agreed to participate under said scheme on terms and condition mutually accepted as here under:-" +
687
					"<br><br> <b>NOW THIS MOU STATES THE TERMS AND CONDITIONS DETAILED HEREUNDER;</b>" +
688
					" </p>" +
689
					"<ol style='text-align:justify'>" +
690
					"<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>" +
691
					"<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>" +
692
					"<ol type='I' style = 'text-align:justify'>" +
693
					"<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>" +
694
					"<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>" +
695
					"<li>To the fullest extent provided by applicable law, Company has no responsibility or liability for any franchisee, their products, or representations.</li>" +
696
					"<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>" +
697
					"</ol>" +
28350 tejbeer 698
 
28422 tejbeer 699
					"<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>" +
700
					"<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>" +
701
					"<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>" +
702
					"<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>" +
703
					"<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>" +
704
					"<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>" +
705
					"<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>" +
706
					"<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>" +
707
					"<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>" +
708
					"<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>" +
709
					"<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>" +
710
					"<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>" +
711
					"<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>" +
712
					"<li>The franchisee holds sole responsibility to advise the customer on same.</li>" +
713
					"<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>" +
714
					"<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>" +
715
					"<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>" +
716
					"<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>" +
717
					"<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." +
718
					" <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>" +
719
					"<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>" +
720
					"</ol>" +
721
					"<ul><li>I understand and accepted the terms and conditions.</li></ul>"
722
				,
723
				buttons: {
724
					confirm: {
725
						label: 'I agree',
726
						className: 'btn-success'
727
					},
728
					cancel: {
729
						label: 'I disagree',
730
						className: 'btn-danger'
731
					}
732
				},
733
				callback: function(result) {
734
					if (result == true) {
735
						loadPendingOrder("main-content");
736
					}
737
				}
738
			}).find("div.modal-body").css({ "height": "700px", "overflow-y": "auto" });
739
		}
740
	});
28358 tejbeer 741
 
28422 tejbeer 742
}