added activity type

This commit is contained in:
dinsmol 2021-08-19 09:26:17 +03:00
parent ee442beb2e
commit b425a14f39
3 changed files with 4 additions and 2 deletions

View file

@ -30,7 +30,7 @@ module Admin
sum: @sum,
currency: @account.currency,
description: params[:description],
activity_type: AccountActivity::ADD_CREDIT)
activity_type: AccountActivity::UPDATE_CREDIT)
if activity.save
true

View file

@ -8,6 +8,7 @@ class AccountActivity < ApplicationRecord
CREATE = 'create'
RENEW = 'renew'
ADD_CREDIT = 'add_credit'
UPDATE_CREDIT = 'update_credit'
after_create :update_balance
def update_balance
@ -20,7 +21,7 @@ class AccountActivity < ApplicationRecord
class << self
def types_for_select
[CREATE, RENEW, ADD_CREDIT].map { |x| [I18n.t(x), x] }
[CREATE, RENEW, ADD_CREDIT, UPDATE_CREDIT].map { |x| [I18n.t(x), x] }
end
def to_csv

View file

@ -603,6 +603,7 @@ en:
receipt_date_from: 'Receipt date from'
receipt_date_until: 'Receipt date until'
add_credit: 'Add credit'
update_credit: 'Update credit'
invalid_yaml: 'Invalid YAML'
reserved_pw: 'Reserved pw'
no_transfers_found: 'No transfers found'