function updateDiscounts(){

    if ($('table#discounts tr.var').length <= 1){
        $('table#discounts td.char_del').hide();
    }
    
}

function addDiscount(){
    $('table#discounts tr').eq(1).clone().appendTo('table#discounts').find('input').val('');
    if ($('table#discounts tr.var').length > 1){
        $('table#discounts td.char_del').show();
    }
}

function deleteDiscount(link){
    $(link).parent('td').parent('tr').remove();
    if ($('table#discounts tr.var').length == 1){
        $('table#discounts td.char_del').hide();
    }
}