From faf7e94d5a3e5b7adb8f705f315aaca041276900 Mon Sep 17 00:00:00 2001 From: anuko Date: Sun, 12 Feb 2017 14:44:49 +0000 Subject: [PATCH] Work in progress on predefined expenses. --- WEB-INF/templates/footer.tpl | 2 +- dbinstall.php | 1 + mysql.sql | 14 +++++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 19dc42f9..e108eb66 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.37.3572 | Copyright © Anuko | +  Anuko Time Tracker 1.9.37.3573 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/dbinstall.php b/dbinstall.php index 0aaa8b49..ac88bc42 100755 --- a/dbinstall.php +++ b/dbinstall.php @@ -635,6 +635,7 @@ if ($_POST) { setChange("RENAME TABLE tt_monthly_quota TO tt_monthly_quotas"); setChange("ALTER TABLE tt_expense_items modify `name` text NOT NULL"); setChange("ALTER TABLE `tt_teams` ADD `uncompleted_indicators` SMALLINT(2) NOT NULL DEFAULT '0' AFTER `record_type`"); + setChange("CREATE TABLE `tt_predefined_expenses` (`id` int(11) NOT NULL auto_increment, `team_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `cost` decimal(10,2) default '0.00', PRIMARY KEY (`id`))"); } // The update_clients function updates projects field in tt_clients table. diff --git a/mysql.sql b/mysql.sql index a951a054..d8294b2c 100644 --- a/mysql.sql +++ b/mysql.sql @@ -342,6 +342,19 @@ create index project_idx on tt_expense_items(project_id); create index invoice_idx on tt_expense_items(invoice_id); +# +# Structure for table tt_predefined_expenses. +# This table keeps names and costs for predefined expenses. +# +CREATE TABLE `tt_predefined_expenses` ( + `id` int(11) NOT NULL auto_increment, # predefined expense id + `team_id` int(11) NOT NULL, # team id + `name` varchar(255) NOT NULL, # predefined expense name, such as mileage + `cost` decimal(10,2) default '0.00', # cost for one unit + PRIMARY KEY (`id`) +); + + # # Structure for table tt_monthly_quotas. # This table keeps monthly work hour quotas for teams. @@ -356,4 +369,3 @@ CREATE TABLE `tt_monthly_quotas` ( ALTER TABLE `tt_monthly_quotas` ADD CONSTRAINT `FK_TT_TEAM_CONSTRAING` FOREIGN KEY (`team_id`) REFERENCES `tt_teams` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; - -- 2.20.1