Class: Skr::PtLine

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#qty_to_shipObject

Returns the value of attribute qty_to_ship.



8
9
10
# File 'lib/skr/models/pt_line.rb', line 8

def qty_to_ship
  @qty_to_ship
end

Instance Method Details

#cancel!Object



25
26
27
28
# File 'lib/skr/models/pt_line.rb', line 25

def cancel!
    self.update_attributes! :is_complete=>true
    self.pick_ticket.maybe_cancel
end

#is_invoiceable?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/skr/models/pt_line.rb', line 30

def is_invoiceable?
    ! self.is_complete? && self.qty_to_ship.to_i > 0
end

#totalObject



34
35
36
# File 'lib/skr/models/pt_line.rb', line 34

def total
    self.price * ( self.qty_to_ship || self.qty )
end