Subversion Repositories SmartDukaan

Rev

Rev 23973 | Rev 24152 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23973 Rev 24105
Line 8... Line 8...
8
 
8
 
9
	$(".sale-history").live('click', function() {
9
	$(".sale-history").live('click', function() {
10
		console.log("Sale History Button Clicked...")
10
		console.log("Sale History Button Clicked...")
11
		saleHistory("main-content", "", "", startDate, endDate);
11
		saleHistory("main-content", "", "", startDate, endDate);
12
	});
12
	});
-
 
13
	
-
 
14
	$(".updatePaymentDetails")
-
 
15
			.live(
-
 
16
					'click',
-
 
17
					function() {
-
 
18
						console
-
 
19
								.log("updatePaymentDetails target Button Clicked...");
-
 
20
						var i = 1;
-
 
21
						var changedTotalAmount = 0;
-
 
22
						var invoiceNumber = $(this).data('invoicenumber');
-
 
23
						var fofoId = $(this).data('fofoid');
-
 
24
						
-
 
25
						var totalNumberOfPaymentOptionId = $(this).data('totalnumberofpaymentoptionid');
-
 
26
						console.log("totalNumberOfPaymentOptionId"+totalNumberOfPaymentOptionId);
-
 
27
						var referenceId = $(this).data('orderid');
-
 
28
						var referenceType = "ORDER";
-
 
29
						console.log(fofoId);
-
 
30
						console.log(referenceId);
-
 
31
						console.log(invoiceNumber);
-
 
32
						console.log(referenceType);
-
 
33
						var paymentOptionTransactionModels = [];
-
 
34
						var inputvalues = {};
-
 
35
						$('.paymentOptions input').each(
-
 
36
								function() {
-
 
37
									console.log($(this).val())
-
 
38
									if (!isFinite($(this).val()))
-
 
39
									{
-
 
40
										return;
-
 
41
									}
-
 
42
									inputvalues = {};
-
 
43
									inputvalues['paymentOptionId'] = $(this)
-
 
44
											.data('payment-option-id');
-
 
45
									inputvalues['amount'] = $(this).val();
-
 
46
									if(!inputvalues['amount'])
-
 
47
										{
-
 
48
										inputvalues['amount']="0";
-
 
49
										}
-
 
50
									console.log("inputvalues['amount']"+inputvalues['amount']);
-
 
51
									paymentOptionTransactionModels
-
 
52
											.push(inputvalues);
-
 
53
								});
-
 
54
						if(paymentOptionTransactionModels.length!=totalNumberOfPaymentOptionId)
-
 
55
							{
-
 
56
								alert("Sending less or more paymentOptionIds for"+fofoId);
-
 
57
								return false;
-
 
58
							}
-
 
59
						console.log(paymentOptionTransactionModels);
-
 
60
						if (confirm("Are you sure you want to update paymentTransaction!") == true) {
-
 
61
							doPutAjaxRequestWithJsonHandler(
-
 
62
									context
-
 
63
											+ "/updatePaymentTransaction?referenceId="
-
 
64
											+ referenceId + "&referenceType="
-
 
65
											+ referenceType + "&fofoId="
-
 
66
											+ fofoId,
-
 
67
									JSON
-
 
68
											.stringify(paymentOptionTransactionModels),
-
 
69
									function(response) {
-
 
70
										if (response === 'true') {
-
 
71
											alert("successfully added");
-
 
72
											loadSearchOrderDetails(
-
 
73
													invoiceNumber,
-
 
74
													"search-order-details-container");
-
 
75
										}
-
 
76
									});
-
 
77
						}
-
 
78
 
-
 
79
					});
13
 
80
 
14
	$('#searchType').live(
81
	$('#searchType').live(
15
			'change',
82
			'change',
16
			function() {
83
			function() {
17
				var searchType = $("#searchType option:selected").val();
84
				var searchType = $("#searchType option:selected").val();
18
				var searchTypevalue = $(this).find('option:selected').text();
85
				var searchTypevalue = $(this).find('option:selected').text();
19
				;
86
				;
20
				saleHistory.searchType = searchType;
87
				saleHistory.searchType = searchType;
21
				console.log("selected searchType = " + searchType);
88
				console.log("selected searchType = " + searchType);
22
				
89
 
23
				saleHistory("main-content", saleHistory.searchType, "",
90
				saleHistory("main-content", saleHistory.searchType, "",
24
						startDate, endDate);
91
						startDate, endDate);
25
			
92
 
26
					$("#sale-history-search-text").val('');
93
				$("#sale-history-search-text").val('');
27
			});
94
			});
28
 
95
 
29
	$("#sale-history-search-button").live(
96
	$("#sale-history-search-button").live(
30
			'click',
97
			'click',
31
			function() {
98
			function() {
Line 134... Line 201...
134
	});
201
	});
135
}
202
}
136
 
203
 
137
function saleHistorySearchInfo(searchType, searchText, startTime, endTime) {
204
function saleHistorySearchInfo(searchType, searchText, startTime, endTime) {
138
	saleHistory("main-content", searchType, searchText, startTime, endTime);
205
	saleHistory("main-content", searchType, searchText, startTime, endTime);
139
}
-
 
140
206
 
-
 
207
}
-
 
208