Module: Statement::Row
- Included in:
- DiscountRow, OrderLocationRow, PaymentTypeRow, TicketTypeRow
- Defined in:
- app/models/statement.rb
Instance Attribute Summary collapse
-
#gross ⇒ Object
Returns the value of attribute gross.
-
#net ⇒ Object
Returns the value of attribute net.
-
#processing ⇒ Object
Returns the value of attribute processing.
-
#tickets ⇒ Object
Returns the value of attribute tickets.
Instance Method Summary collapse
Instance Attribute Details
#gross ⇒ Object
Returns the value of attribute gross.
119 120 121 |
# File 'app/models/statement.rb', line 119 def gross @gross end |
#net ⇒ Object
Returns the value of attribute net.
119 120 121 |
# File 'app/models/statement.rb', line 119 def net @net end |
#processing ⇒ Object
Returns the value of attribute processing.
119 120 121 |
# File 'app/models/statement.rb', line 119 def processing @processing end |
#tickets ⇒ Object
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 |