Subversion Repositories SmartDukaan

Rev

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