// JavaScript Document


$(document).ready(function (e) {

    $('#makeEmptyQuantityZero').live('click', function () {
        $("[id^='newQty']").each(function () {
            if ($(this).val() == "")
            {
                $(this).val(0);
            }
            $(this).trigger('keyup');
            $(this).trigger('change');
        });
    });
});


//function will allow negative numbers in debtAfter
function checkdata(itr)
{

    var newQty = Number($("#newQty" + itr).val());
    var storenegative = Number($("#storenegative").val());

    //alert('newQty'+newQty);
    // alert('storenegative'+storenegative);

    if (isNaN(newQty))
    {
        $("#newQty" + itr).val(0);
    }
    else
    {
        if (storenegative == 0)
        {
            if ($("#newQty" + itr).val() < 0)
            {
                $("#newQty" + itr).val(0);
            }
        }
        else
        {



        }
    }
}