anchor.diff:              <% end %>
             </td>
             <td>
  -            <% if invoice.balance > 0 %>
  -              <nobr>
  -                <%= link_to "Credit",
  -                            kaui_engine.new_credit_path(:params => { :account_id => invoice.account_id,
  -                                                                     :invoice_id => invoice.invoice_id }),
  -                            :class => "btn btn-mini" %>
  -              </nobr>
  -              <nobr>
  -                <%= link_to "Payment",
  -                            kaui_engine.new_payment_path(:params => { :account_id => invoice.account_id,
  -                                                                      :invoice_id => invoice.invoice_id }),
  -                            :class => "btn btn-mini" %>
  -              </nobr>
  -            <% end %>
  +            <nobr>
  +              <%= link_to "Payment",
  +                          kaui_engine.new_payment_path(:params => { :account_id => invoice.account_id,
  +                                                                    :invoice_id => invoice.invoice_id }),
  +                          :class => "btn btn-mini #{"disabled" unless invoice.balance > 0}" %>
  +            </nobr>
  +            <nobr>
  +              <%= link_to "Credit",
  +                          kaui_engine.new_credit_path(:params => { :account_id => invoice.account_id,
  +                                                                   :invoice_id => invoice.invoice_id }),
  +                          :class => "btn btn-mini" %>
  +            </nobr>
               <nobr>
                 <%= link_to "Charge",
                             kaui_engine.new_charge_path(:params => { :account_id => invoice.account_id,
  
positive.code:   <%= link_to 'Back', :back, :class => 'btn' %>
  </div>
  <%= javascript_tag do %>
    function filterBundles() {
      var bundle = $("#bundles").val();
      var dataTable = $("#timeline-table").dataTable();
  
negative.code:     dataTable.fnDraw();
    }
    $(document).ready(function() {
      disableLinks();
  
      $("#bundles").change(filterBundles);
      filterBundles();
    });
  