Subversion Repositories SmartDukaan

Rev

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