VbzCart/docs/tables/cat supp: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | tables
Jump to navigation Jump to search
imported>Woozle
(note about isWarehouse)
imported>Woozle
(ID_PriceFunc, and reorganized a bit)
Line 1: Line 1:
==About==
==About==
* '''purpose''': catalog suppliers (i.e. manufacturers, wholesalers)
* '''purpose''': catalog suppliers (i.e. manufacturers, wholesalers)
* '''history''':
==History==
** '''2011-09-28''' added '''ID_Topic''' field
* '''2011-09-28''' added '''ID_Topic''' field
* '''fields''':
* '''2016-02-01''' moved '''ID_PriceFunc''' field here from deprecated {{l/vc/table|ctg_supp}} table, and moved the field data here as well.
** '''ID_Topic''': subtopics within this topic will take the place of Departments... or at least that is the current thinking
 
===Future===
I'm pretty sure there was an "isWarehouse" flag field at some point, but it seems to have been removed prior to 2005. The thinking was that warehouses and suppliers had a lot in common, so why not use the same table? However, what they have in common is basically address information. I eventually created a separate {{l/vc/table|stk_whse}} table and moved the warehouse records there.
==Fields==
* '''ID_Topic''': subtopics within this topic will take the place of Departments... or at least that is the current thinking
 
==Future==
* Fields which may be added later (or maybe they should be in a separate table):
* Fields which may be added later (or maybe they should be in a separate table):
** '''MinCostPerOrd''' - currency -- supplier's minimum order, dollar amount
** '''MinCostPerOrd''' - currency -- supplier's minimum order, dollar amount
** '''MinQtyPerDesign''' - int(4) -- supplier's default minimum order per design (can be overridden for specific Titles)
** '''MinQtyPerDesign''' - int(4) -- supplier's default minimum order per design (can be overridden for specific Titles)
* Additional contact data should probably be wiki-based. We'll have a namespace for vbz catalog data, probably "vbzcat:", and supplier information will be stored in pages named something like "vbzcat:lb.page", "vbzcat:lb.address", "vbzcat:lb.phone", and so on.
* Additional contact data should probably be private-wiki-based. We'll have a namespace for vbz catalog data, probably "vbzcat:", and supplier information will be stored in pages named something like "vbzcat:lb.page", "vbzcat:lb.address", "vbzcat:lb.phone", and so on.
* There are additional fields in the Access version of this table, but they will be added only when it becomes clear that they are necessary and that there isn't someplace better for them to go.
* There are additional fields in the Access version of this table, but they will be added only when it becomes clear that they are necessary and that there isn't someplace better for them to go.
* view "suppliers" was a temporary alias of cat_supp but I've renamed it (2008-12-06); anything still using it should use cat_supp instead
* view "suppliers" was a temporary alias of cat_supp but I've renamed it (2008-12-06); anything still using it should use cat_supp instead
===Notes===
I'm pretty sure there was an "isWarehouse" flag field at some point. The thinking was that warehouses and suppliers had a lot in common, so why not use the same table. However, what they have in common is basically address information. I don't remember specifically what I had in mind when I deleted the field, but it does seem clear that this area needs some rethinking. Nothing important seems to depend on Warehouse data.
==SQL==
==SQL==
<mysql>CREATE TABLE `cat_supp` (
<mysql>CREATE TABLE `cat_supp` (
   `ID` INT NOT NULL AUTO_INCREMENT,
   `ID`           INT     NOT NULL AUTO_INCREMENT,
   `Name`     VARCHAR(64) COMMENT 'name of supplier as displayed',
   `Name`             VARCHAR(64) COMMENT 'name of supplier as displayed',
   `ID_Topic` INT DEFAULT NULL COMMENT "cat_topic.ID of root topic for this supplier",
   `ID_Topic`     INT DEFAULT NULL COMMENT "cat_topic.ID of root topic for this supplier",
   `CatKey`   VARCHAR(4) COMMENT 'unique code, used for building catalog numbers',
  `ID_PriceFunc` INT DEFAULT NULL COMMENT "ctg_prc_funcs.ID - function to use when calculating prices for this supplier",
   `isActive` BOOL COMMENT 'if FALSE, hide from casual listings',
   `CatKey`             VARCHAR(4) COMMENT 'unique code, used for building catalog numbers',
   `Notes`   TEXT COMMENT "Human-entered notes about this supplier, for quick reference",
   `isActive`                 BOOL COMMENT 'if FALSE, hide from casual listings',
   `Notes`                   TEXT COMMENT "Human-entered notes about this supplier, for quick reference",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
  )
  )
  ENGINE = MYISAM;</mysql>
  ENGINE = MYISAM;</mysql>

Revision as of 21:57, 1 February 2016

About

  • purpose: catalog suppliers (i.e. manufacturers, wholesalers)

History

  • 2011-09-28 added ID_Topic field
  • 2016-02-01 moved ID_PriceFunc field here from deprecated Template:L/vc/table table, and moved the field data here as well.

I'm pretty sure there was an "isWarehouse" flag field at some point, but it seems to have been removed prior to 2005. The thinking was that warehouses and suppliers had a lot in common, so why not use the same table? However, what they have in common is basically address information. I eventually created a separate Template:L/vc/table table and moved the warehouse records there.

Fields

  • ID_Topic: subtopics within this topic will take the place of Departments... or at least that is the current thinking

Future

  • Fields which may be added later (or maybe they should be in a separate table):
    • MinCostPerOrd - currency -- supplier's minimum order, dollar amount
    • MinQtyPerDesign - int(4) -- supplier's default minimum order per design (can be overridden for specific Titles)
  • Additional contact data should probably be private-wiki-based. We'll have a namespace for vbz catalog data, probably "vbzcat:", and supplier information will be stored in pages named something like "vbzcat:lb.page", "vbzcat:lb.address", "vbzcat:lb.phone", and so on.
  • There are additional fields in the Access version of this table, but they will be added only when it becomes clear that they are necessary and that there isn't someplace better for them to go.
  • view "suppliers" was a temporary alias of cat_supp but I've renamed it (2008-12-06); anything still using it should use cat_supp instead

SQL

<mysql>CREATE TABLE `cat_supp` (

  `ID`           INT     NOT NULL AUTO_INCREMENT,
  `Name`              VARCHAR(64) COMMENT 'name of supplier as displayed',
  `ID_Topic`     INT DEFAULT NULL COMMENT "cat_topic.ID of root topic for this supplier",
  `ID_PriceFunc` INT DEFAULT NULL COMMENT "ctg_prc_funcs.ID - function to use when calculating prices for this supplier",
  `CatKey`             VARCHAR(4) COMMENT 'unique code, used for building catalog numbers',
  `isActive`                 BOOL COMMENT 'if FALSE, hide from casual listings',
  `Notes`                    TEXT COMMENT "Human-entered notes about this supplier, for quick reference",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>