- title 'Ensamkommande barn'
%section.box.show.refugee
  %h1.box-title
    = "#{@refugee.name}, #{@refugee.dossier_number}"
    = @refugee.draft? ? '(Utkast)' : ''

  .box-content.basic.form-data
    .tabs
      %ul
        %li= link_to 'Allmänt', @refugee
        %li= link_to 'Placeringar', refugee_show_placements_path(@refugee)
        %li= link_to 'Extra kostnader/insatser', refugee_show_costs_path(@refugee)
        %li= link_to 'Anhöriga', refugee_show_relateds_path(@refugee)
        %li.active Ekonomi

    = form_for @refugee, html: { class: 'basic' } do
      = kv 'Totala kostnader',
           number_to_currency(@refugee.total_costs, delimiter: ' ')
      = kv 'Totala placeringskostnader',
           number_to_currency(@refugee.total_placement_and_home_costs, delimiter: ' ')
      = kv 'Förväntad intäkt',
           number_to_currency(@refugee.total_rate.to_s, delimiter: ' ')
      = kv 'Total utbetald schablon',
           number_to_currency(@refugee.payments.map(&:amount).sum.to_s, delimiter: ' ')

      = render 'payments'

- title 'Ensamkommande barn'
%section.box.show.refugee
  %h1.box-title
    = "#{@refugee.name}, #{@refugee.dossier_number}"
    = @refugee.draft? ? '(Utkast)' : ''

  .box-content.basic.form-data
    .tabs
      %ul
        %li= link_to 'Allmänt', @refugee
        %li= link_to 'Placeringar', refugee_show_placements_path(@refugee)
        %li= link_to 'Extra kostnader/insatser', refugee_show_costs_path(@refugee)
        %li= link_to 'Anhöriga', refugee_show_relateds_path(@refugee)
        %li.active Ekonomi

    = form_for @refugee, html: { class: 'basic' } do
      = kv 'Totala kostnader',
           number_to_currency(@refugee.total_costs, delimiter: ' ')
      = kv 'Totala placeringskostnader',
           number_to_currency(@refugee.total_placement_and_home_costs, delimiter: ' ')
      = kv 'Förväntad intäkt',
           number_to_currency(@refugee.total_rate.to_s, delimiter: ' ')
      = kv 'Total utbetald schablon',
           number_to_currency(@refugee.payments.map(&:amount).sum.to_s, delimiter: ' ')

      - if can? :read, Payment
        = render 'payments'

Check abilities for reading paymen table for refugee
Check abilities for reading paymen table for refugee
