extools.view.utils

Utilities for working with views and data.

extools.view.utils.customer.customer_group_for(customer_id)[source]

Get the customer group for a given customer ID.

Parameters:customer_id (str) – the customer ID to find the group for.
Returns:customer group or an empty string.
Return type:str
extools.view.utils.item.category_for(itemno)[source]

Get the category for an item.

extools.view.utils.item.item_optfield(itemno, optfield)[source]

Get an item’s optional field value.

Parameters:
  • itemno (str) – the I/C item number.
  • optfield (str) – the optional field name.
Returns:

value if set, else None

extools.view.utils.item.unformat_itemno(itemno)[source]

Unformat an item number.

Parameters:itemno (str) – formatted item number.
Returns:item number with formatting characters removed.
extools.view.utils.item.uoms_for(itemno)[source]

Get a list of all UOMs for an item. :param itemno: formatted item number. :type itemno: str :returns: ExQuery(ITEMNO=itemno)

extools.view.utils.item.vendors_for(unfmtitemno)[source]

Get a list of all vendors.

The returned list is sparse: Vendor 1 at index 0, Vendor 2 at index 1, etc. Vendors that are not set will be None.

Parameters:unfmtitemno (str) – Unformatted item number.
extools.view.utils.order.order_from_quotes(customer, quotes)[source]

Create an order for a customer from a list of quotes.

Parameters:
  • customer (str) – customer number
  • quotes (list) – list of quote numbers
Returns:

new order (not yet inserted)

Return type:

ExView(“OE0520”)

extools.view.utils.order.orduniq_for(ordnumber)[source]

Get the Unique Order Key (ORDUNIQ) given an Order Number.

Parameters:ordnumber (str) – Order number to get the unique key for.
Returns:ORDUNIQ or 0.0
Return type:float
extools.view.utils.shipment.shiuniq_for(shinumber)[source]

Get the shipment uniquifier for a shipment number.

Parameters:shinumber (str) – shipment number.
Returns:shipment uniquifier or 0.0 is no such shipment
Return type:float