Class: Skr::PaymentTerm

Inherits:
Model
  • Object
show all
Defined in:
lib/skr/models/payment_term.rb

Overview

A pay

Instance Method Summary collapse

Instance Method Details

#discountObject



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

Returns:

  • (Boolean)


17
18
19
# File 'lib/skr/models/payment_term.rb', line 17

def immediate?
    self.days.nil? || self.days.zero?
end