       $(this).text(revenues - expenses)
 
   $(document).ready ->
-    survey()
     # sorts budgets by direction
     $("tr[data-budget-direction]").each ->
       direction = $(this).attr('data-budget-direction')

    $(this).parent().find("select[id$='working_unit']").val(unit)

  # manages selects to show only indicators in relation with the given variant
  $(document).on 'change', "input:hidden[data-parameter-name='variant_id']", ->
    variant_id = $(this).attr('value')
    console.log(variant_id)
    indicator_select = $(this).parent().find("input[name='budget_indicator']")

(($) ->
  'use strict'
  # usefull functions
  updateItems = () ->
    $(".budget_nested_fields").filter(':visible').each ->
      default_value = $(this).find("input.homogeneous").filter(':visible').first().val()
