Difference between revisions of "VbzCart/tables/rstk rcd line"

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
(→‎SQL: ID_RstkRecd -> ID_RstkRcd)
(→‎SQL: DECIMAL(x,y) is x=total, not x=left-of-decimal)
Line 4: Line 4:
 
* Items actually received in a restock shipment
 
* Items actually received in a restock shipment
 
==SQL==
 
==SQL==
 +
* '''Notes''':
 +
** '''CostActBal''' may be unnecessary anywhere except [[MS Access|Access]], in which it is difficult for bound fields to relate to results which must be calculated in a specific sequence
 +
* '''History''':
 +
** '''2008-11-07''' Created for revised restocking process
 +
** '''2008-11-09''' +InvcDescr field, ID_RstkRecd -> ID_RstkRcd
 +
** '''2008-11-18''' Changed DECIMAL(3,3) to DECIMAL(6,3)
 
<section begin=sql /><mysql>CREATE TABLE `rstk_rcd_line` (
 
<section begin=sql /><mysql>CREATE TABLE `rstk_rcd_line` (
 
   `ID`          INT NOT NULL AUTO_INCREMENT,
 
   `ID`          INT NOT NULL AUTO_INCREMENT,
 
   `ID_RstkRcd`  INT COMMENT "rstk_recd.ID of received restock shipment this line belongs to",
 
   `ID_RstkRcd`  INT COMMENT "rstk_recd.ID of received restock shipment this line belongs to",
 
   `ID_Item`    INT COMMENT "cat_items.ID of item being restocked",
 
   `ID_Item`    INT COMMENT "cat_items.ID of item being restocked",
   `InvcLineNo`  DECIMAL(3,3) COMMENT "line number (use decimals for multiple restock lines as single invoice line)",
+
   `InvcLineNo`  DECIMAL(6,3) COMMENT "line number (use decimals for multiple restock lines as single invoice line)",
 
   `InvcQtyOrd`  INT COMMENT "quantity ordered",
 
   `InvcQtyOrd`  INT COMMENT "quantity ordered",
 
   `InvcQtySent` INT COMMENT "quantity shipped to us",
 
   `InvcQtySent` INT COMMENT "quantity shipped to us",
Line 19: Line 25:
 
   `CostInvTot`  DECIMAL(9,2) COMMENT "invoice line total (CostExpPer x InvcQtySent) for this item",
 
   `CostInvTot`  DECIMAL(9,2) COMMENT "invoice line total (CostExpPer x InvcQtySent) for this item",
 
   `CostActTot`  DECIMAL(9,2) COMMENT "actual (best) line total as used for reconciling",
 
   `CostActTot`  DECIMAL(9,2) COMMENT "actual (best) line total as used for reconciling",
   `CostActBal`  DECIMAL(9,2) COMMENT "running total, calculated from CostActTot; may be unnecessary anywhere except Access",
+
   `CostActBal`  DECIMAL(9,2) COMMENT "running total, calculated from CostActTot",
 
   `Notes`      VARCHAR(255) COMMENT "human-entered notes on this line item",
 
   `Notes`      VARCHAR(255) COMMENT "human-entered notes on this line item",
 
   PRIMARY KEY(`ID`)
 
   PRIMARY KEY(`ID`)

Revision as of 12:31, 18 November 2008

About

SQL

  • Notes:
    • CostActBal may be unnecessary anywhere except Access, in which it is difficult for bound fields to relate to results which must be calculated in a specific sequence
  • History:
    • 2008-11-07 Created for revised restocking process
    • 2008-11-09 +InvcDescr field, ID_RstkRecd -> ID_RstkRcd
    • 2008-11-18 Changed DECIMAL(3,3) to DECIMAL(6,3)

<mysql>CREATE TABLE `rstk_rcd_line` (

  `ID`          INT NOT NULL AUTO_INCREMENT,
  `ID_RstkRcd`  INT COMMENT "rstk_recd.ID of received restock shipment this line belongs to",
  `ID_Item`     INT COMMENT "cat_items.ID of item being restocked",
  `InvcLineNo`  DECIMAL(6,3) COMMENT "line number (use decimals for multiple restock lines as single invoice line)",
  `InvcQtyOrd`  INT COMMENT "quantity ordered",
  `InvcQtySent` INT COMMENT "quantity shipped to us",
  `InvcDescr`   VARCHAR(255) COMMENT "description from invoice",

/* quantities - data from receiving the items */

  `QtyRecd`     INT COMMENT "quantity actually received",
  `QtyFiled`    INT COMMENT "quantity moved into stock",

/* cost information */

  `CostInvPer`  DECIMAL(9,2) COMMENT "invoiced per-item cost",
  `CostInvTot`  DECIMAL(9,2) COMMENT "invoice line total (CostExpPer x InvcQtySent) for this item",
  `CostActTot`  DECIMAL(9,2) COMMENT "actual (best) line total as used for reconciling",
  `CostActBal`  DECIMAL(9,2) COMMENT "running total, calculated from CostActTot",
  `Notes`       VARCHAR(255) COMMENT "human-entered notes on this line item",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>