Module: Statement::Row
- Included in:
- DiscountRow, OrderLocationRow, PassRow, 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.
134 135 136 |
# File 'app/models/statement.rb', line 134 def gross @gross end |
#net ⇒ Object
Returns the value of attribute net.
134 135 136 |
# File 'app/models/statement.rb', line 134 def net @net end |
#processing ⇒ Object
Returns the value of attribute processing.
134 135 136 |
# File 'app/models/statement.rb', line 134 def processing @processing end |
#tickets ⇒ Object
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 |