More changes to how accounts/ledgers/transactions are all handled.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@78 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -632,6 +632,8 @@ CREATE TABLE `pmgr_customers` (
|
||||
`name` VARCHAR(80) NOT NULL,
|
||||
`comment` VARCHAR(255) DEFAULT NULL,
|
||||
|
||||
`account_id` INT(10) UNSIGNED NOT NULL,
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
@@ -689,6 +691,7 @@ CREATE TABLE `pmgr_leases` (
|
||||
`lease_type_id` INT(10) UNSIGNED NOT NULL,
|
||||
`unit_id` INT(10) UNSIGNED NOT NULL,
|
||||
`customer_id` INT(10) UNSIGNED NOT NULL,
|
||||
`account_id` INT(10) UNSIGNED NOT NULL,
|
||||
`late_schedule_id` INT(10) UNSIGNED DEFAULT NULL,
|
||||
|
||||
`lease_date` DATE NOT NULL,
|
||||
@@ -832,17 +835,17 @@ CREATE TABLE `pmgr_accounts` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
LOCK TABLES `pmgr_accounts` WRITE;
|
||||
INSERT INTO `pmgr_accounts` (`id`, `type`, `name`)
|
||||
INSERT INTO `pmgr_accounts` (`type`, `name`)
|
||||
VALUES
|
||||
(1, 'ASSET', 'A/R'),
|
||||
(2, 'LIABILITY', 'A/P'),
|
||||
(3, 'LIABILITY', 'Tax'),
|
||||
(4, 'LIABILITY', 'Customer Credit'),
|
||||
(5, 'ASSET', 'Bank'),
|
||||
(6, 'ASSET', 'Cash'),
|
||||
(7, 'LIABILITY', 'Security Deposit'),
|
||||
(8, 'INCOME', 'Rent'),
|
||||
(9, 'INCOME', 'Late Charge');
|
||||
('ASSET', 'A/R'),
|
||||
('LIABILITY', 'A/P'),
|
||||
('LIABILITY', 'Tax'),
|
||||
('LIABILITY', 'Customer Credit'),
|
||||
('ASSET', 'Bank'),
|
||||
('ASSET', 'Cash'),
|
||||
('LIABILITY', 'Security Deposit'),
|
||||
('INCOME', 'Rent'),
|
||||
('INCOME', 'Late Charge');
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -882,9 +885,18 @@ CREATE TABLE `pmgr_ledgers` (
|
||||
-- this particular ledger is valid and so on.
|
||||
|
||||
`name` VARCHAR(80) DEFAULT NULL,
|
||||
`sequence` INT(10) UNSIGNED DEFAULT 1,
|
||||
`account_id` INT(10) UNSIGNED NOT NULL,
|
||||
`closed` INT UNSIGNED DEFAULT 0,
|
||||
|
||||
-- REVISIT <AP>: 20090607
|
||||
-- Probably, a single close should have the ability to close
|
||||
-- many different account ledgers. For now, just timestamping.
|
||||
-- `close_id` INT(10) UNSIGNED NOT NULL,
|
||||
|
||||
`open_stamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`close_stamp` DATETIME DEFAULT NULL,
|
||||
|
||||
`comment` VARCHAR(255) DEFAULT NULL,
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
@@ -903,13 +915,6 @@ CREATE TABLE `pmgr_transactions` (
|
||||
`through_date` DATE DEFAULT NULL,
|
||||
`due_date` DATE DEFAULT NULL,
|
||||
|
||||
-- REVISIT <AP>: 20090604
|
||||
-- It really seems this is too restrictive. One tenant
|
||||
-- should be able to, within a single transaction, pay
|
||||
-- for their own charges and another tenant's as well.
|
||||
-- customer_id may need to move to ledger_entries
|
||||
`customer_id` INT(10) UNSIGNED NOT NULL,
|
||||
|
||||
-- REVISIT <AP>: 20090604
|
||||
-- How should we track which charges have been paid?
|
||||
-- `related_transaction_id` INT(10) UNSIGNED NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user