Class: Spree::StockReceipt
- Inherits:
-
Object
- Object
- Spree::StockReceipt
- Includes:
- ActedBy, Metadata, NumberIdentifier, SingleStoreResource
- Defined in:
- app/models/spree/stock_receipt.rb
Overview
One delivery against a purchase order or a stock transfer: what the dock
counted in on one day, under one packing slip. Lines on the document keep
the running totals; the receipt is the record of each arrival, and every
received movement it caused names it.
A stock receipt on purpose — a customer-facing sales receipt will want the plain word.
Instance Method Summary collapse
- #event_serializer_class ⇒ Object
-
#quantity_accepted_total ⇒ Integer
Units this delivery put on the shelf.
-
#quantity_rejected_total ⇒ Integer
Units this delivery refused.
Methods included from Metadata
#private_metadata, #private_metadata=
Methods included from ActedBy
#acted_by_prefixed_id, #acted_by_type, assume_admin_actor_type, columns_for, models, registered_model_names
Instance Method Details
#event_serializer_class ⇒ Object
50 51 52 |
# File 'app/models/spree/stock_receipt.rb', line 50 def event_serializer_class 'Spree::Api::V3::StockReceiptEventSerializer'.safe_constantize end |
#quantity_accepted_total ⇒ Integer
Returns units this delivery put on the shelf.
41 42 43 |
# File 'app/models/spree/stock_receipt.rb', line 41 def quantity_accepted_total items.sum { |item| item.quantity_accepted.to_i } end |
#quantity_rejected_total ⇒ Integer
Returns units this delivery refused.
46 47 48 |
# File 'app/models/spree/stock_receipt.rb', line 46 def quantity_rejected_total items.sum { |item| item.quantity_rejected.to_i } end |