     $("[data-appendable]").each ->
       $(this).find("[data-append-before]").prev().remove()
     return false
+
+  # when updating any field
+  $(document).on 'change', "*", ->
+    calculate()
+    return false
   return
 ) jQuery

      revenues = $("[data-support-total='revenue']")[index]
      revenues = parseFloat($(revenues).text())
      $(this).text(revenues - expenses)
  # when adding a support
  $(document).on 'click keyup', "a[data-association='support']", ->
    # adds items

      $("[data-budget-global-amount=#{direction}]").each ->
        sum = sum + parseFloat($(this).text())
      $(this).text(sum)
    # global balance
    $("[data-balance='global']").each ->
      revenue = parseFloat($("[data-budgets-global-amount='revenue']").text())
      expense = parseFloat($("[data-budgets-global-amount='expense']").text())
      sum = revenue - expense
      $(this).text(sum)
    #total revenue/expense per support
    $("[data-budget-add]").each ->
      cells = $(this).find("[data-support-total]")
      cells.each (index) ->
