Class: Skr::PoLine
Instance Method Summary collapse
Instance Method Details
#complete? ⇒ Boolean
31 32 33 |
# File 'lib/skr/po_line.rb', line 31 def complete? qty_unreceived.zero? end |
#qty_unreceived ⇒ Object
27 28 29 |
# File 'lib/skr/po_line.rb', line 27 def qty_unreceived qty - qty_received - qty_canceled end |
#update_qty_received!(receipt = nil) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/skr/po_line.rb', line 35 def update_qty_received!( receipt=nil ) unlock_fields :qty_received do self.qty_received = receipts.sum(:qty) self.save( :validate => false ) if self.complete? self.purchase_order.set_maybe_completed! end end end |