Skip to content

Commit

Permalink
Added PORate to refugee view
Browse files Browse the repository at this point in the history
  • Loading branch information
martent committed Jan 10, 2019
1 parent 7c9a51e commit 41575b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/helpers/refugees_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ def add_ssns_button(name, form)
name
end
end

def po_extra(cost)
po_cost = Economy::CostWithPoRate.new(cost).as_array.sum { |x| x[:po_cost] }
number_to_currency(po_cost || 0, delimiter: ' ')
end
end
1 change: 1 addition & 0 deletions app/views/refugees/_extra_contributions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
= show_attribute('extra_contribution.period_start', extra_contribution.period_start)
= show_attribute('extra_contribution.period_end', extra_contribution.period_end)
= show_attribute('extra_contribution.fee', number_to_currency(extra_contribution.fee.to_s, delimiter: ' '))
= show_attribute('extra_contribution.po_extra', po_extra(extra_contribution))
= show_attribute('extra_contribution.expense', number_to_currency(extra_contribution.expense.to_s, delimiter: ' '))
= show_attribute('extra_contribution.contractor_name', extra_contribution.contractor_name)
= show_attribute('extra_contribution.contractor_birthday', extra_contribution.contractor_birthday)
Expand Down
1 change: 1 addition & 0 deletions config/locales/simple_form.sv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ sv:
period_start: Startdatum
period_end: Slutdatum
fee: Arvode per månad
po_extra: PO-pålägg
expense: Omkostnad per månad
contractor_name: Uppdragstagare
contractor_birthday: Uppdragstagares födelsedag
Expand Down

0 comments on commit 41575b0

Please sign in to comment.