WorkFerret/tables/invc line: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(Date->LineDate)
("Rate" can be NULL)
Line 3: Line 3:
** '''2010-01-29''' Adapted from MS Access version
** '''2010-01-29''' Adapted from MS Access version
** '''2010-02-10''' "Date" is a keyword, which messes things up, so changing "Date" field to "LineDate"
** '''2010-02-10''' "Date" is a keyword, which messes things up, so changing "Date" field to "LineDate"
** '''2010-02-11''' "Rate" can be NULL -- some invoice lines are just flat amounts
==SQL==
==SQL==
<mysql>DROP TABLE IF EXISTS `invc_line`;
<mysql>DROP TABLE IF EXISTS `invc_line`;
CREATE TABLE  `invc_line` (
CREATE TABLE  `invc_line` (
   `ID`        INT(4)   NOT NULL AUTO_INCREMENT,
   `ID`        INT(4)           NOT NULL AUTO_INCREMENT,
   `ID_Invc`    INT(4)   NOT NULL COMMENT "Invoice to which this line belongs",
   `ID_Invc`    INT(4)           NOT NULL COMMENT "Invoice to which this line belongs",
   `Seq`        INT(4)   NOT NULL COMMENT "order in which this line was presented/added",
   `Seq`        INT(4)           NOT NULL COMMENT "order in which this line was presented/added",
   `LineDate`  DATETIME NOT NULL COMMENT "date which applies to this line",
   `LineDate`  DATETIME         NOT NULL COMMENT "date which applies to this line",
   `What`      TEXT     NOT NULL COMMENT "what was done (may be text from several sessions combined)",
   `What`      TEXT             NOT NULL COMMENT "what was done (may be text from several sessions combined)",
   `Qty`        FLOAT       DEFAULT NULL COMMENT "(optional) quantity of billable units",
   `Qty`        FLOAT       DEFAULT NULL COMMENT "(optional) quantity of billable units",
   `Unit`      VARCHAR(31) DEFAULT NULL COMMENT "(optional) description of unit -- typically 'hours'",
   `Unit`      VARCHAR(31) DEFAULT NULL COMMENT "(optional) description of unit -- typically 'hours'",
   `Rate`      DECIMAL(9,2) NOT NULL COMMENT "$ per unit",
   `Rate`      DECIMAL(9,2) DEFAULT NULL COMMENT "$ per unit",
   `CostLine`  DECIMAL(9,2) NOT NULL COMMENT "$ for this line",
   `CostLine`  DECIMAL(9,2)     NOT NULL COMMENT "$ for this line",
   `CostBal`    DECIMAL(9,2) NOT NULL COMMENT "$ total after this line is added",
   `CostBal`    DECIMAL(9,2)     NOT NULL COMMENT "$ total after this line is added",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
) ENGINE=MyISAM;</mysql>
) ENGINE=MyISAM;</mysql>

Revision as of 19:58, 11 February 2010

About

  • History:
    • 2010-01-29 Adapted from MS Access version
    • 2010-02-10 "Date" is a keyword, which messes things up, so changing "Date" field to "LineDate"
    • 2010-02-11 "Rate" can be NULL -- some invoice lines are just flat amounts

SQL

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

 `ID`         INT(4)           NOT NULL AUTO_INCREMENT,
 `ID_Invc`    INT(4)           NOT NULL COMMENT "Invoice to which this line belongs",
 `Seq`        INT(4)           NOT NULL COMMENT "order in which this line was presented/added",
 `LineDate`   DATETIME         NOT NULL COMMENT "date which applies to this line",
 `What`       TEXT             NOT NULL COMMENT "what was done (may be text from several sessions combined)",
 `Qty`        FLOAT        DEFAULT NULL COMMENT "(optional) quantity of billable units",
 `Unit`       VARCHAR(31)  DEFAULT NULL COMMENT "(optional) description of unit -- typically 'hours'",
 `Rate`       DECIMAL(9,2) DEFAULT NULL COMMENT "$ per unit",
 `CostLine`   DECIMAL(9,2)     NOT NULL COMMENT "$ for this line",
 `CostBal`    DECIMAL(9,2)     NOT NULL COMMENT "$ total after this line is added",
  PRIMARY KEY(`ID`)

) ENGINE=MyISAM;</mysql>