VbzCart/docs/tables/ctg sources: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | tables
Jump to navigation Jump to search
imported>Woozle
(New page: ==About== * '''Notes''': ** To discontinue a supplier, set ID_Supercede=ID for all active sources; the catalog will then show only current stock as avaialble. ==SQL== <section begin=sql />...)
 
m (Woozle moved page VbzCart/VbzCart/tables/ctg sources to VbzCart/docs/tables/ctg sources without leaving a redirect: part 3/5)
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
==About==
==About==
* '''Notes''':
* '''Part of''': [[VbzCart/pieces/catalog/building/2017|catalog building process]]
** To discontinue a supplier, set ID_Supercede=ID for all active sources; the catalog will then show only current stock as avaialble.
* <s>'''Used by''': {{l/vbzcart/query|qryCtg_Sources_active}}</s>
==Fields==
* '''ID_Supercede''': Supplier Catalogs.ID of catalog which supercedes this one; NULL = this one is current
** It can be set to point to the current record if the superceding catalog has not been entered or is not known.
* '''isCloseOut''':
** TRUE = this catalog is a list of discontinued items ''no longer in print'' (closeouts) but still available for the moment
** FALSE = normal catalog; items will be marked as "in print"
* '''WhenUpdated''': When this record was last saved. This is actually significant for catalog building because it is copied to LCItem.Supp_LastUpdate. Presumably any time the record is edited, the editor would not leave the ID_Supercede field NULL if the catalog was not still current.
* '''DateActive''': The approximate earliest date of the catalog's effectiveness (e.g. "Spring 20xx" would be 20xx-03-15 or so, or date received if earlier)
* '''DateExpires''': The approximate date when the catalog is no longer expected to apply (e.g. "20xx Catalog" would be 20xx-12-31)
==History==
* '''2017-06-18''' Changed engine from MYISAM to InnoDB; added '''LastUpdate'''
* '''2017-06-19''' Added '''DateExpires'''
* '''2017-06-20''' Renaming '''DateAvail''' to '''DateActive''', mainly for aesthetic reasons
==Notes==
* A "source" is usually a printed catalog from a supplier, though it can also be the manufacturer's web site on a particular date.
* To discontinue a supplier, set ID_Supercede=ID for all active sources; the catalog will then show only current stock as available.
==SQL==
==SQL==
<section begin=sql /><mysql>CREATE TABLE `ctg_sources` (
<mysql>CREATE TABLE `ctg_sources` (
   ID          INT NOT NULL AUTO_INCREMENT,
   ID          INT         NOT NULL AUTO_INCREMENT,
   Name        VARCHAR(63) NOT NULL COMMENT "name of source",
   Name        VARCHAR(63) NOT NULL COMMENT "name of source",
   Abbr        VARCHAR(15) NOT NULL COMMENT "abbreviation, for drop-down lists",
   Abbr        VARCHAR(15) NOT NULL COMMENT "abbreviation, for drop-down lists",
   ID_Supplier INT NOT NULL COMMENT "Suppliers.ID - supplier for this source",
   ID_Supplier INT         NOT NULL COMMENT "Suppliers.ID - supplier for this source",
   DateAvail  DATETIME DEFAULT NULL COMMENT "earliest date on which this source is valid",
   DateActive  DATETIME DEFAULT NULL COMMENT "earliest date on which this source is valid",
   ID_Supercede INT DEFAULT NULL COMMENT "[Supplier Catalogs].ID of catalog which supercedes this one (NULL = this one is current)",
  DateExpires DATETIME DEFAULT NULL COMMENT "estimated date on which this source expires",
   isCloseOut  BOOL DEFAULT FALSE COMMENT "TRUE = this catalog is a list of discontinued items no longer in print (closeouts); FALSE = normal catalog",
  LastUpdate  TIMESTAMP        NULL ON UPDATE NOW() COMMENT "automatically updated when record changes",
   ID_Supercede INT     DEFAULT NULL COMMENT "[Supplier Catalogs].ID of catalog which supercedes this one, if any",
   isCloseOut  BOOL   DEFAULT FALSE COMMENT "is this a close-out catalog?",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
)
)
ENGINE = MYISAM;</mysql>
ENGINE = InnoDB;</mysql>
<section end=sql />

Latest revision as of 01:56, 25 February 2024

About

Fields

  • ID_Supercede: Supplier Catalogs.ID of catalog which supercedes this one; NULL = this one is current
    • It can be set to point to the current record if the superceding catalog has not been entered or is not known.
  • isCloseOut:
    • TRUE = this catalog is a list of discontinued items no longer in print (closeouts) but still available for the moment
    • FALSE = normal catalog; items will be marked as "in print"
  • WhenUpdated: When this record was last saved. This is actually significant for catalog building because it is copied to LCItem.Supp_LastUpdate. Presumably any time the record is edited, the editor would not leave the ID_Supercede field NULL if the catalog was not still current.
  • DateActive: The approximate earliest date of the catalog's effectiveness (e.g. "Spring 20xx" would be 20xx-03-15 or so, or date received if earlier)
  • DateExpires: The approximate date when the catalog is no longer expected to apply (e.g. "20xx Catalog" would be 20xx-12-31)

History

  • 2017-06-18 Changed engine from MYISAM to InnoDB; added LastUpdate
  • 2017-06-19 Added DateExpires
  • 2017-06-20 Renaming DateAvail to DateActive, mainly for aesthetic reasons

Notes

  • A "source" is usually a printed catalog from a supplier, though it can also be the manufacturer's web site on a particular date.
  • To discontinue a supplier, set ID_Supercede=ID for all active sources; the catalog will then show only current stock as available.

SQL

<mysql>CREATE TABLE `ctg_sources` (

 ID          INT          NOT NULL AUTO_INCREMENT,
 Name        VARCHAR(63)  NOT NULL COMMENT "name of source",
 Abbr        VARCHAR(15)  NOT NULL COMMENT "abbreviation, for drop-down lists",
 ID_Supplier INT          NOT NULL COMMENT "Suppliers.ID - supplier for this source",
 DateActive  DATETIME DEFAULT NULL COMMENT "earliest date on which this source is valid",
 DateExpires DATETIME DEFAULT NULL COMMENT "estimated date on which this source expires",
 LastUpdate  TIMESTAMP        NULL ON UPDATE NOW() COMMENT "automatically updated when record changes",
 ID_Supercede INT     DEFAULT NULL COMMENT "[Supplier Catalogs].ID of catalog which supercedes this one, if any",
 isCloseOut  BOOL    DEFAULT FALSE COMMENT "is this a close-out catalog?",
 PRIMARY KEY(`ID`)

) ENGINE = InnoDB;</mysql>