Issue e-invoice along with invoice

Closes #1222
This commit is contained in:
Artur Beljajev 2019-06-25 19:52:15 +03:00
parent 25638da546
commit 86a69c09bf
5 changed files with 17 additions and 6 deletions

View file

@ -53,7 +53,7 @@ class Registrar < ActiveRecord::Base
def issue_prepayment_invoice(amount, description = nil)
vat_rate = ::Invoice::VatRateCalculator.new(registrar: self).calculate
invoices.create!(
invoice = invoices.create!(
issue_date: Time.zone.today,
due_date: (Time.zone.now + Setting.days_to_keep_invoices_active.days).to_date,
description: description,
@ -95,6 +95,11 @@ class Registrar < ActiveRecord::Base
}
]
)
e_invoice = invoice.to_e_invoice
e_invoice.deliver
invoice
end
def cash_account