| Line 429... |
Line 429... |
| 429 |
$("#retailer-details-search-button").click();
|
429 |
$("#retailer-details-search-button").click();
|
| 430 |
}
|
430 |
}
|
| 431 |
});
|
431 |
});
|
| 432 |
|
432 |
|
| 433 |
|
433 |
|
| - |
|
434 |
$('#searchType').live('change', function() {
|
| - |
|
435 |
var searchType = $(this).find('option:selected').text();
|
| - |
|
436 |
console.log("selected searchType = " + searchType);
|
| - |
|
437 |
$("#sale-history-search-text").attr('placeholder', 'Search By '+searchType);
|
| - |
|
438 |
$("#sale-history-search-text").val('');
|
| - |
|
439 |
});
|
| - |
|
440 |
|
| - |
|
441 |
|
| 434 |
$("#sale-history-search-button").live('click', function() {
|
442 |
$("#sale-history-search-button").live('click', function() {
|
| - |
|
443 |
console.log("sale-history-search-button clicked")
|
| - |
|
444 |
var searchType = $("#searchType option:selected").val();
|
| - |
|
445 |
console.log("searchType = " + searchType);
|
| - |
|
446 |
$("#searchType").removeClass("border-highlight");
|
| - |
|
447 |
if(searchType == ""){
|
| - |
|
448 |
alert("Please choose Search Type");
|
| - |
|
449 |
$("#searchType").addClass("border-highlight");
|
| - |
|
450 |
}else{
|
| - |
|
451 |
var startDateTime = $('input[name="startDateTime"]').val();
|
| - |
|
452 |
console.log("startDateTime : "+startDateTime);
|
| - |
|
453 |
var endDateTime = $('input[name="endDateTime"]').val();
|
| - |
|
454 |
console.log("endDateTime : "+endDateTime);
|
| - |
|
455 |
|
| 435 |
saleHistory.searchText = $("#sale-history-search-text").val();
|
456 |
saleHistory.searchText = $("#sale-history-search-text").val();
|
| 436 |
saleHistory.searchType = "invoiceNumber";
|
457 |
saleHistory.searchType = searchType;
|
| 437 |
saleHistory.startTime = "0";
|
458 |
saleHistory.startTime = startDateTime;
|
| 438 |
saleHistory.endTime = "0";
|
459 |
saleHistory.endTime = endDateTime;
|
| 439 |
if (typeof (saleHistory.searchText) == "undefined" || !saleHistory.searchText){
|
460 |
if (typeof (saleHistory.searchText) == "undefined" || !saleHistory.searchText){
|
| 440 |
saleHistory.searchText = "";
|
461 |
saleHistory.searchText = "";
|
| - |
|
462 |
}
|
| - |
|
463 |
saleHistorySearchInfo(saleHistory.searchType, saleHistory.searchText, saleHistory.startTime, saleHistory.endTime);
|
| - |
|
464 |
$("#sale-history-search-text").val(saleHistory.searchText);
|
| - |
|
465 |
$("#searchType").val(searchType);
|
| - |
|
466 |
$('input[name="startDateTime"]').val(saleHistory.startTime);
|
| - |
|
467 |
$('input[name="endDateTime"]').val(saleHistory.endTime);
|
| 441 |
}
|
468 |
}
|
| 442 |
saleHistorySearchInfo(saleHistory.searchText, saleHistory.searchType, saleHistory.startTime, saleHistory.endTime);
|
- |
|
| 443 |
});
|
469 |
});
|
| 444 |
|
470 |
|
| 445 |
$("#sale-history-search-text").live("keyup", function(e) {
|
471 |
/*$("#sale-history-search-text").live("keyup", function(e) {
|
| 446 |
var keyCode = e.keyCode || e.which;
|
472 |
var keyCode = e.keyCode || e.which;
|
| 447 |
if(keyCode == 13){
|
473 |
if(keyCode == 13){
|
| 448 |
$("#sale-history-search-button").click();
|
474 |
$("#sale-history-search-button").click();
|
| 449 |
}
|
475 |
}
|
| 450 |
});
|
476 |
});*/
|
| 451 |
|
477 |
|
| 452 |
$("#grn-history-paginated .next").live('click', function() {
|
478 |
$("#grn-history-paginated .next").live('click', function() {
|
| 453 |
var start = $( "#grn-history-paginated .start" ).text();
|
479 |
var start = $( "#grn-history-paginated .start" ).text();
|
| 454 |
var end = $( "#grn-history-paginated .end" ).text();
|
480 |
var end = $( "#grn-history-paginated .end" ).text();
|
| 455 |
getGrnHistoryNextItems(start,end,grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
|
481 |
getGrnHistoryNextItems(start,end,grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
|
| Line 476... |
Line 502... |
| 476 |
|
502 |
|
| 477 |
|
503 |
|
| 478 |
$("#sale-history-paginated .next").live('click', function() {
|
504 |
$("#sale-history-paginated .next").live('click', function() {
|
| 479 |
var start = $( "#sale-history-paginated .start" ).text();
|
505 |
var start = $( "#sale-history-paginated .start" ).text();
|
| 480 |
var end = $( "#sale-history-paginated .end" ).text();
|
506 |
var end = $( "#sale-history-paginated .end" ).text();
|
| 481 |
getSaleHistoryNextItems(start, end, saleHistory.searchText, saleHistory.searchType, saleHistory.startTime, saleHistory.endTime);
|
507 |
getSaleHistoryNextItems(start, end, saleHistory.searchType, saleHistory.searchText, saleHistory.startTime, saleHistory.endTime);
|
| 482 |
$("#sale-history-paginated .next").blur();
|
508 |
$("#sale-history-paginated .next").blur();
|
| 483 |
});
|
509 |
});
|
| 484 |
|
510 |
|
| 485 |
$("#sale-history-paginated .previous").live('click', function() {
|
511 |
$("#sale-history-paginated .previous").live('click', function() {
|
| 486 |
var start = $( "#sale-history-paginated .start" ).text();
|
512 |
var start = $( "#sale-history-paginated .start" ).text();
|
| 487 |
var end = $( "#sale-history-paginated .end" ).text();
|
513 |
var end = $( "#sale-history-paginated .end" ).text();
|
| 488 |
var pre = end - 20;
|
514 |
var pre = end - 20;
|
| 489 |
getSaleHistoryPreviousItems(start, end, pre, saleHistory.searchText, saleHistory.searchType, saleHistory.startTime, saleHistory.endTime);
|
515 |
getSaleHistoryPreviousItems(start, end, pre, saleHistory.searchType, saleHistory.searchText, saleHistory.startTime, saleHistory.endTime);
|
| 490 |
$("#sale-history-paginated .previous").blur();
|
516 |
$("#sale-history-paginated .previous").blur();
|
| 491 |
});
|
517 |
});
|
| 492 |
|
518 |
|
| 493 |
$("#schemes-paginated .next").live('click', function() {
|
519 |
$("#schemes-paginated .next").live('click', function() {
|
| 494 |
var start = $( "#schemes-paginated .start" ).text();
|
520 |
var start = $( "#schemes-paginated .start" ).text();
|
| Line 518... |
Line 544... |
| 518 |
var pre = end - 20;
|
544 |
var pre = end - 20;
|
| 519 |
getWalletHistoryPreviousItems(start, end, pre, walletHistory.startTime, walletHistory.endTime);
|
545 |
getWalletHistoryPreviousItems(start, end, pre, walletHistory.startTime, walletHistory.endTime);
|
| 520 |
$("#wallet-history-paginated .previous").blur();
|
546 |
$("#wallet-history-paginated .previous").blur();
|
| 521 |
});
|
547 |
});
|
| 522 |
|
548 |
|
| 523 |
$("#sale-history-date-button").live('click', function() {
|
549 |
/*$("#sale-history-date-button").live('click', function() {
|
| 524 |
var dateRange = $('#reportrange span').text();
|
550 |
var dateRange = $('#reportrange span').text();
|
| 525 |
saleHistory.startTime = new Date(dateRange.split("-")[0]).getTime();
|
551 |
saleHistory.startTime = new Date(dateRange.split("-")[0]).getTime();
|
| 526 |
saleHistory.endTime = new Date(dateRange.split("-")[1]).getTime();
|
552 |
saleHistory.endTime = new Date(dateRange.split("-")[1]).getTime();
|
| 527 |
saleHistory.searchType = "dateFilter";
|
553 |
saleHistory.searchType = "";
|
| 528 |
saleHistory.searchText = "";
|
554 |
saleHistory.searchText = "";
|
| 529 |
saleHistorySearchInfo(saleHistory.searchText, saleHistory.searchType, saleHistory.startTime, saleHistory.endTime);
|
555 |
saleHistorySearchInfo(saleHistory.searchType, saleHistory.searchText, saleHistory.startTime, saleHistory.endTime);
|
| 530 |
});
|
556 |
});*/
|
| 531 |
|
557 |
|
| 532 |
$("#wallet-history-date-button").live('click', function() {
|
- |
|
| 533 |
var dateRange = $('#reportrange span').text();
|
- |
|
| 534 |
walletHistory.startTime = new Date(dateRange.split("-")[0]).getTime();
|
- |
|
| 535 |
walletHistory.endTime = new Date(dateRange.split("-")[1]).getTime();
|
- |
|
| 536 |
saleHistorySearchInfo(saleHistory.searchText, saleHistory.searchType, saleHistory.startTime, saleHistory.endTime);
|
- |
|
| 537 |
});
|
- |
|
| 538 |
|
558 |
|
| 539 |
//grn-details
|
559 |
//grn-details
|
| 540 |
|
560 |
|
| 541 |
$(".grn-details").live('click',function(){
|
561 |
$(".grn-details").live('click',function(){
|
| 542 |
var purchaseId = $(this).attr('data');
|
562 |
var purchaseId = $(this).attr('data');
|