WorkFerret/tables/charge: Difference between revisions
< WorkFerret | tables
Jump to navigation
Jump to search
m (missing backtick) |
No edit summary |
||
Line 4: | Line 4: | ||
* '''2016-10-18''' initial design | * '''2016-10-18''' initial design | ||
* '''2016-10-19''' some more timestamps | * '''2016-10-19''' some more timestamps | ||
* '''2016-10-20''' void timestamp | |||
==SQL== | ==SQL== | ||
<mysql>CREATE TABLE `charge` ( | <mysql>CREATE TABLE `charge` ( | ||
Line 11: | Line 12: | ||
`WhenEdited` DATETIME DEFAULT NULL COMMENT "when this record was last edited", | `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 | `WhenConfirm` DATETIME DEFAULT NULL COMMENT "when this charge was confirmed", | ||
`WhenVoided` DATETIME DEFAULT NULL COMMENT "when this charge was voided", | |||
`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 20:22, 20 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
- 2016-10-20 void timestamp
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 this charge was confirmed", `WhenVoided` DATETIME DEFAULT NULL COMMENT "when this charge was voided", `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>