Add small improvements for BankTransactions

This commit is contained in:
Patrick Gansterer 2021-10-16 15:07:53 +02:00
parent 6d71bd2c2f
commit 093313f0f3
2 changed files with 2 additions and 2 deletions

View file

@ -36,7 +36,7 @@ class BankTransaction < ApplicationRecord
def assign_to_invoice
return false unless supplier
content = text
content = text || ""
content += "\n" + reference if reference.present?
invoices = supplier.invoices.unpaid.select { |i| content.include? i.number }
invoices_sum = invoices.map(&:amount).sum