Subversion Repositories SmartDukaan

Rev

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

Rev 23540 Rev 23638
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
	$("a.view-returns").live('click', function() {
2
	$("a.view-returns").live('click', function() {
3
		viewReturns("main-content");
3
		viewReturnStores("main-content");
4
	});
4
	});
5
	$("a.pending-returns").live('click', function() {
5
	$("a.pending-returns").live('click', function() {
6
		viewPendingReturns("main-content");
6
		viewPendingReturns("main-content");
7
	});
7
	});
8
	$("a.approved-returns").live('click', function() {
8
	$("a.approved-returns").live('click', function() {
Line 33... Line 33...
33
			createReturnRequest($(this).data("inventoryitemid"), $(this));
33
			createReturnRequest($(this).data("inventoryitemid"), $(this));
34
		}
34
		}
35
	});
35
	});
36
	$("a.approve-return").live('click', function() {
36
	$("a.approve-return").live('click', function() {
37
		if(confirm("Are you sure to Approve?")) {
37
		if(confirm("Are you sure to Approve?")) {
38
			approveReturnRequest($(this).closest('td').data("inventoryitemid"), $(this).closest('td'));
38
			approveReturnRequest($(this).closest('td').data("returnid"), $(this).closest('td'));
39
		}
39
		}
40
	});
40
	});
41
	$("a.deny-return").live('click', function() {
41
	$("a.deny-return").live('click', function() {
42
		if(confirm("Are you sure to Deny?")) {
42
		if(confirm("Are you sure to Deny?")) {
43
			denyReturnRequest($(this).closest('td').data("inventoryitemid"), $(this).closest('td'));
43
			denyReturnRequest($(this).closest('td').data("inventoryitemid"), $(this).closest('td'));
Line 46... Line 46...
46
	/*$("a.generate-debit-note").live('click', function() {
46
	/*$("a.generate-debit-note").live('click', function() {
47
		if(confirm("Are you sure?")) {
47
		if(confirm("Are you sure?")) {
48
			generateDebitNote($(this).closest('tr').data("id"));
48
			generateDebitNote($(this).closest('tr').data("id"));
49
		}
49
		}
50
	});*/
50
	});*/
-
 
51
	$('#store-container').find('a').live('click', function (){
-
 
52
		fofoId=$(this).data('id');
-
 
53
		doAjaxRequestHandler(context+"/return/inventory/" + fofoId, "GET", function(response){
-
 
54
			inventoryTable.rows().remove().rows.add($(response)).draw(false);
-
 
55
		});
-
 
56
	});
-
 
57
	$('#inventory-container').find('a').live('click', function (){
-
 
58
		itemId=$(this).data('id');
-
 
59
		doAjaxRequestHandler(context+"/return/inventory/" + fofoId + "/" + itemId, "GET", function(response){
-
 
60
			returnsTable.rows().remove().rows.add($(response)).draw(false);
-
 
61
		});
-
 
62
	});
51
});
63
});
52
 
64
 
53
function viewReturns(domId){
65
function viewReturnStores(domId){
54
	doAjaxRequestHandler(context+"/return/inventory", "GET", function(response){
66
	doAjaxRequestHandler(context+"/return/stores", "GET", function(response){
55
		$('#' + domId).html(response);
67
		$('#' + domId).html(response);
56
	});
68
	});
57
}
69
}
58
 
70
 
59
function viewPendingReturns(domId){
71
function viewPendingReturns(domId){