Visualizza <%= Commitment.label(1) %>

<%= iconbutton_backtoindex commitments_path, "Vai all'elenco", @filter_params %> <%= edit_table_open %> <%= edit_table_row (Commitment.human_attribute_name(:enabled)),(check_box_tag :enabled, :enabled, @commitment.enabled, disabled: true) %> <%= edit_table_row (Commitment.human_attribute_name(:datestart)),(@commitment.datestart ? @commitment.datestart.to_dmy : nil) %> <%= edit_table_row (Commitment.human_attribute_name(:dateend)),(@commitment.dateend ? @commitment.dateend.to_dmy : nil) %> <%= edit_table_row (Commitment.human_attribute_name(:person_id)), ( @commitment.person_id ? link_to( @commitment.person.dh_person_name, person_path(@commitment.person_id) ) : nil) %> <%= edit_table_row (Commitment.human_attribute_name(:house_id)), ( @commitment.house_id ? link_to( @commitment.house.format_for_formselect, house_path(@commitment.house_id) ) : nil) %> <%= edit_table_row (Commitment.human_attribute_name(:region_id)), ( @commitment.region_id ? link_to( @commitment.region.descrizione, region_path(@commitment.region_id) ) : nil) %> <%= edit_table_row (Commitment.human_attribute_name(:amount)), ( money_format_zero(@commitment.amount) ) %> <%= edit_table_row (Commitment.human_attribute_name(:name)), ( @commitment.name) %> <%= edit_table_row (Commitment.human_attribute_name(:notes) ),(text_area_tag :notes, @commitment.notes, cols: 40, rows: 10, disabled: true) %> <%= edit_table_row (Commitment.human_attribute_name(:srg_pn_costcenter_id)), ( @commitment.srg_pn_costcenter_id.present? ? link_to( @commitment.srg_pn_costcenter.format_for_formselect, srg_pn_costcenters_path(@commitment.srg_pn_costcenter_id) ) : nil ) %> <%= edit_table_row (Commitment.human_attribute_name(:srg_crb_id)), ( @commitment.srg_crb_id.present? ? link_to( @commitment.srg_crb.format_for_formselect, srg_crbs_path(@commitment.srg_crb_id) ) : nil ) %> <%= edit_table_row (Commitment.human_attribute_name(:srg_service_id)), ( @commitment.srg_service_id.present? ? link_to( @commitment.srg_service.format_for_formselect, srg_services_path(@commitment.srg_service_id) ) : nil ) %> <%= edit_table_close %>
<%= iconbutton_edit edit_commitment_path(@commitment) %> <% if current_user.nil? ? false : current_user.admin? %> <%= iconbutton_delete @commitment, 'Elimina' %> <% end %> <%= iconbutton_backtoindex commitments_path, "Vai all'elenco", @filter_params %>



<% if policy(CommitmentTransaction).index? %>

<%= CommitmentTransaction.label %> corrispondenti:

<% commitment_transactions = CommitmentTransaction.where(commitment_id: @commitment.id).ordered_by_date %>
<%= iconbutton_new new_commitment_transaction_path, nil, @filter_params.merge(filtercommitment_id: @commitment.id) %>
<% if commitment_transactions %> <%= render partial: "commitment_transactions/list", locals: { commitment_transactions: commitment_transactions } %> <% end %>
<% end %>