| Line 1... |
Line 1... |
| 1 |
$(function() {
|
1 |
$(function() {
|
| 2 |
$("a.view-returns").live('click', function() {
|
2 |
$(document).on('click', "a.view-returns", function() {
|
| 3 |
viewReturnStores("main-content");
|
3 |
viewReturnStores("main-content");
|
| 4 |
});
|
4 |
});
|
| 5 |
$("a.pending-returns").live('click', function() {
|
5 |
$(document).on('click', "a.pending-returns", function() {
|
| 6 |
viewPendingReturns("main-content");
|
6 |
viewPendingReturns("main-content");
|
| 7 |
});
|
7 |
});
|
| 8 |
$("a.approved-returns").live('click', function() {
|
8 |
$(document).on('click', "a.approved-returns", function() {
|
| 9 |
viewApprovedReturns("main-content");
|
9 |
viewApprovedReturns("main-content");
|
| 10 |
});
|
10 |
});
|
| 11 |
|
11 |
|
| 12 |
$("a.view-debit-note").live('click', function() {
|
12 |
$(document).on('click', "a.view-debit-note", function() {
|
| 13 |
viewDebitNotes("main-content");
|
13 |
viewDebitNotes("main-content");
|
| 14 |
});
|
14 |
});
|
| 15 |
|
15 |
|
| 16 |
$("a.wh-display-name").live('click', function() {
|
16 |
$(document).on('click', "a.wh-display-name", function() {
|
| 17 |
var whId = $(this).closest('tr').data('id');
|
17 |
var whId = $(this).closest('tr').data('id');
|
| 18 |
$("#approved-returns-container").find("tr.filter").hide().filter('[data-id="' + whId + '"]').show();
|
18 |
$("#approved-returns-container").find("tr.filter").hide().filter('[data-id="' + whId + '"]').show();
|
| 19 |
$(this).closest('table').find('tr').removeClass('warning');
|
19 |
$(this).closest('table').find('tr').removeClass('warning');
|
| 20 |
$(this).closest('tr').addClass('warning');
|
20 |
$(this).closest('tr').addClass('warning');
|
| 21 |
});
|
21 |
});
|
| 22 |
|
22 |
|
| 23 |
$("a.debit-note").live('click', function() {
|
23 |
$(document).on('click', "a.debit-note", function() {
|
| 24 |
var debitNoteId = $(this).closest('tr').data('id');
|
24 |
var debitNoteId = $(this).closest('tr').data('id');
|
| 25 |
$("#debit-note-items").find("tr.filter").hide().filter('[data-id="' + debitNoteId + '"]').show();
|
25 |
$("#debit-note-items").find("tr.filter").hide().filter('[data-id="' + debitNoteId + '"]').show();
|
| 26 |
$(this).closest('table').find('tr').removeClass('warning');
|
26 |
$(this).closest('table').find('tr').removeClass('warning');
|
| 27 |
$(this).closest('tr').addClass('warning');
|
27 |
$(this).closest('tr').addClass('warning');
|
| 28 |
});
|
28 |
});
|
| 29 |
|
29 |
|
| 30 |
|
30 |
|
| 31 |
$("a.request-return").live('click', function() {
|
31 |
$(document).on('click', "a.request-return", function() {
|
| 32 |
if(confirm("Are you sure?")) {
|
32 |
if(confirm("Are you sure?")) {
|
| 33 |
createReturnRequest($(this).data("inventoryitemid"), $(this));
|
33 |
createReturnRequest($(this).data("inventoryitemid"), $(this));
|
| 34 |
}
|
34 |
}
|
| 35 |
});
|
35 |
});
|
| 36 |
$("a.approve-return").live('click', function() {
|
36 |
$(document).on('click', "a.approve-return", function() {
|
| 37 |
if(confirm("Are you sure to Approve?")) {
|
37 |
if(confirm("Are you sure to Approve?")) {
|
| 38 |
approveReturnRequest($(this).closest('td').data("returnid"), $(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 |
$(document).on('click', "a.deny-return", function() {
|
| 42 |
if(confirm("Are you sure to Deny?")) {
|
42 |
if(confirm("Are you sure to Deny?")) {
|
| 43 |
denyReturnRequest($(this).closest('td').data("returnid"), $(this).closest('td'));
|
43 |
denyReturnRequest($(this).closest('td').data("returnid"), $(this).closest('td'));
|
| 44 |
}
|
44 |
}
|
| 45 |
});
|
45 |
});
|
| 46 |
/*$("a.generate-debit-note").live('click', function() {
|
46 |
/*$(document).on('click', "a.generate-debit-note", 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 (){
|
51 |
/*$(document).on('click', '#store-container').find('a', function (){
|
| 52 |
fofoId=$(this).data('id');
|
52 |
fofoId=$(this).data('id');
|
| 53 |
doAjaxRequestHandler(context+"/return/inventory/" + fofoId, "GET", function(response){
|
53 |
doAjaxRequestHandler(context+"/return/inventory/" + fofoId, "GET", function(response){
|
| 54 |
inventoryTable.rows().remove().rows.add($(response)).draw(false);
|
54 |
inventoryTable.rows().remove().rows.add($(response)).draw(false);
|
| 55 |
});
|
55 |
});
|
| 56 |
});*/
|
56 |
});*/
|
| 57 |
$('#inventory-container').find('a').live('click', function (){
|
57 |
$(document).on('click', '#inventory-container').find('a', function (){
|
| 58 |
itemId=$(this).data('id');
|
58 |
itemId=$(this).data('id');
|
| 59 |
doAjaxRequestHandler(context+"/return/inventory/" + fofoId + "/" + itemId, "GET", function(response){
|
59 |
doAjaxRequestHandler(context+"/return/inventory/" + fofoId + "/" + itemId, "GET", function(response){
|
| 60 |
returnsTable.rows().remove().rows.add($(response)).draw(false);
|
60 |
returnsTable.rows().remove().rows.add($(response)).draw(false);
|
| 61 |
});
|
61 |
});
|
| 62 |
});
|
62 |
});
|