mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 15:14:47 +02:00
Fix CC issues
This commit is contained in:
parent
df79982881
commit
18aa7e3d63
1 changed files with 6 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue