Subversion Repositories SmartDukaan

Rev

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

Rev 22354 Rev 22488
Line 79... Line 79...
79
            $('#' + domId).html(response);
79
            $('#' + domId).html(response);
80
        }
80
        }
81
    });  
81
    });  
82
}
82
}
83
 
83
 
-
 
84
function downloadAgingReport(){
-
 
85
	data = JSON.stringify([5,10,15,20,25,30,35,40]),
-
 
86
	xhttp = new XMLHttpRequest();
-
 
87
	xhttp.onreadystatechange = function() {
-
 
88
	    var a;
-
 
89
	    if (xhttp.readyState === 4 && xhttp.status === 200) {
-
 
90
	        // Trick for making downloadable link
-
 
91
	        a = document.createElement('a');
-
 
92
	        a.href = window.URL.createObjectURL(xhttp.response);
-
 
93
	        // Give filename you wish to download
-
 
94
	        a.download = "InventoryItemAging.xlsx";
-
 
95
	        a.style.display = 'none';
-
 
96
	        document.body.appendChild(a);
-
 
97
	        a.click();
-
 
98
	    }
-
 
99
	};
-
 
100
	// Post data to URL which handles post request
-
 
101
	xhttp.open("POST", context+"/getInventoryItemAgingByInterval");
-
 
102
	xhttp.setRequestHeader("Content-Type", "application/json");
-
 
103
	// You should set responseType as blob for binary responses
-
 
104
	xhttp.responseType = 'blob';
-
 
105
	xhttp.send(data);
-
 
106
}
-
 
107
 
84
function loadBadInventory(domId, search_text){
108
function loadBadInventory(domId, search_text){
85
	jQuery.ajax({
109
	jQuery.ajax({
86
        type : "GET",
110
        type : "GET",
87
        url : context+"/getBadInventorySnapshot/?searchTerm="+search_text,
111
        url : context+"/getBadInventorySnapshot/?searchTerm="+search_text,
88
        success : function(response) {
112
        success : function(response) {