 c3 = require('c3')
 _ = require('lodash')
+debug = require('debug')("round-overview:controller")
 
 pie = (fixedCosts) ->
   c3.generate

    data.id = id
    data.roundId = round.id
    data.amount = data.amountDollars
    console.log("data on save", data)

    fixedCost = new FixedCostModel(data)

    console.log("saving", fixedCost.serialize(), id, index)

    FixedCostsStore.save(fixedCost).then (saved) ->
      round.fixedCosts[index] = fixedCost

  $scope.removeFixedCost = (index) ->
    fixedCost = fixedCosts[index]

    console.log("removing", fixedCost)

    FixedCostsStore.remove(fixedCost).then ->
      fixedCosts.splice(index, 1)

  $scope.$watch 'round.fixedCosts', ->


  round.fixedCosts = fixedCosts
  $scope.round = round
  $scope.isAdmin = group.isAdmin(AuthService.getCurrentUser())

  $scope.addFixedCost = ->
    $scope.inserted = new FixedCostModel({
