Class: Skr::SkuTran
- Defined in:
- lib/skr/sku_tran.rb
Overview
In Stockor, inventory related transactions are not performed directly on the model(s)
Instead a SkuTran is created, and it is responsible for adjusting either the cost or qty of the inventory. By doing so, all inventory changes is logged and can be referred to in order to audit changes.
Instance Attribute Summary collapse
-
#allocate_after_save ⇒ Object
Returns the value of attribute allocate_after_save.
-
#credit_gl_account ⇒ Object
Returns the value of attribute credit_gl_account.
-
#debit_gl_account ⇒ Object
Returns the value of attribute debit_gl_account.
-
#gl_tran_description_text ⇒ Object
Returns the value of attribute gl_tran_description_text.
Instance Method Summary collapse
-
#ea_qty ⇒ Fixnum
#qty expressed in terms of single UOM.
- #sku_loc=(sl) ⇒ Object
Instance Attribute Details
#allocate_after_save ⇒ Object
Returns the value of attribute allocate_after_save.
36 37 38 |
# File 'lib/skr/sku_tran.rb', line 36 def allocate_after_save @allocate_after_save end |
#credit_gl_account ⇒ Object
Returns the value of attribute credit_gl_account.
28 29 30 |
# File 'lib/skr/sku_tran.rb', line 28 def credit_gl_account @credit_gl_account end |
#debit_gl_account ⇒ Object
Returns the value of attribute debit_gl_account.
29 30 31 |
# File 'lib/skr/sku_tran.rb', line 29 def debit_gl_account @debit_gl_account end |
#gl_tran_description_text ⇒ Object
Returns the value of attribute gl_tran_description_text.
30 31 32 |
# File 'lib/skr/sku_tran.rb', line 30 def gl_tran_description_text @gl_tran_description_text end |
Instance Method Details
#ea_qty ⇒ Fixnum
Returns #qty expressed in terms of single UOM.
46 47 48 |
# File 'lib/skr/sku_tran.rb', line 46 def ea_qty self.qty * ( self.uom_size || 1 ) end |
#sku_loc=(sl) ⇒ Object
39 40 41 42 43 |
# File 'lib/skr/sku_tran.rb', line 39 def sku_loc=(sl) super self.prior_qty = sl.qty self.prior_mac = sl.mac end |