Class: Beanie::StockAdjustment

Inherits:
Api
  • Object
show all
Defined in:
lib/beanie/stock_adjustment.rb

Constant Summary collapse

TYPE_STOCK_TAKING =
0
TYPE_SCHED_REQUEST =
1
TYPE_ORDER_WAIT =
2
TYPE_TO_INVENTORY =
3
TYPE_FROM_INVENTORY =
3
TYPE_SPOILAGE =
4
TYPE_NAMES =
[
  ["Stock-Taking", TYPE_STOCK_TAKING],
  ["Scheduled Request", TYPE_SCHED_REQUEST],
  ["Awaiting Delivery", TYPE_ORDER_WAIT],
  ["Move to Inventory", TYPE_TO_INVENTORY],
  ["Move from Inventory", TYPE_FROM_INVENTORY],
  ["Spoilage", TYPE_SPOILAGE]
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Api

all, build_url, #construct_path, delete, #extract, #field_name, find, get, #object_name, #populate, post, put, #save!, set_headers

Constructor Details

#initializeStockAdjustment

Initialize instance variables



53
54
55
56
57
58
59
60
61
62
# File 'lib/beanie/stock_adjustment.rb', line 53

def initialize
  @id = nil
  @effective = nil
  @adjustment_type = nil
  @amount = nil
  @note = nil
  @stock_item_id = nil
  @stock_supplier_id = nil
  @purchase_order_item_id = nil
end

Instance Attribute Details

#adjustment_typeObject

Returns the value of attribute adjustment_type.



32
33
34
# File 'lib/beanie/stock_adjustment.rb', line 32

def adjustment_type
  @adjustment_type
end

#amountObject

Returns the value of attribute amount.



32
33
34
# File 'lib/beanie/stock_adjustment.rb', line 32

def amount
  @amount
end

#effectiveObject

Returns the value of attribute effective.



32
33
34
# File 'lib/beanie/stock_adjustment.rb', line 32

def effective
  @effective
end

#idObject

Returns the value of attribute id.



32
33
34
# File 'lib/beanie/stock_adjustment.rb', line 32

def id
  @id
end

#noteObject

Returns the value of attribute note.



32
33
34
# File 'lib/beanie/stock_adjustment.rb', line 32

def note
  @note
end

#purchase_order_item_idObject

Returns the value of attribute purchase_order_item_id.



33
34
35
# File 'lib/beanie/stock_adjustment.rb', line 33

def purchase_order_item_id
  @purchase_order_item_id
end

#stock_item_idObject

Returns the value of attribute stock_item_id.



33
34
35
# File 'lib/beanie/stock_adjustment.rb', line 33

def stock_item_id
  @stock_item_id
end

#stock_supplier_idObject

Returns the value of attribute stock_supplier_id.



33
34
35
# File 'lib/beanie/stock_adjustment.rb', line 33

def stock_supplier_id
  @stock_supplier_id
end

Instance Method Details

#type_nameObject

 Convert the type into a useful name



66
67
68
# File 'lib/beanie/stock_adjustment.rb', line 66

def type_name
  TYPE_NAMES[adjustment_type][0]
end