def spent_material
    @spent_material ||= if cost_entries.blank?
                          BigDecimal("0.0000")
                        else
                          cost_entries.visible_costs(User.current, project).sum("CASE