Top-level module of cam32 package.
PyCAM32’s version string.
sqlalchemy.MetaData instance, which presumably has been reflected from the CAM32 database.
Returns a sorted list of table names found in the database. This exists mostly for ad-hoc convenience, e.g. in a python shell.
A SQLAlchemy-based session to the database.
Note
This Session class overrides the default flush() method to prevent any attempts to write to the database from actually being made. This is done simply to avoid “accidents” whereby writing is unintentionally attempted, in turn causing SQLBase security to raise an exception.
Convenience function to retrieve a cam32.Customer by its number.
Convenience function to retrieve a cam32.Department by its number.
Convenience function to retrieve a cam32.DepartmentClass by its number and that of its department.
Convenience function to retrieve a cam32.DepartmentSubclass by its number and those of its department and class.
Convenience function to retrieve a cam32.InventoryItem by its number.
Convenience function to retrieve a cam32.SalesLogHeader by its number and that of its store.
Convenience function to retrieve a cam32.PurchaseOrder by its number and that of its store.
Convenience function to retrieve a cam32.Store by its number.
Convenience function to retrieve a cam32.Vendor by its number.
These represent various types of data found in the CAM32 database.
Represents an authorized user within a customer account.
The activation date for the user.
Whether the user may pay via check.
Whether the user may pay via store charge.
The customer number to which the user belongs.
The expiration date for the user.
The user’s first name.
The user’s last name.
The user’s middle name.
The user’s name suffix.
The ID of the user.
Represents a customer.
First line of the customer’s address.
The second line of the customer’s address.
A list of cam32.AuthorizedUser instances attached to the customer.
The customer’s birth date.
Note
This attribute’s value is not formatted in any way, but comes back exactly as it exists in the database. This means that it is a string with no mask applied, e.g. a birthday of 1978-04-20 will come back as "042078". See cam32.Customer.get_birth_date() for a way to retrieve a true datetime.date instance.
The “day” portion of the cam32.Customer.birth_date as an integer, or None if the underlying data is missing.
The “month” portion of the cam32.Customer.birth_date as an integer, or None if the underlying data is missing.
The assumed year portion of the cam32.Customer.birth_date.
This value is “guessed” upon inspection of the birth_date attribute, since the underlying data has only 2 digits for the year, in classic “Y2K” style.
If the birth_date value doesn’t even include a year portion, then this attribute will return None. Otherwise it will return an integer according to the following heuristic:
If the year value within the context of the current century would equate to a year later than the current one, then it is assumed to belong to the previous century. Otherwise, i.e. if the year within the context of the current century is still less than or equal to the current actual year, then the current century is assumed.
The customer’s “charge type”. This will be one of the following values:
Note
This is not to be confused with the cam32.Customer.type!
The city in which the customer lives.
The customer’s “code”. This is a user-defined field.
A list of cam32.CustomerCode instances attached to the customer.
The name of the company with which the customer is associated.
The customer’s account balance.
The customer’s credit limit for store charges. Note that if this is set to zero, the customer will not be allowed to do store charges at all.
The customer’s number.
The percentage by which the customer’s purchases are discounted.
The effective starting date for the cam32.Customer.recurring_amount, if applicable.
The customer’s email address.
Convenience method to retrieve a datetime.date instance from some date parts. For each parameter, the current customer’s attribute will be used if no value is explicitly provided.
The last date on which the customer made a purchase.
According to CAM32’s tool tip, this is the annual percentage for late charges.
The customer’s mail code (or mail type).
The customer’s (full) name.
A list of cam32.CustomerNoteLine objects attached to this customer.
This attribute invokes a query which is not cached, FYI.
A list of cam32.CustomerNote objects attached to this customer.
This attribute invokes a query which is not cached, FYI.
The customer’s phone number.
The pricing code for the customer. This attribute’s meaning depends on its value:
If the value is between 1 and 6 inclusive, it corresponds to an inventory price level.
If the value is between 11 to 24 inclusive, it corresponds with one of the pricing matrices found in System Definition -> Define Pricing Matrix.
Boolean indicating whether or not the cashier will be prompted to enter a “purchaser name” when starting a transaction sold to this customer.
An amount to be applied to the customer’s account on a recurring (presumably monthly) basis.
The customer’s gender. This will be one of the following values:
The state in which the customer lives.
The tax rate for the customer.
According to CAM32’s tool tip for this field, the value may be interpreted in one of two ways:
The number of days a customer is allowed to defer payment on an invoice.
According to CAM32’s tool tip for this field, a value of 99 is assumed to mean C.O.D.
The customer’s “type”. This will be one of the following values:
(See the CAM32 documentation for a somewhat reasonable explanation of these terms.)
Boolean indicating whether or not the customer is considered a “wholesale” customer. If True, then sales to the customer will involve “wholesale” invoices.
The customer’s ZIP code.
Represents a (possibly multi-line) note attached to a customer.
The customer number to which the note is attached.
The date when the note was first created.
The store number where the note was first created.
The text of the note as a continuous string (i.e. with embedded newline characters, if applicable).
The time when the note was first created.
Represents a single line within a customer note.
The customer number to which the note is attached.
The date when the note was first created.
The line number for this line of the note.
The store number where the note was first created.
The text of this line of the note.
The time when the note was first created.
Represents a “class” within a department.
The number of the class, unique within the department.
The department number with which the class is associated.
The description (i.e. name) of the class.
A list of cam32.DepartmentSubclass instances belonging to the class.
Represents a “subclass” within a class, within a department.
The cam32.DepartmentClass instance to which this subclass belongs.
The class number with which the subclass is associated.
The department number with which the subclass is associated.
The description (i.e. name) of the subclass.
The number for the subclass, unique within its parent class.
An “inventory cross-reference” entry.
These can represent different things, depending on their cam32.InventoryCrossRef.type attribute.
The data (i.e. actual value) of the entry.
The cam32.InventoryItem with which the entry is associated.
The item number with which the entry is associated.
The sequence number (i.e. ordinal) for the entry.
This is presumed to be unique within the context of a particular cam32.InventoryCrossRef.type for a particular cam32.InventoryItem.
The type of data which the entry represents. This can be one of the following values:
The vendor number with which the entry is associated.
Represents an item (i.e. product) within the Inventory File.
A boolean indicating whether the item is part of an “append” sequence.
The “append number” (i.e. “quantity price level”) for the item.
The meaning of this attribute will vary somewhat, depending on the value of cam32.InventoryItem.append:
If append is False, then append_number doesn’t actually mean anything and should be ignored.
However, if append is True, then append_number will contain the “quantity price level” setting for the item (found within the item’s Inventory Flag Definition).
The value of this attribute will vary depending on whether or not the item if part of an “append” sequence.
If the item is part of an append sequence, this attribute returns the item number of the base (quantity price level 0) item.
Otherwise, None is returned.
A boolean indicating whether the item’s “sold quantity” should be calculated at the POS based on the price of the item.
The case quantity for the item, as an integer.
The class number to which the item belongs, if applicable.
The “code field” for the item, the meaning of which is user-defined.
A boolean indicating whether the item has attached comment(s). See also the cam32.InventoryItem.comments attribute.
Returns a list of cam32.ItemComment instances attached to the item.
Note
This attribute will return whatever is found in the database, regardless of the value of cam32.InventoryItem.comments_attached.
A boolean indicating whether the sales of the item produce a commission.
A boolean indicating whether “composite” scancodes are used with the item.
The (last) cost for the item, as a decimal.Decimal instance rounded to 3 places.
The date when the item was first added to the database.
A boolean indicating whether the item is marked for deletion.
The department number to which the item belongs.
The description for the item.
A boolean indicating whether a discount(s) may be applied to the item at the POS.
A boolean indicating whether the item may be purchased with a flexible spending account (FSA).
A boolean indicating whether the item may be purchased with food stamps.
A boolean indicating whether the item has a “long” description.
A boolean indicating whether or not “History” is checked within the item’s Inventory Flag Definition.
A boolean indicating whether inventory figures are tracked for the item.
The label format number assigned to the item.
The number for the item, unique within the store.
A boolean indicating whether the item is a “kit”.
A boolean indicating whether the item is part of a “kit”.
Returns a list of cam32.InventoryItem instances (which in turn should have valid cam32.Kit instances associated with them) to which this item belongs.
The date when the item was last received on a purchase order.
The date when the item was last sold to a customer.
The minimum age required for a customer to be allowed to purchase the item, if applicable.
The location for the item. This field is user-defined.
The maximum stocking level for the item.
The “manufacturer part number” for the item.
The month-to-date cost of goods sold (in decimal dollars) for the item.
The month-to-date quantity sold (in decimal units) for the item.
The month-to-date value sold (in decimal dollars) for the item.
A dictionary of cam32.MultiVendor instances for the item, keyed by vendor number.
The “balance on hand” figure for the item, as a decimal.Decimal instance rounded to 3 places.
The “balance on order” figure for the item, as a decimal.Decimal instance rounded to 3 places.
A boolean indicating whether the item is on sale (promotion) today.
A boolean indicating whether the item is considered an “open PLU”. If it is, the cashier will be prompted to provide a description for the item when it is rang at the POS.
The “level 1” price for the item, as a decimal.Decimal instance rounded to 3 places.
The “level 2” price for the item, as a decimal.Decimal instance rounded to 3 places.
The “level 3” price for the item, as a decimal.Decimal instance rounded to 3 places.
The “level 4” price for the item, as a decimal.Decimal instance rounded to 3 places.
The “level 5” price for the item, as a decimal.Decimal instance rounded to 3 places.
The “level 6” price for the item, as a decimal.Decimal instance rounded to 3 places.
The start date for the item’s current promotion, if applicable.
The ending date for the item’s current promotion, if applicable.
A boolean indicating whether purchasing is allowed to recalculate the reorder point for the item.
A boolean indicating whether the item is a “rental” item.
The reorder point for the item, as an integer.
A boolean indicating whether the item is “requested”.
A boolean indicating whether the cashier must be “compelled” to weigh the item with a scale at the POS.
A list of scancodes for the item, as strings.
The item’s “code 2 field”, the meaning of which is user-defined.
A boolean indicating whether the item is stocked within a store.
The subclass number to which the item belongs, if applicable.
A 1-character string containing the item’s tax level, e.g. “N” or “1”.
A boolean indicating whether the item falls under unit control.
The unit of sale for the item.
This is typically a 2-character value, e.g. “EA” or “LB”.
The (primary) cam32.Vendor instance with which the item is associated, or None if not applicable.
The (primary) vendor number for the item.
The year-to-date cost of goods sold (in decimal dollars) for the item.
The year-to-date quantity scrapped (in integer units) for the item.
The year-to-date quantity sold (in decimal units) for the item.
The year-to-date value scrapped (in decimal dollars) for the item.
The year-to-date value sold (in decimal dollars) for the item.
Represents a comment attached to a cam32.InventoryItem.
The item number to which the comment is attached.
The ordinal number for the comment (will be between 1 and 4).
The print flag for the comment. This will be one of:
The text of the comment.
Represents a kit item, or more specifically, the kit aspect(s) of an otherwise “normal” instance of cam32.InventoryItem.
References the cam32.InventoryItem instance with which the kit is associated.
Returns the kit’s main item number.
References a list of cam32.KitPart instances which belong to the kit.
The replacement cost for the kit.
Represents a kit data record as it actually exists in the database. (A more Pythonic representation is to be found in the cam32.Kit class.)
The kit’s main item number.
There are 30 such attributes for each KIT_DATA record. The above attribute name is not actually valid; the real attributes include:
Each attribute returns the item number for the kit part.
Same scenario as for cam32.KitData.itemXX_item_number, except returns the kit part’s quantity value.
Same scenario as for cam32.KitData.itemXX_item_number, except returns the kit part’s “star” value (whatever that is).
The record number for the kit data record.
Returns the replacement cost for the kit as a 4-digit decimal.
Represents a part within a cam32.Kit instance.
Returns a reference to the cam32.InventoryItem instance associated with the kit part.
The part’s item number.
Returns the “ordinal” (or “index”) value from the part’s KIT_DATA record’s field names, i.e. a number between 1 and 30.
Returns the part’s quantity value.
Returns the record number value from the KIT_DATA record from whence this part came.
Returns the part’s “star” value (whatever that is).
Represents a “multi-vendor” entry for a cam32.InventoryItem instance.
An item might have multiple entries, but only one per vendor.
The item number with which the entry is associated.
The cost paid when the product was last received on a purchase order.
The cost per unit at level 1.
The cost per unit at level 2.
The cost per unit at level 3.
The cost per unit at level 4.
The cost per unit at level 5.
The cost per unit at level 6.
The cost per unit at level 7.
The “price code” for the entry.
See the CAM32’s Inventory Control documentation for a semi-confusing explanation of the significance of this field.
The quantity which must be ordered to qualify for the level 1 price break.
The quantity which must be ordered to qualify for the level 2 price break.
The quantity which must be ordered to qualify for the level 3 price break.
The quantity which must be ordered to qualify for the level 4 price break.
The quantity which must be ordered to qualify for the level 5 price break.
The quantity which must be ordered to qualify for the level 6 price break.
The quantity which must be ordered to qualify for the level 7 price break.
The quantity last received on a purchase order.
The stock number for the product, specific to a vendor.
The suggested retail price for the product, specific to a vendor.
A reference to the cam32.Vendor instance with which the entry is associated.
The vendor number with which the entry is associated.
Represents a product adjustment record when recording inventory with a PDT.
The cost of the product.
Balance-on-hand for the product which was actually counted.
Boolean indicating whether the product has been counted.
The item number for the adjustment.
Boolean indicating whether the adjustment has been posted.
The price of the product.
Balance-on-hand for the product at the time the adjustments table was initialized.
The store number for the adjustment.
Represents a purchase order, associated with a vendor.
The name of the buyer who submitted the purchase order to the vendor.
The confirmation name for the purchase order.
The date on which the purchase order was submitted to the vendor.
The date by which the product contained on the purchase order is required for delivery.
The invoice number for the purchase order.
The “PO number” for the purchase order.
The status of the purchase order. This will be one of:
The store number for the purchase order.
The cam32.Vendor instance associated with the purchase order.
The vendor number for the purchase order.
Represents a line (detail) item within a purchase order.
The case multiplier for the product.
The case quantity for the product.
The (cached) description for the product.
The excepted quantity received for the product.
The actual cost for the product.
The item number for the product.
The “PO number” for the purchase order.
The original (presumably expected) cost for the product, as of purchase order creation (hm, or is it posting?).
The original retail price for the product, at the time of purchase order creation (hm, or is it posting?).
The quantity ordered for the product.
The quantity received for the product.
The reference (line) number for the detail.
The retail price for the product.
The store number for the purchase order.
The total quantity ordered for the product.
The total quantity received for the product.
The (cached) unit of measure for the product.
Represents a “sales log header” (also known as an “invoice”) within the database.
The total in dollars of any bank cards tendered as payment.
The total in dollars of any cash tendered as payment.
The total in dollars of any store charge tendered as payment.
The total in dollars of any checks tendered as payment.
The name of the sales clerk.
The total cost of goods sold on the invoice.
The total in dollars of any coupons tendered as payment.
The cam32.Customer instance associated with the invoice, or None.
The first name of the customer.
The last name of the customer.
The customer number for the invoice.
The date and time for the invoice.
Note
I’m not sure if this timestamp represents the invoice creation or posting time.
The invoice number.
The total in dollars of non-taxable goods on the invoice.
The number of the register station at which the transaction occurred.
The resale number for the invoice.
The ID of the sales clerk.
The total in dollars of sales on the invoice.
The store number for the invoice.
The pre-tax total in dollars of all goods on the invoice (taxable and otherwise).
The total in dollars of actual tax on the invoice.
The total in dollars of taxable goods on the invoice.
The total in dollars of all payment tendered.
The number of total lines on the invoice.
Represents a line (detail) item on an invoice, or cam32.SalesLogHeader.
The (cached) class number for the product.
The (cached) department number for the product.
The (cached) description for the product.
The calculated “extended” price, i.e. “unit” price multiplied by quantity sold.
Note
Occasionally the value from this simple calculation can differ from that arrived at by CAM32. I’m not sure why it happens, but it’s neither often nor by more than a penny when it does occur.
The invoice number.
The cam32.InventoryItem instance associated with the detail, or None if the item no longer exists.
The item number for the product.
The price (per unit) actually paid for the product.
The quantity of the product which is being sold.
The reference (line) number for the detail.
The (cached) retail price for the product.
The store number for the invoice.
The (cached) subclass number for the product.
The (cached) suggested price for the product.
The (cached) tax category for the product, as an integer.
The (cached) unit cost for the product.
The (cached) vendor number for the product.
Represents a store.
The street address for the store.
The city in which the store is located.
The email address for the store.
The fax number for the store.
The name for the store.
The “notes” for the store (?).
The phone number for the store.
The price level for the store.
The state in which the store is located.
The store’s number.
The ZIP code in which the store is located.
Represents a vendor.
The store’s account number with the vendor.
The street address for the vendor.
The city in which the vendor is located.
The name of the store’s contact within the vendor’s remittance office.
The name for the vendor.
The phone number for the vendor’s remittance office.
The name of the vendor’s “purchase contact” (?).
The street address for the vendor’s sales office.
The city in which the vendor’s sales office is located.
The vendor’s “sales name” (?).
The phone number for the vendor’s sales office.
The state in which the vendor’s sales office is located.
The ZIP code in which the vendor’s sales office is located.
The state in which the vendor is located.
The vendor’s number.
The ZIP code in which the vendor is located.