Subversion Repositories SmartDukaan

Rev

Rev 10490 | Rev 14515 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

$(function() {
    $('table#doa-items').dataTable({
        "aaSorting" : [ [ 1, 'desc' ] ],
        "iDisplayLength" : 20,
        "sDom": 'T<"clear">lfrtip',
        "aLengthMenu" : [ [ 20, 50, 100, -1 ], [ 20, 50, 100, "All" ] ]
    });
    
    $('#doa-in').live('submit', function() {
        $.ajax({
            type    : "PUT",
            url     : "/inventory/doa-in/" + $(this).attr('inventoryItemId'),
            data    : $(this).serialize(),
            success : function(response) {
                document.location.href = "/inventory/doa-in";
            }
        });
        
        return false;
    });
    
    $('#doa-out').live('submit', function() {
        $.ajax({
            type    : "PUT",
            url     : "/inventory/doa-out/" + $(this).attr('inventoryItemId'),
            data    : $(this).serialize(),
            success : function(response) {
                document.location.href = "/inventory/doa-out";
            }
        });

        return false;
    });
    
    $('.orderIdInfo').live('click', function(){
                inventoryItemId = $(this).attr('id');
                $.ajax({
                type : "GET",
                url : "/inventory/doa-in!getOrderIdDOAInItem?id="+inventoryItemId,
                success : function(response) {
                        $.colorbox({
                                        inline : true,
                                width : "350px",
                                height : "150px",
                                opacity : "0.20",
                                overlayClose :  true,
                                escKey :        true,
                                href : $(response),
                                onClosed : function() {
                                        
                                }
                                });
                },
                error : function(response) {
                                alert("Error in fetching Order Id");
                        }                       
            });
        });
    
    /*$('.doa-close-credit-note').hide();
    
    $('.closeDOAButton').live('click', function() {
        $(this).hide();
        $(this).siblings('.doa-close-credit-note').show();
    });*/
    
});