Subversion Repositories SmartDukaan

Rev

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

Rev 24896 Rev 24942
Line 17... Line 17...
17
 
17
 
18
				doGetAjaxRequestHandler(context
18
				doGetAjaxRequestHandler(context
19
						+ "/getWalletHistory?reference=" + reference
19
						+ "/getWalletHistory?reference=" + reference
20
						+ "&referenceType=" + type, function(response) {
20
						+ "&referenceType=" + type, function(response) {
21
					$('.wallet-history-container').html(response);
21
					$('.wallet-history-container').html(response);
-
 
22
					
-
 
23
					doGetAjaxRequestHandler(context + "/getPartnerName?reference="
-
 
24
							+ reference + "&referenceType=" + type, function(
-
 
25
							response) {
-
 
26
						response=JSON.parse(response);
-
 
27
						console.log(response.businessName+ "-" + response.address.city)
-
 
28
	                   $("#FofoId").val(response.businessName+ "-" + response.address.city);
-
 
29
						currentFofoId=response.partnerId;
-
 
30
					});
22
				});
31
				});
23
 
32
 
24
				doGetAjaxRequestHandler(context + "/getPartnerName?reference="
-
 
25
						+ reference + "&referenceType=" + type, function(
-
 
26
						response) {
-
 
27
					response=JSON.parse(response);
-
 
28
					console.log(response.businessName+ "-" + response.address.city)
-
 
29
                   $("#FofoId").val(response.businessName+ "-" + response.address.city);
-
 
30
					currentFofoId=response.partnerId;
-
 
31
				});
33
				
32
 
34
 
33
			});
35
			});
34
	
36
	
35
	$(".fetchTransactions").live('click', function() {
37
	$(".fetchTransactions").live('click', function() {
36
		var type = $('#reference-type option:selected').val();
38
		var type = $('#reference-type option:selected').val();
Line 47... Line 49...
47
				var transactiontype = $('#transaction-type').val();
49
				var transactiontype = $('#transaction-type').val();
48
				var amount = $('#amount').val();
50
				var amount = $('#amount').val();
49
				var description = $('#description').val();
51
				var description = $('#description').val();
50
				var retailerId = currentFofoId
52
				var retailerId = currentFofoId
51
				console.log(currentFofoId)
53
				console.log(currentFofoId)
-
 
54
				console.log(type);
52
				if (type == "") {
55
				if (type == "") {
53
					alert("Please Choose Reference Type");
56
					alert("Please Choose Reference Type");
54
					return;
57
					return;
55
				}
58
				}
-
 
59
				if(type!='INCENTIVES'&&type!='OTHERS'){
-
 
60
					
-
 
61
					if(reference == ""){
-
 
62
						alert("Reference Id is required");
-
 
63
						return;
-
 
64
					}
-
 
65
				}
-
 
66
				
56
				if (transactiontype == "") {
67
				if (transactiontype == "") {
57
					alert("Please Choose Transaction Type");
68
					alert("Please Choose Transaction Type");
58
					return;
69
					return;
59
				}
70
				}
60
				if (amount == "") {
71
				if (amount == "") {
Line 77... Line 88...
77
							+ "/walletUpdate?reference=" + reference
88
							+ "/walletUpdate?reference=" + reference
78
							+ "&referenceType=" + type + "&transactiontype="
89
							+ "&referenceType=" + type + "&transactiontype="
79
							+ transactiontype + "&amount=" + amount
90
							+ transactiontype + "&amount=" + amount
80
							+ "&description=" + description + "&retailerId="
91
							+ "&description=" + description + "&retailerId="
81
							+ currentFofoId, function(response) {
92
							+ currentFofoId, function(response) {
82
						if (response == 'true') {
93
						if (response != 0) {
83
							alert("successfully submit");
94
							alert("successfully submit");
-
 
95
							console.log(response)
-
 
96
							$("#reference_id").val(response);
84
							$("button.referenceSearch").click();
97
							$("button.referenceSearch").click();
85
						}
98
						}
86
					});
99
					});
87
				}
100
				}
88
			});
101
			});