WorkFerret/tables/invc line: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(Created page with '==About== * '''History''': ** '''2010-01-29''' Adapted from MS Access version ==SQL== <mysql>DROP TABLE IF EXISTS `session`; CREATE TABLE `session` ( `ID` INT(4) NOT…')
 
m (6 revisions imported: moving from htyp)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
==About==
==About==
* '''Fields''':
** '''WhenVoid''': timestamp for when this line was voided. If NULL, the line is active; otherwise, it should be ignored for most purposes (it may be displayed with a strikeout or other indication that it is inactive, but should not be included at all on customer-side output).
* '''History''':
* '''History''':
** '''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-11''' '''Rate''' field can now be NULL -- some invoice lines are just flat amounts
** '''2010-07-14''' Decided '''Notes''' field was necessary here so I can make notes if there are differences between the invoice and the original session record
** '''2011-12-01''' Added '''WhenVoid''' field
==SQL==
==SQL==
<mysql>DROP TABLE IF EXISTS `session`;
<mysql>DROP TABLE IF EXISTS `invc_line`;
CREATE TABLE  `session` (
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",
   `Date`       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)",
  `WhenVoid`  DATETIME    DEFAULT NULL COMMENT "timestamp for when this line was voided",
   `Qty`        FLOAT       DEFAULT NULL COMMENT "(optional) quantity of billable units",
   `What`      TEXT             NOT NULL COMMENT "what was done (may be text from several sessions combined)",
   `Unit`      VARCHAR(31) DEFAULT NULL COMMENT "(optional) description of unit -- typically 'hours'",
   `Qty`        FLOAT       DEFAULT NULL COMMENT "(optional) quantity of billable units",
   `Rate`      DECIMAL(9,2) NOT NULL COMMENT "$ per unit",
   `Unit`      VARCHAR(31) DEFAULT NULL COMMENT "(optional) description of unit -- typically 'hours'",
   `CostLine`  DECIMAL(9,2) NOT NULL COMMENT "$ for this line",
   `Rate`      DECIMAL(9,2) DEFAULT NULL COMMENT "$ per unit",
   `CostBal`    DECIMAL(9,2) NOT NULL COMMENT "$ total after this line is added",
   `CostLine`  DECIMAL(9,2)     NOT NULL COMMENT "$ for this line",
   `CostBal`    DECIMAL(9,2)     NOT NULL COMMENT "$ total after this line is added",
  `Notes`      VARCHAR(255) DEFAULT NULL COMMENT "human-entered notes",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
) ENGINE=MyISAM;</mysql>
) ENGINE=MyISAM;</mysql>

Latest revision as of 20:32, 1 May 2022

About

  • Fields:
    • WhenVoid: timestamp for when this line was voided. If NULL, the line is active; otherwise, it should be ignored for most purposes (it may be displayed with a strikeout or other indication that it is inactive, but should not be included at all on customer-side output).
  • 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 field can now be NULL -- some invoice lines are just flat amounts
    • 2010-07-14 Decided Notes field was necessary here so I can make notes if there are differences between the invoice and the original session record
    • 2011-12-01 Added WhenVoid field

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",
 `WhenVoid`   DATETIME     DEFAULT NULL COMMENT "timestamp for when this line was voided",
 `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",
 `Notes`      VARCHAR(255) DEFAULT NULL COMMENT "human-entered notes",
  PRIMARY KEY(`ID`)

) ENGINE=MyISAM;</mysql>