sideshow.db.model.batch.neworder
¶
Data models for New Order Batch
- class sideshow.db.model.batch.neworder.NewOrderBatch(**kwargs)[source]¶
Batch used for entering new orders into the system. Each batch ultimately becomes an
Order
.See also
NewOrderBatchHandler
which is the default batch handler for this batch type.Generic batch attributes (undocumented below) are inherited from
BatchMixin
.- batch_type = 'neworder'¶
Official batch type key.
- created¶
- created_by¶
- created_by_uuid¶
- customer_id¶
Proper account ID for the external customer to which the order pertains, if applicable.
See also
local_customer
andpending_customer
.
- customer_name¶
Name for the customer account.
- description¶
- email_address¶
Email address for the customer.
- executed¶
- executed_by¶
- executed_by_uuid¶
- id¶
- local_customer¶
Reference to the
LocalCustomer
record for the order, if applicable.See also
customer_id
andpending_customer
.
- notes¶
- pending_customer¶
Reference to the
PendingCustomer
record for the order, if applicable.See also
customer_id
andlocal_customer
.
- phone_number¶
Phone number for the customer.
- row_count¶
- status_code¶
- status_text¶
- store_id¶
ID of the store to which the order pertains, if applicable.
- total_price¶
Full price (not including tax etc.) for all items on the order.
- uuid¶
- class sideshow.db.model.batch.neworder.NewOrderBatchRow(**kwargs)[source]¶
Row of data within a
NewOrderBatch
. Each row ultimately becomes anOrderItem
.Generic row attributes (undocumented below) are inherited from
BatchRowMixin
.- STATUS = {1: 'ok', 2: 'missing product', 3: 'missing order qty/uom'}¶
Dict of possible status code -> label options.
- STATUS_MISSING_PRODUCT = 2¶
Status code indicating the row has no
product_id
orpending_product
set.
- STATUS_OK = 1¶
This is the default value for
status_code
. All rows are considered “OK” if they have either aproduct_id
orpending_product
.
- batch_uuid¶
- case_price_quoted¶
Quoted price for a “case” of the item, if applicable.
This is mostly for display purposes;
unit_price_quoted
is used for calculations.
- case_size¶
Case pack count for the product, if known.
If this is not set, then customer cannot order a “case” of the item.
- department_id¶
ID of the department to which the product belongs, if known.
- department_name¶
Name of the department to which the product belongs, if known.
- discount_percent¶
Discount percent to apply when calculating
total_price
, if applicable.
- local_product¶
Reference to the
LocalProduct
record for the order item, if applicable.See also
product_id
andpending_product
.
- modified¶
- order_qty¶
Quantity (as decimal) of product being ordered.
This must be interpreted along with
order_uom
to determine the complete order quantity, e.g. “2 cases”.
- order_uom¶
Code indicating the unit of measure for product being ordered.
This should be one of the codes from
ORDER_UOM
.Sideshow will treat
ORDER_UOM_CASE
differently butORDER_UOM_UNIT
and others are all treated the same (i.e. “unit” is assumed).
- pending_product¶
Reference to the
PendingProduct
record for the order item, if applicable.See also
product_id
andlocal_product
.
- product_brand¶
Brand name for the product - up to 100 chars.
- product_description¶
Description for the product - up to 255 chars.
- product_id¶
Proper ID for the external product which the order item represents, if applicable.
See also
local_product
andpending_product
.
- product_scancode¶
Scancode for the product, as string.
Note
This column allows 14 chars, so can store a full GPC with check digit. However as of writing the actual format used here does not matter to Sideshow logic; “anything” should work.
That may change eventually, depending on POS integration scenarios that come up. Maybe a config option to declare whether check digit should be included or not, etc.
- product_size¶
Size of the product, as string - up to 30 chars.
- product_weighed¶
Flag indicating the product is sold by weight; default is null.
- sale_ends¶
End date/time for the sale in effect, if any.
This is only relevant if
unit_price_sale
is set.
- sequence¶
- special_order¶
Flag indicating the item is a “special order” - e.g. something not normally carried by the store. Default is null.
- status_code¶
- status_text¶
- total_price¶
Full price (not including tax etc.) which the customer is quoted for the order item.
This is calculated using values from:
- unit_cost¶
Cost of goods amount for one “unit” (not “case”) of the product, as decimal to 4 places.
- unit_price_quoted¶
Quoted price for the item unit. This is the “effective” unit price, which is used to calculate
total_price
.This price does not reflect the
discount_percent
. It normally should match eitherunit_price_reg
orunit_price_sale
.See also
case_price_quoted
, if applicable.
- unit_price_reg¶
Regular price for the item unit. Unless a sale is in effect,
unit_price_quoted
will typically match this value.
- unit_price_sale¶
Sale price for the item unit, if applicable. If set, then
unit_price_quoted
will typically match this value. See alsosale_ends
.
- uuid¶