Should have checked this as part of the last commit (r152), since it is the DB schema changes necessary to support the reconciliation work. Also, the sitelink script was modified to match.
git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@153 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -838,6 +838,17 @@ CREATE TABLE `pmgr_accounts` (
|
||||
'INCOME',
|
||||
'EXPENSE')
|
||||
NOT NULL DEFAULT 'ASSET',
|
||||
|
||||
-- Accounts Receivable / Accounts Payable
|
||||
-- If this is a trackable account, any credit posted
|
||||
-- to an ASSET OR EXPENSE account should have an
|
||||
-- entry posted to the reconciliations table (unless
|
||||
-- it is a "pre-payment" of sorts, in which case the
|
||||
-- reconciliation will have to wait for the debit).
|
||||
-- For LIABILITY, EQUITY, and INCOME, the opposite
|
||||
-- is true, with reconciliations posted, under
|
||||
-- normal circumstances, when a debit occurs.
|
||||
`trackable` INT UNSIGNED DEFAULT 0,
|
||||
|
||||
-- Security Level
|
||||
`level` INT UNSIGNED DEFAULT 1,
|
||||
@@ -852,17 +863,17 @@ CREATE TABLE `pmgr_accounts` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
LOCK TABLES `pmgr_accounts` WRITE;
|
||||
INSERT INTO `pmgr_accounts` (`type`, `name`)
|
||||
INSERT INTO `pmgr_accounts` (`type`, `name`, `trackable`)
|
||||
VALUES
|
||||
('ASSET', 'A/R'),
|
||||
('LIABILITY', 'A/P'),
|
||||
('LIABILITY', 'Tax'),
|
||||
('LIABILITY', 'Customer Credit'),
|
||||
('ASSET', 'Bank'),
|
||||
('ASSET', 'Cash'),
|
||||
('LIABILITY', 'Security Deposit'),
|
||||
('INCOME', 'Rent'),
|
||||
('INCOME', 'Late Charge');
|
||||
('ASSET', 'A/R', 1),
|
||||
('LIABILITY', 'A/P', 1),
|
||||
('LIABILITY', 'Tax', 0),
|
||||
('LIABILITY', 'Customer Credit', 1),
|
||||
('ASSET', 'Bank', 0),
|
||||
('ASSET', 'Cash', 0),
|
||||
('LIABILITY', 'Security Deposit', 1),
|
||||
('INCOME', 'Rent', 0),
|
||||
('INCOME', 'Late Charge', 0);
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
@@ -901,9 +912,8 @@ CREATE TABLE `pmgr_ledgers` (
|
||||
-- to add several parameters indicating the period
|
||||
-- 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,
|
||||
`sequence` INT(10) UNSIGNED DEFAULT 1,
|
||||
`closed` INT UNSIGNED DEFAULT 0,
|
||||
|
||||
-- REVISIT <AP>: 20090607
|
||||
@@ -965,6 +975,22 @@ CREATE TABLE `pmgr_ledger_entries` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- ----------------------------------------------------------------------
|
||||
-- TABLE pmgr_reconciliations
|
||||
|
||||
DROP TABLE IF EXISTS `pmgr_reconciliations`;
|
||||
CREATE TABLE `pmgr_reconciliations` (
|
||||
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
|
||||
`debit_ledger_entry_id` INT(10) UNSIGNED NOT NULL,
|
||||
`credit_ledger_entry_id` INT(10) UNSIGNED NOT NULL,
|
||||
`amount` FLOAT(12,2) NOT NULL,
|
||||
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- ----------------------------------------------------------------------
|
||||
-- TABLE pmgr_monetary_sources
|
||||
|
||||
Reference in New Issue
Block a user