Module: Statement::Row

Included in:
DiscountRow, OrderLocationRow, 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.



119
120
121
# File 'app/models/statement.rb', line 119

def gross
  @gross
end

#netObject

Returns the value of attribute net.



119
120
121
# File 'app/models/statement.rb', line 119

def net
  @net
end

#processingObject

Returns the value of attribute processing.



119
120
121
# File 'app/models/statement.rb', line 119

def processing
  @processing
end

#ticketsObject

Returns the value of attribute tickets.



119
120
121
# File 'app/models/statement.rb', line 119

def tickets
  @tickets
end

Instance Method Details

#<<(item) ⇒ Object



124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'app/models/statement.rb', line 124

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