| Line 45... |
Line 45... |
| 45 |
|
45 |
|
| 46 |
$(".item-ledger-report-download-page").live('click', function() {
|
46 |
$(".item-ledger-report-download-page").live('click', function() {
|
| 47 |
loadItemLedgerReportDownloadPage("main-content");
|
47 |
loadItemLedgerReportDownloadPage("main-content");
|
| 48 |
});
|
48 |
});
|
| 49 |
|
49 |
|
| 50 |
/*$(".item-ledger-report-download").live('click', function() {
|
- |
|
| 51 |
var startEndDateTime = $('input[name="startEndDateTime"]').val().split("-");
|
- |
|
| 52 |
var startDateTime = $.trim(startEndDateTime[0]);
|
- |
|
| 53 |
var endDateTime = $.trim(startEndDateTime[1]);
|
- |
|
| 54 |
downloadItemLedgerReport(startDateTime, endDateTime);
|
- |
|
| 55 |
});*/
|
- |
|
| 56 |
|
- |
|
| 57 |
$(".bad_inventory").live('click', function() {
|
50 |
$(".bad_inventory").live('click', function() {
|
| 58 |
loadBadInventory("main-content","");
|
51 |
loadBadInventory("main-content","");
|
| 59 |
});
|
52 |
});
|
| 60 |
|
53 |
|
| 61 |
$("#good-inventory-paginated .next").live('click', function() {
|
54 |
$("#good-inventory-paginated .next").live('click', function() {
|
| Line 148... |
Line 141... |
| 148 |
|
141 |
|
| 149 |
});
|
142 |
});
|
| 150 |
|
143 |
|
| 151 |
|
144 |
|
| 152 |
function loadGoodInventory(domId, search_text){
|
145 |
function loadGoodInventory(domId, search_text){
|
| 153 |
doAjaxRequestHandler(context+"/getCurrentInventorySnapshot/?searchTerm="+search_text, "GET", function(response){
|
146 |
doGetAjaxRequestHandler(context+"/getCurrentInventorySnapshot/?searchTerm="+search_text, function(response){
|
| 154 |
$('#' + domId).html(response);
|
147 |
$('#' + domId).html(response);
|
| 155 |
});
|
148 |
});
|
| 156 |
}
|
149 |
}
|
| 157 |
|
150 |
|
| 158 |
function loadCatalog(domId, search_text){
|
151 |
function loadCatalog(domId, search_text){
|
| 159 |
doAjaxRequestHandler(context+"/getCatalog/?searchTerm="+search_text, "GET", function(response){
|
152 |
doGetAjaxRequestHandler(context+"/getCatalog/?searchTerm="+search_text, function(response){
|
| 160 |
$('#' + domId).html(response);
|
153 |
$('#' + domId).html(response);
|
| 161 |
});
|
154 |
});
|
| 162 |
}
|
155 |
}
|
| 163 |
|
156 |
|
| 164 |
function getInventoryItemAgingByInterval(domId, searchContent){
|
157 |
function getInventoryItemAgingByInterval(domId, searchContent){
|
| 165 |
doAjaxRequestWithJsonHandler(context+"/getInventoryItemAgingByInterval?searchContent="+searchContent, "POST", JSON.stringify([5,15,30,45]), function(response){
|
158 |
doPostAjaxRequestWithJsonHandler(context+"/getInventoryItemAgingByInterval?searchContent="+searchContent, JSON.stringify([5,15,30,45]), function(response){
|
| 166 |
$('#' + domId).html(response);
|
159 |
$('#' + domId).html(response);
|
| 167 |
});
|
160 |
});
|
| 168 |
}
|
161 |
}
|
| 169 |
|
162 |
|
| 170 |
|
163 |
|
| Line 187... |
Line 180... |
| 187 |
}
|
180 |
}
|
| 188 |
|
181 |
|
| 189 |
|
182 |
|
| 190 |
function getItemAgingNextPreviousItems(offset, searchContent){
|
183 |
function getItemAgingNextPreviousItems(offset, searchContent){
|
| 191 |
console.log("getItemAgingNextPreviousItems() called");
|
184 |
console.log("getItemAgingNextPreviousItems() called");
|
| 192 |
doAjaxRequestWithJsonHandler(context+"/getInventoryItemAgingByInterval?offset="+offset+"&searchContent="+searchContent, "POST", JSON.stringify([5,15,30,45]), function(response){
|
185 |
doPostAjaxRequestWithJsonHandler(context+"/getInventoryItemAgingByInterval?offset="+offset+"&searchContent="+searchContent, JSON.stringify([5,15,30,45]), function(response){
|
| 193 |
$('#main-content').html(response);
|
186 |
$('#main-content').html(response);
|
| 194 |
});
|
187 |
});
|
| 195 |
|
188 |
|
| 196 |
}
|
189 |
}
|
| 197 |
|
190 |
|
| 198 |
|
191 |
|
| 199 |
function loadBadInventory(domId, search_text){
|
192 |
function loadBadInventory(domId, search_text){
|
| 200 |
doAjaxRequestHandler(context+"/getBadInventorySnapshot/?searchTerm="+search_text, "GET", function(response){
|
193 |
doGetAjaxRequestHandler(context+"/getBadInventorySnapshot/?searchTerm="+search_text, function(response){
|
| 201 |
$('#' + domId).html(response);
|
194 |
$('#' + domId).html(response);
|
| 202 |
});
|
195 |
});
|
| 203 |
}
|
196 |
}
|
| 204 |
|
197 |
|
| 205 |
|
198 |
|
| 206 |
function getNextItems(start, end, searchText){
|
199 |
function getNextItems(start, end, searchText){
|
| 207 |
console.log(start);
|
200 |
console.log(start);
|
| 208 |
console.log(end);
|
201 |
console.log(end);
|
| 209 |
console.log(+end + +10);
|
202 |
console.log(+end + +10);
|
| 210 |
console.log(+start + +10);
|
203 |
console.log(+start + +10);
|
| 211 |
doAjaxRequestHandler(context+"/getPaginatedCurrentInventorySnapshot/?offset="+end+"&searchTerm="+searchText, "GET", function(response){
|
204 |
doGetAjaxRequestHandler(context+"/getPaginatedCurrentInventorySnapshot/?offset="+end+"&searchTerm="+searchText, function(response){
|
| 212 |
var size = $("#good-inventory-paginated .size").text();
|
205 |
var size = $("#good-inventory-paginated .size").text();
|
| 213 |
if((parseInt(end) + 10) > parseInt(size)){
|
206 |
if((parseInt(end) + 10) > parseInt(size)){
|
| 214 |
console.log("(end + 10) > size == true");
|
207 |
console.log("(end + 10) > size == true");
|
| 215 |
$( "#good-inventory-paginated .end" ).text(size);
|
208 |
$( "#good-inventory-paginated .end" ).text(size);
|
| 216 |
}else{
|
209 |
}else{
|
| Line 230... |
Line 223... |
| 230 |
|
223 |
|
| 231 |
|
224 |
|
| 232 |
}
|
225 |
}
|
| 233 |
|
226 |
|
| 234 |
function getPreviousItems(start,end,pre,searchText){
|
227 |
function getPreviousItems(start,end,pre,searchText){
|
| 235 |
doAjaxRequestHandler(context+"/getPaginatedCurrentInventorySnapshot/?offset="+pre+"&searchTerm="+searchText, "GET", function(response){
|
228 |
doGetAjaxRequestHandler(context+"/getPaginatedCurrentInventorySnapshot/?offset="+pre+"&searchTerm="+searchText, function(response){
|
| 236 |
$( "#good-inventory-paginated .end" ).text(+end - +10);
|
229 |
$( "#good-inventory-paginated .end" ).text(+end - +10);
|
| 237 |
$( "#good-inventory-paginated .start" ).text(+start - +10);
|
230 |
$( "#good-inventory-paginated .start" ).text(+start - +10);
|
| 238 |
$('#good-inventory-table').html(response);
|
231 |
$('#good-inventory-table').html(response);
|
| 239 |
$("#good-inventory-paginated .next").prop('disabled', false);
|
232 |
$("#good-inventory-paginated .next").prop('disabled', false);
|
| 240 |
if (parseInt(pre)==0)
|
233 |
if (parseInt(pre)==0)
|
| Line 253... |
Line 246... |
| 253 |
function getNextCatalogItems(start, end, searchText){
|
246 |
function getNextCatalogItems(start, end, searchText){
|
| 254 |
console.log(start);
|
247 |
console.log(start);
|
| 255 |
console.log(end);
|
248 |
console.log(end);
|
| 256 |
console.log(+end + +10);
|
249 |
console.log(+end + +10);
|
| 257 |
console.log(+start + +10);
|
250 |
console.log(+start + +10);
|
| 258 |
doAjaxRequestHandler(context+"/getPaginatedCatalog/?offset="+end+"&searchTerm="+searchText, "GET", function(response){
|
251 |
doGetAjaxRequestHandler(context+"/getPaginatedCatalog/?offset="+end+"&searchTerm="+searchText, function(response){
|
| 259 |
var size = $("#catalog-paginated .size").text();
|
252 |
var size = $("#catalog-paginated .size").text();
|
| 260 |
if((parseInt(end) + 10) > parseInt(size)){
|
253 |
if((parseInt(end) + 10) > parseInt(size)){
|
| 261 |
console.log("(end + 10) > size == true");
|
254 |
console.log("(end + 10) > size == true");
|
| 262 |
$( "#catalog-paginated .end" ).text(size);
|
255 |
$( "#catalog-paginated .end" ).text(size);
|
| 263 |
}else{
|
256 |
}else{
|
| Line 274... |
Line 267... |
| 274 |
$("#catalog-paginated .previous").prop('disabled', false);
|
267 |
$("#catalog-paginated .previous").prop('disabled', false);
|
| 275 |
});
|
268 |
});
|
| 276 |
}
|
269 |
}
|
| 277 |
|
270 |
|
| 278 |
function getPreviousCatalogItems(start,end,pre,searchText){
|
271 |
function getPreviousCatalogItems(start,end,pre,searchText){
|
| 279 |
doAjaxRequestHandler(context+"/getPaginatedCatalog/?offset="+pre+"&searchTerm="+searchText, "GET", function(response){
|
272 |
doGetAjaxRequestHandler(context+"/getPaginatedCatalog/?offset="+pre+"&searchTerm="+searchText, function(response){
|
| 280 |
$( "#catalog-paginated .end" ).text(+end - +10);
|
273 |
$( "#catalog-paginated .end" ).text(+end - +10);
|
| 281 |
$( "#catalog-paginated .start" ).text(+start - +10);
|
274 |
$( "#catalog-paginated .start" ).text(+start - +10);
|
| 282 |
$('#catalog-table').html(response);
|
275 |
$('#catalog-table').html(response);
|
| 283 |
$("#catalog-paginated .next").prop('disabled', false);
|
276 |
$("#catalog-paginated .next").prop('disabled', false);
|
| 284 |
if (parseInt(pre)==0)
|
277 |
if (parseInt(pre)==0)
|
| Line 292... |
Line 285... |
| 292 |
function loadCatalogSearchInfo(search_text){
|
285 |
function loadCatalogSearchInfo(search_text){
|
| 293 |
loadCatalog("main-content",search_text);
|
286 |
loadCatalog("main-content",search_text);
|
| 294 |
}
|
287 |
}
|
| 295 |
|
288 |
|
| 296 |
function loadItemLedgerReportDownloadPage(domId){
|
289 |
function loadItemLedgerReportDownloadPage(domId){
|
| 297 |
doAjaxRequestHandler(context+"/itemLedger/downloadPage", "GET", function(response){
|
290 |
doGetAjaxRequestHandler(context+"/itemLedger/downloadPage", function(response){
|
| 298 |
$('#' + domId).html(response);
|
291 |
$('#' + domId).html(response);
|
| 299 |
});
|
292 |
});
|
| 300 |
}
|
293 |
}
|
| 301 |
|
294 |
|