class Skr::InventoryAdjustment
Private Instance Methods
apply_adjustment()
click to toggle source
# File lib/skr/inventory_adjustment.rb, line 49 def apply_adjustment self.lines.each do | line | next if line.is_applied? line.unlock_adjusting{ line.adjust_qty! } end true end
attributes_for_gl_transaction()
click to toggle source
# File lib/skr/inventory_adjustment.rb, line 37 def attributes_for_gl_transaction { source: self, location: location, description: "IA #{self.visible_id}" } end
ensure_state_is_savable()
click to toggle source
# File lib/skr/inventory_adjustment.rb, line 42 def ensure_state_is_savable if applied? && state_was == 'applied' errors.add('base' , "Cannot update record once it's approved and applied") return false end end
should_apply_gl?()
click to toggle source
# File lib/skr/inventory_adjustment.rb, line 33 def should_apply_gl? state_event == :mark_applied end