Fix CC issues

This commit is contained in:
Karl Erik Õunapuu 2020-09-10 14:14:42 +03:00
parent df79982881
commit 18aa7e3d63
No known key found for this signature in database
GPG key ID: C9DD647298A34764

View file

@ -42,8 +42,7 @@ class BankTransaction < ApplicationRecord
return unless autobindable? return unless autobindable?
channel = manual ? 'admin_payment' : 'system_payment' channel = manual ? 'admin_payment' : 'system_payment'
create_internal_payment_record(channel: channel, invoice: invoice, create_internal_payment_record(channel: channel, invoice: invoice, registrar: registrar)
registrar: registrar)
end end
def create_internal_payment_record(channel: nil, invoice:, registrar:) def create_internal_payment_record(channel: nil, invoice:, registrar:)
@ -92,12 +91,11 @@ class BankTransaction < ApplicationRecord
end end
def create_activity(registrar, invoice) def create_activity(registrar, invoice)
activity = AccountActivity.new( activity = AccountActivity.new(account: registrar.cash_account, bank_transaction: self,
account: registrar.cash_account, bank_transaction: self, invoice: invoice, sum: invoice.subtotal,
invoice: invoice, sum: invoice.subtotal, currency: currency, description: description,
currency: currency, description: description, activity_type: AccountActivity::ADD_CREDIT)
activity_type: AccountActivity::ADD_CREDIT
)
if activity.save if activity.save
reset_pending_registrar_balance_reload reset_pending_registrar_balance_reload
true true