Class: Skr::PaymentTerm
- Defined in:
- lib/skr/models/payment_term.rb
Overview
A pay
Instance Method Summary collapse
- #discount ⇒ Object
- #discount_amount=(value) ⇒ Object
- #discount_expires_at(start_date = Date.today) ⇒ Object
- #due_date_from(start_date = Date.today) ⇒ Object
- #immediate? ⇒ Boolean
Instance Method Details
#discount ⇒ Object
8 9 10 |
# File 'lib/skr/models/payment_term.rb', line 8 def discount @discount_percnum ||= Numbers::PercNum.new( read_attribute('discount_amount') ) end |
#discount_amount=(value) ⇒ Object
12 13 14 15 |
# File 'lib/skr/models/payment_term.rb', line 12 def discount_amount=(value) @discount_percnum = nil super(value) end |
#discount_expires_at(start_date = Date.today) ⇒ Object
21 22 23 |
# File 'lib/skr/models/payment_term.rb', line 21 def discount_expires_at( start_date = Date.today ) ( start_date + self.discount_days.days ).to_date end |
#due_date_from(start_date = Date.today) ⇒ Object
25 26 27 |
# File 'lib/skr/models/payment_term.rb', line 25 def due_date_from( start_date = Date.today ) ( start_date + self.days.days ).to_date end |
#immediate? ⇒ Boolean
17 18 19 |
# File 'lib/skr/models/payment_term.rb', line 17 def immediate? self.days.nil? || self.days.zero? end |