Module: Statement::Row

Included in:
DiscountRow, OrderLocationRow, PassRow, PaymentTypeRow, TicketTypeRow
Defined in:
app/models/statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#grossObject

Returns the value of attribute gross.



134
135
136
# File 'app/models/statement.rb', line 134

def gross
  @gross
end

#netObject

Returns the value of attribute net.



134
135
136
# File 'app/models/statement.rb', line 134

def net
  @net
end

#processingObject

Returns the value of attribute processing.



134
135
136
# File 'app/models/statement.rb', line 134

def processing
  @processing
end

#ticketsObject

Returns the value of attribute tickets.



134
135
136
# File 'app/models/statement.rb', line 134

def tickets
  @tickets
end

Instance Method Details

#<<(item) ⇒ Object



139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'app/models/statement.rb', line 139

def<<(item)
  if item.refund?
    self.tickets = self.tickets - 1
  elsif item.exchanged? || item.return?
    #Noop
  else
    self.tickets = self.tickets + 1   
  end
  
  self.gross        = self.gross + item.price
  self.processing   = self.processing + (item.realized_price - item.net)
  self.net          = self.net + item.net
end