<% if srg_qecs_nucleogroup %> <%= "RIEPILOGO DH APS DI #{daterange_name(@filterdate)}" %> <% qec_rows_nucleogroup = (srg_qecs_nucleogroup.to_a).sort_by!{ |r| House.find_by(id: r.house_id).descrizione } %> <% totale_dh = 0 %> <% totale_dhfs = 0 %> <% totale_pn_dh = 0 %> <% qec_rows_nucleogroup.each do |nucleo_qecs| %> <% house = House.find_by(id: nucleo_qecs[:house_id]) %> <% srg_qec_row = SrgQec.aggrega_debito_credito(nucleo_qecs.to_row, @filterdate) %> <% qec_totals = SrgQec.calc_total(srg_qec_row, @filterdate) %> <% monthlyPns = SrgPn.collect_sums_and_map_to_rowQec(competenza: @filterdate, house_id: house.id) %> <% pn_totals = SrgQec.calc_total(monthlyPns, @filterdate) %> <% nucleo_pns_dh = monthlyPns[:dh] %> <% totale_dh = totale_dh + nucleo_qecs.dh %> <% totale_dhfs = totale_dhfs + nucleo_qecs.dhfs %> <% totale_pn_dh = totale_pn_dh + nucleo_pns_dh %> <% end %>
DH
quota F.S. totale incasso da incassare
<%= house.descrizione %> <%= money_format( nucleo_qecs.dh) %> <%= money_format( nucleo_qecs.dhfs) %> <%= money_format( nucleo_qecs.dh - nucleo_qecs.dhfs) %> <%= money_format( nucleo_pns_dh) %> <%= money_format( nucleo_qecs.dh - nucleo_qecs.dhfs - nucleo_pns_dh) %>
totali: <%= money_format( totale_dh ) %> <%= money_format( totale_dhfs ) %> <%= money_format( totale_dh - totale_dhfs ) %> <%= money_format( totale_pn_dh ) %> <%= money_format( totale_dh - totale_dhfs - totale_pn_dh ) %>
<% end %>