Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

$(function() {
        $(function() {
                heldInventoryTable = $('#held-inventory-table').dataTable({
                        "sPaginationType": "full_numbers",
                "aaSorting" : [ [ 9, 'desc' ] ],
                "iDisplayLength" : 50,
                "sDom" : 'T<"clear">lfrtip',
                "oTableTools" : {
                "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
                },
        });
        });
        
        $('#transfer-lot-receive-button').live('click', function() {
                var transferLotId = $(this).attr('transferLotId');
                $('#transfer-lot-updation-box').show();
                $('#update-transfer-lot').attr('transferLotId',transferLotId);
                $.colorbox({
                        inline : true,
                width : "325px",
                height : "125px",
                opacity : "0.30",
                overlayClose :  true,
                escKey :        true,
                href : "#transfer-lot-updation-box",
                onClosed : function() {
                    $("#transfer-lot-updation-box").hide();
                    $('#update-transfer-lot').removeAttr('transferLotId');
                }
                });
        });
        
        
        $('#update-transfer-lot').live('click', function () {
                $.ajax({
                        type : "POST",
                        url : "/inventory/transfer-lot!markTransferLotAsReceived",
                        data : "id="+$(this).attr('transferLotId')+"&remoteTransferRefNumber="+$('#transfer-lot-reference-number').val(),
                        success : function(response) {
                                alert("Successfully marked Transfer Lot as Recieved");
                        },
                        error : function(response) {
                                alert("Error in marking Transfer Lot as Recieved");
                        }
                        
                });
        });
        $('#show-transfer-lot-items').live('click', function() {
                $.ajax({
                        type : "GET",
                        url : "/inventory/transfer-lot!getTransferLotItems?id="+$(this).attr('transferLotId'),
                        success : function(response) {
                                $.colorbox({
                                        inline : true,
                                width : "400px",
                                height : "500px",
                                opacity : "0.30",
                                overlayClose :  true,
                                escKey :        true,
                                href : $(response),
                                onClosed : function() {
                                    //TODO
                                }
                                });
                        },
                        error : function(response) {
                                alert("Error in fetching Transfer Lot Items");
                        }
                });
        });
        
});