<%= form_tag(region_path(@region), method: :get, remote: true) do %>
<%= hidden_field_tag :competenza, current_month %>
nascondi voci saldate:
<% checkbox_viewzero_id = :checkbox_viewzero %>
<% new_params = params.except(checkbox_viewzero_id) %>
<% new_params[checkbox_viewzero_id] = RegionsHelper.flip_checkbox(params[checkbox_viewzero_id]) %>
<%= check_box_tag checkbox_viewzero_id, 1, !RegionsHelper.checkbox_checked(params[checkbox_viewzero_id]), data: { url: region_path(new_params.permit!), remote: :true } %>
|
<% data_incasso = Date.today %>
data incasso: <%= date_input_tag(SrgPnsHelper::DataIncasso_ParamsKey, data_incasso,false,"startDate:'#{Date.today.to_dmy}'" ) %> |
<% fund_key = elaborato[:fund_key] %>
<% tipo_di_incasso = SrgPnsHelper::IncassoRegionCommitments %>
<% if esegui_incasso %>
importo dall'economo: <%= number_field_tag('economo_cash', money_format(params[:economo_cash]), step: :any, style: 'text-align: right;', remote: true, onchange: "$('#pleaseWaitDialog').modal();this.form.submit();", data: {turbolinks: "false"} ) %> |
<%= "#{label_totale_da_incassare}: #{money_format(totale_emissione_daincassare)}" %> |
<%= iconbutton_submit(icon('euro-sign'), 'btn-success btn-xs', button_totale_da_incassare, tipo_di_incasso, fund_key, nil, !totaleselezionati_uguale_importoeconomo) %> |
<% else %>
|
<%= "#{label_totale_da_incassare}: #{money_format(totale_emissione_daincassare)}" %> |
|
<% end %>
<%= view_table_open %>
<% if !header_rendered %>
<%= view_table_head_open %>
<%= view_table_row_open %>
<%= view_table_head_cell ('') %>
<%= view_table_head_cell ('emesso' ) %>
<%= view_table_head_cell ('incassato') %>
<%= view_table_head_cell ('da incassare') %>
<% if policy(SrgQec).update? %>
<%= view_table_head_cell ('seleziona') %>
<% data_incasso = Date.today %>
<%= view_table_head_cell ( nil ) %>
<% else %>
<% end %>
<%= view_table_head_cell raw(SrgPnCostcenter.label(1) + " destinazione") %>
<%= view_table_head_cell raw(SrgCrb.label(1) + " destinazione") %>
<%= view_table_head_cell raw(SrgService.label(1) + " destinazione") %>
<%= view_table_row_close %>
<%= view_table_head_close %>
<% header_rendered = true %>
<% end %>
<%= view_table_body_open %>
<% info_emissioni_mese[:sections].each do |info_emissioni_mese_section_fundkey, info_emissioni_mese_section| %>
<% info_emissioni_mese_section.each do |info_emissioni_mese_section_row| %>
<% if info_emissioni_mese_section_row[:emissione_daincassare].is_zero? && !(RegionsHelper.checkbox_checked(params[checkbox_viewzero_id])) %>
<% if !debug_show_also_when_zero %>
<% next %>
<% end %>
<% end %>
<%= view_table_row_open %>
<%= view_table_cell (info_emissioni_mese_section_row[:name_link]) %>
<%= view_table_cell_right ( money_format(info_emissioni_mese_section_row[:emissione_importo]) ) %>
<%= view_table_cell_right ( money_format(info_emissioni_mese_section_row[:emissione_incassato]) ) %>
<% if info_emissioni_mese_section_row[:emissione_daincassare].is_zero? %>
<%= view_table_cell_right ( money_format(info_emissioni_mese_section_row[:emissione_daincassare]) ) %>
<% else %>
<% if info_emissioni_mese_section_row[:partial_allowed] && view_separate_incasso_buttons %>
<%= view_table_cell_right ( number_field_tag(info_emissioni_mese_section_row[:fund_key], money_format(info_emissioni_mese_section_row[:emissione_daincassare]), step: :any, style: 'text-align: right;' ) ) %>
<% else %>
<%= view_table_cell_right ( money_format(info_emissioni_mese_section_row[:emissione_daincassare]) ) %>
<%= hidden_field_tag info_emissioni_mese_section_row[:fund_key], info_emissioni_mese_section_row[:emissione_daincassare] %>
<% end %>
<% end %>
<% if policy(SrgQec).update? %>
<% if info_emissioni_mese_section_row[:emissione_daincassare].is_zero? %>
<%= view_table_cell ( button_tag(type: "submit", class: "btn btn-muted btn-xs", disabled: true) do icon_with_text( icon("check"), "" ) end ) %>
<%= hidden_field_tag info_emissioni_mese_section_row[:checkbox_id], false %>
<% else %>
<% if params[info_emissioni_mese_section_row[:checkbox_id]] == 'on' %>
<%= hidden_field_tag info_emissioni_mese_section_row[:checkbox_id], 'on' %>
<%= view_table_cell (iconbutton_submit(icon('check'), 'btn-success btn-xs', "", RegionsHelper::ActionChangeCheckbox, info_emissioni_mese_section_row[:checkbox_id]) ) %>
<% else %>
<%= hidden_field_tag info_emissioni_mese_section_row[:checkbox_id], 'off' %>
<%= view_table_cell (iconbutton_submit(icon('square'), 'btn-danger btn-xs', "", RegionsHelper::ActionChangeCheckbox, info_emissioni_mese_section_row[:checkbox_id]) ) %>
<% end %>
<% end %>
<% if view_separate_incasso_buttons %>
<%= view_table_cell ( info_emissioni_mese_section_row[:emissione_daincassare].is_zero? ? nil : iconbutton_submit(icon('euro-sign'), 'btn-success btn-xs', info_emissioni_mese_section_row[:emissione_label], info_emissioni_mese_section_row[:tipo_di_incasso], info_emissioni_mese_section_row[:fund_key]) ) %>
<% else %>
<%= view_table_cell ( nil ) %>
<% end %>
<% end %>
<%= view_table_cell ( info_emissioni_mese_section_row[:pncostcenter_link] ) %>
<%= view_table_cell ( info_emissioni_mese_section_row[:crb_link] ) %>
<%= view_table_cell ( info_emissioni_mese_section_row[:salvadanaio_link] ) %>
<%= view_table_row_close %>
<% end %>
<% end %>
<% fund_key = elaborato[:fund_key] %>
<% tipo_di_incasso = SrgPnsHelper::IncassoRegionCommitments %>
<%= view_table_row_open %>
<%= view_table_cell_right ( "Totale:" ) %>
<%= view_table_cell_right ( money_format(totale_emissione_importo) ) %>
<%= view_table_cell_right ( money_format(totale_emissione_incassato) ) %>
<%= view_table_cell_right ( money_format(totale_emissione_daincassare) ) %>
<% if policy(SrgQec).update? %>
<% if totale_emissione_daincassare.is_zero? %>
<%= view_table_cell ( nil ) %>
<% else %>
<% if qualcuno_nonselezionato %>
<%= view_table_cell (iconbutton_submit(icon('check-double'), 'btn-success btn-xs', "tutti", RegionsHelper::ActionChangeAllCheckboxes, "on") ) %>
<% else %>
<%= view_table_cell (iconbutton_submit(icon('eraser'), 'btn-danger btn-xs', "tutti", RegionsHelper::ActionChangeAllCheckboxes, "off") ) %>
<% end %>
<% end %>
<%= hidden_field_tag fund_key, totale_emissione_daincassare %>
<%= view_table_cell ( nil ) %>
<% else %>
<%= view_table_cell ( nil ) %>
<% end %>
<%= view_table_cell ( nil ) %>
<%= view_table_cell ( nil ) %>
<%= view_table_cell ( nil ) %>
<%= view_table_row_close %>
<% view_table_body_close %>
<%= view_table_close %>
<% end %>