Subversion Repositories SmartDukaan

Rev

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

Rev 32549 Rev 32551
Line 1... Line 1...
1
$(function () {
1
$(function () {
2
 
2
 
3
    $(document).on('click', ".submit-inactive", function () {
3
    $(document).on('click', ".submit-inactive", function () {
4
 
4
 
5
        var id = $(this).data('id');
5
        var id = $(this).data('id');
6
        if (confirm("Are you sure you want to In Active this Supplier") == true) {
6
        if (confirm("Are you sure you want to In Active this Supplier")) {
7
 
7
 
8
            doPostAjaxRequestHandler(context + "/setStatusInActive?id=" + id,
8
            doPostAjaxRequestHandler(context + "/setStatusInActive?id=" + id,
9
                function (response) {
9
                function (response) {
10
                    if (response == "true") {
10
                    if (response === "true") {
11
 
11
 
12
                        getAllSupplier("main-content");
12
                        getAllSupplier("main-content");
13
                    }
13
                    }
14
                });
14
                });
15
        }
15
        }
Line 44... Line 44...
44
 
44
 
45
 
45
 
46
    $(document).on('click', ".submit-active", function () {
46
    $(document).on('click', ".submit-active", function () {
47
 
47
 
48
        var id = $(this).data('id');
48
        var id = $(this).data('id');
49
        if (confirm("Are you sure you want to Active this Supplier") == true) {
49
        if (confirm("Are you sure you want to Active this Supplier")) {
50
            doPostAjaxRequestHandler(context + "/setStatusActive?id=" + id,
50
            doPostAjaxRequestHandler(context + "/setStatusActive?id=" + id,
51
                function (response) {
51
                function (response) {
52
                    if (response == "true") {
52
                    if (response === "true") {
53
                        getAllInActiveSupplier("main-content");
53
                        getAllInActiveSupplier("main-content");
54
                    }
54
                    }
55
                });
55
                });
56
        }
56
        }
57
 
57
 
Line 123... Line 123...
123
        $("#instructionItemsContainer .instruction-item-item-id-quantity").each(function () {
123
        $("#instructionItemsContainer .instruction-item-item-id-quantity").each(function () {
124
            var $itemIdQuantity = $(this);
124
            var $itemIdQuantity = $(this);
125
            var itemId = $itemIdQuantity.find('.itemId').val();
125
            var itemId = $itemIdQuantity.find('.itemId').val();
126
            console.log('itemId : ' + itemId);
126
            console.log('itemId : ' + itemId);
127
            var quantity = $itemIdQuantity.find('.quantity').val();
127
            var quantity = $itemIdQuantity.find('.quantity').val();
128
            if (quantity == null || quantity <= 0) {
128
            if (quantity === null || quantity <= 0) {
129
                quantity = 1;
129
                quantity = 1;
130
            }
130
            }
131
            console.log('quantity : ' + quantity);
131
            console.log('quantity : ' + quantity);
132
            itemIdQuantityMap[itemId] = quantity;
132
            itemIdQuantityMap[itemId] = quantity;
133
        });
133
        });
Line 281... Line 281...
281
    });
281
    });
282
}
282
}
283
 
283
 
284
 
284
 
285
function addRemoveWarehouses(domId, emailIdOrMobileNumber, warehouseIds) {
285
function addRemoveWarehouses(domId, emailIdOrMobileNumber, warehouseIds) {
286
    if (confirm("Are you sure you want to add or remove warehouses!") == true) {
286
    if (confirm("Are you sure you want to add or remove warehouses!")) {
287
        doPostAjaxRequestWithJsonHandler(context + "/addRemoveWarehouses?emailIdOrMobileNumber=" + emailIdOrMobileNumber, JSON.stringify(warehouseIds), function (response) {
287
        doPostAjaxRequestWithJsonHandler(context + "/addRemoveWarehouses?emailIdOrMobileNumber=" + emailIdOrMobileNumber, JSON.stringify(warehouseIds), function (response) {
288
            $('#' + domId).html(response);
288
            $('#' + domId).html(response);
289
            $('#emailIdOrMobileNumber').val(emailIdOrMobileNumber);
289
            $('#emailIdOrMobileNumber').val(emailIdOrMobileNumber);
290
            getWarehousesByEmailIdOrMobileNumber();
290
            getWarehousesByEmailIdOrMobileNumber();
291
        });
291
        });
Line 427... Line 427...
427
        );
427
        );
428
    }
428
    }
429
});
429
});
430
 
430
 
431
function newSupplierCreateObjectJson() {
431
function newSupplierCreateObjectJson() {
432
    var newSupplierCreateObject = {};
432
    let newSupplierCreateObject = {};
433
 
433
 
434
 
434
 
435
    newSupplierCreateObject['name'] = $("form#new-supplier-create-form input[name=inputName]").val();
435
    newSupplierCreateObject['name'] = $("form#new-supplier-create-form input[name=inputName]").val();
436
 
436
 
437
    newSupplierCreateObject['phone'] = $("form#new-supplier-create-form input[name=inputPhone]").val();
437
    newSupplierCreateObject['phone'] = $("form#new-supplier-create-form input[name=inputPhone]").val();