<%= HousePnFund.label %>

<% if !pundit_user.has_house_policyscope?(HousePn) %>
<%= form_tag(house_pn_funds_path, method: :get) do %> <%= view_table_open %> <%= view_table_row_open %> <%= render "shared/filterhouse_id" %> <%= view_table_row_close %> <%= view_table_close %> <% end %>
<% end %>
<%= view_table_open %> <%= view_table_head_open %> <%= view_table_row_open %> <%= view_table_head_cell_span 3 %> <% if !pundit_user.has_house_policyscope?(HousePn) %> <%= view_table_head_cell HousePnFund.human_attribute_name(:house_id) %> <% end %> <%= view_table_head_cell HousePnFund.human_attribute_name(:descrizione) %> <% if current_user.nil? ? false : current_user.admin? %> <%= view_table_head_cell HousePnFund.human_attribute_name(:is_default) %> <% end %> <%= view_table_head_cell ('Saldo cassa') %> <%= view_table_row_close %> <%= view_table_head_close %> <% totale_casse = 0 %> <%= view_table_body_open %> <% @house_pn_funds.each do |house_pn_fund| %> <%= view_table_row_open %> <% bg = nil %> <%= view_table_cell ( iconbutton_view house_pn_fund, '') %> <%= view_table_cell ( iconbutton_edit edit_house_pn_fund_path(house_pn_fund), '') %> <% tooltip = "elenco movimenti della #{HousePnFund.label(1)}" %> <%= view_table_cell_tooltip tooltip, ( iconbutton_to house_pns_path, icon('list'), 'btn-success btn-xs', '', @filter_params.merge(filterhousepnfund_id: house_pn_fund.id) ) %> <%#= view_table_cell ( iconbutton_delete house_pn_fund, '') %> <% if !pundit_user.has_house_policyscope?(HousePn) %> <%= view_table_cell ( house_pn_fund.house_id ? link_to( house_pn_fund.house.format_for_formselect, house_path(house_pn_fund.house) ) : nil ), bg %> <% end %> <%= view_table_cell ( link_to(house_pn_fund.descrizione, house_pn_fund_path(house_pn_fund.id) ) ) %> <% if current_user.nil? ? false : current_user.admin? %> <%= view_table_cell ( check_box_tag :is_system, :is_default, house_pn_fund.is_default, disabled: true) %> <% end %> <% saldo_cassa = HousePn.where(house_id: house_pn_fund.house_id, house_pn_fund_id: house_pn_fund.id).sum(:importo) %> <%= view_table_cell_right ( money_color_incasso(saldo_cassa) ) %> <% totale_casse += saldo_cassa %> <%= view_table_row_close %> <% end %> <%= view_table_row_open %> <% if !pundit_user.has_house_policyscope?(HousePn) %> <%= view_table_cell ( '' ) %> <%= view_table_cell_span_right(4, "saldo di nucleo:" ) %> <% else %> <%= view_table_cell_span_right(3, "saldo di nucleo:" ) %> <% end %> <%= view_table_cell_right ( "#{money_color_incasso(totale_casse)}".html_safe ) %> <%= view_table_row_close %> <%= view_table_body_close %> <%= view_table_close %>
<%= iconbutton_new new_house_pn_fund_path %>