Class: Activity::Adjustment

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
ActivityTypeModelHelper, ExtensibleObjectHelper
Defined in:
app/models/activity/adjustment.rb

Instance Method Summary collapse

Methods included from ActivityTypeModelHelper

append_features

Methods included from ExtensibleObjectHelper

append_features

Instance Method Details

#as_legacy_ledger_rowObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/models/activity/adjustment.rb', line 11

def as_legacy_ledger_row
  
  if label and comments and label.length > 0 and comments.length > 0
    description = '%s - %s' % [label, comments]
  else
    description = (comments and comments.length > 0) ? comments : label
  end
  
  [
  1,
  activity.cost,
  activity.cost,
  'Adjustment',
  occurred_on.strftime('%m/%d/%y'),
  description.tr("\r\n", '')
  ]
end

#nameObject



7
8
9
# File 'app/models/activity/adjustment.rb', line 7

def name
  type_quick_namer '%s for %s on %s', label, client
end