mirror of
https://github.com/internetee/registry.git
synced 2025-08-07 02:05:12 +02:00
Add invoice mailer
This commit is contained in:
parent
2bc55e423c
commit
49be49ea63
13 changed files with 60 additions and 12 deletions
|
@ -22,7 +22,7 @@ class Invoice < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def to_s
|
||||
I18n.t('invoice_no', no: id)
|
||||
I18n.t('invoice_no', no: number)
|
||||
end
|
||||
|
||||
def number
|
||||
|
@ -46,6 +46,15 @@ class Invoice < ActiveRecord::Base
|
|||
Country.new(buyer_country_code)
|
||||
end
|
||||
|
||||
def pdf(html)
|
||||
kit = PDFKit.new(html)
|
||||
kit.to_pdf
|
||||
end
|
||||
|
||||
def pdf_name
|
||||
"invoice-#{number}.pdf"
|
||||
end
|
||||
|
||||
def forward
|
||||
return false unless valid?
|
||||
return false unless billing_email
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue