From 414c35b2c6b64b30c2e3d6b03782f8105db52134 Mon Sep 17 00:00:00 2001 From: Adrian Hinz Date: Thu, 6 Oct 2016 12:38:11 +0200 Subject: [PATCH] Signed-off-by: Adrian Hinz --- app/models/user_firm.rb | 6 ++++++ app/views/invoices/_show.html.erb | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/app/models/user_firm.rb b/app/models/user_firm.rb index a31d486..01c9a99 100644 --- a/app/models/user_firm.rb +++ b/app/models/user_firm.rb @@ -1,4 +1,10 @@ class UserFirm < ApplicationRecord belongs_to :user has_many :invoices + + def bank_account_with_spaces + ret = self.bank_account.reverse + ret = ret.gsub(/(.{4})(?=.)/, '\1 \2') + ret.reverse! + end end diff --git a/app/views/invoices/_show.html.erb b/app/views/invoices/_show.html.erb index 946ee9f..2b705c1 100644 --- a/app/views/invoices/_show.html.erb +++ b/app/views/invoices/_show.html.erb @@ -155,6 +155,32 @@ + +
+
+ + + + + + + + + + + + + + + + + + + +
Kwota do zapłaty: 36 900,00 PLN
Słownie do zapłaty: <%= decimal_to_word(36900.0) %>
Forma płatności: Przelew
Termin płatności: <%= @invoice.date_of_payment %> (<%= (@invoice.date_of_payment - @invoice.date).to_i %> dni)
Bank: <%= @invoice.user_firm.bank_name %>
Nr rachunku bankowego: <%= @invoice.user_firm.bank_account_with_spaces %>
+
+
+