Skip to content
Tim Schofield edited this page Oct 11, 2024 · 2 revisions
  1. New budget system
  1. Synopsis

Currently the general ledger budgetting system is quite primitive. All you can do is enter a single amount against a GL code for a period. Thses amounts were stored in the chartdetails table.

  1. Solution

It is proposed to build a budget system where multiple budgets can be made for the same period, and different people can be assigned to manage them. For this we would need two new database tables.

CREATE TABLE IF NOT EXISTS `glbudgetheaders` (
`id` int(11) NOT NULL auto_increment,
`owner` varchar(20) NOT NULL DEFAULT ‘’,
`name` varchar(200) NOT NULL DEFAULT ’’,
`description` text,
`startperiod` smallint(6) NOT NULL DEFAULT 0,
`endperiod` smallint(6) NOT NULL DEFAULT 0,
`current` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
)

and

CREATE TABLE IF NOT EXISTS `glbudgetdetails` (
`id` int(11) NOT NULL auto_increment,
`headerid` int(11) NOT NULL DEFAULT 0,
`account` varchar(20) NOT NULL DEFAULT ’’,
`period` smallint(6) NOT NULL DEFAULT 0,
`amount` double NOT NULL DEFAULT 0.0,
PRIMARY KEY (`id`),
KEY (`account`),
KEY (`headerid`, `account`, `period`)
)

The first table holds the header details of each budget, input from the following

Then the second table holds individual budget amounts for each general ledger account. Input by

Clone this wiki locally