Add automatic generation of financial transactions and links

This commit is contained in:
Patrick Gansterer 2017-01-26 13:27:30 +01:00
parent 91eeac6c40
commit 8e2ca5e7d7
11 changed files with 284 additions and 0 deletions

View file

@ -12,4 +12,14 @@ class BankAccount < ApplicationRecord
# @return [Function] Method wich can be called to import transaction from a bank or nil if unsupported
def find_import_method
end
def assign_unlinked_transactions
count = 0
bank_transactions.without_financial_link.includes(:supplier, :user).each do |t|
if t.assign_to_ordergroup || t.assign_to_invoice
count += 1
end
end
count
end
end