% if @fp_nilRangeStart %>
<% datestart = Date.today.beginning_of_year %>
<% else %>
<% datestart = @fp_valueRangeStart %>
<% end %>
<% if @fp_nilRangeEnd %>
<% dateend = Date.today.end_of_year %>
<% else %>
<% dateend = @fp_valueRangeEnd %>
<% end %>
<% use_date_range = true and !@fp_nilRangeStart %>
<% if use_date_range %>
<% else %>
<% end %>
<% query = SrgPn.search(@filter_params) %>
<% if !@fp_nilSrgpnCostcenter %>
<% centro = @fp_valueSrgpnCostcenter %>
<% query = query.where(srg_pn_costcenter_id: centro.id) %>
<% end %>
<% if !@fp_nilSrgpnFund %>
<% cassa = @fp_valueSrgpnFund %>
<% query = query.where(srg_pn_fund_id: cassa.id) %>
<% end %>
<% if !@fp_nilSrgcrb %>
<% crb = @fp_valueSrgcrb %>
<% query = query.where(srg_crb_id: crb.id) %>
<% end %>
<% if !@fp_nilHouse %>
<% house = @fp_valueHouse %>
<% query = query.where(house: house.id) %>
<% end %>
<% debuginfo = false %>
data | competenza | nucleo | descrizione | CdC/Cassa/Crb | importo | saldo | <% if debuginfo %>info giorno | <% end %>
---|---|---|---|---|---|---|---|
<%= voce.data.to_dmy %> | <% else %> <% if current_date == voce.data %> <% if debuginfo %><% end %> | ||||||
<% else %> <% if debuginfo %> | <%= "quantità : #{subcounter}, subtotale: #{money_format(subtotale)}" %> | <% end %>||||||
<%= voce.data.to_dmy %> | <% subcounter = 0 %> <% subtotale = 0 %> <% end %> <% end %><%= voce.competenza.present? ? daterange_name(voce.competenza) : nil %> | <%= voce.house_id.present? ? voce.house.format_for_formselect : nil %> | <%= voce.descrizione %> | <%= "#{voce.srg_pn_costcenter_id.present? ? voce.srg_pn_costcenter.centro : ''}/#{voce.srg_pn_fund_id.present? ? voce.srg_pn_fund.cassa : ''}/#{voce.srg_crb_id.present? ? voce.srg_crb.cod : ''}" %> | <%= money_format(voce.importo) %> | <%= money_format(totale) %> | <% current_date = voce.data %> <% subcounter += 1 %> <% subtotale += voce.importo if voce.importo.present? %> <% end %> <% end %> <% end %> <% if current_date.nil? %> <% else %> <% if debuginfo %><%= "quantità : #{subcounter}, subtotale: #{money_format(subtotale)}" %> | <% end %>
totale | <%= money_format(totale) %> | <% if debuginfo %> | quantità : <%= counter %> | <% end %>