Subversion Repositories SmartDukaan

Rev

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

Rev 25608 Rev 26647
Line 4... Line 4...
4
saleSearchObj.startTime = "";
4
saleSearchObj.startTime = "";
5
saleSearchObj.endTime = "";
5
saleSearchObj.endTime = "";
6
 
6
 
7
$(function() {
7
$(function() {
8
 
8
 
-
 
9
	$(".pending_fofo_order").live('click', function() {
-
 
10
		console.log("Helloo")
-
 
11
		loadPendingOrder("main-content");
-
 
12
	});
-
 
13
 
-
 
14
	$(".pendingOrderDetail").live(
-
 
15
			'click',
-
 
16
			function() {
-
 
17
				var orderId = $(this).data('orderid');
-
 
18
				console.log(orderId);
-
 
19
 
-
 
20
				var customerObj = {};
-
 
21
 
-
 
22
				var currentRow = $(this).closest("tr");
-
 
23
				customerObj['firstName'] = currentRow.find("td:eq(1)").text();
-
 
24
				customerObj['lastName'] = currentRow.find("td:eq(2)").text();
-
 
25
				customerObj['mobileNumber'] = currentRow.find("td:eq(3)")
-
 
26
						.text();
-
 
27
				customerObj['emailId'] = $(this).data('emailid');
-
 
28
				customerObj['gstNumber'] = $(this).data('gst');
-
 
29
				// customerObj['dateOfBirth'] = startDate;
-
 
30
				var customerAddress = {};
-
 
31
				customerAddress['name'] = currentRow.find("td:eq(1)").text()
-
 
32
						+ " " + currentRow.find("td:eq(2)").text();
-
 
33
				customerAddress['line1'] = $(this).data('line1');
-
 
34
				customerAddress['line2'] = $(this).data('line2');
-
 
35
				customerAddress['city'] = $(this).data('city');
-
 
36
				customerAddress['state'] = $(this).data('state');
-
 
37
				customerAddress['pinCode'] = $(this).data('pincode');
-
 
38
				customerAddress['phoneNumber'] = currentRow.find("td:eq(3)")
-
 
39
						.text();
-
 
40
				customerObj['address'] = customerAddress;
-
 
41
 
-
 
42
				console.log(customerObj);
-
 
43
				localStorage.setItem("customerDetails", JSON
-
 
44
						.stringify(customerObj));
-
 
45
 
-
 
46
				doGetAjaxRequestHandler(context
-
 
47
						+ "/getPendingOrderItem?orderId=" + orderId, function(
-
 
48
						response) {
-
 
49
					$('.pending-order-container').html(response);
-
 
50
				});
-
 
51
			});
-
 
52
 
9
	$(".sale-history").live('click', function() {
53
	$(".sale-history").live('click', function() {
10
		console.log("Sale History Button Clicked...")
54
		console.log("Sale History Button Clicked...")
11
		saleHistory("main-content", "", "", startDate, endDate);
55
		saleHistory("main-content", "", "", startDate, endDate);
12
	});
56
	});
13
 
57
 
Line 105... Line 149...
105
						startDate, endDate);
149
						startDate, endDate);
106
 
150
 
107
				$("#sale-history-search-text").val('');
151
				$("#sale-history-search-text").val('');
108
			});
152
			});
109
 
153
 
110
	$("#sale-history-search-button").live(
154
	$("#sale-history-search-button")
-
 
155
			.live(
111
			'click',
156
					'click',
112
			function() {
157
					function() {
113
				var searchType = $("#searchType option:selected").val();
158
						var searchType = $("#searchType option:selected").val();
114
				console.log("searchType = " + searchType);
159
						console.log("searchType = " + searchType);
115
				$("#searchType").removeClass("border-highlight");
160
						$("#searchType").removeClass("border-highlight");
-
 
161
						saleSearchObj.searchText = $(
116
				saleSearchObj.searchText = $("#sale-history-search-text").val();
162
								"#sale-history-search-text").val();
117
				saleSearchObj.searchType = searchType;
163
						saleSearchObj.searchType = searchType;
118
				saleSearchObj.startTime = startDate;
164
						saleSearchObj.startTime = startDate;
119
				saleSearchObj.endTime = endDate;
165
						saleSearchObj.endTime = endDate;
120
				if (typeof (saleSearchObj.searchText) == "undefined"
166
						if (typeof (saleSearchObj.searchText) == "undefined"
121
						|| !saleSearchObj.searchText) {
167
								|| !saleSearchObj.searchText) {
122
					saleSearchObj.searchText = "";
168
							saleSearchObj.searchText = "";
123
				}
169
						}
124
				saleHistorySearchInfo(saleSearchObj.searchType,
170
						saleHistorySearchInfo(saleSearchObj.searchType,
125
						saleSearchObj.searchText, saleSearchObj.startTime,
171
								saleSearchObj.searchText,
126
						saleSearchObj.endTime);
172
								saleSearchObj.startTime, saleSearchObj.endTime);
127
			});
173
					});
128
	$("#invoice-download-button").live(
174
	$("#invoice-download-button")
-
 
175
			.live(
129
			'click',
176
					'click',
130
			function() {
177
					function() {
131
				var searchType = $("#searchType option:selected").val();
178
						var searchType = $("#searchType option:selected").val();
132
				console.log("searchType = " + searchType);
179
						console.log("searchType = " + searchType);
133
				$("#searchType").removeClass("border-highlight");
180
						$("#searchType").removeClass("border-highlight");
-
 
181
						saleSearchObj.searchText = $(
134
				saleSearchObj.searchText = $("#sale-history-search-text").val();
182
								"#sale-history-search-text").val();
135
				saleSearchObj.searchType = searchType;
183
						saleSearchObj.searchType = searchType;
136
				saleSearchObj.startTime = startDate;
184
						saleSearchObj.startTime = startDate;
137
				saleSearchObj.endTime = endDate;
185
						saleSearchObj.endTime = endDate;
138
				if (typeof (saleSearchObj.searchText) == "undefined"
186
						if (typeof (saleSearchObj.searchText) == "undefined"
139
						|| !saleSearchObj.searchText) {
187
								|| !saleSearchObj.searchText) {
140
					saleSearchObj.searchText = "";
188
							saleSearchObj.searchText = "";
141
				}
189
						}
142
				downloadInvoices(saleSearchObj.searchType,
190
						downloadInvoices(saleSearchObj.searchType,
143
						saleSearchObj.searchText, saleSearchObj.startTime,
191
								saleSearchObj.searchText,
144
						saleSearchObj.endTime);
192
								saleSearchObj.startTime, saleSearchObj.endTime);
145
			});
193
					});
146
 
194
 
147
	$(".search-order").live('click', function() {
195
	$(".search-order").live('click', function() {
148
		console.log("search-order clicked")
196
		console.log("search-order clicked")
149
		loadSearchOrder("main-content");
197
		loadSearchOrder("main-content");
150
	});
198
	});
Line 216... Line 264...
216
			function(response) {
264
			function(response) {
217
				$('#' + domId).html(response);
265
				$('#' + domId).html(response);
218
			});
266
			});
219
}
267
}
220
 
268
 
-
 
269
function loadPendingOrder(domId) {
-
 
270
	doGetAjaxRequestHandler(context + "/pendingOrders", function(response) {
-
 
271
		$('#' + domId).html(response);
-
 
272
 
-
 
273
	});
-
 
274
}
-
 
275
 
221
function loadSearchOrder(domId) {
276
function loadSearchOrder(domId) {
222
	doGetAjaxRequestHandler(context + "/getSearchOrder", function(response) {
277
	doGetAjaxRequestHandler(context + "/getSearchOrder", function(response) {
223
		$('#' + domId).html(response);
278
		$('#' + domId).html(response);
224
	});
279
	});
225
}
280
}