Module: Stall::Models::CreditNote
- Extended by:
- ActiveSupport::Concern
- Included in:
- CreditNote
- Defined in:
- app/models/stall/models/credit_note.rb
Instance Method Summary collapse
Instance Method Details
#remaining_amount ⇒ Object
37 38 39 |
# File 'app/models/stall/models/credit_note.rb', line 37 def remaining_amount amount - adjustments.map(&:price).sum.abs end |
#vat_rate ⇒ Object
41 42 43 |
# File 'app/models/stall/models/credit_note.rb', line 41 def vat_rate read_attribute(:vat_rate) || write_attribute(:vat_rate, Stall.config.vat_rate) end |
#with_remaining_money? ⇒ Boolean
45 46 47 |
# File 'app/models/stall/models/credit_note.rb', line 45 def with_remaining_money? remaining_amount.to_d > 0 end |