Subversion Repositories SmartDukaan

Rev

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