VbzCart/tables/cat items

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | tables
Revision as of 22:49, 10 April 2009 by Woozle (talk | contribs) (deprecated qtyInStock)
Jump to navigation Jump to search

About

  • Purpose: catalog items within a title, i.e. varieties in which the title is (or was ever) available
  • Fields:
    • CatSfx is basically whatever sets the item's catalog number apart from other items of the same title
    • GrpCode and GrpDescr are for differentiating within an item type, e.g. a short-sleeved t-shirt which is available in both tie-dye and one or more solid colors. GrpCode becomes part of the catalog number for items in that group, and GrpDesc is the description for that group. When displaying items for a particular title, sorting should be GrpSort,GrpCode,ItOptSort. See VbzCart catalog building for more.
  • History:
    • 2009-04-10 Tentatively eliminating qtyInStock field (adding " OLD" to name) because (a) can't find any code that uses it, and (b) it really should be calculated dynamically, otherwise it's not reliable.

SQL

<mysql> DROP TABLE IF EXISTS `cat_items`;

CREATE TABLE `cat_items` (
  `ID` INT  NOT NULL AUTO_INCREMENT,
  `CatNum` varchar(64) COMMENT "catalog number: must be unique or null; can be changed",
  `isForSale` BOOL COMMENT "available to be sold/ordered (either in stock or in print)",
  `isMaster` BOOL COMMENT "contains multiple items; split apart when moving into stock",
  `qtyInStock OLD` INT COMMENT "DEPRECATED - number of pieces currently in stock and for sale, calculated from stk_items",
  `isInPrint` BOOL COMMENT "item is in current supplier catalog, and should be orderable",
  `isCloseOut` BOOL COMMENT "item is available as a close-out only; limited quantities, may be gone at any moment",
  `isPulled` BOOL COMMENT "TRUE = record is garbage or a duplicate, and nothing should refer to it",
  `isDumped` BOOL COMMENT "TRUE = pulled item which has been checked to make sure nobody is using it: ok to recycle",
  `ID_Title` INT NOT NULL COMMENT "cat_titles.ID",
  `ID_ItTyp` INT COMMENT "cat_ittyps.ID: basic type of item",
  `ID_ItOpt` INT COMMENT "cat_itopts.ID: item option (e.g. size)",
  `ItOpt_Descr` varchar(63) DEFAULT NULL COMMENT "overrides cat_itopts.Descr if present",
  `ItOpt_Sort` varchar(63) DEFAULT NULL COMMENT "concatenation of IGroup, Option, and Item Type sorting indexes",
  `GrpCode` varchar(15) DEFAULT NULL COMMENT "grouping code - new header when this changes",
  `GrpDescr` varchar(63) DEFAULT NULL COMMENT "group description - show in header, add to item description as shown in cart",
  `GrpSort` varchar(7) DEFAULT NULL COMMENT "sorting override (optional); sorting is by GrpSort+GrpCode",
  `CatSfx` varchar(31) DEFAULT NULL COMMENT "whatever is added to the title's catnum to make the item's catnum",
  `ID_ShipCost` INT COMMENT "applicable shipping cost calculation data",
  `PriceBuy`  DECIMAL(9,2) COMMENT "wholesale price from supplier",
  `PriceSell` DECIMAL(9,2) COMMENT "price to customer",
  `PriceList` DECIMAL(9,2) COMMENT "supplier's retail list price (if available)",
  `Supp_CatNum` varchar(32) COMMENT "supplier's catalog number, if available",
  `QtyMin_Stk` INT COMMENT "minimum quantity to keep in stock",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>