WorkFerret/tables/charge: Difference between revisions
< WorkFerret | tables
Jump to navigation
Jump to search
(Created page with "==About== * '''Purpose''': Tracks charges to clients and amounts received in payment, making it possible to generate statements. ==History== * '''2016-10-18''' initial design...") |
(more timestamps) |
||
Line 3: | Line 3: | ||
==History== | ==History== | ||
* '''2016-10-18''' initial design | * '''2016-10-18''' initial design | ||
* '''2016-10-19''' some more timestamps | |||
==SQL== | ==SQL== | ||
<mysql>CREATE TABLE `charge` ( | <mysql>CREATE TABLE `charge` ( | ||
`ID` INT(4) NOT NULL AUTO_INCREMENT, | `ID` INT(4) NOT NULL AUTO_INCREMENT, | ||
`ID_Proj` INT(4) NOT NULL COMMENT "Project to which this session applies", | `ID_Proj` INT(4) NOT NULL COMMENT "Project to which this session applies", | ||
`WhenCreated` DATETIME NOT NULL COMMENT "when this record was created", | |||
`WhenEdited` DATETIME DEFAULT NULL COMMENT "when this record was last edited", | |||
`WhenEffect` DATETIME NOT NULL COMMENT "effective date of the charge", | `WhenEffect` DATETIME NOT NULL COMMENT "effective date of the charge", | ||
`WhenConfirm DATETIME DEFAULT NULL COMMENT "when the charge was confirmed", | |||
`Amount` DECIMAL(9,2) NOT NULL COMMENT "charge amount (neg = owed to us, pos = payment to us)", | `Amount` DECIMAL(9,2) NOT NULL COMMENT "charge amount (neg = owed to us, pos = payment to us)", | ||
`Sort` DECIMAL(7,4) DEFAULT NULL COMMENT "sorting order for multiple charges on same date", | `Sort` DECIMAL(7,4) DEFAULT NULL COMMENT "sorting order for multiple charges on same date", |
Revision as of 11:31, 19 October 2016
About
- Purpose: Tracks charges to clients and amounts received in payment, making it possible to generate statements.
History
- 2016-10-18 initial design
- 2016-10-19 some more timestamps
SQL
<mysql>CREATE TABLE `charge` (
`ID` INT(4) NOT NULL AUTO_INCREMENT, `ID_Proj` INT(4) NOT NULL COMMENT "Project to which this session applies", `WhenCreated` DATETIME NOT NULL COMMENT "when this record was created", `WhenEdited` DATETIME DEFAULT NULL COMMENT "when this record was last edited", `WhenEffect` DATETIME NOT NULL COMMENT "effective date of the charge", `WhenConfirm DATETIME DEFAULT NULL COMMENT "when the charge was confirmed", `Amount` DECIMAL(9,2) NOT NULL COMMENT "charge amount (neg = owed to us, pos = payment to us)", `Sort` DECIMAL(7,4) DEFAULT NULL COMMENT "sorting order for multiple charges on same date", `Code` VARCHAR(255) DEFAULT NULL COMMENT "identifying numbers, with a prefix (CHK, INVC...)", `ID_Invc` INT(4) DEFAULT NULL COMMENT "invoice ID, where applicable", `Descr` TEXT DEFAULT NULL COMMENT "charge summary, for statements", `Notes` TEXT DEFAULT NULL COMMENT "internal notes, for reference", PRIMARY KEY(`ID`)
) ENGINE=InnoDB;</mysql>