Merge branch 'release/3.2.3'
@ -35,12 +35,13 @@ Everything is organised:
|
||||
- Easy navigation through your records;
|
||||
- Browse back and forth to see previous months or even years;
|
||||
- Lots of charts because we all love them.
|
||||
- Financial reporting showing you how well you are doing;
|
||||
|
||||
## Changes
|
||||
|
||||
Firefly III will feature, but does not feature yet:
|
||||
|
||||
- Financial reporting showing you how well you are doing;
|
||||
|
||||
- More control over other resources outside of personal finance
|
||||
- Accounts shared with a partner (household accounts)
|
||||
- Debts
|
||||
|
606
_sql/firefly-iii-reference-3.2.2.sql
Normal file
@ -0,0 +1,606 @@
|
||||
# ************************************************************
|
||||
# Sequel Pro SQL dump
|
||||
# Version 4096
|
||||
#
|
||||
# http://www.sequelpro.com/
|
||||
# http://code.google.com/p/sequel-pro/
|
||||
#
|
||||
# Host: 127.0.0.1 (MySQL 5.6.19-0ubuntu0.14.04.1)
|
||||
# Database: homestead
|
||||
# Generation Time: 2015-01-02 19:01:30 +0000
|
||||
# ************************************************************
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
|
||||
# Dump of table account_meta
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `account_meta`;
|
||||
|
||||
CREATE TABLE `account_meta` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`account_id` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`data` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `account_meta_account_id_name_unique` (`account_id`,`name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table account_types
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `account_types`;
|
||||
|
||||
CREATE TABLE `account_types` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`type` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`editable` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `account_types_type_unique` (`type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
LOCK TABLES `account_types` WRITE;
|
||||
/*!40000 ALTER TABLE `account_types` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `account_types` (`id`, `created_at`, `updated_at`, `type`, `editable`)
|
||||
VALUES
|
||||
(1,'2015-01-02 19:00:13','2015-01-02 19:00:13','Default account',1),
|
||||
(2,'2015-01-02 19:00:13','2015-01-02 19:00:13','Cash account',0),
|
||||
(3,'2015-01-02 19:00:13','2015-01-02 19:00:13','Asset account',1),
|
||||
(4,'2015-01-02 19:00:13','2015-01-02 19:00:13','Expense account',1),
|
||||
(5,'2015-01-02 19:00:13','2015-01-02 19:00:13','Revenue account',1),
|
||||
(6,'2015-01-02 19:00:13','2015-01-02 19:00:13','Initial balance account',0),
|
||||
(7,'2015-01-02 19:00:13','2015-01-02 19:00:13','Beneficiary account',1),
|
||||
(8,'2015-01-02 19:00:13','2015-01-02 19:00:13','Import account',0);
|
||||
|
||||
/*!40000 ALTER TABLE `account_types` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Dump of table accounts
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `accounts`;
|
||||
|
||||
CREATE TABLE `accounts` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`account_type_id` int(10) unsigned NOT NULL,
|
||||
`name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `accounts_user_id_account_type_id_name_unique` (`user_id`,`account_type_id`,`name`),
|
||||
KEY `accounts_account_type_id_foreign` (`account_type_id`),
|
||||
CONSTRAINT `accounts_account_type_id_foreign` FOREIGN KEY (`account_type_id`) REFERENCES `account_types` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `accounts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table bills
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `bills`;
|
||||
|
||||
CREATE TABLE `bills` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`match` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`amount_min` decimal(10,2) NOT NULL,
|
||||
`amount_max` decimal(10,2) NOT NULL,
|
||||
`date` date NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`automatch` tinyint(1) NOT NULL,
|
||||
`repeat_freq` enum('daily','weekly','monthly','quarterly','half-year','yearly') COLLATE utf8_unicode_ci NOT NULL,
|
||||
`skip` smallint(5) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `uid_name_unique` (`user_id`,`name`),
|
||||
CONSTRAINT `bills_uid_for` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table budget_limits
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `budget_limits`;
|
||||
|
||||
CREATE TABLE `budget_limits` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`budget_id` int(10) unsigned DEFAULT NULL,
|
||||
`startdate` date NOT NULL,
|
||||
`amount` decimal(10,2) NOT NULL,
|
||||
`repeats` tinyint(1) NOT NULL,
|
||||
`repeat_freq` enum('daily','weekly','monthly','quarterly','half-year','yearly') COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `unique_ci_combi` (`startdate`,`repeat_freq`),
|
||||
UNIQUE KEY `unique_bl_combi` (`budget_id`,`startdate`,`repeat_freq`),
|
||||
CONSTRAINT `bid_foreign` FOREIGN KEY (`budget_id`) REFERENCES `budgets` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table budget_transaction_journal
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `budget_transaction_journal`;
|
||||
|
||||
CREATE TABLE `budget_transaction_journal` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`budget_id` int(10) unsigned NOT NULL,
|
||||
`transaction_journal_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `budid_tjid_unique` (`budget_id`,`transaction_journal_id`),
|
||||
KEY `budget_transaction_journal_transaction_journal_id_foreign` (`transaction_journal_id`),
|
||||
CONSTRAINT `budget_transaction_journal_transaction_journal_id_foreign` FOREIGN KEY (`transaction_journal_id`) REFERENCES `transaction_journals` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `budget_transaction_journal_budget_id_foreign` FOREIGN KEY (`budget_id`) REFERENCES `budgets` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table budgets
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `budgets`;
|
||||
|
||||
CREATE TABLE `budgets` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `budgets_user_id_name_unique` (`user_id`,`name`),
|
||||
CONSTRAINT `budgets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table categories
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `categories`;
|
||||
|
||||
CREATE TABLE `categories` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `categories_user_id_name_unique` (`user_id`,`name`),
|
||||
CONSTRAINT `categories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table category_transaction_journal
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `category_transaction_journal`;
|
||||
|
||||
CREATE TABLE `category_transaction_journal` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`category_id` int(10) unsigned NOT NULL,
|
||||
`transaction_journal_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `catid_tjid_unique` (`category_id`,`transaction_journal_id`),
|
||||
KEY `category_transaction_journal_transaction_journal_id_foreign` (`transaction_journal_id`),
|
||||
CONSTRAINT `category_transaction_journal_transaction_journal_id_foreign` FOREIGN KEY (`transaction_journal_id`) REFERENCES `transaction_journals` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `category_transaction_journal_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table components
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `components`;
|
||||
|
||||
CREATE TABLE `components` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`class` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `components_user_id_class_name_unique` (`user_id`,`class`,`name`),
|
||||
CONSTRAINT `components_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table limit_repetitions
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `limit_repetitions`;
|
||||
|
||||
CREATE TABLE `limit_repetitions` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`budget_limit_id` int(10) unsigned NOT NULL,
|
||||
`startdate` date NOT NULL,
|
||||
`enddate` date NOT NULL,
|
||||
`amount` decimal(10,2) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `limit_repetitions_limit_id_startdate_enddate_unique` (`budget_limit_id`,`startdate`,`enddate`),
|
||||
CONSTRAINT `limit_repetitions_limit_id_foreign` FOREIGN KEY (`budget_limit_id`) REFERENCES `budget_limits` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table migrations
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `migrations`;
|
||||
|
||||
CREATE TABLE `migrations` (
|
||||
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`batch` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
LOCK TABLES `migrations` WRITE;
|
||||
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `migrations` (`migration`, `batch`)
|
||||
VALUES
|
||||
('2014_06_27_163032_create_users_table',1),
|
||||
('2014_06_27_163145_create_account_types_table',1),
|
||||
('2014_06_27_163259_create_accounts_table',1),
|
||||
('2014_06_27_163817_create_components_table',1),
|
||||
('2014_06_27_163818_create_piggybanks_table',1),
|
||||
('2014_06_27_164042_create_transaction_currencies_table',1),
|
||||
('2014_06_27_164512_create_transaction_types_table',1),
|
||||
('2014_06_27_164619_create_recurring_transactions_table',1),
|
||||
('2014_06_27_164620_create_transaction_journals_table',1),
|
||||
('2014_06_27_164836_create_transactions_table',1),
|
||||
('2014_06_27_165344_create_component_transaction_table',1),
|
||||
('2014_07_05_171326_create_component_transaction_journal_table',1),
|
||||
('2014_07_06_123842_create_preferences_table',1),
|
||||
('2014_07_09_204843_create_session_table',1),
|
||||
('2014_07_17_183717_create_limits_table',1),
|
||||
('2014_07_19_055011_create_limit_repeat_table',1),
|
||||
('2014_08_06_044416_create_component_recurring_transaction_table',1),
|
||||
('2014_08_12_173919_create_piggybank_repetitions_table',1),
|
||||
('2014_08_18_100330_create_piggybank_events_table',1),
|
||||
('2014_08_23_113221_create_reminders_table',1),
|
||||
('2014_11_10_172053_create_account_meta_table',1),
|
||||
('2014_11_29_135749_create_transaction_groups_table',1),
|
||||
('2014_11_29_140217_create_transaction_group_transaction_journal_table',1),
|
||||
('2014_12_13_190730_changes_for_v321',1),
|
||||
('2014_12_24_191544_changes_for_v322',1);
|
||||
|
||||
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Dump of table piggy_bank_events
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `piggy_bank_events`;
|
||||
|
||||
CREATE TABLE `piggy_bank_events` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`piggy_bank_id` int(10) unsigned NOT NULL,
|
||||
`transaction_journal_id` int(10) unsigned DEFAULT NULL,
|
||||
`date` date NOT NULL,
|
||||
`amount` decimal(10,2) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `piggybank_events_piggybank_id_foreign` (`piggy_bank_id`),
|
||||
KEY `piggybank_events_transaction_journal_id_foreign` (`transaction_journal_id`),
|
||||
CONSTRAINT `piggybank_events_transaction_journal_id_foreign` FOREIGN KEY (`transaction_journal_id`) REFERENCES `transaction_journals` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `piggybank_events_piggybank_id_foreign` FOREIGN KEY (`piggy_bank_id`) REFERENCES `piggy_banks` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table piggy_bank_repetitions
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `piggy_bank_repetitions`;
|
||||
|
||||
CREATE TABLE `piggy_bank_repetitions` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`piggy_bank_id` int(10) unsigned NOT NULL,
|
||||
`startdate` date DEFAULT NULL,
|
||||
`targetdate` date DEFAULT NULL,
|
||||
`currentamount` decimal(10,2) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `piggybank_repetitions_piggybank_id_startdate_targetdate_unique` (`piggy_bank_id`,`startdate`,`targetdate`),
|
||||
CONSTRAINT `piggybank_repetitions_piggybank_id_foreign` FOREIGN KEY (`piggy_bank_id`) REFERENCES `piggy_banks` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table piggy_banks
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `piggy_banks`;
|
||||
|
||||
CREATE TABLE `piggy_banks` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`account_id` int(10) unsigned NOT NULL,
|
||||
`name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`targetamount` decimal(10,2) NOT NULL,
|
||||
`startdate` date DEFAULT NULL,
|
||||
`targetdate` date DEFAULT NULL,
|
||||
`repeats` tinyint(1) NOT NULL,
|
||||
`rep_length` enum('day','week','quarter','month','year') COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
`rep_every` smallint(5) unsigned NOT NULL,
|
||||
`rep_times` smallint(5) unsigned DEFAULT NULL,
|
||||
`reminder` enum('day','week','quarter','month','year') COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
`reminder_skip` smallint(5) unsigned NOT NULL,
|
||||
`remind_me` tinyint(1) NOT NULL,
|
||||
`order` int(10) unsigned NOT NULL,
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `piggybanks_account_id_name_unique` (`account_id`,`name`),
|
||||
CONSTRAINT `piggybanks_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table preferences
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `preferences`;
|
||||
|
||||
CREATE TABLE `preferences` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`data` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `preferences_user_id_name_unique` (`user_id`,`name`),
|
||||
CONSTRAINT `preferences_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table reminders
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `reminders`;
|
||||
|
||||
CREATE TABLE `reminders` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`startdate` date NOT NULL,
|
||||
`enddate` date DEFAULT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`notnow` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`remindersable_id` int(10) unsigned DEFAULT NULL,
|
||||
`remindersable_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `reminders_user_id_foreign` (`user_id`),
|
||||
CONSTRAINT `reminders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table sessions
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `sessions`;
|
||||
|
||||
CREATE TABLE `sessions` (
|
||||
`id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`payload` text COLLATE utf8_unicode_ci NOT NULL,
|
||||
`last_activity` int(11) NOT NULL,
|
||||
UNIQUE KEY `sessions_id_unique` (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table transaction_currencies
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `transaction_currencies`;
|
||||
|
||||
CREATE TABLE `transaction_currencies` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`code` varchar(3) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`name` varchar(48) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
`symbol` varchar(8) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `transaction_currencies_code_unique` (`code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
LOCK TABLES `transaction_currencies` WRITE;
|
||||
/*!40000 ALTER TABLE `transaction_currencies` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `transaction_currencies` (`id`, `created_at`, `updated_at`, `deleted_at`, `code`, `name`, `symbol`)
|
||||
VALUES
|
||||
(1,'2015-01-02 19:00:13','2015-01-02 19:00:13',NULL,'EUR','Euro','€'),
|
||||
(2,'2015-01-02 19:00:13','2015-01-02 19:00:13',NULL,'USD','US Dollar','$'),
|
||||
(3,'2015-01-02 19:00:13','2015-01-02 19:00:13',NULL,'HUF','Hungarian forint','Ft');
|
||||
|
||||
/*!40000 ALTER TABLE `transaction_currencies` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Dump of table transaction_group_transaction_journal
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `transaction_group_transaction_journal`;
|
||||
|
||||
CREATE TABLE `transaction_group_transaction_journal` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`transaction_group_id` int(10) unsigned NOT NULL,
|
||||
`transaction_journal_id` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `tt_joined` (`transaction_group_id`,`transaction_journal_id`),
|
||||
KEY `tr_trj_id` (`transaction_journal_id`),
|
||||
CONSTRAINT `tr_trj_id` FOREIGN KEY (`transaction_journal_id`) REFERENCES `transaction_journals` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `tr_grp_id` FOREIGN KEY (`transaction_group_id`) REFERENCES `transaction_groups` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table transaction_groups
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `transaction_groups`;
|
||||
|
||||
CREATE TABLE `transaction_groups` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`relation` enum('balance') COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `transaction_groups_user_id_foreign` (`user_id`),
|
||||
CONSTRAINT `transaction_groups_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table transaction_journals
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `transaction_journals`;
|
||||
|
||||
CREATE TABLE `transaction_journals` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`transaction_type_id` int(10) unsigned NOT NULL,
|
||||
`bill_id` int(10) unsigned DEFAULT NULL,
|
||||
`transaction_currency_id` int(10) unsigned NOT NULL,
|
||||
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
`completed` tinyint(1) NOT NULL,
|
||||
`date` date NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `transaction_journals_user_id_foreign` (`user_id`),
|
||||
KEY `transaction_journals_transaction_type_id_foreign` (`transaction_type_id`),
|
||||
KEY `transaction_journals_transaction_currency_id_foreign` (`transaction_currency_id`),
|
||||
KEY `bill_id_foreign` (`bill_id`),
|
||||
CONSTRAINT `bill_id_foreign` FOREIGN KEY (`bill_id`) REFERENCES `bills` (`id`) ON DELETE SET NULL,
|
||||
CONSTRAINT `transaction_journals_transaction_currency_id_foreign` FOREIGN KEY (`transaction_currency_id`) REFERENCES `transaction_currencies` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `transaction_journals_transaction_type_id_foreign` FOREIGN KEY (`transaction_type_id`) REFERENCES `transaction_types` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `transaction_journals_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table transaction_types
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `transaction_types`;
|
||||
|
||||
CREATE TABLE `transaction_types` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `transaction_types_type_unique` (`type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
LOCK TABLES `transaction_types` WRITE;
|
||||
/*!40000 ALTER TABLE `transaction_types` DISABLE KEYS */;
|
||||
|
||||
INSERT INTO `transaction_types` (`id`, `created_at`, `updated_at`, `deleted_at`, `type`)
|
||||
VALUES
|
||||
(1,'2015-01-02 19:00:13','2015-01-02 19:00:13',NULL,'Withdrawal'),
|
||||
(2,'2015-01-02 19:00:13','2015-01-02 19:00:13',NULL,'Deposit'),
|
||||
(3,'2015-01-02 19:00:13','2015-01-02 19:00:13',NULL,'Transfer'),
|
||||
(4,'2015-01-02 19:00:13','2015-01-02 19:00:13',NULL,'Opening balance');
|
||||
|
||||
/*!40000 ALTER TABLE `transaction_types` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
||||
# Dump of table transactions
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `transactions`;
|
||||
|
||||
CREATE TABLE `transactions` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`deleted_at` timestamp NULL DEFAULT NULL,
|
||||
`account_id` int(10) unsigned NOT NULL,
|
||||
`transaction_journal_id` int(10) unsigned NOT NULL,
|
||||
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
`amount` decimal(10,2) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `transactions_account_id_foreign` (`account_id`),
|
||||
KEY `transactions_transaction_journal_id_foreign` (`transaction_journal_id`),
|
||||
CONSTRAINT `transactions_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `transactions_transaction_journal_id_foreign` FOREIGN KEY (`transaction_journal_id`) REFERENCES `transaction_journals` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
# Dump of table users
|
||||
# ------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `users`;
|
||||
|
||||
CREATE TABLE `users` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`email` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`password` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`reset` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
`remember_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `users_email_unique` (`email`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
|
||||
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
@ -124,6 +124,19 @@ class BudgetController extends BaseController
|
||||
return View::make('budgets.index', compact('budgetMaximum', 'budgets', 'spent', 'spentPCT', 'overspent', 'amount'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function noBudget()
|
||||
{
|
||||
$start = \Session::get('start', Carbon::now()->startOfMonth());
|
||||
$end = \Session::get('end', Carbon::now()->startOfMonth());
|
||||
$list = $this->_repository->journalsNoBudget($start, $end);
|
||||
$subTitle = 'Transactions without a budget in ' . $start->format('F Y');
|
||||
|
||||
return View::make('budgets.noBudget', compact('list', 'subTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
@ -189,7 +202,6 @@ class BudgetController extends BaseController
|
||||
return Redirect::route('budgets.create')->withInput();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Budget $budget
|
||||
*
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Database\Category\Category as CategoryRepository;
|
||||
use FireflyIII\Exception\FireflyException;
|
||||
|
||||
@ -34,6 +35,19 @@ class CategoryController extends BaseController
|
||||
return View::make('categories.create')->with('subTitle', 'Create a new category');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function noCategory()
|
||||
{
|
||||
$start = \Session::get('start', Carbon::now()->startOfMonth());
|
||||
$end = \Session::get('end', Carbon::now()->startOfMonth());
|
||||
$list = $this->_repository->journalsNoCategory($start, $end);
|
||||
$subTitle = 'Transactions without a category in ' . $start->format('F Y');
|
||||
|
||||
return View::make('categories.noCategory', compact('list', 'subTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Category $category
|
||||
*
|
||||
|
@ -155,7 +155,7 @@ class GoogleChartController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
$noBudgetSet = $bdt->transactionsWithoutBudgetInDateRange($this->_start, $this->_end);
|
||||
$noBudgetSet = $bdt->expenseNoBudget($this->_start, $this->_end);
|
||||
$sum = $noBudgetSet->sum('amount') * -1;
|
||||
$this->_chart->addRow('No budget', 0, $sum);
|
||||
$this->_chart->generate();
|
||||
|
@ -7,6 +7,7 @@ use Carbon\Carbon;
|
||||
*/
|
||||
class HomeController extends BaseController
|
||||
{
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
|
@ -262,7 +262,7 @@ class PiggyBankController extends BaseController
|
||||
* Number of reminders:
|
||||
*/
|
||||
|
||||
$subTitle = e($piggyBank->name);
|
||||
$subTitle = e($piggyBank->name);
|
||||
|
||||
return View::make('piggy_banks.show', compact('piggyBank', 'events', 'subTitle'));
|
||||
|
||||
@ -273,9 +273,13 @@ class PiggyBankController extends BaseController
|
||||
*/
|
||||
public function store()
|
||||
{
|
||||
$data = Input::all();
|
||||
$data['repeats'] = 0;
|
||||
$data['user_id'] = Auth::user()->id;
|
||||
$data = Input::all();
|
||||
$data['repeats'] = 0;
|
||||
$data['user_id'] = Auth::user()->id;
|
||||
$data['rep_every'] = 0;
|
||||
$data['reminder_skip'] = 0;
|
||||
$data['remind_me'] = intval(Input::get('remind_me'));
|
||||
$data['order'] = 0;
|
||||
|
||||
|
||||
// always validate:
|
||||
|
@ -10,7 +10,7 @@ use FireflyIII\Exception\NotImplementedException;
|
||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Illuminate\Database\Query\Builder as QueryBuilder;
|
||||
|
||||
/**
|
||||
* Class Budget
|
||||
@ -258,19 +258,19 @@ class Budget implements CUDInterface, CommonDatabaseCallsInterface, BudgetInterf
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function transactionsWithoutBudgetInDateRange(Carbon $start, Carbon $end)
|
||||
public function expenseNoBudget(Carbon $start, Carbon $end)
|
||||
{
|
||||
// Add expenses that have no budget:
|
||||
return $this->getUser()
|
||||
->transactionjournals()
|
||||
->whereNotIn(
|
||||
'transaction_journals.id', function (Builder $query) use ($start, $end) {
|
||||
'transaction_journals.id', function (QueryBuilder $query) use ($start, $end) {
|
||||
$query
|
||||
->select('transaction_journals.id')
|
||||
->from('transaction_journals')
|
||||
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->where('transaction_journals.date', '>=', $start->format('Y-m-d'))
|
||||
->where('transaction_journals.date', '<=', $end->format('Y-m-d'));
|
||||
->where('transaction_journals.date', '>=', $start->format('Y-m-d 00:00:00'))
|
||||
->where('transaction_journals.date', '<=', $end->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
)
|
||||
->before($end)
|
||||
@ -280,6 +280,26 @@ class Budget implements CUDInterface, CommonDatabaseCallsInterface, BudgetInterf
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function journalsNoBudget(Carbon $start, Carbon $end)
|
||||
{
|
||||
$set = $this->getUser()
|
||||
->transactionjournals()
|
||||
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->whereNull('budget_transaction_journal.id')
|
||||
->before($end)
|
||||
->after($start)
|
||||
->orderBy('transaction_journals.date')
|
||||
->get(['transaction_journals.*']);
|
||||
|
||||
return $set;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Budget $budget
|
||||
* @param Carbon $date
|
||||
|
@ -26,6 +26,15 @@ interface BudgetInterface
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function transactionsWithoutBudgetInDateRange(Carbon $start, Carbon $end);
|
||||
public function expenseNoBudget(Carbon $start, Carbon $end);
|
||||
|
||||
/**
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function journalsNoBudget(Carbon $start, Carbon $end);
|
||||
|
||||
|
||||
}
|
||||
|
@ -175,6 +175,26 @@ class Category implements CUDInterface, CommonDatabaseCallsInterface
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function journalsNoCategory(Carbon $start, Carbon $end)
|
||||
{
|
||||
$set = $this->getUser()
|
||||
->transactionjournals()
|
||||
->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->whereNull('category_transaction_journal.id')
|
||||
->before($end)
|
||||
->after($start)
|
||||
->orderBy('transaction_journals.date')
|
||||
->get(['transaction_journals.*']);
|
||||
|
||||
return $set;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Category $category
|
||||
* @param Carbon $date
|
||||
|
@ -59,15 +59,19 @@ class TransactionJournal extends Eloquent
|
||||
*/
|
||||
public function getAmount(\Account $account = null)
|
||||
{
|
||||
|
||||
$amount = 0;
|
||||
foreach ($this->transactions as $t) {
|
||||
if (!is_null($account) && $account->id == $t->account_id) {
|
||||
return floatval($t->amount);
|
||||
$amount = floatval($t->amount);
|
||||
break;
|
||||
}
|
||||
if (floatval($t->amount) > 0) {
|
||||
return floatval($t->amount);
|
||||
$amount = floatval($t->amount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -196,6 +196,7 @@ Route::group(
|
||||
Route::get('/budgets/edit/{budget}', ['uses' => 'BudgetController@edit', 'as' => 'budgets.edit']);
|
||||
Route::get('/budgets/delete/{budget}', ['uses' => 'BudgetController@delete', 'as' => 'budgets.delete']);
|
||||
Route::get('/budgets/show/{budget}/{limitrepetition?}', ['uses' => 'BudgetController@show', 'as' => 'budgets.show']);
|
||||
Route::get('/budgets/list/noBudget', ['uses' => 'BudgetController@noBudget', 'as' => 'budgets.noBudget']);
|
||||
|
||||
// category controller:
|
||||
Route::get('/categories', ['uses' => 'CategoryController@index', 'as' => 'categories.index']);
|
||||
@ -203,6 +204,7 @@ Route::group(
|
||||
Route::get('/categories/edit/{category}', ['uses' => 'CategoryController@edit', 'as' => 'categories.edit']);
|
||||
Route::get('/categories/delete/{category}', ['uses' => 'CategoryController@delete', 'as' => 'categories.delete']);
|
||||
Route::get('/categories/show/{category}', ['uses' => 'CategoryController@show', 'as' => 'categories.show']);
|
||||
Route::get('/categories/list/noCategory', ['uses' => 'CategoryController@noCategory', 'as' => 'categories.noBudget']);
|
||||
|
||||
// currency controller
|
||||
Route::get('/currency', ['uses' => 'CurrencyController@index', 'as' => 'currency.index']);
|
||||
@ -258,11 +260,11 @@ Route::group(
|
||||
Route::get('/profile/change-password', ['uses' => 'ProfileController@changePassword', 'as' => 'change-password']);
|
||||
|
||||
// related controller:
|
||||
Route::get('/related/alreadyRelated/{tj}', ['uses' => 'RelatedController@alreadyRelated','as' => 'related.alreadyRelated']);
|
||||
Route::post('/related/relate/{tj}/{tjSecond}', ['uses' => 'RelatedController@relate','as' => 'related.relate']);
|
||||
Route::get('/related/removeRelation/{tj}/{tjSecond}', ['uses' => 'RelatedController@removeRelation','as' => 'related.removeRelation']);
|
||||
Route::get('/related/related/{tj}', ['uses' => 'RelatedController@related','as' => 'related.related']);
|
||||
Route::post('/related/search/{tj}', ['uses' => 'RelatedController@search','as' => 'related.search']);
|
||||
Route::get('/related/alreadyRelated/{tj}', ['uses' => 'RelatedController@alreadyRelated', 'as' => 'related.alreadyRelated']);
|
||||
Route::post('/related/relate/{tj}/{tjSecond}', ['uses' => 'RelatedController@relate', 'as' => 'related.relate']);
|
||||
Route::get('/related/removeRelation/{tj}/{tjSecond}', ['uses' => 'RelatedController@removeRelation', 'as' => 'related.removeRelation']);
|
||||
Route::get('/related/related/{tj}', ['uses' => 'RelatedController@related', 'as' => 'related.related']);
|
||||
Route::post('/related/search/{tj}', ['uses' => 'RelatedController@search', 'as' => 'related.search']);
|
||||
|
||||
// bills controller
|
||||
Route::get('/bills', ['uses' => 'BillController@index', 'as' => 'bills.index']);
|
||||
@ -381,21 +383,24 @@ Route::group(
|
||||
['before' => 'guest'], function () {
|
||||
// user controller
|
||||
Route::get('/login', ['uses' => 'UserController@login', 'as' => 'login']);
|
||||
Route::get('/register', ['uses' => 'UserController@register', 'as' => 'register','before' => 'allow-register']);
|
||||
Route::get('/register', ['uses' => 'UserController@register', 'as' => 'register', 'before' => 'allow-register']);
|
||||
Route::get('/reset/{reset}', ['uses' => 'UserController@reset', 'as' => 'reset']);
|
||||
Route::get('/remindMe', ['uses' => 'UserController@remindMe', 'as' => 'remindMe']);
|
||||
|
||||
Route::get('/oauth2callback', ['uses' => 'HomeController@marauder', 'as' => 'marauder']);
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// guest + csrf routes:
|
||||
Route::group(
|
||||
['before' => 'csrf|guest'], function () {
|
||||
|
||||
// user controller
|
||||
Route::post('/login', ['uses' => 'UserController@postLogin', 'as' => 'login.post']);
|
||||
Route::post('/register', ['uses' => 'UserController@postRegister', 'as' => 'register.post','before' => 'allow-register']);
|
||||
Route::post('/register', ['uses' => 'UserController@postRegister', 'as' => 'register.post', 'before' => 'allow-register']);
|
||||
Route::post('/remindMe', ['uses' => 'UserController@postRemindMe', 'as' => 'remindMe.post']);
|
||||
}
|
||||
);
|
||||
|
@ -51,6 +51,18 @@
|
||||
<div class="col-lg-3 col-sm-4 col-md-4">
|
||||
<!-- time based navigation -->
|
||||
@include('partials.date_nav')
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
Transactions without a budget
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
<a href="{{route('budgets.noBudget')}}">Transactions without a budget in
|
||||
{{\Session::get('start', \Carbon\Carbon::now()->startOfMonth())->format('F Y')}}.</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
24
app/views/budgets/noBudget.blade.php
Normal file
@ -0,0 +1,24 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName()) }}
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-md-4 col-sm-12 ">
|
||||
<!-- time based navigation -->
|
||||
@include('partials.date_nav')
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
{{{$subTitle}}}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@include('list.journals-full',['journals' => $list])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
24
app/views/categories/noCategory.blade.php
Normal file
@ -0,0 +1,24 @@
|
||||
@extends('layouts.default')
|
||||
@section('content')
|
||||
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName()) }}
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-md-4 col-sm-12 ">
|
||||
<!-- time based navigation -->
|
||||
@include('partials.date_nav')
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
{{{$subTitle}}}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@include('list.journals-full',['journals' => $list])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
@ -24,12 +24,13 @@
|
||||
"davejamesmiller/laravel-breadcrumbs": "2.*",
|
||||
"grumpydictator/gchart": "1.*",
|
||||
"michelf/php-markdown": "1.*",
|
||||
"watson/validating": "0.10.*"
|
||||
"watson/validating": "0.10.*",
|
||||
"doctrine/dbal": "~2.3"
|
||||
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "@stable",
|
||||
"barryvdh/laravel-ide-helper": "@stable",
|
||||
"doctrine/dbal": "~2.3",
|
||||
"satooshi/php-coveralls": "dev-master",
|
||||
"mockery/mockery": "@stable",
|
||||
"league/factory-muffin": "~2.1",
|
||||
|
1184
composer.lock
generated
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 884 B |
Before Width: | Height: | Size: 838 B |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 854 B |
Before Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 867 B |
Before Width: | Height: | Size: 668 B |
Before Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 70 B |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 326 B |
@ -1,281 +0,0 @@
|
||||
div.dataTables_length label {
|
||||
font-weight: normal;
|
||||
float: left;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.dataTables_length select {
|
||||
width: 75px;
|
||||
}
|
||||
|
||||
div.dataTables_filter label {
|
||||
font-weight: normal;
|
||||
float: right;
|
||||
}
|
||||
|
||||
div.dataTables_filter input {
|
||||
width: 16em;
|
||||
}
|
||||
|
||||
div.dataTables_info {
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
div.dataTables_paginate {
|
||||
float: right;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
div.dataTables_paginate ul.pagination {
|
||||
margin: 2px 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.dataTable td,
|
||||
table.dataTable th {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
|
||||
table.dataTable {
|
||||
clear: both;
|
||||
margin-top: 6px !important;
|
||||
margin-bottom: 6px !important;
|
||||
max-width: none !important;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting,
|
||||
table.dataTable thead .sorting_asc,
|
||||
table.dataTable thead .sorting_desc,
|
||||
table.dataTable thead .sorting_asc_disabled,
|
||||
table.dataTable thead .sorting_desc_disabled {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.dataTable thead .sorting { background: url('../images/sort_both.png') no-repeat center right; }
|
||||
table.dataTable thead .sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; }
|
||||
table.dataTable thead .sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; }
|
||||
|
||||
table.dataTable thead .sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; }
|
||||
table.dataTable thead .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; }
|
||||
|
||||
table.dataTable thead > tr > th {
|
||||
padding-left: 18px;
|
||||
padding-right: 18px;
|
||||
}
|
||||
|
||||
table.dataTable th:active {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Scrolling */
|
||||
div.dataTables_scrollHead table {
|
||||
margin-bottom: 0 !important;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
div.dataTables_scrollHead table thead tr:last-child th:first-child,
|
||||
div.dataTables_scrollHead table thead tr:last-child td:first-child {
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody table {
|
||||
border-top: none;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
div.dataTables_scrollBody tbody tr:first-child th,
|
||||
div.dataTables_scrollBody tbody tr:first-child td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
div.dataTables_scrollFoot table {
|
||||
margin-top: 0 !important;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
/* Frustratingly the border-collapse:collapse used by Bootstrap makes the column
|
||||
width calculations when using scrolling impossible to align columns. We have
|
||||
to use separate
|
||||
*/
|
||||
table.table-bordered.dataTable {
|
||||
border-collapse: separate !important;
|
||||
}
|
||||
table.table-bordered thead th,
|
||||
table.table-bordered thead td {
|
||||
border-left-width: 0;
|
||||
border-top-width: 0;
|
||||
}
|
||||
table.table-bordered tbody th,
|
||||
table.table-bordered tbody td {
|
||||
border-left-width: 0;
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
table.table-bordered th:last-child,
|
||||
table.table-bordered td:last-child {
|
||||
border-right-width: 0;
|
||||
}
|
||||
div.dataTables_scrollHead table.table-bordered {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* TableTools styles
|
||||
*/
|
||||
.table tbody tr.active td,
|
||||
.table tbody tr.active th {
|
||||
background-color: #08C;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.table tbody tr.active:hover td,
|
||||
.table tbody tr.active:hover th {
|
||||
background-color: #0075b0 !important;
|
||||
}
|
||||
|
||||
.table tbody tr.active a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.table-striped tbody tr.active:nth-child(odd) td,
|
||||
.table-striped tbody tr.active:nth-child(odd) th {
|
||||
background-color: #017ebc;
|
||||
}
|
||||
|
||||
table.DTTT_selectable tbody tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.DTTT .btn {
|
||||
color: #333 !important;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
div.DTTT .btn:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
ul.DTTT_dropdown.dropdown-menu {
|
||||
z-index: 2003;
|
||||
}
|
||||
|
||||
ul.DTTT_dropdown.dropdown-menu a {
|
||||
color: #333 !important; /* needed only when demo_page.css is included */
|
||||
}
|
||||
|
||||
ul.DTTT_dropdown.dropdown-menu li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
ul.DTTT_dropdown.dropdown-menu li:hover a {
|
||||
background-color: #0088cc;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
div.DTTT_collection_background {
|
||||
z-index: 2002;
|
||||
}
|
||||
|
||||
/* TableTools information display */
|
||||
div.DTTT_print_info.modal {
|
||||
height: 150px;
|
||||
margin-top: -75px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.DTTT_print_info h6 {
|
||||
font-weight: normal;
|
||||
font-size: 28px;
|
||||
line-height: 28px;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
div.DTTT_print_info p {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
div.dataTables_processing {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
margin-left: -50%;
|
||||
margin-top: -25px;
|
||||
padding-top: 20px;
|
||||
text-align: center;
|
||||
font-size: 1.2em;
|
||||
background-color: white;
|
||||
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));
|
||||
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
|
||||
background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
|
||||
background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
|
||||
background: -o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
|
||||
background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* FixedColumns styles
|
||||
*/
|
||||
div.DTFC_LeftHeadWrapper table,
|
||||
div.DTFC_LeftFootWrapper table,
|
||||
div.DTFC_RightHeadWrapper table,
|
||||
div.DTFC_RightFootWrapper table,
|
||||
table.DTFC_Cloned tr.even {
|
||||
background-color: white;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
div.DTFC_RightHeadWrapper table ,
|
||||
div.DTFC_LeftHeadWrapper table {
|
||||
margin-bottom: 0 !important;
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child,
|
||||
div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child,
|
||||
div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child,
|
||||
div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child {
|
||||
border-bottom-left-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
div.DTFC_RightBodyWrapper table,
|
||||
div.DTFC_LeftBodyWrapper table {
|
||||
border-top: none;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
div.DTFC_RightBodyWrapper tbody tr:first-child th,
|
||||
div.DTFC_RightBodyWrapper tbody tr:first-child td,
|
||||
div.DTFC_LeftBodyWrapper tbody tr:first-child th,
|
||||
div.DTFC_LeftBodyWrapper tbody tr:first-child td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
div.DTFC_RightFootWrapper table,
|
||||
div.DTFC_LeftFootWrapper table {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FixedHeader styles
|
||||
*/
|
||||
div.FixedHeader_Cloned table {
|
||||
margin: 0 !important
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 894 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
@ -106,6 +106,17 @@ class TransactionControllerCest
|
||||
$I->see(intval($journal->getAmount()));
|
||||
}
|
||||
|
||||
public function showGroupedJournal(FunctionalTester $I)
|
||||
{
|
||||
$journal = TransactionJournal::where('description', 'LIKE', 'Big expense in %')->first();
|
||||
|
||||
|
||||
$I->wantTo('see a grouped transaction');
|
||||
$I->amOnPage('/transaction/show/' . $journal->id);
|
||||
$I->see($journal->description);
|
||||
$I->see('Money for '.$journal->description);
|
||||
}
|
||||
|
||||
public function store(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('store a transaction');
|
||||
|
@ -23,12 +23,14 @@ class UserTest extends TestCase
|
||||
{
|
||||
$pref = f::create('Preference');
|
||||
$this->assertEquals($pref->user_id, $pref->user->id);
|
||||
$this->assertCount(1, $pref->user->preferences()->get());
|
||||
}
|
||||
|
||||
public function testReminder()
|
||||
{
|
||||
$reminder = f::create('Reminder');
|
||||
$this->assertEquals($reminder->user_id, $reminder->user->id);
|
||||
$this->assertCount(1, $reminder->user->reminders()->get());
|
||||
}
|
||||
|
||||
}
|
||||
|