diff --git a/db/schema.sql b/db/schema.sql index d32a099..52d4f6b 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -945,6 +945,66 @@ CREATE TABLE `pmgr_payments` ( +-- ###################################################################### +-- ###################################################################### +-- ###################################################################### +-- ###################################################################### +-- ###################################################################### +-- ###################################################################### +-- ###################################################################### +-- ###################################################################### +-- ###################################################################### +-- ## +-- ## CREDITS +-- ## + + +-- ---------------------------------------------------------------------- +-- ---------------------------------------------------------------------- +-- TABLE pmgr_credit_types + +-- DROP TABLE IF EXISTS `pmgr_credit_types`; +-- CREATE TABLE `pmgr_credit_types` ( +-- `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + +-- `name` VARCHAR(80) NOT NULL, +-- `comment` VARCHAR(255) DEFAULT NULL, +-- `account_id` INT(10) UNSIGNED NOT NULL, -- quickbooks tracking + +-- PRIMARY KEY (`id`) +-- ) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- LOCK TABLES `pmgr_credit_types` WRITE; +-- INSERT INTO `pmgr_credit_types` (`id`, `name`, `account_id`) +-- VALUES +-- (1, 'Security Deposit', 0), +-- (2, 'Rent', 0), +-- (3, 'Late Credit', 0); +-- UNLOCK TABLES; + + +-- ---------------------------------------------------------------------- +-- ---------------------------------------------------------------------- +-- TABLE pmgr_credits + +DROP TABLE IF EXISTS `pmgr_credits`; +CREATE TABLE `pmgr_credits` ( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + + -- `credit_type_id` INT(10) UNSIGNED NOT NULL, + `lease_id` INT(10) UNSIGNED NOT NULL, + `credit_date` DATE NOT NULL, + `credit_to_date` DATE DEFAULT NULL, + `due_date` DATE DEFAULT NULL, + `amount` FLOAT(12,2) NOT NULL, + `tax` FLOAT(12,2) NOT NULL, + `total` FLOAT(12,2) NOT NULL, + `comment` VARCHAR(255) DEFAULT NULL, + + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + -- ###################################################################### -- ###################################################################### -- ######################################################################