Difference between revisions of "VbzCart/tables/stk bins"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(extracted from VbzCart/tables)
 
(actual table was already InnoDB)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==About==
 
==About==
 
* '''Purpose''': containers in which stock may be found
 
* '''Purpose''': containers in which stock may be found
* '''Refers to''': {{vbzcart/table|stk_places}}
+
* '''Refers to''': {{vbzcart|table|stk_places}}
 +
* '''Referenced by''': {{l/vc/table|stk_lines}}
 
* '''Fields''':
 
* '''Fields''':
 
** '''WhenCreated''' can be NOT NULL if you don't have any legacy data to deal with.
 
** '''WhenCreated''' can be NOT NULL if you don't have any legacy data to deal with.
** '''isForShip''' got eventually added because I kept forgetting to use WhenVoided, and I finally decided that it wasn't redundant to have a flag specifically for this attribute
+
** '''isForShip''' eventually got added because I kept forgetting to use WhenVoided, and I finally decided that it wasn't redundant to have a flag specifically for this attribute. It has two meanings which may eventually need to be separated into separate fields:
 +
*** A. FALSE = do not ship this item, even though we have it on site (why would this happen? not sure if needed)
 +
*** B. FALSE = this bin is not physically accessible to the shipping department; items must be shipped by someone at that location or sent here to be shipped from this location. This meaning should actually be reflected by the Warehouse set in {{vbzcart|table|stk_places}}, but that's going to take a little thinking to implement that properly because it's hierarchical. Administrators operating at a given location should only be able to move items into (or out of) bins ''at that location''. Right now, we just globally say that some bins are unreachable: not as good, but much easier to implement. Fix later.
 +
** '''isEnabled''' (DEPRECATED): TRUE = this bin is in a Place that is currently valid, usable, etc. FALSE = this bin should be treated as unshippable and unsellable even if isForShip and isForSale are marked TRUE
 +
*** It looks like this was intended to be calculated from the status of the parent Place; possibly it should just be eliminated.
 +
==History==
 +
* '''2011-04-01''' added '''WhenCounted''' field -- for some reason, I thought this field was already here, but obviously it needs to be so we can track which bins are due for inventorying
 +
* '''2012-02-06''' added '''isEnabled''' field
 +
* '''2015-11-17''' added '''WhenEdited''' field
 +
* '''2017-03-24''' deprecating '''isEnabled''' field
 +
* '''2017-09-05''' Changed MyISAM to InnoDB
 
==SQL==
 
==SQL==
<section begin=sql /><mysql>DROP TABLE IF EXISTS `stk_bins`;
+
<mysql>DROP TABLE IF EXISTS `stk_bins`;
 
 
CREATE TABLE `stk_bins` (
 
CREATE TABLE `stk_bins` (
   `ID` int(11) NOT NULL auto_increment,
+
   `ID`           INT(11)     NOT NULL auto_increment,
   `ID_Place` int(11) NOT NULL COMMENT 'stk_places.ID',
+
   `ID_Place`     INT(11)     NOT NULL COMMENT 'stk_places.ID',
   `Code` varchar(15) NOT NULL COMMENT 'code name, e.g. NC01 -- must appear on outside of box',
+
   `Code`     VARCHAR(15)     NOT NULL COMMENT 'code name, e.g. NC01 -- must appear on outside of box',
   `Descr` varchar(63) default NULL COMMENT 'brief summary of contents',
+
   `Descr`   VARCHAR(63) DEFAULT NULL COMMENT 'brief summary of contents',
   `WhenCreated` datetime default NULL COMMENT 'date when container was added to the database',
+
   `WhenCreated` DATETIME DEFAULT NULL COMMENT 'date when container was added to the database',
   `WhenVoided` datetime default NULL COMMENT 'date when container was destroyed or removed from usage',
+
  `WhenEdited`  DATETIME DEFAULT NULL COMMENT 'date when container record was last edited',
   `WhenTainted` datetime default NULL COMMENT "if NOT NULL, this bin needs re-inventorying",
+
   `WhenVoided` DATETIME DEFAULT NULL COMMENT 'date when container was destroyed or removed from usage',
   `isForSale` tinyint(1) default NULL COMMENT "TRUE = this item is visible to customers as stock",
+
   `WhenTainted` DATETIME DEFAULT NULL COMMENT "if NOT NULL, this bin needs re-inventorying",
   `isForShip` tinyint(1) default NULL COMMENT "TRUE = this item is available for filling orders",
+
  `WhenCounted` DATETIME DEFAULT NULL COMMENT "timestamp of when bin's contents were last inventoried",
   `Notes` text,
+
   `isForSale` TINYINT(1) DEFAULT NULL COMMENT "TRUE = this item is visible to customers as stock",
   PRIMARY KEY (`ID`)
+
   `isForShip` TINYINT(1) DEFAULT NULL COMMENT "TRUE = this item is available for filling orders",
) ENGINE=MyISAM AUTO_INCREMENT=111 DEFAULT CHARSET=latin1;</mysql>
+
  `isEnabled` TINYINT(1) DEFAULT NULL COMMENT "DEPRECATED; do not use; will be removed soon",
<section end=sql />
+
   `Notes`           TEXT,
 +
   PRIMARY KEY (`ID`)
 +
) ENGINE=InnoDB;</mysql>

Latest revision as of 13:34, 5 September 2017

About

  • Purpose: containers in which stock may be found
  • Refers to: stk_places
  • Referenced by: stk_lines
  • Fields:
    • WhenCreated can be NOT NULL if you don't have any legacy data to deal with.
    • isForShip eventually got added because I kept forgetting to use WhenVoided, and I finally decided that it wasn't redundant to have a flag specifically for this attribute. It has two meanings which may eventually need to be separated into separate fields:
      • A. FALSE = do not ship this item, even though we have it on site (why would this happen? not sure if needed)
      • B. FALSE = this bin is not physically accessible to the shipping department; items must be shipped by someone at that location or sent here to be shipped from this location. This meaning should actually be reflected by the Warehouse set in stk_places, but that's going to take a little thinking to implement that properly because it's hierarchical. Administrators operating at a given location should only be able to move items into (or out of) bins at that location. Right now, we just globally say that some bins are unreachable: not as good, but much easier to implement. Fix later.
    • isEnabled (DEPRECATED): TRUE = this bin is in a Place that is currently valid, usable, etc. FALSE = this bin should be treated as unshippable and unsellable even if isForShip and isForSale are marked TRUE
      • It looks like this was intended to be calculated from the status of the parent Place; possibly it should just be eliminated.

History

  • 2011-04-01 added WhenCounted field -- for some reason, I thought this field was already here, but obviously it needs to be so we can track which bins are due for inventorying
  • 2012-02-06 added isEnabled field
  • 2015-11-17 added WhenEdited field
  • 2017-03-24 deprecating isEnabled field
  • 2017-09-05 Changed MyISAM to InnoDB

SQL

<mysql>DROP TABLE IF EXISTS `stk_bins`; CREATE TABLE `stk_bins` (

 `ID`           INT(11)     NOT NULL auto_increment,
 `ID_Place`     INT(11)     NOT NULL COMMENT 'stk_places.ID',
 `Code`     VARCHAR(15)     NOT NULL COMMENT 'code name, e.g. NC01 -- must appear on outside of box',
 `Descr`    VARCHAR(63) DEFAULT NULL COMMENT 'brief summary of contents',
 `WhenCreated` DATETIME DEFAULT NULL COMMENT 'date when container was added to the database',
 `WhenEdited`  DATETIME DEFAULT NULL COMMENT 'date when container record was last edited',
 `WhenVoided`  DATETIME DEFAULT NULL COMMENT 'date when container was destroyed or removed from usage',
 `WhenTainted` DATETIME DEFAULT NULL COMMENT "if NOT NULL, this bin needs re-inventorying",
 `WhenCounted` DATETIME DEFAULT NULL COMMENT "timestamp of when bin's contents were last inventoried",
 `isForSale` TINYINT(1) DEFAULT NULL COMMENT "TRUE = this item is visible to customers as stock",
 `isForShip` TINYINT(1) DEFAULT NULL COMMENT "TRUE = this item is available for filling orders",
 `isEnabled` TINYINT(1) DEFAULT NULL COMMENT "DEPRECATED; do not use; will be removed soon",
 `Notes`           TEXT,
 PRIMARY KEY (`ID`)

) ENGINE=InnoDB;</mysql>