mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Add autobind fix if invoice with this sum is already present
This commit is contained in:
parent
3821c76d36
commit
19cd5ecd95
2 changed files with 52 additions and 1 deletions
|
@ -17,7 +17,7 @@ class BankTransaction < ApplicationRecord
|
|||
end
|
||||
|
||||
def invoice
|
||||
@invoice ||= registrar.invoices.find_by(total: sum) if registrar
|
||||
@invoice ||= registrar.invoices.order(created_at: :asc).unpaid.find_by(total: sum) if registrar
|
||||
end
|
||||
|
||||
def registrar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue