mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Send unpayable e-invoice when invoice has already been paid via wire transfer
This commit is contained in:
parent
6b2aaf305f
commit
17188ec635
4 changed files with 15 additions and 12 deletions
|
@ -99,8 +99,8 @@ class Invoice < ApplicationRecord
|
|||
generator.as_pdf
|
||||
end
|
||||
|
||||
def to_e_invoice
|
||||
generator = Invoice::EInvoiceGenerator.new(self)
|
||||
def to_e_invoice(payable: true)
|
||||
generator = Invoice::EInvoiceGenerator.new(self, payable: payable)
|
||||
generator.generate
|
||||
end
|
||||
|
||||
|
@ -120,7 +120,7 @@ class Invoice < ApplicationRecord
|
|||
wo_vat = transaction.sum / (1 + (vat / 100))
|
||||
registrar_user.issue_prepayment_invoice(amount: wo_vat,
|
||||
description: 'Direct top-up via bank transfer',
|
||||
paid: true)
|
||||
payable: false)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue