Compare commits

...

1616 Commits
3.3 ... 3.5.6

Author SHA1 Message Date
James Cole
c2d444347d Merge branch 'release/3.5.6' 2015-12-28 08:07:43 +01:00
James Cole
5cb497596d New release. 2015-12-28 08:07:26 +01:00
James Cole
1857469d2f Removed unused parameters 2015-12-28 08:00:42 +01:00
James Cole
ea71b4843d Formatting fix in chart. 2015-12-28 07:58:40 +01:00
James Cole
97727e2e3d Some code cleanup courtesy of phpstorm. 2015-12-28 07:55:09 +01:00
James Cole
f81e7da8bb Code cleanup. 2015-12-28 07:49:27 +01:00
James Cole
8e827bf83b Removed parameter. 2015-12-28 07:43:57 +01:00
James Cole
9e1fa284ca Update php doc. 2015-12-28 07:43:05 +01:00
James Cole
3bf800be6e null check. 2015-12-28 07:41:44 +01:00
James Cole
635b9f9dba instance check. 2015-12-28 07:39:48 +01:00
James Cole
52a0d7cf7b Clean up code. 2015-12-28 07:38:02 +01:00
James Cole
a34516932b Rename include advised by scrutinizer. 2015-12-28 07:35:09 +01:00
James Cole
929a2a30a2 Fix TODO. 2015-12-28 07:31:48 +01:00
James Cole
ffa88eeb08 Made deleted piggy banks for piggy bank events visible. 2015-12-28 07:27:16 +01:00
James Cole
51b45b4ed4 Code cleanup. 2015-12-28 07:12:47 +01:00
James Cole
f263844793 Fix a bug where you cannot edit transactions. Will warrant a new release of FF. 2015-12-28 07:12:12 +01:00
James Cole
18c46df9aa Fix negative amounts and chart names. 2015-12-27 21:26:44 +01:00
James Cole
15846e157b From 200+ queries back to ~17. 2015-12-27 21:17:04 +01:00
James Cole
bc59f2db0d Optimised queries. 2015-12-27 20:07:49 +01:00
James Cole
cd2be8c1a4 Activate caching. 2015-12-27 19:51:20 +01:00
James Cole
f958115c50 Update composer file. 2015-12-27 17:57:32 +01:00
James Cole
e7d677bfb6 Add rounding, so the number will be a float. 2015-12-27 17:34:31 +01:00
James Cole
3e80ffc52b Huge change to bills and paid/unpaid/cc boxes. 2015-12-27 17:29:41 +01:00
James Cole
d0c7a5c076 Optimised query. 2015-12-27 09:44:12 +01:00
James Cole
f3f4e6b354 Stops date from skipping ahead slowly. 2015-12-27 09:40:28 +01:00
James Cole
5a45b25614 Merge branch 'hotfix/chart-fix' 2015-12-27 09:35:41 +01:00
James Cole
0b5ee1edfc Merge branch 'hotfix/chart-fix' into develop 2015-12-27 09:35:41 +01:00
James Cole
da3dc599f9 Fix chart call. 2015-12-27 09:35:24 +01:00
James Cole
f013b435ab Merge branch 'release/3.5.5' 2015-12-27 08:58:36 +01:00
James Cole
5f6975a113 Merge branch 'release/3.5.5' into develop 2015-12-27 08:58:36 +01:00
James Cole
c5dee29e4b New version. 2015-12-27 08:58:25 +01:00
James Cole
633ee02f13 Remove old Google references 2015-12-27 08:57:51 +01:00
James Cole
6b750c909a Fix forgotten call in bill repository. 2015-12-27 08:39:41 +01:00
James Cole
5f8b6640a9 A lot less queries thanks to efficient query. 2015-12-27 08:39:29 +01:00
James Cole
dd42d8437c Removed code for unused chart. 2015-12-27 08:12:46 +01:00
James Cole
67a178591d Some query optimisations. 2015-12-27 07:59:00 +01:00
James Cole
f5e5659c1f Code cleanup. 2015-12-26 09:40:24 +01:00
James Cole
8b0f0fb615 Optimise queries. 2015-12-26 09:39:35 +01:00
James Cole
209116e766 Query optimisations. 2015-12-26 09:21:45 +01:00
James Cole
79392ab656 Add caching to various queries and lists. 2015-12-26 08:44:34 +01:00
James Cole
3ca1207231 #135 2015-12-26 08:24:41 +01:00
James Cole
cec1b147f2 #135 2015-12-26 08:23:52 +01:00
James Cole
46cfcfa3e7 Update admin template. 2015-12-26 08:22:48 +01:00
James Cole
b833e8dfa2 #135 2015-12-26 08:16:30 +01:00
James Cole
77b843efd8 #135 2015-12-26 08:15:22 +01:00
James Cole
db72ad7c60 Issue #135 2015-12-26 08:12:51 +01:00
James Cole
eadc630fcb #135 2015-12-26 08:12:44 +01:00
James Cole
170c1793cc #135 2015-12-26 08:06:34 +01:00
James Cole
9f7c6c2d0c Extra cache. 2015-12-25 17:11:55 +01:00
James Cole
72d054c55c Add support for virtual balance currency, even though it cannot be stored yet. 2015-12-25 17:10:04 +01:00
James Cole
524edfe7c2 Better formatting (will take currency into account). 2015-12-25 16:40:27 +01:00
James Cole
c25c5623d2 Fixed the currency dropdown when multiple fields present on single page. 2015-12-25 16:38:53 +01:00
James Cole
4f38b77ef6 Better caching. 2015-12-25 09:34:37 +01:00
James Cole
5862803434 This saves some queries. 2015-12-25 09:34:23 +01:00
James Cole
5b3beded39 I can't believe I left this here all this time. 2015-12-25 07:58:19 +01:00
James Cole
c61fb7a598 Marked some unused stuff as deprecated. 2015-12-25 07:52:56 +01:00
James Cole
33d9148029 Make sure charts are cached. 2015-12-25 07:43:34 +01:00
James Cole
63969f5a33 Same routine but for money spent on accounts. 2015-12-25 07:42:00 +01:00
James Cole
edde18aeef Remove old chart. 2015-12-25 07:32:56 +01:00
James Cole
657116d361 Display new chart. 2015-12-25 07:32:03 +01:00
James Cole
e16269daa8 Collect data for new chart. 2015-12-25 07:31:54 +01:00
James Cole
c07591ff5c New method, earnedForAccounts 2015-12-25 07:31:43 +01:00
James Cole
75a478ad54 New chart, earned in period. 2015-12-25 07:31:29 +01:00
James Cole
8dae8b1a7f More code. Forgot to push. 2015-12-24 16:59:38 +01:00
James Cole
15fd8cf486 Completed the renaming of some methods. 2015-12-24 10:27:45 +01:00
James Cole
55333156ac Better cache control for some charts. 2015-12-24 10:14:01 +01:00
James Cole
8cdcba3231 Original fix in place. #133 2015-12-24 09:50:28 +01:00
James Cole
8bab9e84e2 Should not have edited that code. #133 2015-12-24 09:50:16 +01:00
James Cole
2faae83912 Include empty budgets. #133 2015-12-24 09:47:44 +01:00
James Cole
5a61a11a61 Attempt to fix bug #133 2015-12-24 09:45:21 +01:00
James Cole
a6d71988f2 Replaced some language calls. 2015-12-24 08:35:08 +01:00
James Cole
7069e242ae Removed useless entry. 2015-12-24 08:20:59 +01:00
James Cole
56ee830558 Moved locale information from the language to the translation files. 2015-12-24 08:20:47 +01:00
James Cole
6dd12729e6 Small disclaimer in readme. 2015-12-24 08:20:19 +01:00
James Cole
14a48303cb Cleanup. 2015-12-23 11:32:50 +01:00
James Cole
72cf6c9c0f Removed old route. 2015-12-23 11:32:41 +01:00
James Cole
144ee6b8ca Updated read me. 2015-12-23 10:38:42 +01:00
James Cole
8967d86da6 Updated language files. 2015-12-23 09:34:23 +01:00
James Cole
18c6edbb5d Update language files. 2015-12-23 09:09:51 +01:00
James Cole
53de3c4717 Merge branch 'develop' of https://github.com/JC5/firefly-iii into develop
* 'develop' of https://github.com/JC5/firefly-iii:
  Fix a bug where the frontpage would not honor transaction order.
  Fix a bug where the report page would mess up the session dates.
2015-12-22 20:46:52 +01:00
James Cole
ad577e4e81 Expand language files. 2015-12-22 20:46:16 +01:00
James Cole
44811a3e7c Fix a bug where the frontpage would not honor transaction order. 2015-12-21 11:30:58 +01:00
James Cole
1ab3f05b3a Fix a bug where the report page would mess up the session dates. 2015-12-21 10:25:57 +01:00
James Cole
5e76488ae7 Better localisation in charts. 2015-12-20 08:40:58 +01:00
James Cole
32771fe7e1 Add Português do Brasil 2015-12-20 08:20:50 +01:00
James Cole
9b40cc6881 Fix locale setting for Carbon. 2015-12-20 08:19:26 +01:00
James Cole
2e35260bbb Add some translations. 2015-12-20 07:34:10 +01:00
James Cole
a067704277 Move stuff around. 2015-12-20 07:34:01 +01:00
James Cole
de281818ac Add language 2015-12-19 21:16:09 +01:00
James Cole
c49bfad38d Move languages. 2015-12-19 20:54:59 +01:00
James Cole
c1ba591b26 Rename languages. 2015-12-19 20:54:27 +01:00
James Cole
719af38a61 Cleanup. 2015-12-18 18:42:56 +01:00
James Cole
ac61dfae6b File reformatting. 2015-12-18 16:38:50 +01:00
James Cole
813fb679a7 File reformatting. 2015-12-18 16:37:45 +01:00
James Cole
e7562781f7 File reformatting. 2015-12-18 16:37:27 +01:00
James Cole
56d36b7f53 Remove Google references. 2015-12-18 16:37:02 +01:00
James Cole
53b3f7f821 Merge branch 'release/3.5.4' 2015-12-18 08:13:28 +01:00
James Cole
08a53156bd Merge branch 'release/3.5.4' into develop 2015-12-18 08:13:28 +01:00
James Cole
8985cd6309 New composer for 3.5.4. 2015-12-18 08:13:19 +01:00
James Cole
3833da7410 Add something about security. 2015-12-18 08:11:05 +01:00
James Cole
4210cd10db Cleanup. 2015-12-18 08:10:41 +01:00
James Cole
a7bd1c6892 Merge branch 'develop' of https://github.com/JC5/firefly-iii into develop
* 'develop' of https://github.com/JC5/firefly-iii:
  First attempt cleaning up chart money formatting.
2015-12-18 07:32:03 +01:00
James Cole
52b0111afa Expanded text in register dialog. 2015-12-18 07:31:49 +01:00
James Cole
7921d128e4 Cleanup routine that checks for blocked domains. 2015-12-18 07:31:36 +01:00
James Cole
d7e838701a Blocked domains now in .env file. 2015-12-18 07:31:14 +01:00
James Cole
289bcb22aa First attempt cleaning up chart money formatting. 2015-12-17 15:03:47 +01:00
James Cole
3fe57b7983 Report remembers budgets and categories. 2015-12-16 16:19:15 +01:00
James Cole
32e92c2a16 Committed some dev stuff. 2015-12-16 13:10:49 +01:00
James Cole
1b3d208540 First attempt at functional category chart. 2015-12-16 13:08:26 +01:00
James Cole
6a8bf0aa62 Fixed the "undefined" error. 2015-12-16 12:13:01 +01:00
James Cole
56715556ed Second attempt. 2015-12-16 10:54:56 +01:00
James Cole
838330b909 First attempt at multi-year budget chart. 2015-12-16 10:17:15 +01:00
James Cole
69553b138b First calculations for multi-year budget chart. 2015-12-15 12:52:42 +01:00
James Cole
36d7a02994 Some refactoring. 2015-12-15 12:46:40 +01:00
James Cole
301528e2d2 Quick links. 2015-12-15 12:38:18 +01:00
James Cole
0303b45707 First code for multi year budget chart. 2015-12-15 12:37:55 +01:00
James Cole
ba722e8ed5 Expanded error message. 2015-12-15 08:19:16 +01:00
James Cole
289e5a5442 Add new blocked domain. 2015-12-15 08:19:07 +01:00
James Cole
fdad96e2bc Replaced route. 2015-12-14 21:14:34 +01:00
James Cole
af994e4dae Included first multi-year chart. 2015-12-14 21:12:10 +01:00
James Cole
006d68e279 Expand chart generation. 2015-12-14 21:11:57 +01:00
James Cole
29dc122ad3 New charts (slight variations of previous charts) 2015-12-14 21:11:26 +01:00
James Cole
cf4a8c6204 New translations. 2015-12-14 21:11:12 +01:00
James Cole
3c73fe92bf Lower threshold. 2015-12-14 20:58:23 +01:00
James Cole
6637590797 Empty placeholder for multi-year report. 2015-12-14 20:54:19 +01:00
James Cole
b8bab11acd Fix bread crumbs, clean up routes. 2015-12-14 20:45:12 +01:00
James Cole
a2f600feac Nice clean code. 2015-12-14 20:37:38 +01:00
James Cole
80dd62ef0a Refer to correct translations. 2015-12-14 20:34:08 +01:00
James Cole
827b1c9cd8 Fix some translations. 2015-12-14 20:33:57 +01:00
James Cole
2e4fcf803d Fix JS references. 2015-12-14 20:33:50 +01:00
James Cole
d00d95fc6f Cleanup JS 2015-12-14 20:33:10 +01:00
James Cole
3e3ab9bd25 Move some JS around. 2015-12-14 20:25:48 +01:00
James Cole
6eecc7722d Merge branch 'develop' of https://github.com/JC5/firefly-iii into develop
* 'develop' of https://github.com/JC5/firefly-iii:
  Fix for left unbalanced field in report.
2015-12-14 20:22:47 +01:00
James Cole
ada4aaf69a This will generate buttloads of test data. 2015-12-14 20:21:24 +01:00
James Cole
93244c1f78 Fix for left unbalanced field in report. 2015-12-14 12:35:52 +01:00
James Cole
be056cea6b Update some queries. 2015-12-13 20:41:35 +01:00
James Cole
659ca8be14 Update some queries. 2015-12-13 20:40:41 +01:00
James Cole
ea9af8366d Update some queries. 2015-12-13 20:39:26 +01:00
James Cole
80edd47d36 First attempts at building a multi-year report. 2015-12-13 17:31:25 +01:00
James Cole
d7746b3649 Support multi-year, not implemented yet. 2015-12-13 10:18:25 +01:00
James Cole
c4c4fbc34c Refactor 2015-12-13 10:05:13 +01:00
James Cole
59f57c96e9 Refactor names. 2015-12-13 09:41:22 +01:00
James Cole
a2f852fecf Clean up code. 2015-12-13 09:35:58 +01:00
James Cole
ad114ed329 Remove unused methods. 2015-12-13 09:30:02 +01:00
James Cole
c4c3d0f07f Some refactoring. 2015-12-13 09:01:17 +01:00
James Cole
6cf8102de5 Update version for coming release. 2015-12-12 22:32:19 +01:00
James Cole
e7e4aa2218 Update composer.lock. 2015-12-12 22:32:04 +01:00
James Cole
6d84f4b6c1 Update screenshots. 2015-12-12 22:31:34 +01:00
James Cole
ce3e9ffd11 Better cache control. 2015-12-12 21:20:20 +01:00
James Cole
3ada260e0e This will keep history. 2015-12-12 20:59:29 +01:00
James Cole
8fdd0cb795 Fixed some yearly charts. 2015-12-12 20:56:07 +01:00
James Cole
913e05a2e6 Really, reversed. 2015-12-12 20:20:18 +01:00
James Cole
fa1f703ef6 Some negative sums were failing regarding transfers. 2015-12-12 20:19:40 +01:00
James Cole
4004c53e1b Fix negative amount thing. 2015-12-12 20:16:30 +01:00
James Cole
4838670649 Transfer fix. 2015-12-12 20:13:07 +01:00
James Cole
a985e09282 Fix query. 2015-12-12 20:10:52 +01:00
James Cole
9bd1503cb4 Expand query to catch all expenses. 2015-12-12 20:07:33 +01:00
James Cole
a2ccbf7844 Jump to year report if the period is too long. 2015-12-12 19:04:30 +01:00
James Cole
61bbe8a905 Don't need this file. 2015-12-12 17:51:40 +01:00
James Cole
59bc5d22d1 Clean up some urls 2015-12-12 17:51:07 +01:00
James Cole
1423d5b314 Expand query, let's see what happens. 2015-12-12 12:36:36 +01:00
James Cole
152d0eb1d0 Cleanup and translations. 2015-12-12 12:29:54 +01:00
James Cole
6426d1df06 Fix the report chart. 2015-12-12 10:41:51 +01:00
James Cole
9284eb3fe9 First attempt at account specific bill report. 2015-12-12 10:33:19 +01:00
James Cole
afdae8bc1e Fix a sum for #129 2015-12-12 08:26:12 +01:00
James Cole
2a7085e593 Experimental budget lines. #129 2015-12-12 08:25:08 +01:00
James Cole
2408fb3ed4 Experimental budget lines. #129 2015-12-12 08:24:17 +01:00
James Cole
8316afb176 Experimental budget lines. #129 2015-12-12 08:21:46 +01:00
James Cole
e59fd098a3 Spent amount / withdrawals are negative, #129. 2015-12-12 08:15:14 +01:00
James Cole
e044199693 Spent amount / withdrawals are negative, #129. 2015-12-12 08:14:17 +01:00
James Cole
8f8e29fc22 Fix a sum. 2015-12-12 08:12:27 +01:00
James Cole
8de5384158 Spent amount / withdrawals are negative, #129. 2015-12-12 08:11:30 +01:00
James Cole
216c659335 Spent amount / withdrawals are negative, #129. 2015-12-12 08:07:25 +01:00
James Cole
041ca8a5d3 Amount reversal for #129 2015-12-12 08:05:10 +01:00
James Cole
fe4f1b306d Fix a sum for #129 2015-12-11 18:52:21 +01:00
James Cole
a0972d99fb Made a negative amount a positive as per #129 2015-12-11 18:49:07 +01:00
James Cole
e332bfef7c First attempt at budgets (split by account). 2015-12-11 18:45:39 +01:00
James Cole
cba5e226d8 Fix display of amount. 2015-12-11 18:36:19 +01:00
James Cole
5aff0c4943 Some fixes for #129 2015-12-11 18:35:49 +01:00
James Cole
cb49c00f4d Fix another JS error 2015-12-11 18:33:47 +01:00
James Cole
e26d797d57 Fix JS error. 2015-12-11 18:32:57 +01:00
James Cole
938581527e Fix sorting. 2015-12-11 18:31:15 +01:00
James Cole
c38ae09735 Negative expenses, as per #129 2015-12-11 18:30:28 +01:00
James Cole
28c3cfe084 Fix display of amount. See issue #129 2015-12-11 18:15:37 +01:00
James Cole
4a2823bcba Reverse sort. 2015-12-11 18:05:07 +01:00
James Cole
18eba02026 Expanded report for categories. 2015-12-11 18:03:13 +01:00
James Cole
d4690ce580 Fix date in budget report 2015-12-11 17:54:52 +01:00
James Cole
a785c450b1 First attempt at including a budget report. 2015-12-11 17:53:17 +01:00
James Cole
7480dc4a19 Fix a query. 2015-12-11 16:39:33 +01:00
James Cole
ad01891a67 First attempt at including expense report. 2015-12-11 16:36:40 +01:00
James Cole
67fe35d564 Small query fix. 2015-12-11 11:32:22 +01:00
James Cole
7f19b6957a Expanded new report a bit. Mainly copy/paste work. Will have to see how it pans out. 2015-12-11 09:39:17 +01:00
James Cole
0a54caf202 Tweak more translations. 2015-12-11 08:48:07 +01:00
James Cole
4b4c1c7f8f Moved some translations to see if they will still be picked up by Laravel. 2015-12-11 08:40:45 +01:00
James Cole
d071f3947e Merge pull request #127 from tonicospinelli/demeter-law
applying Demeter law for Transaction Type. Looking good!
2015-12-11 08:36:03 +01:00
Antonio Spinelli
b3d99cd210 apply demeter law for transaction type calls
- adds contants for transaction type names
- demeter law = never speaks with strangers
2015-12-10 16:53:48 -02:00
James Cole
90e696f82c Period is a month 2015-12-07 14:42:28 +01:00
James Cole
958fcd1cfa Report IP address 2015-12-07 14:41:04 +01:00
James Cole
8f57c7dcb3 Some fixes to amounts. 2015-12-06 13:17:00 +01:00
James Cole
77262f52a4 First functional view of default report. 2015-12-06 13:11:43 +01:00
James Cole
16bfbc8a12 Some JS to process the report form beforehand. 2015-12-06 08:42:04 +01:00
James Cole
1fd375b875 Better redirect after logout. 2015-12-05 17:45:33 +01:00
James Cole
46131ad39d Updated view for new reports. 2015-12-04 06:57:08 +01:00
James Cole
0b5c5b2ae9 Some mediocre Javascript for report thing. 2015-12-04 06:56:59 +01:00
James Cole
55be174037 Method to find an account. 2015-12-04 06:56:45 +01:00
James Cole
a17b7025f1 New function to build URL report. 2015-12-04 06:56:35 +01:00
James Cole
170cf7fd77 New routes for new reports. 2015-12-04 06:56:03 +01:00
James Cole
23cdb4d326 Expand month list for new reports. 2015-12-04 06:55:54 +01:00
James Cole
cbbe529572 Show bill if one is connected. 2015-12-04 06:16:19 +01:00
James Cole
0b382426e9 First experimental report generator / choice thing. 2015-12-03 14:52:10 +01:00
James Cole
1cbbf9baa4 Added a missing translation. 2015-12-03 11:46:05 +01:00
James Cole
8d41ff7b79 Prev should be next. Duh. 2015-12-03 11:41:06 +01:00
James Cole
e3b6057bf8 Catch Swift exceptions and do a log only (instead of crashing) because the email message isn't actually critical. 2015-12-03 11:30:43 +01:00
James Cole
66a4042cad Updated composer file. 2015-12-03 11:25:12 +01:00
James Cole
56c08d8302 Can block certain domains from registering, such as ten-minute-mail services. Two example domains provided in configuration. 2015-12-03 11:17:48 +01:00
James Cole
d4e759754d Make password reset impossible for blocked users. 2015-12-02 13:28:11 +01:00
James Cole
a96e171cbf Update composer. 2015-12-02 13:26:58 +01:00
James Cole
bd4a8c8397 Fixed "under" column 2015-12-02 09:03:34 +01:00
James Cole
04f71b3b43 Removed old code. 2015-12-02 09:01:40 +01:00
James Cole
d124de51db Shouldn't be like this? 2015-12-02 09:00:28 +01:00
James Cole
d87d12a0f5 Better query. See if works. 2015-12-02 08:58:40 +01:00
James Cole
f2b08346d0 Log. 2015-12-02 08:50:28 +01:00
James Cole
d3682a6727 Another fix in reports. 2015-12-02 08:46:03 +01:00
James Cole
371bbd9508 Some cosmetic fixes to reports 2015-12-02 08:44:23 +01:00
James Cole
a8a28f442f Also show "zero" amounts. 2015-12-02 08:38:57 +01:00
James Cole
65ddd8a736 One 'equals' sign too many! 2015-12-02 08:37:35 +01:00
James Cole
8bb27de233 More report subtleties. 2015-12-02 08:37:08 +01:00
James Cole
37e2f097ba To make budget report more clear, add spent amount to "spent" column. 2015-12-02 08:35:15 +01:00
James Cole
1966d87ce6 Small formatting fixes in reports. 2015-12-02 08:33:22 +01:00
James Cole
7b8c86e1e3 Only get active piggy banks. 2015-12-02 08:25:38 +01:00
unknown
de634da513 Only get active savings accounts. 2015-12-02 08:22:25 +01:00
James Cole
96836e2d6c Update read me. 2015-11-28 16:04:30 +01:00
James Cole
8a9d576f61 Allow change to default currency. issue #121 2015-11-22 11:30:06 +01:00
James Cole
791d12fbb4 Fix for issue #123 2015-11-22 11:25:15 +01:00
James Cole
d1329be2fa Bill scan routine should not grab transfers and income. 2015-11-20 20:13:10 +01:00
James Cole
3ed6561702 Updated all packages. 2015-11-13 07:16:23 +01:00
James Cole
7a0587f433 Merge branch 'release/3.5.3' 2015-11-13 07:01:29 +01:00
James Cole
0fe682bfe6 Merge branch 'release/3.5.3' into develop 2015-11-13 07:01:29 +01:00
James Cole
0f685e8789 New version. 2015-11-13 07:01:14 +01:00
James Cole
420771c233 New translations. See issue #117 2015-11-13 07:00:30 +01:00
James Cole
5e3e9271ca Added encryption to new password. See issue #118 2015-11-13 06:59:08 +01:00
James Cole
1e603c0833 Merge pull request #113 from RonaldvanMeer/develop
Removed duplicated controlbar item
2015-11-01 08:22:33 +01:00
James Cole
03e1673e92 Fix login message. 2015-11-01 08:06:51 +01:00
James Cole
9f992f003d Fix redirect loop. 2015-11-01 08:03:41 +01:00
James Cole
f50244a41f Merge branch 'release/3.5.2' into develop 2015-10-30 07:23:43 +01:00
James Cole
8b9607f9b5 Merge branch 'release/3.5.2' 2015-10-30 07:23:42 +01:00
James Cole
af107ad5e8 New release. 2015-10-30 07:23:33 +01:00
James Cole
8926d62165 Remake of: Merge pull request #111 from colinodell/patch-1
Loosen league/commonmark version
2015-10-30 07:22:39 +01:00
James Cole
45344ee347 Fixed a bug where budget chart would come up negative on overspent amounts. 2015-10-30 07:16:15 +01:00
RonaldvanMeer
baf9ebab15 Update control-bar.twig 2015-10-27 12:31:21 +01:00
James Cole
b7dab817f2 Merge pull request #111 from colinodell/patch-1
Loosen league/commonmark version
2015-10-27 12:17:25 +01:00
RonaldvanMeer
fb2fa54480 Merge pull request #1 from RonaldvanMeer/master
Duplicate controlbar item
2015-10-26 22:45:38 +01:00
James Cole
2c966a1234 Fixed ambiguous column. 2015-10-19 15:21:17 +02:00
James Cole
143ea69c0d Fixed the fix (fixeption). 2015-10-19 15:20:18 +02:00
James Cole
8a02ead013 Blind validator update. 2015-10-19 15:16:30 +02:00
James Cole
930d5ab941 Better fix. 2015-10-17 21:15:16 +02:00
James Cole
e54a56d3a8 Experimental chart fix. 2015-10-17 21:14:25 +02:00
James Cole
f5216c0d85 Fixed absolute uri 2015-10-05 20:30:57 +02:00
James Cole
ebc77540b9 Fix some reports. 2015-10-03 22:49:12 +02:00
James Cole
28d2583c10 Remove multiplication. 2015-10-03 22:34:25 +02:00
James Cole
b0988a7b00 Fix zero division. 2015-10-03 22:32:36 +02:00
James Cole
2c4920db2d Fix amount thing. 2015-10-03 22:31:55 +02:00
James Cole
8321663815 Some amount fixes. 2015-10-03 22:29:34 +02:00
James Cole
ac0280d460 Fixed some amounts. 2015-10-03 22:23:42 +02:00
James Cole
ba6f4268f0 Get correct fields. 2015-10-03 17:55:08 +02:00
James Cole
0bd18f94ac Fix ambiguous id. 2015-10-03 17:54:15 +02:00
James Cole
66fb63661f Less journals. 2015-10-03 17:53:13 +02:00
James Cole
d9b16beb0a Added some debug. 2015-10-03 17:51:13 +02:00
James Cole
6a01a9bdfd Fix bill scan. 2015-10-01 07:48:50 +02:00
James Cole
b81b34a706 Fixed amount in bill chart. 2015-10-01 07:46:47 +02:00
James Cole
3750a00b5f Fix amount, make it positive. 2015-09-30 19:43:02 +02:00
James Cole
05ddcc169d Fix amount thing. 2015-09-30 19:41:21 +02:00
James Cole
f571a5f1bd Merge branch 'develop' of https://github.com/JC5/firefly-iii into develop
* 'develop' of https://github.com/JC5/firefly-iii:
  Fixed the other chart too.
  Trying to fix chart.
  New code. Debug.
2015-09-30 19:32:58 +02:00
James Cole
48b786adea Some fixes for amounts. 2015-09-30 19:31:21 +02:00
James Cole
d691fa9b4d Fixed the other chart too. 2015-09-29 09:29:28 +02:00
James Cole
da50f9e419 Trying to fix chart. 2015-09-29 09:28:16 +02:00
James Cole
103de5e18a New code. Debug. 2015-09-29 09:20:50 +02:00
James Cole
dac6efd98b Fix amount in box. 2015-09-28 21:45:11 +02:00
James Cole
46aa7f81b2 Fixed a method call. 2015-09-28 20:41:53 +02:00
James Cole
0683c7cd67 Fixed chart 2015-09-28 14:43:08 +02:00
James Cole
50d7aa7b6a Fix so chart will not display negatives. 2015-09-28 14:32:12 +02:00
James Cole
b781215d0a Date range fixes. 2015-09-27 17:45:01 +02:00
James Cole
866bc2f3bd Cleanup in budgets. 2015-09-27 17:44:49 +02:00
James Cole
49d4705014 Chart was negative. 2015-09-27 09:52:02 +02:00
James Cole
9163fcfccb Quicker amount thing. 2015-09-27 09:47:13 +02:00
James Cole
7e10641461 Organized some category charts. Still needs some translating 2015-09-26 07:18:12 +02:00
James Cole
cdc0e3cfd8 Some cleaning up. 2015-09-25 20:40:24 +02:00
James Cole
466e81d56a Fixed some sorting. 2015-09-25 20:25:22 +02:00
James Cole
5953f691d1 More should fit. 2015-09-25 20:15:38 +02:00
James Cole
e2790ca6c1 Try to limit the collection returned to the user. 2015-09-25 20:13:43 +02:00
James Cole
66dbd48b76 Fix something with the dates. 2015-09-25 19:36:03 +02:00
James Cole
73cfbbd2ba Fix some things so the date range has a better display. 2015-09-25 19:28:39 +02:00
James Cole
38bc38bf26 Add some period things. 2015-09-25 17:28:42 +02:00
James Cole
e12d13c838 Fixed a negative chart. 2015-09-25 16:43:34 +02:00
James Cole
fcc3af6136 Fixed something. 2015-09-25 16:38:36 +02:00
James Cole
491298e1cb Some fixes in titles and bread crumbs. 2015-09-25 16:33:45 +02:00
James Cole
72b5895217 Added a subtitle to the category view. 2015-09-25 16:25:17 +02:00
James Cole
0a8f4017bd Fix some chart things. Again. 2015-09-25 16:18:50 +02:00
James Cole
cb985f5897 Make sure the month chart can show the spent / earned. 2015-09-25 16:08:10 +02:00
James Cole
968ec0853f Fixed the chart. Forgot an argument. 2015-09-25 16:06:06 +02:00
James Cole
0bde72d3df Spent should not be negative for the chart. 2015-09-25 16:04:22 +02:00
James Cole
45293fbd42 Fixes for #109. 2015-09-25 16:00:14 +02:00
Colin O'Dell
72997065f0 Loosen league/commonmark version
See https://github.com/thephpleague/commonmark#versioning
2015-09-19 10:49:55 -04:00
James Cole
a838dc163d I need unit tests again. #109 2015-09-14 17:22:31 +02:00
James Cole
3d15a4ca6d I need unit tests again. #109 2015-09-14 17:20:20 +02:00
James Cole
51c7d4fb1b Properly show spent and earned. #109 2015-09-13 07:40:37 +02:00
James Cole
fa586dba7e Also include all types. 2015-09-13 07:35:53 +02:00
James Cole
8ad40389f2 Corrected the field used for bug #109 2015-09-13 07:34:58 +02:00
James Cole
b3333cc2d3 Experimental fix for issue #109. 2015-09-13 07:32:39 +02:00
James Cole
3699a7ba9a Some cleaning up. 2015-09-08 19:38:04 +02:00
James Cole
204e521ba4 Fixed sorting for contracts. 2015-09-08 19:36:54 +02:00
James Cole
c9bab3e5c3 Tag list show sum. 2015-08-29 08:43:18 +02:00
James Cole
3d00e20238 Fixed a translation. 2015-08-29 08:35:11 +02:00
James Cole
c3958ed3c4 Fixed some bugs that caused inconsistencies in the monthly reports. 2015-08-29 07:20:53 +02:00
James Cole
e5b88be5fa Fix a bug where an transfer to and from a shared asset would count as an expense/income. 2015-08-29 06:48:12 +02:00
James Cole
425552988a Fix month report so transfers from a shared account to another shared account do not count as income. 2015-08-28 06:19:50 +02:00
James Cole
a81dd8abe5 Send search engine spiders away, as suggested in issue #105 2015-08-24 20:11:04 +02:00
James Cole
bac8154a5b Merge branch 'release/3.5.1' 2015-08-23 07:43:02 +02:00
James Cole
737d15fa0e Merge branch 'release/3.5.1' into develop 2015-08-23 07:43:02 +02:00
James Cole
5f2317af7f New version 2015-08-23 07:42:32 +02:00
James Cole
2bd1f783e5 Cleaned up some translations. 2015-08-23 07:41:12 +02:00
James Cole
d6c0c9f963 Cleanup composer. 2015-08-23 07:10:02 +02:00
James Cole
21b6ad7a41 More checks in the bounce cron job. 2015-08-19 19:21:39 +02:00
James Cole
a65d609fdc Fixed bug #104 2015-08-16 21:18:12 +02:00
James Cole
04e676b936 Fix bug #103 2015-08-16 20:27:25 +02:00
James Cole
be8eaaffdf Some code cleanup. 2015-08-16 20:26:11 +02:00
James Cole
28c753523f Caught a nasty bug thanks to an alert Tweakers.net user. This fix will make the account-edit screen inconsistent for a select number of users. This will be detailed on the wiki. 2015-08-15 21:45:29 +02:00
James Cole
7fbd0b2ffc Fixed some inconsistencies in the delete-form. 2015-08-15 21:44:29 +02:00
James Cole
7ffb48a87a New translations 2015-08-15 21:42:45 +02:00
James Cole
d485270e1f Merge branch 'release/3.5.0' 2015-08-13 17:37:55 +02:00
James Cole
5fd688b266 Merge branch 'release/3.5.0' into develop 2015-08-13 17:37:55 +02:00
James Cole
3716668e0c Updated read me. 2015-08-13 17:37:45 +02:00
James Cole
ae7fd18c34 New composer file. 2015-08-13 17:35:48 +02:00
James Cole
4f59b1d32f No Google thing when no Analytics ID present. 2015-08-13 17:35:41 +02:00
James Cole
90cb3279df Better example env file. 2015-08-13 17:34:08 +02:00
James Cole
cf0c7ef6b2 New version. 2015-08-13 17:32:22 +02:00
James Cole
47c23781d9 Fixed password reset. 2015-08-13 17:32:15 +02:00
James Cole
e258c050f7 Merge branch 'release/3.4.11' 2015-08-10 20:13:38 +02:00
James Cole
57801b2f34 Merge branch 'release/3.4.11' into develop 2015-08-10 20:13:38 +02:00
James Cole
710e9c9423 new version. 2015-08-10 20:13:33 +02:00
James Cole
deefef83bd Added sum for the current period, see issue #99 2015-08-09 17:01:12 +02:00
James Cole
51e30aed66 Added a sum of the current page and the sum of the entire category, in reference to issue #99. 2015-08-09 16:56:38 +02:00
James Cole
8d109a3cfe Fixed a null pointer exception. 2015-08-09 13:54:58 +02:00
James Cole
3424e019b5 Removed animation, again [skip ci] 2015-08-06 16:39:53 +02:00
James Cole
c6b4bceb67 Animation test [skip ci] 2015-08-06 16:39:06 +02:00
James Cole
afb4155015 Remove animation thing. [skip ci] 2015-08-06 16:37:53 +02:00
James Cole
8d99baf38a Update charts.js 2015-08-05 09:02:33 +02:00
James Cole
b91cb60328 Fix translations [skip ci] 2015-08-02 09:01:13 +02:00
James Cole
c0d62237fc Made the date thing throw a FF error. 2015-08-02 08:53:34 +02:00
James Cole
223ea80860 Fixed some embarrassing spelling errors in the CSV importer. [skip ci] 2015-08-02 08:53:19 +02:00
James Cole
5a77bef494 Sort chart and code cleanup [skip ci] 2015-08-02 07:41:47 +02:00
James Cole
80c0efe821 Small rearrangement of front page boxes. [skip ci] 2015-08-02 07:35:09 +02:00
James Cole
8044d89557 Display correct amount [skip ci] 2015-08-02 07:08:47 +02:00
James Cole
4f0ed97410 Fixed a bug where the category list in a monthly report would be empty. 2015-08-02 07:04:43 +02:00
James Cole
af7952f204 Removed old references to Google [skip ci] 2015-08-01 07:22:48 +02:00
James Cole
d8dcae856b Remove log. 2015-08-01 07:12:34 +02:00
James Cole
7296796ed9 Fix chart. 2015-08-01 07:12:03 +02:00
James Cole
a2c2bb4948 Forgot a dot [skip ci] 2015-08-01 07:09:51 +02:00
James Cole
72ebfdc20e Debug log. 2015-08-01 07:09:12 +02:00
James Cole
16b95ea78a New chart. 2015-08-01 07:04:41 +02:00
James Cole
c04f08dfd8 Filter empty budgets. 2015-07-31 18:18:54 +02:00
James Cole
a30793e818 Fix chart. Related to #99 2015-07-31 18:14:24 +02:00
James Cole
e39e1eaf21 Included opening balance. 2015-07-31 18:10:55 +02:00
James Cole
ab22d2cbaa Fixed the overview chart for categories, so it will properly reflect income and expenses. See bug #99 2015-07-31 14:26:22 +02:00
James Cole
96ddbe7227 Reorganized the category charts in the year report to properly reflect income and expenses. Necessary to facilitate the changes needed for bug #99 2015-07-31 14:20:18 +02:00
James Cole
4d09235aef Update composer.lock 2015-07-31 14:17:49 +02:00
James Cole
136b8975e3 Sort piggy bank list. 2015-07-31 13:44:56 +02:00
James Cole
e21b1eca17 Remove script. 2015-07-31 07:31:05 +02:00
James Cole
244b90b1d4 Fix bug #98 2015-07-30 21:32:58 +02:00
James Cole
b318f3f940 Merge branch 'release/3.4.10' 2015-07-27 21:23:20 +02:00
James Cole
e211c9812e Fixed some math things. 2015-07-26 19:42:28 +02:00
James Cole
eef28d96f4 Code cleanup [skip ci] 2015-07-26 19:13:06 +02:00
James Cole
c8227e09ee id was ambiguous. 2015-07-26 19:10:31 +02:00
James Cole
3e05fd91d9 Lots of cleaning up. 2015-07-26 19:07:02 +02:00
James Cole
450baba56a Removed some dead code and fixed some other. 2015-07-26 17:03:05 +02:00
James Cole
17a8c4918c Code cleanup. 2015-07-26 15:51:07 +02:00
James Cole
0e2419d61a New translations [skip ci] 2015-07-26 09:44:31 +02:00
James Cole
79b1a2ca6d Gave cron controller a new line. [skip ci] 2015-07-26 07:42:34 +02:00
James Cole
2213c68155 Added a missing breadcrumb. 2015-07-26 07:41:10 +02:00
James Cole
2492b1fa96 Expanded the message a user may get when his credentials do not work. 2015-07-26 07:39:21 +02:00
James Cole
6c6598dac5 Lots of new translations. 2015-07-26 07:39:04 +02:00
James Cole
a137112e66 New read me. 2015-07-25 19:28:19 +02:00
James Cole
8642ae8180 New version. 2015-07-25 19:27:14 +02:00
James Cole
894c4dc5a7 New composer.lock. 2015-07-25 19:24:07 +02:00
James Cole
d96063ea6e Also expand interface. 2015-07-25 19:23:00 +02:00
James Cole
c3dc193f3e First attempt at new last activity thing. 2015-07-25 19:22:41 +02:00
James Cole
3c2952009e Some new stuff. 2015-07-25 19:04:39 +02:00
James Cole
f4ade470df Remove if statements. 2015-07-25 18:48:48 +02:00
James Cole
2e33b43389 CSS and invalid account warning. 2015-07-25 18:40:45 +02:00
James Cole
92799699bc Better attachment handling. 2015-07-25 18:33:19 +02:00
James Cole
7ab0508167 Some new translations. 2015-07-25 18:31:05 +02:00
James Cole
3c65c28936 Some translations. 2015-07-25 16:48:32 +02:00
James Cole
43892da07e may edit fields [skip ci] 2015-07-25 07:05:27 +02:00
James Cole
7c436920a4 Some formatting and translations. [skip ci] 2015-07-25 07:04:09 +02:00
James Cole
89d565e63b Check for block code. [skip ci] 2015-07-25 07:03:50 +02:00
James Cole
150b6fe5b6 Add block code [skip ci] 2015-07-25 07:03:42 +02:00
James Cole
0e77574c26 Also give block code. [skip ci] 2015-07-25 07:03:35 +02:00
James Cole
df23863443 Remove bounce error thing. 2015-07-24 22:08:38 +02:00
James Cole
581bf11b21 Fixed a translation [skip ci] 2015-07-24 13:34:22 +02:00
James Cole
d602d4b429 Add some debug logging. 2015-07-24 13:26:42 +02:00
James Cole
d1d4a52934 Catch empty send grid credentials. 2015-07-24 13:23:02 +02:00
James Cole
375d113769 Find users not already blocked only. 2015-07-24 13:20:09 +02:00
James Cole
9b83974bff Improve the cron controller. Force blocked users to logout. 2015-07-24 13:17:47 +02:00
James Cole
3c68c99bd5 Fixed some translations. 2015-07-24 09:03:40 +02:00
James Cole
ec4b37c596 Updated chart. 2015-07-24 08:36:49 +02:00
James Cole
ba9601d21c Better display for piggy bank events. 2015-07-24 08:34:30 +02:00
James Cole
50c13fd469 Clear cache. 2015-07-22 22:13:40 +02:00
James Cole
7af072b8fc Show message. 2015-07-22 19:35:39 +02:00
James Cole
faa128d41e Made a cron controller. 2015-07-22 19:09:17 +02:00
James Cole
868fe46932 Some more debug stuff. 2015-07-22 18:44:51 +02:00
James Cole
e9e4307ce5 Better debug. 2015-07-22 18:09:14 +02:00
James Cole
774d4844a9 Another try to fix csrf 2015-07-22 17:58:06 +02:00
James Cole
586c53e670 Remove CSRF check. 2015-07-22 17:52:55 +02:00
James Cole
68e073fbff A new controller that can be used in combination with SendGrid. 2015-07-22 17:50:02 +02:00
James Cole
8101dc37b1 New route for attachment preview. 2015-07-19 22:19:36 +02:00
James Cole
63f16c458d Small fixes for piggy banks data seed. 2015-07-19 22:19:26 +02:00
James Cole
821e007e95 If zero, other thing. 2015-07-19 18:39:06 +02:00
James Cole
1656a2f11a Experimenting with a preview for attachments. 2015-07-19 18:37:29 +02:00
James Cole
4dbc135dce Added max file size for uploads. 2015-07-19 14:30:20 +02:00
James Cole
fc886f6bc1 Seed some tags. 2015-07-19 13:46:41 +02:00
James Cole
f93e480466 Better notifications. 2015-07-19 13:46:34 +02:00
James Cole
fe807e23f8 Fixed sorting in tags. 2015-07-19 13:46:20 +02:00
James Cole
ecf61c31f1 Add new line to file. 2015-07-19 12:23:27 +02:00
James Cole
4feff18af5 Fix test data. 2015-07-19 12:21:51 +02:00
James Cole
a07c52e0d8 Fix some route names. 2015-07-19 12:21:38 +02:00
James Cole
7bb07d7f55 Add non-breaking space to fix issue #95. 2015-07-19 12:20:35 +02:00
James Cole
f12dfc8a14 Icons for attachments. 2015-07-19 11:47:56 +02:00
James Cole
be030f15c4 New composer.lock. 2015-07-19 09:57:26 +02:00
James Cole
f5fb6c063b Also delete attachments. 2015-07-19 09:53:58 +02:00
James Cole
fb722f06b9 Some added newlines. 2015-07-19 09:38:44 +02:00
James Cole
c0ea19e15e Test data no longer runs into the future. 2015-07-19 09:37:52 +02:00
James Cole
cdeb1ad87c Some model updates. 2015-07-19 09:37:37 +02:00
James Cole
0dbe4e94fa Allow to edit an attachment. 2015-07-19 09:37:28 +02:00
James Cole
b5e2e8aa1d Edit attachment page. 2015-07-18 23:51:51 +02:00
James Cole
9502010248 Some new routes. 2015-07-18 23:06:51 +02:00
James Cole
fea0557b47 Going to allow edit of attachment. 2015-07-18 22:49:27 +02:00
James Cole
ed4fcc9011 Some optimisation. 2015-07-18 22:17:31 +02:00
James Cole
ed12ea7cfb Check for double files and some code clean up. 2015-07-18 21:46:16 +02:00
James Cole
73e526645e Uncomment providers. 2015-07-18 21:33:52 +02:00
James Cole
72aeafb2b5 Some model code block updates 2015-07-18 21:33:10 +02:00
James Cole
cc1af60cb4 Basic attachment download function. 2015-07-18 21:32:31 +02:00
James Cole
359fab315f A fix in the model and a simple view for attachments. 2015-07-18 21:12:34 +02:00
James Cole
6a9574bab9 Allow jpeg and PDF. 2015-07-18 19:49:35 +02:00
James Cole
83d6158483 Basic upload working. 2015-07-18 09:49:59 +02:00
James Cole
63ef89b6cc Basic interface for upload. 2015-07-18 09:49:29 +02:00
James Cole
b0beab4cd3 Attachment model and database changes. 2015-07-18 09:49:19 +02:00
James Cole
a34782575f Fix form and upload thing. 2015-07-18 08:59:33 +02:00
James Cole
142bdc9430 Add attachment thing to upload form. 2015-07-17 21:45:58 +02:00
James Cole
14b79cb0a4 Fixed a bug where deposits and/or transfers would be assigned budgets if you had selected a budget at the withdrawal screen earlier. 2015-07-17 21:03:13 +02:00
James Cole
ce5beeaf2c Better compare for amounts because floatval can be inaccurate. 2015-07-17 17:35:04 +02:00
James Cole
31114a2ca5 Fixed a bug where tags would be recreated instead of "found". 2015-07-17 17:34:49 +02:00
James Cole
32528094ad Updated composer file. 2015-07-16 20:39:20 +02:00
James Cole
0a2a01c44c Code reformat. 2015-07-15 21:06:26 +02:00
James Cole
c1888dc3ac Merge branch 'release/3.4.9' 2015-07-15 21:02:36 +02:00
James Cole
4d76afbe01 Merge branch 'release/3.4.9' into develop 2015-07-15 21:02:36 +02:00
James Cole
76d7a97f93 New release with all changes so far. Change log coming soon. 2015-07-15 21:02:27 +02:00
James Cole
8b1366b20a Merge pull request #93 from RonaldvanMeer/master
fix issue #91
2015-07-15 21:00:29 +02:00
RonaldvanMeer
e0f9685578 Spacing fixes 2015-07-15 12:29:11 +02:00
RonaldvanMeer
5235657954 Fixing missing IBAN field on Create New User request 2015-07-15 12:25:09 +02:00
James Cole
a15fbc8094 Now committing to correct branch. 2015-07-14 22:48:34 +02:00
James Cole
546f1d9c50 Revert "Some login and session updates."
This reverts commit 74231f552a.
2015-07-14 22:45:14 +02:00
James Cole
74231f552a Some login and session updates. 2015-07-14 22:45:00 +02:00
James Cole
b250a10e3c Merge branch 'release/3.4.8'
Conflicts:
	resources/twig/auth/login.twig
	resources/twig/auth/password.twig
	resources/twig/auth/register.twig
2015-07-12 22:45:37 +02:00
James Cole
a9f1b31dd6 New version. 2015-07-12 22:43:43 +02:00
James Cole
7fe393acaf Updated composer.lock. 2015-07-12 22:43:01 +02:00
James Cole
04faba4db5 Fix URL things. 2015-07-12 22:37:05 +02:00
James Cole
91bba40c20 Cleanup code. 2015-07-12 17:59:13 +02:00
James Cole
79e39f7de8 Code cleanup. 2015-07-12 17:36:38 +02:00
James Cole
9c09353559 Some improvements in tour 2015-07-12 12:45:41 +02:00
James Cole
50752a5bfe Implemented a short tour. 2015-07-11 10:01:13 +02:00
James Cole
d59879db7d Add bootstrap tour references. 2015-07-11 08:37:21 +02:00
James Cole
aab125da27 Add bootstrap tour files. 2015-07-11 08:36:46 +02:00
James Cole
74fc731f96 Full Bootstrap. 2015-07-11 08:35:51 +02:00
James Cole
bd0050fec2 Fix balance display. 2015-07-10 20:59:20 +02:00
James Cole
aa5e313b92 Save transactions by moving them. 2015-07-10 20:48:45 +02:00
James Cole
e89d613b7e Removed confidential data from logging routine. [skip ci] 2015-07-10 20:25:17 +02:00
James Cole
8757929ead Make log [skip ci] 2015-07-10 20:19:31 +02:00
James Cole
e0a9b19802 Some new translations and what-not. 2015-07-10 20:17:17 +02:00
James Cole
308da6dc6e Clean up some lists [skip ci] 2015-07-10 07:39:59 +02:00
James Cole
b6960fb0e5 Small layout and translation fixes [skip ci] 2015-07-10 05:39:35 +02:00
James Cole
137208c3fd Typical. 2015-07-09 21:59:02 +02:00
James Cole
d7a9a62a1d Should fix some scrutinyizer problems. 2015-07-09 21:48:05 +02:00
James Cole
075315bdaa Added some model thingies so scrutinizer will stop whining. 2015-07-09 21:29:30 +02:00
James Cole
3948fcd614 Added newlines to files. 2015-07-09 21:26:40 +02:00
James Cole
8e61e129ab More debug, some bug fixes. 2015-07-09 19:36:14 +02:00
James Cole
20cffd0502 Fixed Rabo importer. 2015-07-09 19:23:49 +02:00
James Cole
5df09dab09 Put specifix in json. 2015-07-09 19:05:59 +02:00
James Cole
7446b911e5 Logging in Rabo specifix. 2015-07-09 19:03:39 +02:00
James Cole
f15267c1ab Better import feedback. 2015-07-09 18:38:15 +02:00
James Cole
9c9fc2b5dc Some fixes in csv importer. 2015-07-09 18:33:09 +02:00
James Cole
28f601b54b Import fix asset account. 2015-07-09 16:37:42 +02:00
James Cole
18b8a05014 Extra logging. 2015-07-09 16:07:05 +02:00
James Cole
910c995ed8 Log account id. [skip ci] 2015-07-09 16:03:47 +02:00
James Cole
498468aa2c Display error. [skip ci] 2015-07-09 15:39:41 +02:00
James Cole
637aebcb34 Bug fix for importer. [skip ci] 2015-07-09 15:36:56 +02:00
James Cole
9afd5cb277 Fix specific [skip ci] 2015-07-09 15:27:40 +02:00
James Cole
bc525e7272 Date format in config downloader. [skip ci] 2015-07-09 15:25:24 +02:00
James Cole
a80180780d Use log [skip ci] 2015-07-09 15:21:34 +02:00
James Cole
0d73086c37 More logging [skip ci] 2015-07-09 15:20:55 +02:00
James Cole
02ae39238d Forgot one iban key. 2015-07-09 14:04:01 +02:00
James Cole
43d6b51d42 Some cleaning up [skip ci] 2015-07-09 11:13:38 +02:00
James Cole
84566310de Cleaned up model comments. 2015-07-09 09:42:09 +02:00
James Cole
6a6ec9fbe4 Cleaned up some bill related code. 2015-07-09 09:41:54 +02:00
James Cole
84a7f825d7 Some small code optimisations. 2015-07-09 06:13:39 +02:00
James Cole
0372c1aaf1 Small fix to make account journal list sortable. [skip ci] 2015-07-08 20:18:51 +02:00
James Cole
c9fff197f7 Some improved sorting. 2015-07-08 13:11:51 +02:00
James Cole
6900392e43 Fixed some sorting. 2015-07-08 13:05:33 +02:00
James Cole
c00bcd78cc Some dependency clean up. 2015-07-07 19:09:45 +02:00
James Cole
b2b82124e6 Merge branch 'release/3.4.7' 2015-07-07 11:12:30 +02:00
James Cole
3de57c668f Merge branch 'release/3.4.7' into develop 2015-07-07 11:12:30 +02:00
James Cole
43669648ce New test data. 2015-07-07 11:10:13 +02:00
James Cole
3b73b416d5 New read me. 2015-07-07 11:10:07 +02:00
James Cole
5153591c8f New version. 2015-07-07 10:38:53 +02:00
James Cole
3172bc90da Some small fixes. 2015-07-07 10:05:11 +02:00
James Cole
76a1b2cd51 Improve some search methods. 2015-07-07 09:46:19 +02:00
James Cole
bdf7eee72f Clean up some code routines. 2015-07-07 01:07:19 +02:00
James Cole
2d4b148b2c Various optimisations. 2015-07-06 22:23:34 +02:00
James Cole
d67db74ca2 Optimized some code. 2015-07-06 22:12:35 +02:00
James Cole
516725456f Scrutiniser will now include duplicate code. 2015-07-06 21:57:43 +02:00
James Cole
001d72a484 Code cleanup. 2015-07-06 20:56:20 +02:00
James Cole
c555e28988 Add new bank specific fixes. 2015-07-06 20:21:55 +02:00
James Cole
af13d1943f Should fix the last issues. 2015-07-06 18:57:15 +02:00
James Cole
52df2edc8f Fixed the last issues. Now onto code complexity. 2015-07-06 18:48:17 +02:00
James Cole
cd08484a13 Code cleanup. 2015-07-06 18:13:57 +02:00
James Cole
f38d38f139 Math fixes. Not bugs. 2015-07-06 18:06:31 +02:00
James Cole
93b6c68938 Some math fixes. Not bugs. 2015-07-06 18:04:13 +02:00
James Cole
a4cc25175a Fixed some duplication. 2015-07-06 17:45:59 +02:00
James Cole
3fb14b4708 Code cleanup. 2015-07-06 16:52:18 +02:00
James Cole
6bdb6db330 Fixed some problems. 2015-07-06 16:42:19 +02:00
James Cole
d05c165ace These might be the final issues on scrutiniser, apart from code complexity. 2015-07-06 16:33:54 +02:00
James Cole
ab53cdb896 Cleanup redirect code. 2015-07-06 16:27:21 +02:00
James Cole
c1f142af78 Fix some redirect things. 2015-07-06 16:12:22 +02:00
James Cole
6e261abb73 Some code improvements. 2015-07-06 16:08:36 +02:00
James Cole
39af9e4414 More translations. 2015-07-06 10:39:44 +02:00
James Cole
5b50abb2c7 Bread crumbs and fine tuning. 2015-07-06 08:33:39 +02:00
James Cole
13bda0a264 Mainly layout improvements. 2015-07-06 08:14:19 +02:00
James Cole
1658c666ab Some changes. 2015-07-05 21:47:59 +02:00
James Cole
170aebfe54 Some code improvements. 2015-07-05 19:57:44 +02:00
James Cole
c4ef379d0e Cleanup post processing. 2015-07-05 19:31:58 +02:00
James Cole
18b038d8ff Fixed most importers. 2015-07-05 18:18:44 +02:00
James Cole
12ee5da872 Massively complex but working never the less. 2015-07-05 16:39:25 +02:00
James Cole
601f9f86bb Some more importers. 2015-07-05 15:16:44 +02:00
James Cole
d7329a5915 Expanded CSV configuration. 2015-07-05 14:37:36 +02:00
James Cole
9e7b730002 Somehow CSV reader got lost in translation. 2015-07-05 09:34:57 +02:00
James Cole
2d59d845bc Account iban thing fix [skip ci] 2015-07-05 09:19:51 +02:00
James Cole
c2645894e0 Allow update iban [skip ci] 2015-07-05 09:07:05 +02:00
James Cole
3751106317 Fix name in option list. 2015-07-05 09:05:51 +02:00
James Cole
60bb639351 Add IBAN to account list. 2015-07-05 08:52:35 +02:00
James Cole
74c50930bd Merge branch 'feature/csv-import' into develop
Conflicts:
	composer.json
	composer.lock
	resources/lang/en/form.php
	resources/lang/nl/form.php
2015-07-05 08:50:54 +02:00
James Cole
9105104303 Make CSV import a feature that can be turned on / off. 2015-07-05 08:47:16 +02:00
James Cole
540dde135e CSV importer now indicates the problems it has. 2015-07-05 08:45:05 +02:00
James Cole
f8936210cf Small fixes. 2015-07-05 07:18:48 +02:00
James Cole
1dc6d8de40 First working version, very beta. 2015-07-05 06:59:05 +02:00
James Cole
1069db3c13 Some new converters. 2015-07-05 06:26:34 +02:00
James Cole
65122f0144 Greatly expanded the CSV routine. 2015-07-05 06:18:02 +02:00
James Cole
d2c018f7da First (almost) functional CSV importer. 2015-07-04 07:53:37 +02:00
James Cole
46493c2af6 Merge branch 'develop' of https://github.com/JC5/firefly-iii into develop
* 'develop' of https://github.com/JC5/firefly-iii:
  Update model info.
  Accounts can now have IBAN.
  Add IBAN field.
  New read me.
2015-07-03 12:54:45 +02:00
James Cole
c303e03f76 Update model info. 2015-07-03 12:54:35 +02:00
James Cole
d8b65f62e7 Accounts can now have IBAN. 2015-07-03 12:54:35 +02:00
James Cole
854368a8f3 Add IBAN field. 2015-07-03 12:54:35 +02:00
James Cole
7653a34aea New read me. 2015-07-03 12:54:35 +02:00
James Cole
ee50b58e00 Update model info. 2015-07-03 12:52:03 +02:00
James Cole
1eb60ab100 Accounts can now have IBAN. 2015-07-03 12:51:14 +02:00
James Cole
4a20eef351 Add IBAN field. 2015-07-03 12:27:49 +02:00
James Cole
26c9b2c353 Initial process form. 2015-07-03 12:22:20 +02:00
James Cole
16374bce9b Fixed upload form, made a new form element, added some processing. 2015-07-03 11:52:51 +02:00
James Cole
86011d4ea2 Initial commit for CSV import. 2015-07-03 10:45:00 +02:00
James Cole
fcb8b02da9 Merge branch 'release/3.4.6.1' 2015-07-03 10:32:31 +02:00
James Cole
571165c2bb Merge branch 'release/3.4.6.1' into develop 2015-07-03 10:32:31 +02:00
James Cole
c842113610 New read me. 2015-07-03 10:32:16 +02:00
James Cole
974a8b3b70 Merge branch 'master' of https://github.com/JC5/firefly-iii
# By Richard Ebbers
# Via James Cole (2) and Richard Ebbers (1)
* 'master' of https://github.com/JC5/firefly-iii:
  updated authentication pages to use dynamic urls
  use relative path in login screen
2015-07-03 10:30:57 +02:00
Richard Ebbers
2e20c99ada updated authentication pages to use dynamic urls 2015-07-03 10:30:32 +02:00
Richard Ebbers
aa88ff6f2c use relative path in login screen 2015-07-03 10:30:32 +02:00
James Cole
5e6aa63d03 Merge pull request #86 from ebbz/master
use relative path in login screen improved
2015-07-03 10:29:35 +02:00
James Cole
ad6700c114 An example test. Will continue later. 2015-07-03 10:28:40 +02:00
Richard Ebbers
f08c6efb00 updated authentication pages to use dynamic urls 2015-07-03 09:37:59 +02:00
James Cole
cc807ec132 Remove database setup from single test. 2015-07-03 08:16:14 +02:00
James Cole
24e7c68243 Initial codeception installation. 2015-07-03 08:15:30 +02:00
James Cole
ab25edd37a Updated to include codeception. 2015-07-03 08:13:50 +02:00
James Cole
be47fde6c2 Removed all tests. 2015-07-03 07:38:55 +02:00
James Cole
1ffa8c5e72 Removed code coverage logic. 2015-07-03 07:33:43 +02:00
James Cole
d855ccb8a7 Removed help button for small layouts [skip ci] 2015-07-03 07:28:20 +02:00
James Cole
d88919474b Reversed codeception. 2015-07-03 07:27:01 +02:00
James Cole
e139664301 Revert "Some updates to unit tests."
This reverts commit 5adf5f6e3f.
2015-07-03 07:25:07 +02:00
James Cole
5adf5f6e3f Some updates to unit tests. 2015-07-03 07:24:34 +02:00
James Cole
aef2075c8e Cleanup test case. 2015-07-02 09:49:45 +02:00
James Cole
922b2962a3 Bootstrap codeception. 2015-07-02 09:45:21 +02:00
James Cole
b4a401700e Installed codeception. 2015-07-02 09:44:56 +02:00
James Cole
e9601bb9c1 Add codeception. 2015-07-02 09:36:43 +02:00
James Cole
58af3dc6ea Removed everything related to unit tests. Can restore later. 2015-07-02 08:51:53 +02:00
Richard Ebbers
074295df61 use relative path in login screen 2015-07-01 20:03:43 +02:00
James Cole
ec349b31c7 Fixed tests. 2015-07-01 16:41:59 +02:00
James Cole
5ae236e016 With tooltips. 2015-07-01 15:08:09 +02:00
James Cole
d7c5897aba Optimise bootstrap. [skip ci] 2015-07-01 15:04:56 +02:00
James Cole
5252e7efe7 Cleanup css [skip ci] 2015-07-01 15:02:27 +02:00
James Cole
fc7d65629a Reorder bill chart [skip ci] 2015-07-01 13:18:50 +02:00
James Cole
f28fdf8252 Fixed chart tooltip [skip ci] 2015-07-01 11:08:14 +02:00
James Cole
5d07c4a949 Add date format to category charts [skip ci] 2015-07-01 11:07:10 +02:00
James Cole
fdd9eaab4b Added a better date for some budget charts [skip ci] 2015-07-01 11:04:08 +02:00
James Cole
e0d863a46f Create bills in test data, sort them [skip ci] 2015-07-01 10:52:42 +02:00
James Cole
3aacb6f5f3 New packages, updated read me, new composer.lock 2015-06-29 16:42:38 +02:00
James Cole
428e331b3e Reinstated the help button. 2015-06-29 15:23:50 +02:00
James Cole
847e05e9a7 Small experimental fix [skip ci] 2015-06-29 12:34:31 +02:00
James Cole
087eb5dbe6 Merge branch 'release/3.4.6' into develop 2015-06-29 09:53:26 +02:00
James Cole
f15932b2ac Merge branch 'release/3.4.6' 2015-06-29 09:53:25 +02:00
James Cole
d3a4c3795d New version. 2015-06-29 09:53:10 +02:00
James Cole
b15d55e1d9 Ignore untestable stuff. 2015-06-29 09:23:39 +02:00
James Cole
4f5889cc5b New tests for navigation. 2015-06-29 09:14:39 +02:00
James Cole
bf2a104a4e Fixed some tests. 2015-06-29 07:59:06 +02:00
James Cole
0c6dd5cd16 Removed some dead code. 2015-06-29 07:22:51 +02:00
James Cole
5efb06a7aa Removed unused code. 2015-06-29 07:17:39 +02:00
James Cole
b13acef272 Removed some dead code. 2015-06-29 07:16:43 +02:00
James Cole
cfa67d6c0f Implemented google chart tests. 2015-06-28 21:33:39 +02:00
James Cole
e70444f19a Fixed the bug that would unintentionally not let you edit accounts without changing their name. Closed #83 2015-06-28 21:13:08 +02:00
James Cole
0258982e60 Implemented two google chart tests. 2015-06-28 20:56:04 +02:00
James Cole
70eed5cb5e New tests. 2015-06-28 18:00:11 +02:00
James Cole
a650fa51f7 Implemented bill chart JS test. 2015-06-28 16:41:12 +02:00
James Cole
cb205580d8 First test for chartJS. 2015-06-28 16:20:14 +02:00
James Cole
f9329aac00 Removed unnecessary html tags. [skip ci] 2015-06-28 13:09:20 +02:00
James Cole
745f4a7523 Small chart and layout fixes [skip ci] 2015-06-28 13:07:23 +02:00
James Cole
60254dafd7 Implemented a forgotten chart. 2015-06-28 12:41:58 +02:00
James Cole
a8d60388ba New (empty) tests. 2015-06-28 10:38:51 +02:00
James Cole
83ec60254c New tests. 2015-06-28 10:03:34 +02:00
James Cole
c15c45f765 Some small fixes. 2015-06-28 08:42:06 +02:00
James Cole
cbe52b5089 Optimised chart generation. 2015-06-28 08:33:23 +02:00
James Cole
e4e2921f3e Fixed some tests. 2015-06-28 08:24:12 +02:00
James Cole
4673170531 Restored some cache [skip ci] 2015-06-27 22:22:27 +02:00
James Cole
2c2ed26c38 Optimise some charts [skip ci] 2015-06-27 22:11:03 +02:00
James Cole
94be5244fe Final chart. First version. 2015-06-27 20:52:06 +02:00
James Cole
f137a08493 Implemented some more charts. 2015-06-27 20:39:50 +02:00
James Cole
48624d0a34 A new chart, single count. 2015-06-27 17:38:16 +02:00
James Cole
4cceb3ddaa Completed the index. 2015-06-27 17:32:52 +02:00
James Cole
f728395603 Added some more charts 2015-06-27 17:05:39 +02:00
James Cole
3e82d43807 Expand some code to generate chartJS charts. 2015-06-27 16:01:06 +02:00
James Cole
2194c4e0a9 Expand some layouts to accept chartJS charts. 2015-06-27 16:00:50 +02:00
James Cole
c581080f3f Added option for other charts (chartJS currently). 2015-06-27 12:21:04 +02:00
James Cole
f6b1ec27e5 Renamed google chart methods and data. 2015-06-27 12:04:53 +02:00
James Cole
368b183230 Fixed category chart [skip ci] 2015-06-27 11:46:14 +02:00
James Cole
9028ad36ad Moved charts to separate generators. 2015-06-27 11:44:18 +02:00
James Cole
6cc041cd39 Fixed the chart generator. 2015-06-27 08:38:27 +02:00
James Cole
63ff01e78d Outsourced a chart to a specialised Google chart thing. 2015-06-27 08:18:47 +02:00
James Cole
9e5484937e Code cleanup [skip ci] 2015-06-27 08:06:24 +02:00
James Cole
b8ed489b14 Updated the read me [skip ci] 2015-06-27 07:55:59 +02:00
James Cole
765152d04b Reimplemented GA code. [skip ci] 2015-06-26 05:19:11 +02:00
James Cole
14934367d8 Simplified account name for cash accounts. 2015-06-26 04:57:30 +02:00
James Cole
04164500c8 Optimised some layout things. 2015-06-25 17:06:20 +02:00
James Cole
5160f2c298 Some new tests and a bug fix for piggy banks. 2015-06-24 21:02:34 +02:00
James Cole
124c9303b9 This should fix the tests. 2015-06-23 22:13:13 +02:00
James Cole
cd27f0ad69 Some database and css fixes. [skip ci] 2015-06-23 21:14:21 +02:00
James Cole
a7555bcce3 Some layout and file updates. 2015-06-23 19:07:37 +02:00
James Cole
6b5c4fd3f4 Merge branch 'master' of https://github.com/JC5/firefly-iii into develop
* 'master' of https://github.com/JC5/firefly-iii:
  New images [skip ci]
2015-06-23 07:40:50 +02:00
James Cole
cc55e2acee Lets see if this fixes the database. 2015-06-23 07:38:48 +02:00
James Cole
1511f75a80 Fixed tests. Broke database. 2015-06-22 22:04:46 +02:00
James Cole
f01bbefc1f Fixed tests. 2015-06-22 21:45:32 +02:00
James Cole
1d1eb5ffa8 Fix migration thing. 2015-06-22 21:37:02 +02:00
James Cole
a465cb2191 Remove all references to reminders. 2015-06-22 21:31:12 +02:00
James Cole
42d13e02ef New images [skip ci] 2015-06-22 21:04:31 +02:00
James Cole
d00786c43f Merge branch 'release/3.4.5' into develop 2015-06-22 19:12:05 +02:00
James Cole
4b47f99829 Merge branch 'release/3.4.5' 2015-06-22 19:12:04 +02:00
James Cole
35aaf40003 Updated composer file. 2015-06-22 19:11:17 +02:00
James Cole
cc5b4a1e02 Actually fix version [skip ci] 2015-06-22 19:03:03 +02:00
James Cole
7079521e8c Fix version in develop. 2015-06-22 19:02:28 +02:00
James Cole
b5025560a5 Merge branch 'feature/admin-lte' into develop 2015-06-22 18:59:36 +02:00
James Cole
3f4bdd7f0e Remove unnecessary code. 2015-06-22 18:58:19 +02:00
James Cole
e94bb9b549 Fixed some html errors [skip ci] 2015-06-22 18:50:54 +02:00
James Cole
1ddaacbef5 Some updated templates [skip ci] 2015-06-22 17:55:37 +02:00
James Cole
e8b40518e0 Hide boxes [skip ci] 2015-06-22 17:23:02 +02:00
James Cole
0f88cbb41b Fixed some layouts [skip ci] 2015-06-22 07:24:44 +02:00
James Cole
780d137b76 Fixed tests. 2015-06-21 16:10:32 +02:00
James Cole
ad8a9717d1 Fixed some views. [skip ci] 2015-06-21 15:09:10 +02:00
James Cole
9d6ea6b2f6 Some view updates [skip ci] 2015-06-21 11:59:35 +02:00
James Cole
7559383089 Cleaned up lots of views. 2015-06-21 10:50:45 +02:00
James Cole
f84381c927 Fixed search [skip ci] 2015-06-21 05:58:05 +02:00
James Cole
cb0122a43f Different colour scheme. [skip ci] 2015-06-21 05:48:47 +02:00
James Cole
6776b20989 Cleaned up tag views [skip ci] 2015-06-21 05:48:07 +02:00
James Cole
e98d556022 Some new templates and a bug fix [skip ci] 2015-06-20 22:18:54 +02:00
James Cole
5bf18b69d7 Smaller css footprint [skip ci] 2015-06-20 21:57:54 +02:00
James Cole
ea17f045a7 Added language stuff [skip ci] 2015-06-20 21:57:03 +02:00
James Cole
526f565ea7 Updated stuff from the control list. 2015-06-20 21:55:55 +02:00
James Cole
4aff9d6e73 Some more stuff done. Layout mostly. 2015-06-20 18:22:33 +02:00
James Cole
bf516d4d21 Fix some things. 2015-06-20 09:54:01 +02:00
James Cole
ae92e409d9 First functional run of new layout. 2015-06-20 07:48:44 +02:00
James Cole
4d017dc8a9 Updated boxes and what-not. 2015-06-20 07:29:25 +02:00
James Cole
707f4e2965 First implementation of new template. 2015-06-19 20:59:14 +02:00
James Cole
1c3bffdc50 Trigger a build. 2015-06-19 08:38:21 +02:00
James Cole
e54ddcb8b0 Small fix in edit form. [skip ci] 2015-06-18 18:12:57 +02:00
James Cole
ddefb0debc Improved tag view [skip ci] 2015-06-18 18:05:06 +02:00
James Cole
92d8dde90d Fixed sort commands [skip ci] 2015-06-17 06:11:35 +02:00
James Cole
1bb0508ddf Fix balance report [skip ci] 2015-06-16 18:34:19 +02:00
James Cole
a280a326b9 Fix report [skip ci] 2015-06-16 18:32:34 +02:00
James Cole
683e9b7c2c Small bugs in transaction controller [skip ci] 2015-06-16 18:26:17 +02:00
James Cole
a44e5da421 Add save routine to each transaction. [skip ci] 2015-06-16 06:52:30 +02:00
James Cole
8cd2c90ad7 Fixed menu in mobile [skip ci] 2015-06-15 20:24:58 +02:00
James Cole
5e57a390a2 Fixed tests. 2015-06-15 19:25:54 +02:00
James Cole
620848272e Implement tag count and fix a count thing. 2015-06-14 21:27:04 +02:00
James Cole
1e86794416 Add tag count to journal for easier amount calculations [skip ci] 2015-06-14 11:52:07 +02:00
James Cole
e36717259b Put tags in test data [skip ci] 2015-06-14 11:51:47 +02:00
James Cole
75b9238b90 Code cleanup [skip ci] 2015-06-14 11:51:33 +02:00
James Cole
ce5b20027e Newlines [skip ci] 2015-06-14 11:22:41 +02:00
James Cole
0de1242c83 Some cleaning up [skip ci] 2015-06-14 08:22:02 +02:00
James Cole
8bd445ab19 Some code cleanup [skip ci] 2015-06-13 10:02:36 +02:00
James Cole
fdef0de163 Increased test coverage. 2015-06-13 08:17:38 +02:00
James Cole
b1b03a4325 Upgrade to laravel 5.1 2015-06-11 21:19:40 +02:00
James Cole
0587d96474 Fixed tests [skip ci] 2015-06-11 20:14:15 +02:00
James Cole
c2241567e4 New translations. [skip ci] 2015-06-11 18:32:31 +02:00
James Cole
7ac24ba418 Some new translations [skip ci] 2015-06-09 17:56:08 +02:00
James Cole
c933ffec66 Quick fix in budget edit. [skip ci] 2015-06-09 16:20:37 +02:00
James Cole
e587d934b1 Switch menu around [skip ci] 2015-06-09 15:47:10 +02:00
James Cole
f354e90656 Some small menu optimisations. [skip ci] 2015-06-09 15:46:13 +02:00
James Cole
1b0bc7ec6e Clean up language. [skip ci] 2015-06-08 21:36:54 +02:00
James Cole
ee1acb9c00 Merge branch 'hotfix/3.4.4.2' 2015-06-08 18:52:30 +02:00
James Cole
06862a2812 Merge branch 'hotfix/3.4.4.2' into develop 2015-06-08 18:52:30 +02:00
James Cole
5fa87e18db Fix tag bug. (again) 2015-06-08 18:51:45 +02:00
James Cole
77989e2720 Fix read me. 2015-06-08 18:50:48 +02:00
James Cole
3a1102fa4e New code for auth controller [skip ci] 2015-06-08 18:42:19 +02:00
James Cole
8a9974ce53 New menu and new boxes [skip ci] 2015-06-08 18:41:47 +02:00
James Cole
4be8f1ca03 New email messages [skip ci] 2015-06-08 18:41:36 +02:00
James Cole
1ec2970ee3 Merge branch 'hotfix/3.4.4.1' 2015-06-08 18:41:02 +02:00
James Cole
81b3a22606 Merge branch 'hotfix/3.4.4.1' into develop 2015-06-08 18:41:02 +02:00
James Cole
f81a475cc9 Fixed a bug where the source and destination account could be the same one. 2015-06-08 18:40:52 +02:00
Sander Dorigo
d7ee03d4f9 New HTML view. 2015-06-08 09:48:53 +02:00
Sander Dorigo
c1c06410c2 Add HTML view. 2015-06-08 09:47:02 +02:00
James Cole
657d16bb60 Merge branch 'release/3.4.4' 2015-06-07 18:24:40 +02:00
James Cole
e65a4c1010 Merge branch 'release/3.4.4' into develop 2015-06-07 18:24:40 +02:00
James Cole
e23d3f5661 Mark a new release. 2015-06-07 18:24:23 +02:00
James Cole
e13611f7af Stupid faker messes up again. 2015-06-07 16:58:49 +02:00
James Cole
596cd09489 With a little luck this will cover a lot. 2015-06-07 15:32:01 +02:00
James Cole
0be5b27d34 Fixed some test coverage. 2015-06-07 10:28:26 +02:00
James Cole
a27471ae55 Fixed test. [skip ci] 2015-06-07 09:30:24 +02:00
James Cole
e27e3622a8 Fixed translation [skip ci] 2015-06-07 09:10:44 +02:00
James Cole
e95273b72b Simplified (or tried to) some code. [skip ci] 2015-06-07 09:09:27 +02:00
James Cole
583d4f3249 Cleanup scan method. [skip ci] 2015-06-07 08:13:19 +02:00
James Cole
d6967c4516 Cleaning up the relevantTags thing [skip ci] 2015-06-07 07:48:53 +02:00
James Cole
40b3097374 Lots of cleanup and stuff. 2015-06-06 23:09:12 +02:00
James Cole
1a1f127993 Cleanup code. 2015-06-06 17:40:41 +02:00
James Cole
a0f34a7ce1 Fix tests. 2015-06-06 16:26:26 +02:00
James Cole
db020db34b Fix tests and fix coverage. 2015-06-06 15:36:12 +02:00
James Cole
681167bc1b Some code cleanup. 2015-06-05 19:02:23 +02:00
James Cole
40e49ffc37 Some bug fixes and cleanup. 2015-06-05 16:49:16 +02:00
James Cole
834b1afb38 Updated some code [skip ci] 2015-06-05 13:39:24 +02:00
James Cole
62d5a1da87 Cleaning up [skip ci] 2015-06-05 12:48:58 +02:00
James Cole
8d8308e557 Cleanup another validator [skip ci] 2015-06-05 12:34:45 +02:00
James Cole
e1aa63487a Optimized a validator. [skip ci] 2015-06-05 12:18:20 +02:00
Sander Dorigo
b7fbe110d4 Merge pull request #82 from JC5/scrutinizer-patch-5
Scrutinizer Auto-Fixes
2015-06-05 11:39:08 +02:00
Scrutinizer Auto-Fixer
58859eb35a Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-06-05 08:40:26 +00:00
James Cole
4b7e1ae1c6 Removed duplicate code. 2015-06-05 10:02:40 +02:00
James Cole
3a06a6ac07 Removed unnecessary code. 2015-06-05 09:51:52 +02:00
James Cole
db0f269dc8 Fix class reference. 2015-06-05 09:50:59 +02:00
James Cole
3cabe6ca5a Improved test coverage. 2015-06-05 08:39:23 +02:00
James Cole
d483005219 Expanded some tests. 2015-06-05 07:49:07 +02:00
James Cole
fea9bc4e7e Increased coverage and fixed a nasty bug. 2015-06-05 07:10:51 +02:00
James Cole
d579992c98 Slightly improved test coverage. 2015-06-04 23:08:44 +02:00
James Cole
ad1c61d959 Improved test coverage. 2015-06-04 21:35:36 +02:00
James Cole
bb1da31830 Increase test coverage. 2015-06-04 17:43:50 +02:00
James Cole
a50949e554 Cache preferences. 2015-06-03 22:11:50 +02:00
James Cole
14dce8a10b Optimized preferences. 2015-06-03 21:58:06 +02:00
James Cole
1240c8f685 Update models [skip ci] 2015-06-03 21:27:36 +02:00
James Cole
cc7c2e952c Code cleanup [skip ci] 2015-06-03 21:25:11 +02:00
James Cole
409ec2e086 Should fix tests. 2015-06-03 21:15:52 +02:00
James Cole
a7f6848e53 Lots of stuff gets cached now. 2015-06-03 18:22:47 +02:00
James Cole
4b0b79199d Some cleanup. 2015-06-03 17:32:50 +02:00
Sander Dorigo
d1d6c48d9b Update GA code 2015-06-03 11:27:47 +02:00
James Cole
21631780bb Fix some tests 2015-06-02 22:22:47 +02:00
James Cole
b935e32340 Fix amount in tag list [skip ci] 2015-06-02 22:07:38 +02:00
James Cole
72dd064932 Fix count in transaction search [skip ci] 2015-06-02 21:58:30 +02:00
James Cole
2e75446665 Fixed some JS bugs [skip ci] 2015-06-02 18:13:23 +02:00
James Cole
be17e4481e Cache boxes. 2015-06-02 18:05:42 +02:00
James Cole
616c849b1f Fixed tests. 2015-06-02 17:58:30 +02:00
James Cole
71947c097f Some experiments with a cache control thing. [skip ci] 2015-06-02 17:44:50 +02:00
James Cole
546787802d Some code cleanup [skip ci] 2015-06-02 17:14:03 +02:00
James Cole
294d0e388a Add cache to main chart. 2015-06-01 18:41:18 +02:00
James Cole
193a1b0325 Basic tutorial for new users. 2015-06-01 18:13:54 +02:00
James Cole
12743217a2 Merge branch 'release/3.4.3' into develop 2015-06-01 17:37:03 +02:00
James Cole
b252b9da66 Merge branch 'release/3.4.3' 2015-06-01 17:37:02 +02:00
James Cole
cdef9c3c7e New version. 2015-06-01 17:36:53 +02:00
James Cole
71dcebb744 New read me [skip ci] 2015-06-01 17:36:13 +02:00
James Cole
25f248c60a New read me [skip ci] 2015-06-01 17:35:48 +02:00
James Cole
d5cbc17831 Update read me. 2015-06-01 17:35:03 +02:00
James Cole
7a10217511 New read me and scrutiniser instructions. 2015-05-31 20:53:31 +02:00
James Cole
7559efab77 Update build thing. 2015-05-31 20:52:20 +02:00
James Cole
8254efbd03 Fix modal. 2015-05-31 20:24:06 +02:00
James Cole
4ae24225a5 Cleanup some modals. 2015-05-31 20:23:49 +02:00
James Cole
67d9154563 Added some new code to implement a permission scheme. 2015-05-28 06:43:07 +02:00
James Cole
ad0319c188 Some new translations [skip ci] 2015-05-28 06:11:39 +02:00
James Cole
eb650ea3ec Some code cleanup 2015-05-27 08:36:26 +02:00
James Cole
7eba33e805 Fixed some issues for scrutiniser [skip ci] 2015-05-27 07:58:54 +02:00
James Cole
e1cb9d387e Fixed chart and redirect 2015-05-27 07:51:33 +02:00
James Cole
2ace7c3ca0 Some code cleanup [skip ci] 2015-05-27 07:27:05 +02:00
James Cole
58014f0592 Extra translation [skip ci] 2015-05-27 06:57:02 +02:00
James Cole
1d4938bb09 Small fix in error handler. 2015-05-26 22:12:34 +02:00
James Cole
bbf4007c3e Fixed return type [skip ci] 2015-05-26 20:59:16 +02:00
Sander Dorigo
4d5124fb4c Merge pull request #81 from JC5/scrutinizer-patch-4
Scrutinizer Auto-Fixes
2015-05-26 20:58:11 +02:00
Scrutinizer Auto-Fixer
14a7cd05b1 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-05-26 18:57:31 +00:00
James Cole
946be80eef Fix route urls. 2015-05-26 20:37:01 +02:00
James Cole
9ad8b1a980 Some optimisations. 2015-05-26 20:28:18 +02:00
James Cole
f733216fcb Trigger a build. 2015-05-26 20:18:21 +02:00
Sander Dorigo
ffc6139e21 Merge pull request #80 from JC5/scrutinizer-patch-3
Scrutinizer Auto-Fixes
2015-05-26 20:16:39 +02:00
Scrutinizer Auto-Fixer
571cac6644 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-05-26 17:50:09 +00:00
James Cole
2738ac5a5c Did some cleanup [skip ci] 2015-05-26 19:48:49 +02:00
James Cole
7dfde51b84 Fixed tests. 2015-05-26 19:38:52 +02:00
James Cole
2d2f18e538 Code cleanup. 2015-05-26 12:19:11 +02:00
James Cole
3af0dd2e3b Some code cleanup [skip ci] 2015-05-26 12:08:46 +02:00
James Cole
349e077802 Added model data to models to aid scrutiniser. 2015-05-26 11:15:45 +02:00
James Cole
812aae358f Some code cleanup. 2015-05-26 08:17:58 +02:00
James Cole
c3c59d0627 Fixed some JS things [skip ci] 2015-05-26 07:50:38 +02:00
James Cole
89518b412d Merge branch 'release/3.4.2' into develop 2015-05-25 23:18:33 +02:00
James Cole
f43b026162 Merge branch 'release/3.4.2' 2015-05-25 23:18:32 +02:00
James Cole
b806c70f52 New read me. 2015-05-25 22:58:49 +02:00
James Cole
10bff3c0b8 Fix tests. 2015-05-25 22:56:00 +02:00
James Cole
65c12fd0b2 Merge branch 'release/3.4.1' 2015-05-25 22:24:28 +02:00
James Cole
50f71c4130 Merge branch 'release/3.4.1' into develop 2015-05-25 22:24:28 +02:00
James Cole
8e401a53dc New version. 2015-05-25 22:24:21 +02:00
James Cole
64a289a47c Cleanup some code [skip ci] 2015-05-25 22:17:41 +02:00
James Cole
8f2c37061b Update translations [skip ci] 2015-05-25 22:16:00 +02:00
James Cole
39f2de6b90 Cleanup code [skip ci] 2015-05-25 22:04:24 +02:00
James Cole
855ba8d4f3 Cleanup [skip ci] 2015-05-25 22:01:48 +02:00
James Cole
74f098e718 Some new translations [skip ci] 2015-05-25 21:39:05 +02:00
James Cole
56c8a84691 Update translations [skip ci] 2015-05-25 21:26:34 +02:00
James Cole
8bbf319032 Some translations and a new test. 2015-05-25 21:17:36 +02:00
James Cole
afbca4ae65 Newline in travis.ml [skip ci] 2015-05-25 20:08:31 +02:00
James Cole
0ef6d2f91a Code cleanup. 2015-05-25 19:58:13 +02:00
James Cole
fbe4435599 Fix translation [skip ci] 2015-05-25 19:19:27 +02:00
James Cole
34be565dd1 New translations [skip ci] 2015-05-25 19:18:16 +02:00
James Cole
af838e4ed1 New translations. 2015-05-25 09:23:45 +02:00
James Cole
60fe8ce011 New GA events [skip ci] 2015-05-25 08:12:31 +02:00
James Cole
8ece341467 Add GA events [skip ci] 2015-05-25 08:01:06 +02:00
James Cole
dfa6bdbcb8 Fixed menu for mobile screens [skip ci] 2015-05-25 07:53:13 +02:00
James Cole
fb2481ebaa Add some GA events. 2015-05-25 07:26:19 +02:00
James Cole
4874c116cf Add GA to 503 page. [skip ci] 2015-05-25 07:23:35 +02:00
James Cole
e19c44efbd Some code cleanup. 2015-05-25 07:14:04 +02:00
James Cole
4b687b9bdc Clean up config 2015-05-25 07:03:26 +02:00
James Cole
6af79ef601 Fixed tests 2015-05-24 23:08:55 +02:00
James Cole
352b996ad2 Cleanup some code. 2015-05-24 22:59:48 +02:00
James Cole
4a93bb35f8 Cleanup budget view. 2015-05-24 22:54:59 +02:00
James Cole
8e1f493daf Another build routine. 2015-05-24 21:45:10 +02:00
James Cole
59ee153375 Fixed test. 2015-05-24 21:11:37 +02:00
James Cole
60f7f1fc16 New build routine. 2015-05-24 21:07:22 +02:00
James Cole
b7433683d8 Cleanup cleanup [skip ci] 2015-05-24 20:57:27 +02:00
James Cole
42799b9273 Some JS cleanup. 2015-05-24 20:48:31 +02:00
James Cole
860a0f790e Update js [skip ci] 2015-05-24 20:41:14 +02:00
James Cole
8daccbfbb4 Add JSHint stuff. [skip ci] 2015-05-24 18:22:41 +02:00
James Cole
285b77dcb7 Merge branch 'release/3.4.0.10' into develop 2015-05-24 15:56:05 +02:00
James Cole
6e48827d3f Merge branch 'release/3.4.0.10' 2015-05-24 15:56:04 +02:00
James Cole
f0c20cc706 New release. 2015-05-24 15:55:59 +02:00
James Cole
8916c0a3de Clean code [skip ci] 2015-05-24 15:18:19 +02:00
James Cole
7193a77840 Some translations and cleanup [skip ci] 2015-05-24 15:13:07 +02:00
James Cole
61930b5b51 Code cleanup [skip ci] 2015-05-24 15:03:45 +02:00
James Cole
11a494cacf Remove some middleware, fix cleanup [skip ci] 2015-05-24 12:53:47 +02:00
James Cole
17f9bf0339 Merge branch 'release/3.4.0.9' into develop 2015-05-24 11:53:44 +02:00
James Cole
3d9755ca8c Merge branch 'release/3.4.0.9' 2015-05-24 11:53:43 +02:00
James Cole
b5cf2d03e6 New version. 2015-05-24 11:53:34 +02:00
James Cole
e3b35b8f35 Add code climate file [skip ci] 2015-05-24 11:46:41 +02:00
James Cole
1c1fe672bd Some code cleanup [skip ci] 2015-05-24 11:41:52 +02:00
James Cole
6c71f68ed8 Should cover models. 2015-05-24 11:13:46 +02:00
James Cole
8f2f912cdf New (empty) tests for models. 2015-05-24 10:01:00 +02:00
James Cole
bf6ea16acb Fixed test. 2015-05-24 09:29:44 +02:00
James Cole
288546c2b9 Fixed some math. 2015-05-24 08:00:40 +02:00
James Cole
724db6c34c Built some new tests 2015-05-24 07:43:48 +02:00
James Cole
067c451c1d Fixed tests 2015-05-23 21:41:04 +02:00
James Cole
11e3696191 Cleanup tests. 2015-05-23 21:23:51 +02:00
James Cole
41e20664de Fixed coverage. 2015-05-23 21:18:20 +02:00
James Cole
d8de90d6f3 Ignore constructors. 2015-05-23 20:49:57 +02:00
James Cole
b01e8299d3 Fixed tests 2015-05-23 20:47:31 +02:00
James Cole
1ec11e3e2e Compartmentalised all tests. 2015-05-23 19:41:54 +02:00
James Cole
422f429725 Experimental count thing. 2015-05-23 17:38:16 +02:00
James Cole
5c55fa5fbb Remove encrypted amounts because it stinks. 2015-05-23 17:33:04 +02:00
James Cole
80d845fdf2 Save but don't use. 2015-05-23 17:18:23 +02:00
James Cole
601fe68346 Don't multiply transactions. 2015-05-23 17:14:36 +02:00
James Cole
9e050fb059 Updated some tests. 2015-05-23 17:11:16 +02:00
James Cole
99d4adf5e6 Translations [skip ci] 2015-05-23 15:57:38 +02:00
James Cole
85f8d1e8e9 Math is hard [skip ci] 2015-05-23 15:45:01 +02:00
James Cole
8334d3d99f Translation error [skip ci] 2015-05-23 15:43:48 +02:00
James Cole
cff08d19eb Slowly move away from using the raw 'transactions.amount' field. 2015-05-23 15:42:19 +02:00
James Cole
2d86390bc1 Experimental query.Code cleanup [skip ci] 2015-05-23 09:11:59 +02:00
James Cole
7a20835571 Code cleanup [skip ci] 2015-05-23 09:09:25 +02:00
James Cole
ff3c9676b5 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:05:08 +02:00
James Cole
055f97dab1 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:03:52 +02:00
James Cole
8a867e71a1 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:02:27 +02:00
James Cole
b8275b4734 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:01:38 +02:00
James Cole
36b951b146 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:01:07 +02:00
James Cole
c5a5f17643 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 09:00:11 +02:00
James Cole
16b909c4df Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 08:59:23 +02:00
James Cole
92b7648e03 Encrypt more stuff in the cleanup routine [skip ci] 2015-05-23 08:58:21 +02:00
James Cole
ca46ebe3b2 Encrypt bill amounts [skip ci] 2015-05-23 08:57:02 +02:00
James Cole
676e48254a Whoops [skip ci] 2015-05-23 08:55:16 +02:00
James Cole
b15b55227d Add another cleanup routine. [skip ci] 2015-05-23 08:54:25 +02:00
James Cole
3c3b723913 Some code cleanup [skip ci] 2015-05-23 08:51:24 +02:00
James Cole
f05002c729 Updated models for encryption. 2015-05-23 08:46:46 +02:00
James Cole
1c2cbd5b40 New stuff for encrypted amounts. 2015-05-23 07:47:36 +02:00
James Cole
54c6ca9f45 Expanded some tests. 2015-05-22 20:25:12 +02:00
James Cole
c10efbb170 Also encrypt meta data for reminders. 2015-05-22 19:19:18 +02:00
James Cole
a496ad5814 Simple routine to encrypt entries which were not encrypted yet. 2015-05-22 19:18:00 +02:00
James Cole
50cf7f6a3b Merge branch 'release/3.4.0.8' 2015-05-22 18:55:13 +02:00
James Cole
f946f10afd Merge branch 'release/3.4.0.8' into develop 2015-05-22 18:55:13 +02:00
James Cole
eecb4db34c Built chart tests. 2015-05-22 18:31:57 +02:00
James Cole
1f865d3ea4 Improved coverage. 2015-05-22 15:05:32 +02:00
James Cole
623bb4b350 New tests. 2015-05-22 10:17:20 +02:00
James Cole
dc8ad673a6 New test to cover some reminder stuff. 2015-05-22 08:52:30 +02:00
James Cole
4914ad821e Fixed coverage for transaction controller. 2015-05-22 08:03:34 +02:00
James Cole
f099cbadc3 Version increment. 2015-05-22 07:16:36 +02:00
James Cole
42cda384c8 Fix help routes 2015-05-22 07:15:40 +02:00
James Cole
23c91b9990 Some translations, playing around with popups. [skip ci] 2015-05-21 23:05:31 +02:00
James Cole
ff0379182e Sort chart [skip ci] 2015-05-21 18:57:14 +02:00
James Cole
e08a23948f Fixed chart. [skip ci] 2015-05-21 18:50:23 +02:00
James Cole
bd56de6d36 Fix other translations [skip ci] 2015-05-21 17:47:10 +02:00
James Cole
42970aea80 Fix some translations. 2015-05-21 17:45:01 +02:00
James Cole
003a05ee8d Fixed the category chart. 2015-05-21 17:27:48 +02:00
James Cole
ffb11b01a6 Some new translations. 2015-05-21 07:44:44 +02:00
James Cole
e426f5d5da Some new translations. 2015-05-21 07:30:38 +02:00
James Cole
6989f61e1b Extra translations [skip ci] 2015-05-20 20:10:01 +02:00
James Cole
0e6677ccb3 Remove cash accounts from list [skip ci] 2015-05-20 20:04:27 +02:00
James Cole
8f104d555a Added newlines to files. 2015-05-20 19:56:14 +02:00
James Cole
b1d3158db1 Code cleanup. 2015-05-20 19:55:53 +02:00
James Cole
7645005d5a Return of account id. 2015-05-20 18:18:05 +02:00
James Cole
411f77fd29 Fixed some other displays of money 2015-05-20 18:09:44 +02:00
James Cole
568ab26db1 Spell check [skip ci] 2015-05-20 17:06:47 +02:00
James Cole
29652108f0 Fixed tests. 2015-05-20 17:04:53 +02:00
James Cole
f07e4dc711 Fix sort. [skip ci] 2015-05-20 07:21:40 +02:00
James Cole
8a2ac457c2 Name fix [skip ci] 2015-05-20 07:21:01 +02:00
James Cole
9e54eecfaa Fixed some views. 2015-05-20 07:20:02 +02:00
James Cole
95ef691077 Fixed some more reports and charts. [skip ci] 2015-05-20 07:07:46 +02:00
James Cole
7a0ad5a587 Fixed a chart [skip ci] 2015-05-20 06:50:24 +02:00
James Cole
42b49d0e4b Added some correcting methods. [skip ci] 2015-05-20 06:50:15 +02:00
James Cole
9217c2f003 Corrected some charts [skip ci] 2015-05-20 06:49:51 +02:00
James Cole
fbdf66998d Added a forgotten chart, corrected some others. [skip ci] 2015-05-20 06:49:22 +02:00
James Cole
deda9d3c54 Add corrected expense routes [skip ci] 2015-05-20 06:49:03 +02:00
James Cole
a5d78f20ae Add corrected income and expense methods [skip ci] 2015-05-20 06:48:52 +02:00
James Cole
5ed09e3f38 Call the corrected spent function [skip ci] 2015-05-20 06:47:53 +02:00
James Cole
3e9774cd66 Merge branch 'release/3.4.0.7' 2015-05-18 18:23:07 +02:00
James Cole
54387c8fdf Merge branch 'release/3.4.0.7' into develop 2015-05-18 18:23:07 +02:00
James Cole
7eec949a13 Push new release. 2015-05-18 18:23:01 +02:00
James Cole
4113c4ff40 Fixed the tests. 2015-05-18 17:57:44 +02:00
James Cole
1bf0968bfe Show correct icon. [skip ci] 2015-05-18 17:05:22 +02:00
James Cole
374b90fb00 Show correct amount [skip ci] 2015-05-18 17:04:10 +02:00
James Cole
064e60e9d5 Show tag amount better [skip ci] 2015-05-18 17:02:18 +02:00
James Cole
b637455970 New translations [skip ci] 2015-05-18 16:59:01 +02:00
James Cole
68158937d1 Fixed translation [skip ci] 2015-05-18 06:56:59 +02:00
James Cole
adb1356b7a Small bug fix in display of income vs. expenses [skip ci] 2015-05-18 06:55:36 +02:00
James Cole
d880ccb8e0 Small bug fix in display of income vs. expenses [skip ci] 2015-05-18 06:54:46 +02:00
James Cole
050fb1d1ef Some translations [skip ci] 2015-05-17 18:06:00 +02:00
James Cole
6580752bde Now includes chart! [skip ci] 2015-05-17 18:03:16 +02:00
James Cole
c9df265c9b Included bills in month report. [skip ci] 2015-05-17 17:54:13 +02:00
James Cole
098e5bc162 Small translation fix [skip ci] 2015-05-17 17:27:56 +02:00
James Cole
4b2dcc74d4 Expanded the amount thing. 2015-05-17 16:12:00 +02:00
James Cole
a9254c5c9a Some new translations, better tag view [skip ci] 2015-05-17 15:55:24 +02:00
James Cole
7ce57e6ccb Fix a view, fix tag format. 2015-05-17 15:24:30 +02:00
James Cole
0fcb32a66f Fix update error. 2015-05-17 15:17:06 +02:00
James Cole
9946535f01 Some new bread crumbs [skip ci] 2015-05-17 15:12:45 +02:00
James Cole
2b17396d6b Fix some translations. 2015-05-17 13:44:58 +02:00
James Cole
b01d5bc237 Translation fixes [skip ci] 2015-05-17 12:53:32 +02:00
James Cole
b123860304 More stuff. 2015-05-17 12:49:09 +02:00
James Cole
033f5b67db Code cleanup 2015-05-17 11:28:58 +02:00
James Cole
6280448dfb Fixed more tests. 2015-05-17 10:47:12 +02:00
James Cole
01cd3333e4 Fixing tests. 2015-05-17 10:36:11 +02:00
James Cole
63050907b9 Code cleanup. 2015-05-17 10:30:18 +02:00
James Cole
beedf7d780 Cleaning up 2015-05-17 10:10:58 +02:00
James Cole
6b8194261f Clean up and simplify code. 2015-05-17 10:01:47 +02:00
James Cole
dbb1c4d534 Fixed some reports. 2015-05-17 09:35:49 +02:00
James Cole
e6263f9ff5 Some cleaning up 2015-05-17 09:18:44 +02:00
James Cole
6ca119c4db Minor changes [skip ci] 2015-05-17 09:04:55 +02:00
James Cole
c483a1ab3a Ignore simple classes. 2015-05-16 19:08:54 +02:00
James Cole
2e7edd033c Some expanded things. 2015-05-16 16:47:52 +02:00
James Cole
c576902501 Fixed tests. 2015-05-16 16:04:51 +02:00
James Cole
66c2951594 Cleanup 2015-05-16 15:52:09 +02:00
James Cole
b812881cdb More hip report stuff. 2015-05-16 15:43:58 +02:00
James Cole
cdeac2c6db Should simplify reports. 2015-05-16 14:51:23 +02:00
James Cole
bca2ddd529 Budget report thing. 2015-05-16 14:14:22 +02:00
James Cole
e7285c6499 Some overhauls. 2015-05-16 13:53:08 +02:00
James Cole
bdff275672 Simplified report code. 2015-05-16 13:06:38 +02:00
James Cole
bec58a1ee6 Experimental test coverage. 2015-05-16 10:34:38 +02:00
James Cole
f64616748c Expenses only [skip ci] 2015-05-16 10:18:32 +02:00
James Cole
512ce15973 Small tweaks in charts. 2015-05-16 10:13:41 +02:00
James Cole
ed8b301574 Routes and JS cleanup. 2015-05-16 10:05:22 +02:00
James Cole
d22a6c019c Fixed lots of chart references. 2015-05-16 09:57:31 +02:00
James Cole
a0cb1b9d9e Clean up and split chart controllers 2015-05-16 09:41:14 +02:00
James Cole
a5294c62ea Renamed a method. 2015-05-16 09:26:54 +02:00
James Cole
e155d3311c Fixed tests 2015-05-16 09:25:14 +02:00
James Cole
0a372b0daf Cleanup tests 2015-05-16 09:16:32 +02:00
James Cole
69143399d1 Moved some stuff around. 2015-05-16 09:09:52 +02:00
James Cole
3270d3bf96 Cleanup. 2015-05-16 08:14:26 +02:00
James Cole
3896a66122 Fixed tests. 2015-05-16 08:09:15 +02:00
James Cole
b94781aef1 Some optimisations. 2015-05-16 08:05:04 +02:00
James Cole
bed1adc367 Fixed budget. 2015-05-16 07:56:15 +02:00
James Cole
ae54497efa Differ between shared and normal transactions (not build yet). 2015-05-16 07:49:02 +02:00
James Cole
06b747c221 Some cleanup and translations. 2015-05-16 07:28:58 +02:00
James Cole
f159beee0d Fixed preferences tests. 2015-05-15 23:24:55 +02:00
James Cole
49d7dea086 Fixed some coverage. 2015-05-15 23:02:42 +02:00
James Cole
3e65733dc5 Small fix in report view [skip ci] 2015-05-15 22:12:31 +02:00
James Cole
cc375d58bb Fixed tests. 2015-05-15 22:06:52 +02:00
James Cole
911c7c662a Expanded reports. 2015-05-15 22:00:00 +02:00
James Cole
aae003be33 Some more cleaning up and fixing 2015-05-15 21:01:24 +02:00
James Cole
aede03d8b2 Some more layout changes. 2015-05-15 20:43:50 +02:00
James Cole
f0f5ada7de More changes to reports. 2015-05-15 20:38:39 +02:00
James Cole
58365121a3 Fixed tests. 2015-05-15 20:15:58 +02:00
James Cole
d5a154d2e6 Cleaned up reports and associated views. 2015-05-15 20:07:51 +02:00
James Cole
b20f369aef Some new tests. 2015-05-15 18:39:59 +02:00
James Cole
abb8aa0b29 Merge branch 'feature/translations' into develop 2015-05-15 18:38:26 +02:00
James Cole
5368a0f1d7 Some new translations. 2015-05-14 19:44:20 +02:00
James Cole
d3897eece7 This should fix the tests on the translations branch. 2015-05-14 18:15:31 +02:00
James Cole
a82b829da9 More translations. 2015-05-14 18:00:56 +02:00
James Cole
9f5058e81a Some new translations. 2015-05-14 17:52:50 +02:00
James Cole
5b19263720 Some more [skip ci] 2015-05-14 16:43:12 +02:00
James Cole
9d5a0db0d9 [skip ci] 2015-05-14 16:36:08 +02:00
James Cole
4bd8a7014f Count things [skip ci] 2015-05-14 16:35:41 +02:00
James Cole
353e96d951 Better (and translated) delete forms. [skip ci] 2015-05-14 16:32:35 +02:00
James Cole
149a6f92b0 Translations [skip ci] 2015-05-14 15:56:23 +02:00
James Cole
d66426c137 Nieuw vertalingen [skip ci] 2015-05-14 15:53:56 +02:00
James Cole
4fc9966392 Chart translations [skip ci] 2015-05-14 13:43:58 +02:00
James Cole
417766f0db Various date localisation. [skip ci] 2015-05-14 13:41:21 +02:00
James Cole
de9ac97887 Also english. [skip ci] 2015-05-14 13:19:26 +02:00
James Cole
6be42f112a Charts and titles in Dutch. [skip ci] 2015-05-14 13:17:53 +02:00
James Cole
3895ae63c7 Some translations for lists [skip ci] 2015-05-14 13:00:43 +02:00
James Cole
607d416d54 Better translation for 'balance' [skip ci] 2015-05-14 12:11:56 +02:00
James Cole
038693dc86 More index translations [skip ci] 2015-05-14 12:10:42 +02:00
James Cole
cc9be13544 Added a bread crumb [skip ci] 2015-05-14 11:50:48 +02:00
James Cole
9c1474087f Forgot one [skip ci] 2015-05-14 11:50:04 +02:00
James Cole
831de2bcf4 New menu translations [skip ci] 2015-05-14 11:48:59 +02:00
James Cole
eb687333bb Small edits to buttons and others. [skip ci] 2015-05-14 11:31:54 +02:00
James Cole
5cc7966d54 Some new form things. [skip ci] 2015-05-14 11:25:43 +02:00
James Cole
d1a34e7a6f Breadcrumbs translated to English. [skip ci] 2015-05-14 11:22:20 +02:00
James Cole
d63d791717 Translated all bread crumbs to Dutch. [skip ci] 2015-05-14 11:17:56 +02:00
James Cole
015570c741 Small translations as a basic start [skip ci] 2015-05-14 10:26:15 +02:00
James Cole
8400ebc9c6 Added a language test, added Dutch basic file. [skip ci] 2015-05-14 10:03:57 +02:00
James Cole
9f99e7c0af Edit and set language [skip ci] 2015-05-14 09:59:30 +02:00
James Cole
392c1fc399 Add language selector to preferences [skip ci] 2015-05-14 09:56:41 +02:00
James Cole
d3cea7a89c Add new supported languages [skip ci] 2015-05-14 09:52:58 +02:00
James Cole
1dcf7407e6 Cleanup [skip ci] 2015-05-14 09:51:54 +02:00
James Cole
d543c033a3 Small fixes to translations. 2015-05-14 09:50:07 +02:00
James Cole
aaa186be5e Merge branch 'release/3.4.0.6' 2015-05-14 09:21:23 +02:00
James Cole
2054b5b3dd Merge branch 'release/3.4.0.6' into develop 2015-05-14 09:21:23 +02:00
James Cole
98ae5b0ca0 New read me. 2015-05-14 09:21:12 +02:00
James Cole
36c8171d0f Clean up and tests. 2015-05-14 09:01:10 +02:00
James Cole
3603eb94cc Different budget query [skip ci] 2015-05-14 08:08:25 +02:00
James Cole
0e068d4ccf Fixed some tests. 2015-05-13 21:37:11 +02:00
James Cole
199f348ff4 Smaller mobile pages. 2015-05-13 21:32:33 +02:00
James Cole
b22655fb7c Fix helper 2015-05-13 21:32:27 +02:00
James Cole
06cc9618ba Some new tests 2015-05-13 21:32:21 +02:00
James Cole
b9019c8c7f Smaller screens update [skip ci] 2015-05-13 06:34:17 +02:00
James Cole
77e133e67c Some cleaning up for mobile screens [skip ci] 2015-05-13 06:31:32 +02:00
James Cole
571e7df807 Some tiny optimisations. 2015-05-12 20:51:03 +02:00
James Cole
22f4d2979a Added some more ignores, edited some middleware. 2015-05-11 22:12:53 +02:00
James Cole
e46e366694 Added some tests to cover an event. 2015-05-11 21:45:31 +02:00
James Cole
7b4bc23815 Merge branch 'release/3.4.0.5' 2015-05-10 19:18:57 +02:00
James Cole
9ca79f767c Merge branch 'release/3.4.0.5' into develop 2015-05-10 19:18:57 +02:00
James Cole
274dba7408 Update read me. 2015-05-10 19:18:49 +02:00
James Cole
31708ca29e Ignore some code. 2015-05-10 19:18:43 +02:00
James Cole
671b025588 More ignore stuff. 2015-05-10 13:40:29 +02:00
James Cole
a7956e4856 Adding lots of ignore statements because testing the models is pointless. 2015-05-10 13:22:00 +02:00
James Cole
355862025a Auth and password controller. 2015-05-10 13:06:02 +02:00
James Cole
a2a39ee0f8 Ignore piggy bank part. 2015-05-10 09:35:42 +02:00
James Cole
ec8e39c16f Fixed currency tests. 2015-05-10 09:26:44 +02:00
James Cole
88f714999e Add test to get full coverage. 2015-05-10 08:53:49 +02:00
James Cole
c0c2aa3be0 Fixed one test. 2015-05-10 08:49:15 +02:00
James Cole
822044820e Ignored more files. 2015-05-10 08:26:42 +02:00
James Cole
6ffc182142 Ignore lots of code in test coverage. 2015-05-10 08:08:07 +02:00
James Cole
3d54a78573 Tag repository tests 2015-05-10 07:48:33 +02:00
James Cole
8ddf7d953a Ignore constructor. 2015-05-10 07:09:21 +02:00
James Cole
8b9e9ad103 Tests for reminder repository. 2015-05-10 07:07:17 +02:00
James Cole
5737224c40 Simplified translations [skip ci] 2015-05-09 22:42:45 +02:00
James Cole
ec9aacbcae More new tests. 2015-05-09 22:30:16 +02:00
James Cole
9395454997 Small optimalizations [skip ci] 2015-05-09 19:27:25 +02:00
James Cole
66198a8d98 Expanded bread crumb [skip ci] 2015-05-09 19:23:37 +02:00
James Cole
96ed9a4256 Finished journal repository. 2015-05-09 18:30:58 +02:00
James Cole
10e54b2263 Tested part of the journal repository. 2015-05-09 18:11:48 +02:00
James Cole
cf00922ad2 Merge branch 'release/3.4.0.4' 2015-05-09 15:13:20 +02:00
James Cole
84e8e007a5 Merge branch 'release/3.4.0.4' into develop 2015-05-09 15:13:20 +02:00
James Cole
d07b2e773b Update read me 2015-05-09 15:13:14 +02:00
James Cole
506ef7b0b9 Covered currency repository. 2015-05-09 15:11:12 +02:00
James Cole
2cd5dae8e2 New read me [skip ci] 2015-05-09 15:08:56 +02:00
James Cole
a1cd49c111 First attempt at translations. 2015-05-09 13:56:03 +02:00
James Cole
aca2973aef Experimental chart [skip ci] 2015-05-09 13:55:07 +02:00
James Cole
0a7a691c95 Experimental chart [skip ci] 2015-05-09 13:53:58 +02:00
James Cole
72906a7afd Experimental chart [skip ci] 2015-05-09 13:52:33 +02:00
James Cole
d1a4a83570 Covered category repository. 2015-05-09 13:14:02 +02:00
James Cole
e0396b29e8 Add GA beacon [skip ci] 2015-05-09 10:43:37 +02:00
James Cole
536833cfe0 Fixed tests. 2015-05-09 10:25:52 +02:00
James Cole
317b02d1b9 Finished budget repository tests. 2015-05-09 10:23:13 +02:00
James Cole
75e279ea0d Update read me [skip ci] 2015-05-09 09:17:09 +02:00
James Cole
dc2ad21f4c Updated read me [skip ci] 2015-05-09 09:15:39 +02:00
James Cole
484d49aae1 Fixed tests 2015-05-09 09:15:27 +02:00
James Cole
ca39438ad4 Small update to the read me. [skip ci] 2015-05-09 09:11:54 +02:00
James Cole
49a65ebff4 New budget repository tests. 2015-05-09 09:05:37 +02:00
James Cole
befdc05084 Rewrote read me. [skip ci] 2015-05-08 19:34:03 +02:00
James Cole
1fbffe761b Merge branch 'release/3.4.0.3' into develop 2015-05-08 17:35:03 +02:00
James Cole
36aad379ff Merge branch 'release/3.4.0.3' 2015-05-08 17:35:02 +02:00
James Cole
540cfa072e Update read me. 2015-05-08 17:34:54 +02:00
James Cole
3b049c15cc Updated composer.json [skip ci] 2015-05-08 17:15:16 +02:00
James Cole
3e93ed0a17 Small JS fix. [skip ci] 2015-05-08 17:13:49 +02:00
James Cole
d7d9358136 Fix sorting [skip ci] 2015-05-08 17:04:24 +02:00
James Cole
5cf0939ff9 Fixed sorting [skip ci] 2015-05-08 17:03:20 +02:00
James Cole
8dc6f91d3c Add sort options. [skip ci] 2015-05-08 17:00:39 +02:00
James Cole
a3a25db230 New tests. 2015-05-08 16:44:57 +02:00
James Cole
c06f18c815 Some new tests 2015-05-08 14:00:49 +02:00
James Cole
6802f04036 First two tests for bill repository. 2015-05-08 12:50:39 +02:00
James Cole
beeccdf345 New (incomplete) tests [skip ci] 2015-05-08 12:44:42 +02:00
James Cole
58241ed39d Covered account repository. 2015-05-08 12:42:12 +02:00
James Cole
31128020f0 Merge branch 'release/3.4.0.2' 2015-05-08 07:57:06 +02:00
James Cole
6c48afc37b Merge branch 'release/3.4.0.2' into develop 2015-05-08 07:57:06 +02:00
James Cole
7a2f169dfc Push new version. 2015-05-08 07:56:55 +02:00
James Cole
ed910b99a7 Update travis configuration [skip ci] 2015-05-08 07:48:04 +02:00
James Cole
54195c0826 Updated tests. 2015-05-08 07:39:05 +02:00
James Cole
cefbbcd1df Fixed some tests. 2015-05-08 07:27:29 +02:00
James Cole
cc01592085 Cover some more account repository. 2015-05-08 06:01:39 +02:00
James Cole
5a98a5252d Added tests. 2015-05-07 21:26:00 +02:00
James Cole
184e8b1132 Some new tests. 2015-05-07 20:56:27 +02:00
James Cole
2b6b896c2e Some more coverage. 2015-05-06 18:09:45 +02:00
James Cole
96d06b7a93 Added incomplete tests. 2015-05-05 22:46:28 +02:00
James Cole
f54f1611b5 First tests for account repository. 2015-05-05 20:46:13 +02:00
James Cole
69ad757e8b Lazily remove todo's [skip ci] 2015-05-05 13:03:39 +02:00
James Cole
e0beb796ad Some cleaning up [skip ci] 2015-05-05 13:03:04 +02:00
James Cole
f331e7d820 Removed unnecessary imports (use statements) [skip ci] 2015-05-05 12:57:27 +02:00
James Cole
cbb62d3d78 Added new line at the end of files. [skip ci] 2015-05-05 12:51:57 +02:00
James Cole
c85bc59c1d Merge branch 'release/3.4.0.1' into develop 2015-05-05 12:35:23 +02:00
James Cole
8081eeb007 Merge branch 'release/3.4.0.1' 2015-05-05 12:35:22 +02:00
James Cole
56f91bd10d Increment version. 2015-05-05 12:35:11 +02:00
James Cole
8e20b78731 Cleanup. 2015-05-05 10:30:39 +02:00
James Cole
23a09b7081 Code cleanup. 2015-05-05 10:23:01 +02:00
James Cole
67fdd27499 Various code cleanup [skip ci] 2015-05-05 07:51:02 +02:00
James Cole
e1941daedd Updated phpdoc. [skip ci] 2015-05-05 07:48:34 +02:00
James Cole
f28bc568a4 Some cleanup [skip ci] 2015-05-05 07:43:16 +02:00
James Cole
f24cfe39aa Expanded some tests. 2015-05-05 07:41:30 +02:00
James Cole
59d2bf3f79 Covered transaction controller. 2015-05-05 07:28:04 +02:00
James Cole
3176e54614 Partial coverage of the transaction controller. 2015-05-04 23:46:14 +02:00
James Cole
eb090f7265 Better factory. 2015-05-04 22:33:52 +02:00
James Cole
6d3a9bfd18 Some cleaning up 2015-05-04 22:33:03 +02:00
James Cole
76f08b7acb Full coverage for chart controller. 2015-05-04 19:28:49 +02:00
James Cole
1ff99346aa Update chart [skip ci] 2015-05-04 18:51:51 +02:00
James Cole
369695ab32 Update chart [skip ci] 2015-05-04 18:51:38 +02:00
James Cole
7e23dd1d66 Update composer.lock [skip ci] 2015-05-04 18:45:32 +02:00
James Cole
0205d3fc5c Overspent transactions have a separate colour [skip ci] 2015-05-04 18:45:20 +02:00
James Cole
4660cf2ad5 Fixed a bug in the display of the current currency code. 2015-05-03 16:16:43 +02:00
James Cole
e26d08d674 Update git ignore. [skip ci] 2015-05-03 16:14:15 +02:00
James Cole
0932bf2797 Don't need these files [skip ci] 2015-05-03 16:13:38 +02:00
James Cole
f560fc6d76 Covered search controller. 2015-05-03 15:55:19 +02:00
James Cole
aa6209af00 Covered tag controller. 2015-05-03 15:00:39 +02:00
James Cole
4a51176193 General cleanup. 2015-05-03 12:58:55 +02:00
James Cole
bb84f7a434 Fixed parameter order [skip ci] 2015-05-03 12:54:39 +02:00
James Cole
48168b1ef0 Covered report controller. 2015-05-03 11:02:34 +02:00
James Cole
8281c7c83e Don't escape currency symbol [skip ci] 2015-05-03 10:11:16 +02:00
James Cole
a07c1e3c71 See code. [skip ci] 2015-05-03 10:07:18 +02:00
James Cole
0766bb31fe Better amount formatting [skip ci] 2015-05-03 10:03:50 +02:00
James Cole
ff4472c1a5 FormatAmountPlain is HTML safe [skip ci] 2015-05-03 10:01:38 +02:00
James Cole
17424740e5 Show plain amount instead of coloured amounts. [skip ci] 2015-05-03 10:00:47 +02:00
James Cole
dad0b2fcd3 Show plain amount instead of coloured amounts. [skip ci] 2015-05-03 10:00:03 +02:00
James Cole
c48dbf030f Covered the reminder controller. 2015-05-03 09:55:22 +02:00
James Cole
617808d603 Covered profile controller with tests. 2015-05-03 09:19:14 +02:00
James Cole
845149deee Boxes are empty, so even when it's zero, place the amount. 2015-05-03 08:56:44 +02:00
James Cole
1a9e009327 Merge branch 'release/3.4' into develop 2015-05-02 23:51:45 +02:00
James Cole
ae90815708 Merge branch 'release/3.4' 2015-05-02 23:51:44 +02:00
James Cole
1c460343b7 New version! 2015-05-02 23:51:34 +02:00
James Cole
26079622f9 Fixed JSON controller tests. 2015-05-02 23:39:39 +02:00
James Cole
06c6d6096f Fixed coverage. 2015-05-02 23:28:04 +02:00
James Cole
c8183aea51 Format amount [skip ci] 2015-05-02 22:50:40 +02:00
James Cole
7531134ad2 Some tag related fine tuning. 2015-05-02 22:41:32 +02:00
James Cole
cd0c6439c2 Delete tags now possible. 2015-05-02 22:30:59 +02:00
James Cole
c918c93f51 Forget me own head next. [skip ci] 2015-05-02 22:13:37 +02:00
James Cole
97d3bd68ed Show balance act tags. 2015-05-02 22:12:26 +02:00
James Cole
75f1e034ae Fixed menu. [skip ci] 2015-05-02 22:09:21 +02:00
James Cole
8e72f218f1 Show HTML 2015-05-02 22:05:57 +02:00
James Cole
d643e05c5a Basic amount format fix. 2015-05-02 22:05:18 +02:00
James Cole
fea44834d0 Fixed test to match fixed controller. 2015-05-02 21:22:27 +02:00
James Cole
195a2d7523 Removed all the old views. 2015-05-02 21:18:04 +02:00
James Cole
b2fd346ef8 Merge branch 'feature/twig' into develop 2015-05-02 21:16:21 +02:00
James Cole
1ff8b62cb7 And now with actual coverage. 2015-05-02 19:44:31 +02:00
James Cole
c7ae15a41a This should fix all twig tests. Let's find out! 2015-05-02 19:44:12 +02:00
James Cole
efe6f59f79 Last templates. Should cover everything. [skip ci] 2015-05-02 19:19:47 +02:00
James Cole
8e31d0491d Fixed search [skip ci] 2015-05-02 18:30:59 +02:00
James Cole
73d4a10351 Fixed reports [skip ci] 2015-05-02 18:26:55 +02:00
James Cole
81d9d4dbc7 Various files updated to twig [skip ci] 2015-05-02 13:20:49 +02:00
James Cole
184ec13f99 Fixed bills [skip ci] 2015-05-02 12:51:02 +02:00
James Cole
dee0422eff Fix preferences [skip ci] 2015-05-02 12:22:19 +02:00
James Cole
81a2975f1a Show piggy banks [skip ci] 2015-05-02 11:32:45 +02:00
James Cole
5cd2ef4a5e Some generic templates and the first piggy bank ones [skip ci] 2015-05-02 10:53:54 +02:00
James Cole
466c2a68c2 Add delete form [skip ci] 2015-05-02 10:42:41 +02:00
James Cole
0fb9fba531 New currency routes 2015-05-02 10:40:20 +02:00
James Cole
356dd2c6cd Creat / edit / index [skip ci] 2015-05-02 10:37:16 +02:00
James Cole
32c4661233 Fixed no budget / no category bread crumb [skip ci] 2015-05-02 09:49:37 +02:00
James Cole
a245b504ec Fixed bread crumbs. 2015-05-02 09:31:57 +02:00
James Cole
a2f5fbdfd3 Working on two more views [skip ci] 2015-05-02 09:29:34 +02:00
James Cole
04be26adc5 Fixed title [skip ci] 2015-05-02 09:26:20 +02:00
James Cole
be0adb7cf2 Create / edit category 2015-05-02 09:25:45 +02:00
James Cole
84fd92bf5a Categories [skip ci] 2015-05-02 09:21:42 +02:00
James Cole
ee4e061739 Removed code from budget index [skip ci] 2015-05-02 09:21:32 +02:00
James Cole
4a2b01cd9a Menu fixes [skip ci] 2015-05-02 09:16:17 +02:00
James Cole
efdd6460fb Fixed injection. 2015-05-02 09:08:41 +02:00
James Cole
803827e05c Fixed more views. [skip ci] 2015-05-02 09:06:07 +02:00
James Cole
a41d5e9ab3 New budget [skip ci] 2015-05-02 08:32:20 +02:00
James Cole
e94333f877 Can view budgets [skip ci] 2015-05-02 08:28:24 +02:00
James Cole
6dbb80d687 Optimisations [skip ci] 2015-05-02 08:09:54 +02:00
James Cole
31a1031624 And delete is fixed. 2015-05-01 23:39:45 +02:00
James Cole
f8e9ce0d52 Can edit as well. 2015-05-01 23:35:35 +02:00
James Cole
11baa968cd Can create accounts. 2015-05-01 23:17:17 +02:00
James Cole
3e5e5b376f Made it almost to the accounts. 2015-05-01 22:44:35 +02:00
James Cole
bda18f296d Optimised Twig extensions. 2015-05-01 20:17:06 +02:00
James Cole
287d110c84 Small bug fix in budget chart. 2015-05-01 18:45:42 +02:00
James Cole
c98275e73a More templates converted to twig. 2015-05-01 18:44:49 +02:00
James Cole
aa573cc951 Fix redirect 2015-05-01 14:32:31 +02:00
James Cole
883d3d86e3 Update a test. 2015-05-01 14:32:26 +02:00
James Cole
fb047bd5f4 Fix migration. 2015-05-01 08:34:53 +02:00
James Cole
66a04d8365 Slightly different chart on index. 2015-05-01 08:34:44 +02:00
James Cole
a0e501f9fd First attempt at implementing Twig. 2015-05-01 08:29:41 +02:00
James Cole
8b40d3346d An attempt at showing tag info. 2015-05-01 06:47:24 +02:00
James Cole
eddf5cd250 Fix button, close #74 2015-05-01 06:38:48 +02:00
James Cole
ee5c534ca3 Took the time to fix the tests. 2015-04-30 17:32:00 +02:00
James Cole
fd4e77ae0f Catch empty tags. 2015-04-28 21:01:54 +02:00
James Cole
b747c50aa3 Fix method to return object, not key. 2015-04-28 21:00:26 +02:00
James Cole
deebdd86a6 And another small JS fix [skip ci] 2015-04-28 20:20:16 +02:00
James Cole
b2db79cc10 Fixed some small CSS / JS problems. 2015-04-28 20:17:31 +02:00
James Cole
bbab370b1e Some new code. 2015-04-28 17:10:52 +02:00
James Cole
db4adf399d Cleaning up. 2015-04-28 15:26:30 +02:00
James Cole
0683c87e52 Small check in tags. 2015-04-28 14:08:58 +02:00
James Cole
3f62b647fc Removed code related to "related transactions". 2015-04-28 13:50:53 +02:00
James Cole
2562a5b30d Don't save all tags unconditionally. 2015-04-28 13:47:13 +02:00
James Cole
e232f2e223 Delete tags 2015-04-28 11:04:46 +02:00
James Cole
21644ff4dd Routes will throw 404's 2015-04-28 11:04:38 +02:00
James Cole
be96a4fce5 Show tags in transaction. 2015-04-28 10:51:56 +02:00
James Cole
a1cabcbed3 Show tag icons. 2015-04-28 10:50:43 +02:00
James Cole
ce933b1f06 Edit and update tags. 2015-04-28 10:36:13 +02:00
James Cole
51ae130922 Fixed the build by adding new migrations for each step. 2015-04-28 09:54:22 +02:00
James Cole
da1bc18a47 Better list for piggy banks. 2015-04-28 09:15:31 +02:00
James Cole
e7165a526b First attempt at basic tag functionality. 2015-04-28 08:58:01 +02:00
James Cole
6081cc399f Small bug fixes and cleaning up. 2015-04-28 08:12:12 +02:00
James Cole
7c5c24e15d Moved edit buttons. 2015-04-26 07:42:55 +02:00
James Cole
e3e55b4347 Moved all create-buttons lower. 2015-04-26 07:39:49 +02:00
James Cole
40d8e7d1ad Fixed a bug where transfers away from a piggy bank's account would not properly reflect the piggy bank. 2015-04-24 12:06:13 +02:00
James Cole
59e23b89f2 Removed unnecessary sort. 2015-04-24 11:54:23 +02:00
James Cole
cc33af8193 Could not set order. 2015-04-24 10:00:56 +02:00
James Cole
0e1e7eb2a9 Merge branch 'release/3.3.9' 2015-04-22 08:08:14 +02:00
James Cole
52a28a7758 Merge branch 'release/3.3.9' into develop 2015-04-22 08:08:14 +02:00
James Cole
3f752d6832 New read me. 2015-04-22 08:08:05 +02:00
James Cole
fe714e9989 Built a routine that will allow you to completely delete an account. 2015-04-22 07:54:56 +02:00
James Cole
0d3213a379 Covered the preferences controller. 2015-04-21 17:19:14 +02:00
James Cole
44056629e8 Use local db instead of constant migrating. 2015-04-20 22:08:24 +02:00
James Cole
54125c05d3 New tests and prep for future runs. 2015-04-20 21:57:20 +02:00
James Cole
7d32e50f25 Mentioned wrong amount. 2015-04-20 20:56:28 +02:00
James Cole
4af9ff49a0 Fixed a bug in the report controller that grouped transactions wrong. 2015-04-20 20:54:55 +02:00
James Cole
23faef845c Merge branch 'release/3.3.8' 2015-04-20 18:07:02 +02:00
James Cole
41dad4091a Merge branch 'release/3.3.8' into develop 2015-04-20 18:07:02 +02:00
James Cole
daf859b977 Updated read me. 2015-04-20 18:06:37 +02:00
James Cole
f47ba6c977 Update example file. 2015-04-20 18:06:21 +02:00
James Cole
4b9b207d92 Removed development references. 2015-04-20 17:59:04 +02:00
James Cole
875cbf66af 1 should be 0 2015-04-19 19:10:53 +02:00
James Cole
412d6d4fd7 Small CSS fix for piggy banks [skip ci] 2015-04-19 17:43:04 +02:00
James Cole
91c6deeb1f Renamed another field. 2015-04-19 14:28:17 +02:00
James Cole
6d1978fd9a Showed the wrong value. 2015-04-19 14:27:08 +02:00
James Cole
52d23b6ef5 Referred to an id which turned out to be a index. 2015-04-19 14:19:25 +02:00
James Cole
0656ccbdd9 Fixed a bug where the query would include deleted transactions. 2015-04-19 13:57:43 +02:00
James Cole
e774ebd0a3 Possible bug in account create thing. [skip ci] 2015-04-18 16:04:21 +02:00
James Cole
edbda32a84 Fix balance. 2015-04-13 21:13:05 +02:00
James Cole
721fa04e3c Added home screen information about piggy banks. 2015-04-13 20:43:58 +02:00
James Cole
9fd8d8915d amount > queryAmount 2015-04-12 10:53:53 +02:00
James Cole
7a9f5ebdd1 Added "what" variable. 2015-04-12 10:22:15 +02:00
James Cole
a3423f0321 Add the correct path to category overview. 2015-04-12 10:19:37 +02:00
James Cole
c37e9a4467 Covered the JSON controller. 2015-04-11 19:59:41 +02:00
James Cole
6157d82a0b time format 2015-04-11 18:52:03 +02:00
James Cole
38b27fec92 Without moment.js 2015-04-11 18:49:57 +02:00
James Cole
c43439bb68 Test for date. 2015-04-11 18:47:37 +02:00
James Cole
8d9561d7a5 Removed data-value. 2015-04-11 18:45:01 +02:00
James Cole
2a72cce3b7 Included date format. 2015-04-11 15:11:45 +02:00
James Cole
d3bbb6fb1f Removed date value. 2015-04-11 15:11:19 +02:00
James Cole
7b6723e9a2 Update date format. 2015-04-11 15:10:29 +02:00
James Cole
1ee741460d Updated empty entries as well. 2015-04-11 15:09:48 +02:00
James Cole
967b0b493b Switched dates around. 2015-04-11 15:07:42 +02:00
James Cole
b53aaf7dde Fixed sort format. 2015-04-11 15:06:10 +02:00
James Cole
714c13bdbf Include moment.js 2015-04-11 15:04:16 +02:00
James Cole
651a4fd3cc Sortable accounts. 2015-04-11 15:01:42 +02:00
James Cole
505aee22bb Sortable categories. 2015-04-11 14:53:22 +02:00
James Cole
ca3d59dc33 Another fix. 2015-04-11 12:51:58 +02:00
James Cole
13890e32a1 Fixed a view and a botched include. 2015-04-11 12:50:56 +02:00
James Cole
df8976eabe Journals that no longer match a bill will be removed. 2015-04-11 12:40:47 +02:00
James Cole
3e01daa172 Query & loop optimizations. 2015-04-11 12:36:17 +02:00
James Cole
f6999f355b Some foreach loop cleaning up. 2015-04-11 12:27:56 +02:00
James Cole
5c06b45eb1 Code cleanup. 2015-04-11 07:32:11 +02:00
James Cole
1802bb967a Moved JSON money boxes to individual functions. 2015-04-11 07:24:07 +02:00
James Cole
d8d92f147f Removed logging, found bug. 2015-04-10 07:29:36 +02:00
James Cole
4a95bdd8ba Added temporary debug to google chart. 2015-04-10 07:25:24 +02:00
James Cole
db5d94d956 Added temporary debug entries. 2015-04-10 07:19:45 +02:00
James Cole
06f2e34bb5 Renamed the amount variable so it stops interfering with another variable 2015-04-10 06:57:39 +02:00
James Cole
2ef7a01945 Fixed a bug where the bill chart and boxes would inaccurately reflect the amount of bills yet to pay. 2015-04-10 06:52:36 +02:00
James Cole
d3f642551d Fixed a small bug in the bill-chart and simplified yet another Json box. 2015-04-09 21:36:58 +02:00
James Cole
490997157e Switched two queries around. 2015-04-09 21:30:35 +02:00
James Cole
2432af7883 Simplified the in and out-box. 2015-04-09 21:29:58 +02:00
James Cole
7abeece3f0 Simplified the "out"-box. 2015-04-09 21:27:35 +02:00
James Cole
3851652821 Renamed various fields from 'amount' to 'queryAmount' to prevent interfering with the getAmountAttribute property. 2015-04-09 21:18:18 +02:00
James Cole
1d67d2250a Renamed various fields from 'amount' to 'queryAmount' to prevent interfering with the getAmountAttribute property. 2015-04-09 21:16:35 +02:00
James Cole
37f40d8637 Renamed various fields from 'amount' to 'queryAmount' to prevent interfering with the getAmountAttribute property. 2015-04-09 21:14:15 +02:00
James Cole
0224d1d59b Accidentally commented out date limits in query. 2015-04-09 21:01:08 +02:00
James Cole
587b94153d Removed some foreach() routines that are no longer necessary now that getAmountAttribute() exists. 2015-04-09 20:58:57 +02:00
James Cole
5124ce0302 Fixed a bug where getAmountAttribute would interfere with queries that contained a "amount"-field. 2015-04-09 20:52:47 +02:00
James Cole
950c4045b0 Fix total savings to accurately reflect end of current period. 2015-04-09 19:10:24 +02:00
James Cole
9c8ba66873 Order categories by name. 2015-04-09 17:54:24 +02:00
James Cole
25d1d1be1b Merge pull request #72 from vbali/feature/savings-total
Add savings total for savings widget on dashboard
2015-04-09 17:47:24 +02:00
James Cole
339c352505 Fixed a bug where categories would be created even though they already existed. 2015-04-09 17:46:47 +02:00
Balazs Varkonyi
c587081fe4 Add savings total for savings widget on dashboard 2015-04-09 11:52:35 +02:00
James Cole
8f9b1b866b Included full home controller tests. 2015-04-07 20:54:43 +02:00
James Cole
ff5ecf6182 More tests. 2015-04-07 19:58:49 +02:00
James Cole
05670cf393 Optimize test code. 2015-04-07 18:52:15 +02:00
James Cole
f10f5d30bf Mock previously unmocked calls. 2015-04-07 18:48:34 +02:00
James Cole
0d336727e8 Automated code cleanup. 2015-04-07 18:26:14 +02:00
James Cole
bf354275b3 Some general cleaning up. 2015-04-07 18:25:21 +02:00
James Cole
1932bf277a More tests 2015-04-07 17:51:22 +02:00
James Cole
192db4bb6e Accidentally included JS twice. 2015-04-07 10:14:20 +02:00
James Cole
701efb943d Lots of new tests. 2015-04-07 10:14:10 +02:00
James Cole
b2674971f1 Updated composer.lock. 2015-04-06 09:20:45 +02:00
James Cole
c907cb4cf1 General cleanup and new (incomplete) tests. 2015-04-06 09:15:59 +02:00
James Cole
bb1462b4d9 Merge branch 'release/3.3.7' 2015-04-05 21:15:01 +02:00
James Cole
1035f0e139 Merge branch 'release/3.3.7' into develop 2015-04-05 21:15:01 +02:00
James Cole
8475757716 Removed iconv() commented code. See other commit. 2015-04-05 21:14:41 +02:00
James Cole
20ffd8d61b New read me. 2015-04-05 21:14:25 +02:00
James Cole
8601428c4c Fixed a bug in the form request that wouldn't accept fairly long names. 2015-04-05 21:12:54 +02:00
James Cole
59998573ee Removed iconv thing that doesn't seem to matter. See screenshot at https://imgur.com/8r26ZZu 2015-04-05 21:12:31 +02:00
James Cole
293cd72001 Add currency tests. 2015-04-05 20:47:19 +02:00
James Cole
22ab9ebb2f Included tests for the category controller. 2015-04-05 19:43:20 +02:00
James Cole
9136e592d3 Included bill controller. 2015-04-05 18:20:06 +02:00
James Cole
ed8e392616 Fixed budget controller tests. 2015-04-05 15:53:03 +02:00
James Cole
e57ce6e644 Test now works. 2015-04-05 15:25:35 +02:00
James Cole
8204e46086 Removed inspiring quotes. 2015-04-05 10:38:53 +02:00
James Cole
9e365d9f80 Mar tests. 2015-04-05 10:36:28 +02:00
James Cole
6b40a933e9 And.. completed the account controller. 2015-04-04 22:53:49 +02:00
James Cole
8520a5002f Another attempt at fixing some tests. I'm probably searching in the wrong direction with this. 2015-04-04 22:27:51 +02:00
James Cole
b38ed06f6e New tests. 2015-04-04 21:52:56 +02:00
James Cole
48427b1143 A mediocre fix for the database failures. 2015-04-04 21:33:36 +02:00
James Cole
5d505f4ed0 Fixed more tests but the factories are not perfect yet. 2015-04-04 21:23:37 +02:00
James Cole
0c02a08954 Merge pull request #65 from vbali/master
Fixes for chart and account creation
2015-04-04 06:50:30 +02:00
Balazs Varkonyi
0221bd0f80 Merge branch 'hotfix/diff–fix' 2015-04-04 01:56:25 +02:00
Balazs Varkonyi
28216cbcb5 Removed merge conflict from CategoryController 2015-04-04 01:56:19 +02:00
Balazs Varkonyi
3e08a8cd6b Merge branch 'hotfix/account-fix' 2015-04-04 01:37:05 +02:00
Balazs Varkonyi
67fafdeef7 Return the new account from firstOrCreateEncrypted 2015-04-04 01:36:55 +02:00
Balazs Varkonyi
cc82505b66 Merge branch 'hotfix/chart-fix' 2015-04-04 01:33:36 +02:00
Balazs Varkonyi
fd5f075f63 Chart fix for accounts with accented letters 2015-04-04 01:31:57 +02:00
James Cole
a115960411 Merge branch 'release/3.3.6'
Conflicts:
	app/Http/Controllers/CategoryController.php
2015-04-03 23:31:29 +02:00
James Cole
e9fa4ca816 New version in read me. 2015-04-03 23:30:54 +02:00
James Cole
75d92bc7f0 Allow FF to send events. 2015-04-03 23:22:23 +02:00
James Cole
74aa6e911e Make boxes respond to unpaid / paid credit card bills. 2015-04-03 23:10:51 +02:00
James Cole
9d000c1898 Added amount because debug. 2015-04-03 23:05:50 +02:00
James Cole
b2254875b2 Expanded to credit cards. 2015-04-03 22:54:21 +02:00
James Cole
78d04230d5 New CC help text. 2015-04-03 21:25:04 +02:00
James Cole
1c04477393 Support credit cards (in name only). 2015-04-03 21:12:54 +02:00
James Cole
2a9679c94e Textual fix in bill [skip ci] 2015-04-03 21:05:41 +02:00
James Cole
6009f8ecde Better chart for bills. 2015-04-03 21:05:01 +02:00
James Cole
35cdbec70a Clean up for budget limits. 2015-04-03 19:39:36 +02:00
James Cole
0faef542c1 Fixed a bug in the budget controller. 2015-04-03 19:11:55 +02:00
James Cole
8b085af6a1 First attempt at account controller::index. 2015-04-03 12:14:40 +02:00
James Cole
e3b11a9eb2 New test for edit form that is more inclusive. 2015-04-03 09:30:44 +02:00
James Cole
72fc88f3c6 Even more tests. 2015-04-03 08:55:24 +02:00
James Cole
a5b759f268 Updates TestCase.php 2015-04-03 08:37:53 +02:00
James Cole
6a9ffae25d New tests and factories. 2015-04-03 08:31:50 +02:00
James Cole
64c031c7fe Small updates [skip ci] 2015-04-03 07:44:44 +02:00
James Cole
720926c50d Tests now run without a database, as they should. 2015-04-03 07:33:18 +02:00
James Cole
36ec974284 Add heavy but working migrate routine. Will fix the tests but must be optimised. Also, should not be necessary. 2015-04-02 22:51:00 +02:00
James Cole
cff77c39e2 Update travis-ci and composer.lock and composer.json 2015-04-02 22:46:50 +02:00
James Cole
056a0a1736 Smaller boxes. 2015-04-02 22:43:12 +02:00
James Cole
f301da83c6 Fixed the tests. 2015-04-02 22:39:31 +02:00
James Cole
5362231efa Ignore virtual balance in select places. 2015-04-01 19:46:16 +02:00
James Cole
4bb14cad73 Allow virtual balance to be ignored. 2015-04-01 19:45:13 +02:00
James Cole
7f5188f5a4 Added something fancy called "virtual balance". 2015-04-01 19:42:14 +02:00
James Cole
a80b7aac6c Fix more redirections. 2015-04-01 18:59:34 +02:00
James Cole
83f32478fa Fixed more redirections. 2015-04-01 09:43:19 +02:00
James Cole
7578ec6801 Fix redirections in budget. 2015-04-01 09:40:19 +02:00
James Cole
e14a32f76f Also fix delete/destroy redirection routine. 2015-04-01 09:23:51 +02:00
James Cole
58faa189ac Can now actually store transactions without an expense / revenue account. 2015-04-01 09:17:07 +02:00
James Cole
9b4f87d44a Fix checkbox for edit screen. 2015-04-01 09:16:51 +02:00
James Cole
7830a64170 Fix redirect. 2015-04-01 09:16:41 +02:00
James Cole
8f0fa02107 Better redirection for new transactions. 2015-04-01 09:12:49 +02:00
James Cole
e000fb5d80 Optimized decryption. 2015-03-31 22:46:11 +02:00
James Cole
566fadad15 Add decryption routine. 2015-03-31 21:18:22 +02:00
James Cole
cf23858c10 Gokje. 2015-03-31 20:52:48 +02:00
James Cole
216a223617 Fix in year list. 2015-03-31 20:49:02 +02:00
James Cole
638f38d823 New flush method. 2015-03-31 20:46:37 +02:00
James Cole
98ee70f04e Fix range thing. 2015-03-31 20:45:06 +02:00
James Cole
b365db5a4b New hidden id field. 2015-03-31 20:39:28 +02:00
James Cole
02e55496df Remove reminders when piggy bank is reminded. 2015-03-31 20:22:51 +02:00
James Cole
e11e53913a Some new code + GA 2015-03-31 19:21:49 +02:00
James Cole
f8a5fb4225 Fixed tests. 2015-03-31 17:49:47 +02:00
James Cole
3a49450461 Made sure migrations can be rolled back. 2015-03-31 15:38:44 +02:00
James Cole
3c375fb955 Remove build stuff because sqlite does not work with change things. 2015-03-31 15:24:13 +02:00
James Cole
011fea2cc6 Fix encryption in home chart. 2015-03-31 15:10:22 +02:00
James Cole
a079eec2cb Better unicity for objects. 2015-03-31 14:16:25 +02:00
James Cole
776b37f4ea Clean up some code, optimise the 503 error. 2015-03-30 21:24:56 +02:00
James Cole
a4d8bbe3da Fixed a bug where certain types of accounts could not be validated. 2015-03-30 20:16:33 +02:00
James Cole
72166743fa Merge branches 'develop' and 'develop' of https://github.com/JC5/firefly-iii into develop 2015-03-30 20:08:40 +02:00
James Cole
c4312c0b11 Extra large code cleanup. 2015-03-30 20:08:27 +02:00
James Cole
38ba645415 Add hidden-xs class. 2015-03-30 09:23:18 +02:00
James Cole
ac12a47071 Hide inactive budgets when there are none. 2015-03-29 21:29:37 +02:00
James Cole
bea321939e Code rearrange and optimise. 2015-03-29 21:27:51 +02:00
James Cole
210f84b6ea Allow edit from budget overview, and allow changing of active setting. 2015-03-29 21:27:13 +02:00
James Cole
d4c642741f Fixed division by zero. 2015-03-29 21:09:33 +02:00
James Cole
e6b1b58379 Enable inactive budgets. 2015-03-29 19:50:29 +02:00
James Cole
8d982c1a90 Some extensions. 2015-03-29 19:44:59 +02:00
James Cole
be10e836dc Updated composer.lock 2015-03-29 19:40:22 +02:00
James Cole
9be05e7e17 Small optimisations. 2015-03-29 18:28:49 +02:00
James Cole
bd96b2819f Removed double code. 2015-03-29 12:32:00 +02:00
James Cole
f601af3da0 Cleaned up report controller. 2015-03-29 12:25:46 +02:00
James Cole
70a01c082b Removed some double code. 2015-03-29 12:12:06 +02:00
James Cole
bcf066ead7 Cleaned up some double code. 2015-03-29 11:51:26 +02:00
James Cole
24dd3578ed Merge branch 'release/3.3.5' into develop 2015-03-29 08:43:55 +02:00
James Cole
d5c39d54d8 Merge branch 'release/3.3.5' 2015-03-29 08:43:54 +02:00
James Cole
6e3f6abc67 New read me. 2015-03-29 08:43:46 +02:00
James Cole
463201df2c New gitignore. 2015-03-29 08:43:03 +02:00
James Cole
a7501c396f Renamed some methods. 2015-03-29 08:24:56 +02:00
James Cole
4c8bc49a7e Add newlines. 2015-03-29 08:22:48 +02:00
James Cole
f254674f88 Add newlines. 2015-03-29 08:21:33 +02:00
James Cole
a97c267378 Added new lines 2015-03-29 08:20:37 +02:00
James Cole
eaa947894b Updated composer.son 2015-03-29 08:20:30 +02:00
James Cole
fb3a26510b Removed some unused use statements. 2015-03-29 08:20:20 +02:00
James Cole
bfe8b14e49 Cleaned up. 2015-03-29 08:18:15 +02:00
James Cole
afb47eb742 Add newlines. 2015-03-29 08:14:32 +02:00
James Cole
ba97f96288 Removed unused use statements. 2015-03-29 08:03:53 +02:00
James Cole
ecbafb8f4b Removed commented out code. 2015-03-29 07:59:18 +02:00
James Cole
12d3800d67 Removed unused use statements. 2015-03-29 07:51:56 +02:00
James Cole
d586b82372 New composer.son file. 2015-03-29 07:45:14 +02:00
James Cole
ba9877c9b4 Add typehints to object parameters 2015-03-29 07:43:20 +02:00
James Cole
907933f3df Removed debug logic and bad operators. 2015-03-29 07:32:24 +02:00
James Cole
2e91d21a88 Add return to form routine to budgets. 2015-03-28 18:22:36 +01:00
James Cole
dca395a018 Merge branch 'release/3.3.4' 2015-03-28 17:45:56 +01:00
James Cole
625070a5b9 Merge branch 'release/3.3.4' into develop 2015-03-28 17:45:56 +01:00
James Cole
f875c7cbf5 Updated read me file. 2015-03-28 17:45:46 +01:00
James Cole
eed88fc103 Don't fail on repeated piggy banks, just log it. 2015-03-28 17:45:15 +01:00
James Cole
6fc54d1d27 Fixed the tests 2015-03-28 07:00:53 +01:00
James Cole
0ef52bf909 Remove recurring transactions [skip ci] 2015-03-28 06:59:43 +01:00
James Cole
95e34af6ef Update script [skip ci] 2015-03-28 06:51:54 +01:00
James Cole
650b99ead2 Ignore apple files. [skip ci] 2015-03-28 06:50:26 +01:00
James Cole
57941a19de Excutable. 2015-03-28 06:48:54 +01:00
James Cole
6157db0b6a Some new tests 2015-03-28 06:48:38 +01:00
James Cole
c9358acf5d Update tests and token replace routine. 2015-03-28 06:25:36 +01:00
James Cole
ed29eb8a5d New lock file. 2015-03-28 06:19:37 +01:00
James Cole
bcf7452312 Some new tests. 2015-03-28 06:19:09 +01:00
James Cole
b9000519e4 Fixed unique piggy check. 2015-03-27 20:20:52 +01:00
James Cole
2694297466 Fixed a bug where start / end would be used incorrectly. 2015-03-27 19:48:55 +01:00
James Cole
53ff5c1490 Wrong operator, 2015-03-27 19:47:31 +01:00
James Cole
32a036b076 Add certainty to chart. 2015-03-27 19:45:47 +01:00
James Cole
aae2ab2693 Unnecessary if statement. 2015-03-27 19:43:53 +01:00
James Cole
4ef23e28a3 Update year report. 2015-03-27 19:43:20 +01:00
James Cole
38beb7f8d2 Fallback. 2015-03-27 19:42:35 +01:00
James Cole
0129a66906 Debug hidden accounts in year reports. 2015-03-27 19:37:00 +01:00
James Cole
45bced7b34 Hide accounts with no activity during a year. 2015-03-27 19:34:37 +01:00
James Cole
7f5a55dffb Small updates to read me. 2015-03-27 19:21:51 +01:00
James Cole
80289df6d3 Capital letter 2015-03-27 18:58:28 +01:00
James Cole
2115c3ced8 Read me 2015-03-27 18:58:11 +01:00
James Cole
1c2d0e6618 Updated read me file 2015-03-27 18:57:49 +01:00
James Cole
ea4f7f79ce Removed more references. 2015-03-27 18:17:15 +01:00
James Cole
b17f8ac311 Removed references to repeated expenses. 2015-03-27 18:15:10 +01:00
James Cole
6870d13b72 Removed repeated expenses. 2015-03-27 18:14:17 +01:00
James Cole
81fa304fd2 Removed repeated expenses. 2015-03-27 18:13:53 +01:00
James Cole
a663ddb0d9 Hide accounts with no activity. 2015-03-27 13:39:12 +01:00
James Cole
f7969afc22 Hide accounts with no activity in budget report. 2015-03-27 13:36:33 +01:00
James Cole
52ce4cd313 Resort array. 2015-03-27 13:25:46 +01:00
James Cole
247175881f Moved some code. 2015-03-27 13:24:04 +01:00
James Cole
fcf5009338 Moved some code around. 2015-03-27 13:20:48 +01:00
James Cole
12542d8f63 Auto fill transaction descriptions. 2015-03-27 13:16:14 +01:00
James Cole
e94194e28b New favicon. 2015-03-27 13:04:53 +01:00
James Cole
115499f3b2 New favicon. 2015-03-27 11:59:07 +01:00
James Cole
12af05b94f Only display budgets when there's money in the envelope or when there's money spent. 2015-03-27 09:43:29 +01:00
James Cole
88b83d8164 Merge branch 'release/3.3.3' into develop 2015-03-27 09:36:04 +01:00
James Cole
fcc22c692a Merge branch 'release/3.3.3' 2015-03-27 09:36:03 +01:00
James Cole
a876e8005c New version. 2015-03-27 09:35:52 +01:00
James Cole
2288e3705a Fixed order view. 2015-03-27 09:29:14 +01:00
James Cole
e8b58154e0 Bug fix. 2015-03-27 09:24:26 +01:00
James Cole
4393475af3 Remove debug. 2015-03-27 09:22:08 +01:00
James Cole
3fc560597c Validation bug. 2015-03-27 09:21:09 +01:00
James Cole
9f9af0b693 Moved to account list. 2015-03-27 08:11:13 +01:00
James Cole
a83fe2caea Correct ordering (everywhere). 2015-03-27 07:32:06 +01:00
James Cole
30c5376217 Fix order. 2015-03-27 07:29:01 +01:00
James Cole
6dddd6629d Thing with order and should fix Travis. 2015-03-27 07:20:32 +01:00
James Cole
f80de12cb5 Fix sorting. 2015-03-26 22:53:34 +01:00
James Cole
544ffca3a5 Sortable transactions. 2015-03-26 22:52:49 +01:00
James Cole
e0730c7b39 Fixed double named accounts. 2015-03-26 18:05:23 +01:00
James Cole
3d59d141c4 Push! 2015-03-26 17:46:08 +01:00
James Cole
ccddc2623d Merge branch 'develop' of github.com:JC5/firefly-iii into develop 2015-03-26 17:45:58 +01:00
James Cole
fcc47b58b4 Return to edit / create screen when user indicates. 2015-03-26 17:45:03 +01:00
James Cole
f67ac2e25e Update AccountController.php 2015-03-26 14:50:49 +01:00
James Cole
26127c9ccf Update AccountController.php 2015-03-26 14:49:02 +01:00
James Cole
d624efa799 Fix registration bug. 2015-03-25 22:30:36 +01:00
James Cole
ed3d40a4e0 Whoops. 2015-03-25 22:29:32 +01:00
James Cole
6e90ce5496 Cant dismiss reminders again. 2015-03-25 19:12:33 +01:00
James Cole
ab851b1be4 Fixed transfers 2015-03-25 17:44:06 +01:00
James Cole
340de53825 Use normal logging. 2015-03-25 17:42:33 +01:00
James Cole
a867b60af0 Update CategoryController.php 2015-03-25 16:14:28 +01:00
James Cole
26eafb0bd2 Update CategoryController.php 2015-03-25 16:13:39 +01:00
James Cole
0dbe44764b Update GoogleChartController.php 2015-03-25 16:00:06 +01:00
James Cole
2159df6802 Update GoogleChartController.php
Fixed chart.
2015-03-25 15:58:37 +01:00
James Cole
23389b9f17 Update FireflyValidator.php
Update uniqueForUser.
2015-03-25 15:56:32 +01:00
James Cole
6d3e3b894a Update AccountFormRequest.php
Update rules to include belongsToUser.
2015-03-25 15:55:39 +01:00
James Cole
55340aefa3 Remove code. 2015-03-24 21:06:45 +01:00
James Cole
94bc751e41 Sum starts at 0. 2015-03-24 21:05:15 +01:00
James Cole
89259c11e2 Fix chart. 2015-03-24 21:04:53 +01:00
James Cole
6bbaf1523c Fixed a bug in relevantOnDate 2015-03-24 21:00:42 +01:00
James Cole
fa3f18b60f Expand log for event. 2015-03-24 20:56:58 +01:00
James Cole
3dc794002f This should catch the missing piggy bank events. 2015-03-24 20:54:25 +01:00
James Cole
f50b133f2e Cleaned up some icons, improved routine for repeated expenses. 2015-03-21 21:33:52 +01:00
James Cole
1d6f6d28c9 Update font in calendar. 2015-03-21 10:29:25 +01:00
James Cole
c913de3c8b Fix percentage. 2015-03-21 08:56:24 +01:00
James Cole
bbc7b54a38 Catch 0 start balance. 2015-03-21 08:55:55 +01:00
James Cole
05fa1b40d1 Support > 100% 2015-03-21 08:53:43 +01:00
James Cole
6a88c8634d Added a block with savings. 2015-03-21 08:51:34 +01:00
James Cole
8ae1efa230 Added type savings account. 2015-03-20 23:17:59 +01:00
James Cole
ab8df4c8ab Fixed css reference. 2015-03-20 22:50:50 +01:00
James Cole
c259a46ed3 Clean up sql codes. 2015-03-20 22:39:07 +01:00
James Cole
5dc0677599 Fixed search sort 2015-03-20 18:30:17 +01:00
James Cole
7ed662ecc2 Fixed search in encrypted entries. 2015-03-20 18:21:14 +01:00
James Cole
4361cc69d4 Update font options in charts. 2015-03-20 15:54:40 +01:00
James Cole
461cbcbc28 Update to use Roboto font. 2015-03-20 13:34:59 +01:00
James Cole
09ae6c488b Fixed a bug where the session date would be edited by a chart. 2015-03-20 08:16:16 +01:00
James Cole
271a0ade26 Add code coverage to phpunit. 2015-03-18 22:24:54 +01:00
James Cole
4b076d227a Touch db so it can be created. 2015-03-18 22:17:18 +01:00
James Cole
3c4e7158a1 Config for test database. 2015-03-18 22:16:00 +01:00
James Cole
0b16765f37 Add sudo: false to enable container based builds. 2015-03-18 21:51:56 +01:00
James Cole
20c2ff3443 Add debug output to phpunit. 2015-03-18 21:43:19 +01:00
James Cole
96f2e598f4 Better position for titles. 2015-03-16 19:03:52 +01:00
James Cole
7374f0f9dd Removed Material Design. 2015-03-16 18:02:52 +01:00
James Cole
ccc44a74a0 Removed debug information. 2015-03-15 19:02:33 +01:00
James Cole
66cd63a68d Fixed a bug. 2015-03-15 18:08:52 +01:00
James Cole
decf7e5485 Set order in title. 2015-03-15 18:02:40 +01:00
James Cole
063c8025aa Allow piggy banks to be ordered. 2015-03-15 18:00:33 +01:00
James Cole
2fa7d2bd56 Add some text alignments. 2015-03-15 14:24:25 +01:00
James Cole
e55e7bce74 Misspelled a class name. 2015-03-15 14:23:26 +01:00
James Cole
f572445a65 Small updates. 2015-03-15 09:34:57 +01:00
James Cole
8b4f656d90 Switched to Google Material design line charts. 2015-03-15 08:38:12 +01:00
James Cole
6c1e093ebd Merge branch 'release/3.3.2' into develop 2015-03-14 22:06:12 +01:00
James Cole
6dd1b4537a Merge branch 'release/3.3.2' 2015-03-14 22:06:11 +01:00
James Cole
39ca9bea72 Update read me. 2015-03-14 22:06:01 +01:00
James Cole
999103277e Updated composer. 2015-03-14 22:05:36 +01:00
James Cole
3cc57ab89c Remove hash routine from user model. 2015-03-14 22:00:57 +01:00
James Cole
4e830079de New icon. 2015-03-14 17:31:17 +01:00
James Cole
ea7231e9fe Update mail config. 2015-03-14 17:25:35 +01:00
James Cole
ddfaca6d0c Cleanup and added some icons. 2015-03-14 17:21:43 +01:00
James Cole
3b11bd0593 Fixed some basic tests. 2015-03-13 08:44:07 +01:00
James Cole
3f89057528 Fixed a bug where the home budget chart would not actually list transactions without a budget. 2015-03-13 07:10:26 +01:00
James Cole
2f1073712f Merge pull request #63 from niekvanderkooy/fix-migrations
Fix migrations
2015-03-13 07:00:55 +01:00
James Cole
678e504c48 Fix charts to match report. 2015-03-10 20:26:52 +01:00
James Cole
e69545fd95 Include shared accounts. 2015-03-10 20:07:02 +01:00
James Cole
a7ed025cd6 Fine tune query. 2015-03-10 20:05:27 +01:00
James Cole
3d8e1f2484 Forgot the javascript. 2015-03-10 20:03:44 +01:00
James Cole
c38c9608da Fine tune query. 2015-03-10 20:01:49 +01:00
James Cole
2396b75e3c Fine tune income. 2015-03-10 20:00:43 +01:00
James Cole
e5c19b7562 Small fixes. 2015-03-10 19:58:05 +01:00
James Cole
114788567d More code for previous. 2015-03-10 19:57:20 +01:00
James Cole
17ae4b7d2a See if we can easily generate reports with shared accounts. 2015-03-10 19:51:24 +01:00
Niek van der Kooy
12d652bd0e We cannot entirely drop the foreign key constraint, since it is originally created (and dropped) in v3.2.1. 2015-03-10 18:25:23 +01:00
Niek van der Kooy
ff1bed97b8 We need to include models we use
Probably some left over L5 migration stuff, since you wouldn't notice it until reversing a migration
2015-03-10 18:24:28 +01:00
Niek van der Kooy
56490f0e84 Fix error when reverting changed migration.
When reverting changed migration, the down would fail because the foreign key constraint has to be dropped before you are able to rename the column.
2015-03-10 18:04:31 +01:00
James Cole
0b028a8923 Correctly order account names. 2015-03-10 17:26:31 +01:00
James Cole
43ac541cb8 Add reminders to top right menu. 2015-03-08 20:27:07 +01:00
James Cole
5218443678 Can now successfully act on reminders. 2015-03-08 20:20:58 +01:00
James Cole
d9028ed9b7 Small optimizations to the reminders 2015-03-08 09:00:04 +01:00
James Cole
9b9bd11ebb Small fix to table fix. 2015-03-07 19:42:45 +01:00
James Cole
07011ec5f7 Tiny chart improvement because I said so 2015-03-07 19:41:56 +01:00
James Cole
c3990ac32f Small updates to icons and code. 2015-03-07 12:34:03 +01:00
James Cole
081ff3ff55 View single reminder. 2015-03-07 09:29:43 +01:00
James Cole
93996ada96 Expanded reminders. 2015-03-07 09:21:06 +01:00
James Cole
a60671d4c1 First stuff for acting on reminders. 2015-03-06 20:33:23 +01:00
James Cole
3f716cc369 First new display of piggy bank reminders. 2015-03-06 17:23:29 +01:00
James Cole
9f23cffd1b Clean up code. 2015-03-06 15:26:21 +01:00
James Cole
07c416cfbf Fix set reminder. 2015-03-06 15:24:36 +01:00
James Cole
389fcc1c8d Update reminder in database. 2015-03-06 15:21:44 +01:00
James Cole
fa07811375 Add logging for debug purposes. 2015-03-06 15:18:07 +01:00
James Cole
fc91a50979 Reimplemented a routine that creates reminders. Cannot act on them yet. 2015-03-06 15:12:07 +01:00
James Cole
f9c518f321 Smaller font for boxes. 2015-03-06 10:10:07 +01:00
James Cole
015b439f0d New icons. 2015-03-06 08:30:15 +01:00
James Cole
0675622508 Experiment with boxes. 2015-03-06 08:20:27 +01:00
James Cole
e9969bdd5f Update the ranges to reflect the current dates. 2015-03-05 21:13:38 +01:00
James Cole
1139f950ed Fixed some views. 2015-03-04 21:11:47 +01:00
James Cole
284732c7a6 Better list for bills. 2015-03-04 20:58:57 +01:00
James Cole
0cb0720d8b No popup when the amount is zero. 2015-03-04 20:57:40 +01:00
James Cole
8ad1ede0c5 Popups in the reports as we've always promised. 2015-03-04 20:47:00 +01:00
James Cole
a349aac8a4 Fix balance thing. 2015-03-04 19:09:57 +01:00
James Cole
83b169c6ef Search related transfers, cleanup. 2015-03-04 16:04:17 +01:00
James Cole
49c37baac5 Update to related manager. 2015-03-04 15:30:44 +01:00
James Cole
8d62088576 Order bills. 2015-03-04 09:44:48 +01:00
James Cole
f5437a17f8 Lots of changes. 2015-03-04 09:42:47 +01:00
James Cole
92af4e5c96 Layout tweaks. 2015-03-04 05:12:05 +01:00
James Cole
0619adb0cd Support any bill in any range. 2015-03-03 17:40:17 +01:00
James Cole
65a5107854 Small layout updates. 2015-03-03 09:35:06 +01:00
James Cole
0fcc1e252b Mail user registration confirmation. 2015-03-03 09:29:02 +01:00
James Cole
4b7f817475 Removed panel for table. 2015-03-03 09:19:16 +01:00
James Cole
0439599971 Layout update. 2015-03-03 09:15:28 +01:00
James Cole
fa344d5308 Do not update when no event connected. 2015-03-03 08:46:14 +01:00
James Cole
f0316f09ed Do not over / undercorrect 2015-03-02 20:29:10 +01:00
James Cole
b1af6bab28 Cleaning up and bug fixing. 2015-03-02 20:05:28 +01:00
James Cole
ad2aebb54d Sort account list. 2015-03-02 15:46:31 +01:00
James Cole
23fc652092 Table border. 2015-03-02 15:45:24 +01:00
James Cole
f0a5756f25 Add a panel-body for the layout. 2015-03-02 15:45:00 +01:00
James Cole
14c7ad201a Paginated the account list. 2015-03-02 15:44:06 +01:00
James Cole
08ca3c89d3 Expanded account view. 2015-03-02 15:27:36 +01:00
James Cole
edda470bf8 Add everything range 2015-03-02 13:19:13 +01:00
James Cole
7183d72e5c Update chart to include other budget repetitions. 2015-03-02 12:50:51 +01:00
James Cole
5e38ebfce5 Merge branch 'feature/date-range' into develop 2015-03-02 12:35:34 +01:00
James Cole
56e36847a5 New code for new date range thing. 2015-03-02 12:35:14 +01:00
James Cole
6dba916d02 New code & css for date range. 2015-03-02 12:04:40 +01:00
James Cole
fd57086ffd Better mostly report lists. 2015-03-02 11:54:20 +01:00
James Cole
d98d366eea Some small bug fixes in the account views. 2015-03-02 11:42:27 +01:00
James Cole
b261b0b447 Shared expense should of course be shared asset. 2015-03-02 11:27:46 +01:00
James Cole
c6042a9053 Try to fix modal dialog for piggy banks. 2015-03-01 19:47:42 +01:00
James Cole
ae1245abec Fixed update transactions. 2015-03-01 19:31:00 +01:00
James Cole
e26d2376fc Fixed piggy bank delete routine. 2015-03-01 19:26:30 +01:00
James Cole
bb36ad64a7 Moved the form. 2015-03-01 13:39:16 +01:00
James Cole
262d4f92d4 Fixed a bug where consecutive payments from one source would not be summed up. 2015-03-01 10:55:20 +01:00
James Cole
675530458c Account show didn't show anything. 2015-03-01 10:44:10 +01:00
James Cole
19e34b460f Update event. 2015-03-01 08:34:59 +01:00
James Cole
dddb8cdbc0 This loops. 2015-03-01 08:25:12 +01:00
James Cole
0d0df5f143 Scan bills when editing and creating journals. 2015-03-01 08:15:24 +01:00
James Cole
d1cf683f57 Some layout and content updates 2015-03-01 07:50:26 +01:00
James Cole
d099c33e5b No more code climate for now. 2015-02-27 21:40:49 +01:00
James Cole
21fb41545b Now with son_path variable. 2015-02-27 21:24:14 +01:00
James Cole
4c56814785 Do code coverage from phpunit. 2015-02-27 21:15:21 +01:00
James Cole
cffe05e22b Add coveralls to composer.json 2015-02-27 21:01:18 +01:00
James Cole
4237850299 Restoring code coverage 2015-02-27 20:52:49 +01:00
James Cole
b5fc36a8e1 Clean up test stuff. 2015-02-27 20:46:39 +01:00
James Cole
4586c1ef52 Removed all test cases. 2015-02-27 20:45:17 +01:00
James Cole
2722f0b749 Merge branch 'release/3.3.1' 2015-02-27 20:42:12 +01:00
James Cole
d6cf7c4872 Merge branch 'release/3.3.1' into develop 2015-02-27 20:42:12 +01:00
James Cole
3aedfed432 Updated version. 2015-02-27 20:42:04 +01:00
James Cole
edeaf13259 New CSS / JS code. 2015-02-27 18:05:40 +01:00
James Cole
c1290c4e9b Forgot to commit one view. 2015-02-27 16:53:06 +01:00
James Cole
b2c1527b17 Lost a lot of stuff along the way. 2015-02-27 16:48:33 +01:00
James Cole
a4a65ea56e Merge branch 'release/3.3' into develop 2015-02-27 16:15:30 +01:00
758 changed files with 44644 additions and 47229 deletions

25
.codeclimate.yml Normal file
View File

@@ -0,0 +1,25 @@
# Save as .codeclimate.yml (note leading .) in project root directory
languages:
JavaScript: true
PHP: true
exclude_paths:
- "public/packages/maximebf/php-debugbar/debugbar.js"
- "public/packages/maximebf/php-debugbar/widgets.js"
- "public/packages/maximebf/php-debugbar/openhandler.js"
- "public/packages/maximebf/php-debugbar/widgets/sqlqueries/widget.js"
- "public/js/bootstrap3-typeahead.min.js"
- "public/js/bootstrap-sortable.js"
- "public/js/bootstrap-tagsinput.min.js"
- "public/js/bootstrap-tagsinput.min.js.map"
- "public/js/daterangepicker.js"
- "public/js/jquery-2.1.3.min.js"
- "public/js/jquery-2.1.3.min.js.map"
- "public/js/jquery-ui.min.js"
- "public/js/metisMenu.js"
- "public/js/moment.min.js"
- "public/js/sb-admin-2.js"
- "public/bootstrap/*"
- "resources/lang/*"
- "tests/*"
- "database/*"
- "storage/*"

View File

@@ -1,3 +1 @@
src_dir: .
coverage_clover: tests/_output/coverage.xml
json_path: tests/_output/coveralls-upload.json

View File

@@ -1,6 +1,7 @@
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
APP_ENV=production
APP_DEBUG=false
APP_KEY=SomeRandomStringOf32CharsExactly
DB_CONNECTION=mysql
DB_HOST=localhost
@@ -11,6 +12,22 @@ DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
DEFAULT_CURRENCY=EUR
DEFAULT_LANGUAGE=en_US
EMAIL_SMTP=
EMAIL_DRIVER=smtp
EMAIL_USERNAME=
EMAIL_PASSWORD=
EMAIL_PRETEND=false
SHOW_INCOMPLETE_TRANSLATIONS=false
ANALYTICS_ID=
RUNCLEANUP=true
SITE_OWNER=mail@example.com
SENDGRID_USERNAME=
SENDGRID_PASSWORD=
BLOCKED_DOMAINS=

View File

@@ -8,6 +8,11 @@ DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
CACHE_DRIVER=array
SESSION_DRIVER=array
EMAIL_SMTP=
EMAIL_USERNAME=
EMAIL_PASSWORD=
ANALYTICS_ID=ABC
EMAIL_PRETEND=true

11
.gitignore vendored
View File

@@ -5,7 +5,7 @@ Thumbs.db
.idea/
tests/_output/*
_ide_helper.php
/build/logs/clover.xml
/build/logs
index.html*
app/storage/firefly-export*
.vagrant
@@ -25,3 +25,12 @@ c3.php
db.sqlite-journal
tests/_output/*
.env
clover.xml
node_modules/
addNewLines.php
.phpstorm.meta.php
.env.backup
.env.local
tests/_output/*
tests/_output/*

22
.jshintrc Normal file
View File

@@ -0,0 +1,22 @@
{
"undef": true,
"unused": false,
"strict": true,
"browser": true,
"jquery": true,
"devel": true,
"globals": [
"language",
"token",
"currencyCode",
"$",
"token",
"accountID",
"billID",
"currentMonthName",
"previousMonthName",
"nextMonthName",
"everything",
"moment"
]
}

3
.scrutinizer.yml Normal file
View File

@@ -0,0 +1,3 @@
# .scrutinizer.yml
tools:
external_code_coverage: false

View File

@@ -1,26 +1,18 @@
language: php
sudo: false
php:
- 5.5
- 5.6
addons:
code_climate:
repo_token: 26489f9e854fcdf7e7660ba29c1455694685465b1f90329a79f7d2bf448acb61
install:
- rm composer.lock
- composer install
- composer update
- php artisan env
- mv -v .env.testing .env
- touch storage/database/testing.db
- php artisan migrate --env=testing
- php artisan migrate --seed --env=testing
script:
- ./tests/_data/db.sh
- php vendor/bin/codecept build
- php vendor/bin/codecept run --coverage --coverage-xml --no-exit
after_script:
- cp -v tests/_output/coverage.xml build/logs/clover.xml
- php vendor/bin/coveralls
- vendor/bin/test-reporter --stdout > codeclimate.json
- "curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v0.1.1)' https://codeclimate.com/test_reports"
- phpunit

155
README.md
View File

@@ -1,76 +1,127 @@
Firefly III (v3.3)
===========
# Firefly III
[![Build Status](https://travis-ci.org/JC5/firefly-iii.svg?branch=develop)](https://travis-ci.org/JC5/firefly-iii)
[![Project Status](http://stillmaintained.com/JC5/firefly-iii.png?a=b)](http://stillmaintained.com/JC5/firefly-iii)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d44c7012-5f50-41ad-add8-8445330e4102/mini.png)](https://insight.sensiolabs.com/projects/d44c7012-5f50-41ad-add8-8445330e4102)
[![Code Climate](https://codeclimate.com/github/JC5/firefly-iii/badges/gpa.svg)](https://codeclimate.com/github/JC5/firefly-iii)
[![Test Coverage](https://codeclimate.com/github/JC5/firefly-iii/badges/coverage.svg)](https://codeclimate.com/github/JC5/firefly-iii)
[![Latest Stable Version](https://poser.pugx.org/grumpydictator/firefly-iii/v/stable)](https://packagist.org/packages/grumpydictator/firefly-iii)
[![Total Downloads](https://poser.pugx.org/grumpydictator/firefly-iii/downloads)](https://packagist.org/packages/grumpydictator/firefly-iii)
[![Latest Stable Version](https://poser.pugx.org/grumpydictator/firefly-iii/v/stable.svg)](https://packagist.org/packages/grumpydictator/firefly-iii)
[![Total Downloads](https://poser.pugx.org/grumpydictator/firefly-iii/downloads.svg)](https://packagist.org/packages/grumpydictator/firefly-iii)
[![Latest Unstable Version](https://poser.pugx.org/grumpydictator/firefly-iii/v/unstable.svg)](https://packagist.org/packages/grumpydictator/firefly-iii)
[![License](https://poser.pugx.org/grumpydictator/firefly-iii/license.svg)](https://packagist.org/packages/grumpydictator/firefly-iii)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/JC5/firefly-iii/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/JC5/firefly-iii/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/JC5/firefly-iii/badges/build.png?b=master)](https://scrutinizer-ci.com/g/JC5/firefly-iii/build-status/master)
Firefly III is a tool to help you manage your finances. Please read the full description [in the wiki](https://github.com/JC5/firefly-iii/wiki/full-description).
## About
Firefly Mark III is a new version of Firefly built upon best practices and lessons learned
from building [Firefly](https://github.com/JC5/Firefly). It's Mark III since the original Firefly never made it outside of my
laptop and [Firefly II](https://github.com/JC5/Firefly) is live.
"Firefly III" is a financial manager. It can help you keep track of expenses, income, budgets and everything in between. It even supports credit cards, shared
household accounts and savings accounts! It's pretty fancy. You should use it to save and organise money.
_Firefly is a system you'll have install yourself on webhosting of your choosing._
Personal financial management is pretty difficult, and everybody has their own approach to it. Some people
make budgets, other people limit their cashflow by throwing away their credit cards, others try to increase
their current cashflow. There are tons of ways to save and earn money.
Firefly works on the principle that if you know where you're money is going, you can stop it from going there.
To get to know Firefly, and to see if it fits you, check out these resources:
- The screenshots below on this very page.
- The featurelist below, also on this very page.
- The [full description](https://github.com/JC5/firefly-iii/wiki/full-description), which will tell you how Firefly works,
and the philosophy behind it.
#### About the name (should you care)
It's III, or 3, because [version 2](https://github.com/JC5/Firefly) and version 1 (not online) preceded it. It has been growing steadily ever since.
## Current features
- [A double-entry bookkeeping system](http://en.wikipedia.org/wiki/Double-entry_bookkeeping_system);
- You can store, edit and remove withdrawals, deposits and transfers. This allows you full financial management;
- It's possible to create, change and manage money using _budgets_;
- [A double-entry bookkeeping system](https://en.wikipedia.org/wiki/Double-entry_bookkeeping_system);
- You can store, edit and remove [withdrawals, deposits and transfers](https://en.wikipedia.org/wiki/Financial_transaction). This allows you full financial management;
- You can manage different types of accounts;
- [Asset](https://en.wikipedia.org/wiki/Asset) accounts
- Shared [asset accounts](https://en.wikipedia.org/wiki/Asset) ([household accounts](https://en.wikipedia.org/wiki/Household))
- Saving accounts
- Credit cards
- It's possible to create, change and manage money using _[budgets](https://en.wikipedia.org/wiki/Envelope_system)_;
- Organize transactions using categories;
- Save towards a goal using piggy banks;
- Predict and anticipate large expenses using "repeated expenses" (ie. yearly taxes);
- Predict and anticipate bills using "recurring transactions" (rent for example);
- View basic income / expense reports.
- Lots of help text in case you don't get it;
- Save towards a goal using [piggy banks](https://en.wikipedia.org/wiki/Piggy_bank);
- Predict and anticipate [bills](https://en.wikipedia.org/wiki/Invoice);
- View income / expense [reports](https://en.wikipedia.org/wiki/Financial_statement);
- Organize expenses using tags;
- Lots of help text in case you don't get it.
Everything is organised:
- Clear views that should show you how you're doing;
- 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:
- More control over other resources outside of personal finance
- Accounts shared with a partner (household accounts)
- Debts
- Credit cards
- More test-coverage;
- Firefly will be able to split transactions; a single purchase can be split in multiple entries, for more fine-grained control.
- Firefly will be able to join transactions.
- Any other features I might not have thought of.
Some stuff has been removed:
- The nesting of budgets, categories and beneficiaries is removed because it was pretty pointless.
- Firefly will not encrypt the content of the (MySQL) tables. Old versions of Firefly had this capability but it sucks when searching, sorting and organizing entries.
- Lots of charts because we all love them;
- Financial reporting showing you how well you are doing.
## Screenshots
![Index](http://i.imgur.com/TkZNIer.png)
_Please note that everything in these screenshots is fictional and may not be realistic._
![Accounts](http://i.imgur.com/YE8WavP.png)
![Index](https://i.nder.be/hmp5mhw5)
![Budgets](http://i.imgur.com/Go0M6Nd.png)
![Accounts](https://i.nder.be/hf5k02g9)
![Budgets](https://i.nder.be/gzv635mz)
![Reports 1](https://i.nder.be/g0w698s3)
![Reports 2](https://i.nder.be/cr77nyxq)
![Bills](https://i.nder.be/c7sugsz5)
![Piggy banks](https://i.nder.be/gy2nk0y4)
## Running and installing
If you're still interested please read [the installation guide](https://github.com/JC5/firefly-iii/wiki/Installation),
[the upgrade guide](https://github.com/JC5/firefly-iii/wiki/Upgrade-instructions) (if applicable)
and the **[first use guide](https://github.com/JC5/firefly-iii/wiki/First-use)**.
If you want to try out Firefly III, you can do so on [this dedicated website](https://geld.nder.be/).
This site always runs the latest version of Firefly III. If you want to use it, please read the [privacy considerations](https://github.com/JC5/firefly-iii/wiki/Privacy-on-demo-site) for this demo-site. Accounts on the demo sites will stop working after one month. It's a trial.
## Security
You should always run Firefly III on a site with TLS enabled (https://). Please note that although some parts of the
database are encrypted (transaction descriptions, names, etc.) some parts are _not_ (amounts, dates, etc). If you need
more security, you must enable transparent database encryption or a comparable technology. Please remember that this
is open source software under active development, and it is in no way guaranteed to be safe or secure.
## Translations
Firefly III is currently available in Dutch and English. Support for other languages is being worked on. I can use
your help. Checkout [Crowdin](https://crowdin.com/project/firefly-iii) for more information.
## Credits
Firefly III uses the following libraries and tools:
* The AdminLTE template by [Almsaseed Studio](https://almsaeedstudio.com/)
* The [Google charts](https://developers.google.com/chart/) library.
* [Chart.js](http://www.chartjs.org/)
* [Bootstrap](http://getbootstrap.com/)
* [Laravel](http://laravel.com/)
* [Twig](http://twig.sensiolabs.org/)
* For development, some of the excellent tools made by [Barry van den Heuvel](https://github.com/barryvdh)
* [Bootstrap sortable](https://github.com/drvic10k/bootstrap-sortable) by [Matúš Brliť](https://github.com/drvic10k).
* [Date range picker](https://github.com/dangrossman/bootstrap-daterangepicker/) by [Dan Grossman](https://github.com/dangrossman)
* The [real favicon generator](http://realfavicongenerator.net/)
* Various other open source components (see [composer.json](https://github.com/JC5/firefly-iii/blob/master/composer.json))
![Reports](http://i.imgur.com/EnEIyQI.png)
## Current state
I have the basics up and running. Test coverage is currently coming, slowly.
Although I have not checked extensively, some forms and views have CSRF vulnerabilities. This is because not all
views escape all characters by default. Will be fixed.
Firefly III is pretty much all grown up. Full test coverage (nerd alert!) is coming. Translations are a work in progress.
Questions, ideas or other things to contribute? [Let me know](https://github.com/JC5/firefly-iii/issues/new)!
Questions, ideas, bugs or other things to contribute? [Let me know](https://github.com/JC5/firefly-iii/issues/new)!
If you like this tool, feel free to [donate me some beer money](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=2ZMV952UUSCLU&lc=NL&item_name=Development%20of%20Firefly&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted).
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d44c7012-5f50-41ad-add8-8445330e4102/mini.png)](https://insight.sensiolabs.com/projects/d44c7012-5f50-41ad-add8-8445330e4102)
[![Code Climate](https://codeclimate.com/github/JC5/firefly-iii/badges/gpa.svg)](https://codeclimate.com/github/JC5/firefly-iii)
[![Project Status](http://stillmaintained.com/JC5/firefly-iii.png?a=b)](http://stillmaintained.com/JC5/firefly-iii)
[![Latest Stable Version](https://poser.pugx.org/grumpydictator/firefly-iii/v/stable.svg)](https://packagist.org/packages/grumpydictator/firefly-iii)
![GA](https://ga-beacon.appspot.com/UA-58172398-6/firefly-iii/readme)

View File

@@ -2,6 +2,7 @@
/**
* Class Command
*
* @codeCoverageIgnore
* @package FireflyIII\Commands
*/
abstract class Command

View File

@@ -1,37 +0,0 @@
<?php namespace FireflyIII\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
/**
* Class Inspire
*
* @package FireflyIII\Console\Commands
*/
class Inspire extends Command
{
/**
* The console command description.
*
* @var string
*/
protected $description = 'Display an inspiring quote';
/**
* The console command name.
*
* @var string
*/
protected $name = 'inspire';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
}
}

View File

@@ -6,6 +6,7 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
/**
* Class Kernel
*
* @codeCoverageIgnore
* @package FireflyIII\Console
*/
class Kernel extends ConsoleKernel
@@ -18,7 +19,6 @@ class Kernel extends ConsoleKernel
*/
protected $commands
= [
'FireflyIII\Console\Commands\Inspire',
];
/**
@@ -26,12 +26,12 @@ class Kernel extends ConsoleKernel
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')
->hourly();
}
}

View File

@@ -3,6 +3,7 @@
/**
* Class Event
*
* @codeCoverageIgnore
* @package FireflyIII\Events
*/
abstract class Event

View File

@@ -0,0 +1,34 @@
<?php namespace FireflyIII\Events;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels;
/**
* Class JournalCreated
*
* @codeCoverageIgnore
* @package FireflyIII\Events
*/
class JournalCreated extends Event
{
use SerializesModels;
public $journal;
public $piggyBankId;
/**
* Create a new event instance.
*
* @param TransactionJournal $journal
* @param $piggyBankId
*/
public function __construct(TransactionJournal $journal, $piggyBankId)
{
//
$this->journal = $journal;
$this->piggyBankId = $piggyBankId;
}
}

View File

@@ -2,6 +2,12 @@
use Illuminate\Queue\SerializesModels;
/**
* Class JournalDeleted
*
* @codeCoverageIgnore
* @package FireflyIII\Events
*/
class JournalDeleted extends Event
{
@@ -10,7 +16,6 @@ class JournalDeleted extends Event
/**
* Create a new event instance.
*
* @return void
*/
public function __construct()
{

View File

@@ -0,0 +1,30 @@
<?php namespace FireflyIII\Events;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Queue\SerializesModels;
/**
* Class JournalSaved
*
* @codeCoverageIgnore
* @package FireflyIII\Events
*/
class JournalSaved extends Event
{
use SerializesModels;
public $journal;
/**
* Create a new event instance.
*
* @param TransactionJournal $journal
*/
public function __construct(TransactionJournal $journal)
{
//
$this->journal = $journal;
}
}

View File

@@ -6,6 +6,7 @@ namespace FireflyIII\Exceptions;
/**
* Class FireflyException
*
* @codeCoverageIgnore
* @package FireflyIII\Exceptions
*/
class FireflyException extends \Exception

View File

@@ -2,10 +2,12 @@
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;
/**
* Class Handler
*
* @codeCoverageIgnore
* @package FireflyIII\Exceptions
*/
class Handler extends ExceptionHandler
@@ -26,12 +28,13 @@ class Handler extends ExceptionHandler
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @SuppressWarnings(PHPMD.ShortVariable)
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($this->isHttpException($e)) {
if ($e instanceof HttpException) {
return $this->renderHttpException($e);
} else {
return parent::render($request, $e);
@@ -42,6 +45,7 @@ class Handler extends ExceptionHandler
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* @SuppressWarnings(PHPMD.ShortVariable)
*
* @param \Exception $e
*
@@ -49,8 +53,7 @@ class Handler extends ExceptionHandler
*/
public function report(Exception $e)
{
/** @noinspection PhpInconsistentReturnPointsInspection */
return parent::report($e);
parent::report($e);
}
}

View File

@@ -5,6 +5,7 @@ namespace FireflyIII\Exceptions;
/**
* Class NotImplementedException
*
* @codeCoverageIgnore
* @package FireflyIII\Exceptions
*/
class NotImplementedException extends \Exception

View File

@@ -4,6 +4,7 @@ namespace FireflyIII\Exceptions;
/**
* Class ValidationExceptions
*
* @codeCoverageIgnore
* @package FireflyIII\Exception
*/
class ValidationException extends \Exception

View File

@@ -0,0 +1,43 @@
<?php
namespace FireflyIII\Generator\Chart\Account;
use Carbon\Carbon;
use FireflyIII\Models\Account;
use Illuminate\Support\Collection;
/**
* Interface AccountChartGenerator
*
* @package FireflyIII\Generator\Chart\Account
*/
interface AccountChartGenerator
{
/**
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function frontpage(Collection $accounts, Carbon $start, Carbon $end);
/**
* @param Account $account
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function single(Account $account, Carbon $start, Carbon $end);
/**
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function expenseAccounts(Collection $accounts, Carbon $start, Carbon $end);
}

View File

@@ -0,0 +1,187 @@
<?php
namespace FireflyIII\Generator\Chart\Account;
use Carbon\Carbon;
use FireflyIII\Models\Account;
use Illuminate\Support\Collection;
use Steam;
/**
* Class ChartJsAccountChartGenerator
*
* @package FireflyIII\Generator\Chart\Account
*/
class ChartJsAccountChartGenerator implements AccountChartGenerator
{
/**
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function expenseAccounts(Collection $accounts, Carbon $start, Carbon $end)
{
$data = [
'count' => 1,
'labels' => [], 'datasets' => [[
'label' => trans('firefly.spent'),
'data' => []]]];
bcscale(2);
$start->subDay();
$ids = $this->getIdsFromCollection($accounts);
$startBalances = Steam::balancesById($ids, $start);
$endBalances = Steam::balancesById($ids, $end);
$accounts->each(
function (Account $account) use ($startBalances, $endBalances) {
$id = $account->id;
$startBalance = $this->isInArray($startBalances, $id);
$endBalance = $this->isInArray($endBalances, $id);
$diff = bcsub($endBalance, $startBalance);
$account->difference = round($diff, 2);
}
);
$accounts = $accounts->sortByDesc(
function (Account $account) {
return $account->difference;
}
);
foreach ($accounts as $account) {
if ($account->difference > 0) {
$data['labels'][] = $account->name;
$data['datasets'][0]['data'][] = $account->difference;
}
}
return $data;
}
/**
* @param $array
* @param $entryId
*
* @return string
*/
protected function isInArray($array, $entryId)
{
if (isset($array[$entryId])) {
return $array[$entryId];
}
return '0';
}
/**
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function frontpage(Collection $accounts, Carbon $start, Carbon $end)
{
// language:
$format = trans('config.month_and_day');
$data = [
'count' => 0,
'labels' => [],
'datasets' => [],
];
$current = clone $start;
while ($current <= $end) {
$data['labels'][] = $current->formatLocalized($format);
$current->addDay();
}
foreach ($accounts as $account) {
$set = [
'label' => $account->name,
'fillColor' => 'rgba(220,220,220,0.2)',
'strokeColor' => 'rgba(220,220,220,1)',
'pointColor' => 'rgba(220,220,220,1)',
'pointStrokeColor' => '#fff',
'pointHighlightFill' => '#fff',
'pointHighlightStroke' => 'rgba(220,220,220,1)',
'data' => [],
];
$current = clone $start;
$range = Steam::balanceInRange($account, $start, clone $end);
$previous = array_values($range)[0];
while ($current <= $end) {
$format = $current->format('Y-m-d');
$balance = isset($range[$format]) ? $range[$format] : $previous;
$set['data'][] = $balance;
$previous = $balance;
$current->addDay();
}
$data['datasets'][] = $set;
}
$data['count'] = count($data['datasets']);
return $data;
}
/**
* @param Account $account
* @param Carbon $start
* @param Carbon $end
*
* @return array
*/
public function single(Account $account, Carbon $start, Carbon $end)
{
// language:
$format = trans('config.month_and_day');
$data = [
'count' => 1,
'labels' => [],
'datasets' => [
[
'label' => $account->name,
'data' => []
]
],
];
$range = Steam::balanceInRange($account, $start, $end);
$current = clone $start;
$previous = array_values($range)[0];
while ($end >= $current) {
$theDate = $current->format('Y-m-d');
$balance = isset($range[$theDate]) ? $range[$theDate] : $previous;
$data['labels'][] = $current->formatLocalized($format);
$data['datasets'][0]['data'][] = $balance;
$previous = $balance;
$current->addDay();
}
return $data;
}
/**
* @param Collection $collection
*
* @return array
*/
protected function getIdsFromCollection(Collection $collection)
{
$ids = [];
foreach ($collection as $entry) {
$ids[] = $entry->id;
}
return array_unique($ids);
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace FireflyIII\Generator\Chart\Bill;
use FireflyIII\Models\Bill;
use Illuminate\Support\Collection;
/**
* Interface BillChartGenerator
*
* @package FireflyIII\Generator\Chart\Bill
*/
interface BillChartGenerator
{
/**
* @param string $paid
* @param string $unpaid
*
* @return array
*/
public function frontpage($paid, $unpaid);
/**
* @param Bill $bill
* @param Collection $entries
*
* @return array
*/
public function single(Bill $bill, Collection $entries);
}

View File

@@ -0,0 +1,96 @@
<?php
namespace FireflyIII\Generator\Chart\Bill;
use FireflyIII\Models\Bill;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Support\Collection;
/**
* Class ChartJsBillChartGenerator
*
* @package FireflyIII\Generator\Chart\Bill
*/
class ChartJsBillChartGenerator implements BillChartGenerator
{
/**
* @param string $paid
* @param string $unpaid
*
* @return array
*/
public function frontpage($paid, $unpaid)
{
bcscale(2);
$data = [
[
'value' => round($unpaid, 2),
'color' => 'rgba(53, 124, 165,0.7)',
'highlight' => 'rgba(53, 124, 165,0.9)',
'label' => trans('firefly.unpaid'),
],
[
'value' => round($paid * -1, 2), // paid is negative, must be positive.
'color' => 'rgba(0, 141, 76, 0.7)',
'highlight' => 'rgba(0, 141, 76, 0.9)',
'label' => trans('firefly.paid'),
]
];
return $data;
}
/**
* @param Bill $bill
* @param Collection $entries
*
* @return array
*/
public function single(Bill $bill, Collection $entries)
{
// language:
$format = trans('config.month');
$data = [
'count' => 3,
'labels' => [],
'datasets' => [],
];
// dataset: max amount
// dataset: min amount
// dataset: actual amount
$minAmount = [];
$maxAmount = [];
$actualAmount = [];
/** @var TransactionJournal $entry */
foreach ($entries as $entry) {
$data['labels'][] = $entry->date->formatLocalized($format);
$minAmount[] = round($bill->amount_min, 2);
$maxAmount[] = round($bill->amount_max, 2);
/*
* journalAmount has been collected in BillRepository::getJournals
*/
$actualAmount[] = round(($entry->journalAmount * -1), 2);
}
$data['datasets'][] = [
'label' => trans('firefly.minAmount'),
'data' => $minAmount,
];
$data['datasets'][] = [
'label' => trans('firefly.billEntry'),
'data' => $actualAmount,
];
$data['datasets'][] = [
'label' => trans('firefly.maxAmount'),
'data' => $maxAmount,
];
$data['count'] = count($data['datasets']);
return $data;
}
}

View File

@@ -0,0 +1,50 @@
<?php
namespace FireflyIII\Generator\Chart\Budget;
use Illuminate\Support\Collection;
/**
* Interface BudgetChartGenerator
*
* @package FireflyIII\Generator\Chart\Budget
*/
interface BudgetChartGenerator
{
/**
* @param Collection $entries
*
* @return array
*/
public function budget(Collection $entries);
/**
* @param Collection $entries
*
* @return array
*/
public function budgetLimit(Collection $entries);
/**
* @param Collection $entries
*
* @return array
*/
public function frontpage(Collection $entries);
/**
* @param Collection $entries
*
* @return array
*/
public function multiYear(Collection $entries);
/**
* @param Collection $budgets
* @param Collection $entries
*
* @return array
*/
public function year(Collection $budgets, Collection $entries);
}

View File

@@ -0,0 +1,176 @@
<?php
namespace FireflyIII\Generator\Chart\Budget;
use Config;
use Illuminate\Support\Collection;
use Preferences;
/**
* Class ChartJsBudgetChartGenerator
*
* @package FireflyIII\Generator\Chart\Budget
*/
class ChartJsBudgetChartGenerator implements BudgetChartGenerator
{
/**
* @param Collection $entries
* @param string $dateFormat
*
* @return array
*/
public function budget(Collection $entries, $dateFormat = 'month')
{
// language:
$language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data;
$format = Config::get('firefly.' . $dateFormat . '.' . $language);
$data = [
'labels' => [],
'datasets' => [
[
'label' => 'Amount',
'data' => [],
],
],
];
/** @var array $entry */
foreach ($entries as $entry) {
$data['labels'][] = $entry[0]->formatLocalized($format);
$data['datasets'][0]['data'][] = $entry[1];
}
$data['count'] = count($data['datasets']);
return $data;
}
/**
* @codeCoverageIgnore
*
* @param Collection $entries
*
* @return array
*/
public function budgetLimit(Collection $entries)
{
return $this->budget($entries, 'monthAndDay');
}
/**
* @param Collection $entries
*
* @return array
*/
public function frontpage(Collection $entries)
{
$data = [
'count' => 0,
'labels' => [],
'datasets' => [],
];
// dataset: left
// dataset: spent
// dataset: overspent
$left = [];
$spent = [];
$overspent = [];
foreach ($entries as $entry) {
if ($entry[1] != 0 || $entry[2] != 0 || $entry[3] != 0) {
$data['labels'][] = $entry[0];
$left[] = round($entry[1], 2);
$spent[] = round($entry[2] * -1, 2); // spent is coming in negative, must be positive
$overspent[] = round($entry[3] * -1, 2); // same
}
}
$data['datasets'][] = [
'label' => trans('firefly.left'),
'data' => $left,
];
$data['datasets'][] = [
'label' => trans('firefly.spent'),
'data' => $spent,
];
$data['datasets'][] = [
'label' => trans('firefly.overspent'),
'data' => $overspent,
];
$data['count'] = count($data['datasets']);
return $data;
}
/**
* @param Collection $budgets
* @param Collection $entries
*
* @return array
*/
public function year(Collection $budgets, Collection $entries)
{
// language:
$format = trans('config.month');
$data = [
'labels' => [],
'datasets' => [],
];
foreach ($budgets as $budget) {
$data['labels'][] = $budget->name;
}
/** @var array $entry */
foreach ($entries as $entry) {
$array = [
'label' => $entry[0]->formatLocalized($format),
'data' => [],
];
array_shift($entry);
$array['data'] = $entry;
$data['datasets'][] = $array;
}
$data['count'] = count($data['datasets']);
return $data;
}
/**
* @param Collection $entries
*
* @return array
*/
public function multiYear(Collection $entries)
{
// dataset:
$data = [
'count' => 0,
'labels' => [],
'datasets' => [],
];
// get labels from one of the budgets (assuming there's at least one):
$first = $entries->first();
foreach ($first['budgeted'] as $year => $noInterest) {
$data['labels'][] = strval($year);
}
// then, loop all entries and create datasets:
foreach ($entries as $entry) {
$name = $entry['name'];
$spent = $entry['spent'];
$budgeted = $entry['budgeted'];
$data['datasets'][] = ['label' => 'Spent on ' . $name, 'data' => array_values($spent)];
$data['datasets'][] = ['label' => 'Budgeted for ' . $name, 'data' => array_values($budgeted)];
}
$data['count'] = count($data['datasets']);
return $data;
}
}

View File

@@ -0,0 +1,58 @@
<?php
namespace FireflyIII\Generator\Chart\Category;
use Illuminate\Support\Collection;
/**
* Interface CategoryChartGenerator
*
* @package FireflyIII\Generator\Chart\Category
*/
interface CategoryChartGenerator
{
/**
* @param Collection $entries
*
* @return array
*/
public function all(Collection $entries);
/**
* @param Collection $categories
* @param Collection $entries
*
* @return array
*/
public function earnedInPeriod(Collection $categories, Collection $entries);
/**
* @param Collection $entries
*
* @return array
*/
public function frontpage(Collection $entries);
/**
* @param Collection $entries
*
* @return array
*/
public function multiYear(Collection $entries);
/**
* @param Collection $entries
*
* @return array
*/
public function period(Collection $entries);
/**
* @param Collection $categories
* @param Collection $entries
*
* @return array
*/
public function spentInPeriod(Collection $categories, Collection $entries);
}

View File

@@ -0,0 +1,194 @@
<?php
namespace FireflyIII\Generator\Chart\Category;
use Illuminate\Support\Collection;
/**
* Class ChartJsCategoryChartGenerator
*
* @package FireflyIII\Generator\Chart\Category
*/
class ChartJsCategoryChartGenerator implements CategoryChartGenerator
{
/**
* @param Collection $entries
*
* @return array
*/
public function all(Collection $entries)
{
$data = [
'count' => 2,
'labels' => [],
'datasets' => [
[
'label' => trans('firefly.spent'),
'data' => []
],
[
'label' => trans('firefly.earned'),
'data' => []
]
],
];
foreach ($entries as $entry) {
$data['labels'][] = $entry[1];
$spent = round($entry[2], 2);
$earned = round($entry[3], 2);
$data['datasets'][0]['data'][] = $spent == 0 ? null : $spent * -1;
$data['datasets'][1]['data'][] = $earned == 0 ? null : $earned;
}
return $data;
}
/**
* @param Collection $categories
* @param Collection $entries
*
* @return array
*/
public function earnedInPeriod(Collection $categories, Collection $entries)
{
// language:
$format = trans('config.month');
$data = [
'count' => 0,
'labels' => [],
'datasets' => [],
];
foreach ($categories as $category) {
$data['labels'][] = $category->name;
}
foreach ($entries as $entry) {
$date = $entry[0]->formatLocalized($format);
array_shift($entry);
$data['count']++;
$data['datasets'][] = ['label' => $date, 'data' => $entry];
}
return $data;
}
/**
* @param Collection $entries
*
* @return array
*/
public function frontpage(Collection $entries)
{
$data = [
'count' => 1,
'labels' => [],
'datasets' => [
[
'label' => trans('firefly.spent'),
'data' => []
]
],
];
foreach ($entries as $entry) {
if ($entry['sum'] != 0) {
$data['labels'][] = $entry['name'];
$data['datasets'][0]['data'][] = round(($entry['sum'] * -1), 2);
}
}
return $data;
}
/**
* @param Collection $entries
*
* @return array
*/
public function multiYear(Collection $entries)
{
// dataset:
$data = [
'count' => 0,
'labels' => [],
'datasets' => [],
];
// get labels from one of the categories (assuming there's at least one):
$first = $entries->first();
foreach ($first['spent'] as $year => $noInterest) {
$data['labels'][] = strval($year);
}
// then, loop all entries and create datasets:
foreach ($entries as $entry) {
$name = $entry['name'];
$spent = $entry['spent'];
$earned = $entry['earned'];
if (array_sum(array_values($spent)) != 0) {
$data['datasets'][] = ['label' => 'Spent in category ' . $name, 'data' => array_values($spent)];
}
if (array_sum(array_values($earned)) != 0) {
$data['datasets'][] = ['label' => 'Earned in category ' . $name, 'data' => array_values($earned)];
}
}
$data['count'] = count($data['datasets']);
return $data;
}
/**
* @codeCoverageIgnore
*
* @param Collection $entries
*
* @return array
*/
public function period(Collection $entries)
{
return $this->all($entries);
}
/**
* @param Collection $categories
* @param Collection $entries
*
* @return array
*/
public function spentInPeriod(Collection $categories, Collection $entries)
{
// language:
$format = trans('config.month');
$data = [
'count' => 0,
'labels' => [],
'datasets' => [],
];
foreach ($categories as $category) {
$data['labels'][] = $category->name;
}
foreach ($entries as $entry) {
$date = $entry[0]->formatLocalized($format);
array_shift($entry);
$data['count']++;
$data['datasets'][] = ['label' => $date, 'data' => $entry];
}
return $data;
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace FireflyIII\Generator\Chart\PiggyBank;
use Carbon\Carbon;
use Illuminate\Support\Collection;
/**
* Class ChartJsPiggyBankChartGenerator
*
* @package FireflyIII\Generator\Chart\PiggyBank
*/
class ChartJsPiggyBankChartGenerator implements PiggyBankChartGenerator
{
/**
* @param Collection $set
*
* @return array
*/
public function history(Collection $set)
{
// language:
$format = trans('config.month_and_day');
$data = [
'count' => 1,
'labels' => [],
'datasets' => [
[
'label' => 'Diff',
'data' => []
]
],
];
$sum = '0';
bcscale(2);
foreach ($set as $entry) {
$date = new Carbon($entry->date);
$sum = bcadd($sum, $entry->sum);
$data['labels'][] = $date->formatLocalized($format);
$data['datasets'][0]['data'][] = round($sum, 2);
}
return $data;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace FireflyIII\Generator\Chart\PiggyBank;
use Illuminate\Support\Collection;
/**
* Interface PiggyBankChartGenerator
*
* @package FireflyIII\Generator\Chart\PiggyBank
*/
interface PiggyBankChartGenerator
{
/**
* @param Collection $set
*
* @return array
*/
public function history(Collection $set);
}

View File

@@ -0,0 +1,144 @@
<?php
namespace FireflyIII\Generator\Chart\Report;
use Illuminate\Support\Collection;
/**
* Class ChartJsReportChartGenerator
*
* @package FireflyIII\Generator\Chart\Report
*/
class ChartJsReportChartGenerator implements ReportChartGenerator
{
/**
* Same as above but other translations.
*
* @param Collection $entries
*
* @return array
*/
public function multiYearInOut(Collection $entries)
{
$data = [
'count' => 2,
'labels' => [],
'datasets' => [
[
'label' => trans('firefly.income'),
'data' => []
],
[
'label' => trans('firefly.expenses'),
'data' => []
]
],
];
foreach ($entries as $entry) {
$data['labels'][] = $entry[0]->formatLocalized('%Y');
$data['datasets'][0]['data'][] = round($entry[1], 2);
$data['datasets'][1]['data'][] = round($entry[2], 2);
}
return $data;
}
/**
* @param string $income
* @param string $expense
* @param int $count
*
* @return array
*/
public function multiYearInOutSummarized($income, $expense, $count)
{
$data = [
'count' => 2,
'labels' => [trans('firefly.sum_of_years'), trans('firefly.average_of_years')],
'datasets' => [
[
'label' => trans('firefly.income'),
'data' => []
],
[
'label' => trans('firefly.expenses'),
'data' => []
]
],
];
$data['datasets'][0]['data'][] = round($income, 2);
$data['datasets'][1]['data'][] = round($expense, 2);
$data['datasets'][0]['data'][] = round(($income / $count), 2);
$data['datasets'][1]['data'][] = round(($expense / $count), 2);
return $data;
}
/**
* @param Collection $entries
*
* @return array
*/
public function yearInOut(Collection $entries)
{
// language:
$format = trans('config.month');
$data = [
'count' => 2,
'labels' => [],
'datasets' => [
[
'label' => trans('firefly.income'),
'data' => []
],
[
'label' => trans('firefly.expenses'),
'data' => []
]
],
];
foreach ($entries as $entry) {
$data['labels'][] = $entry[0]->formatLocalized($format);
$data['datasets'][0]['data'][] = round($entry[1], 2);
$data['datasets'][1]['data'][] = round($entry[2], 2);
}
return $data;
}
/**
* @param string $income
* @param string $expense
* @param int $count
*
* @return array
*/
public function yearInOutSummarized($income, $expense, $count)
{
$data = [
'count' => 2,
'labels' => [trans('firefly.sum_of_year'), trans('firefly.average_of_year')],
'datasets' => [
[
'label' => trans('firefly.income'),
'data' => []
],
[
'label' => trans('firefly.expenses'),
'data' => []
]
],
];
$data['datasets'][0]['data'][] = round($income, 2);
$data['datasets'][1]['data'][] = round($expense, 2);
$data['datasets'][0]['data'][] = round(($income / $count), 2);
$data['datasets'][1]['data'][] = round(($expense / $count), 2);
return $data;
}
}

View File

@@ -0,0 +1,47 @@
<?php
namespace FireflyIII\Generator\Chart\Report;
use Illuminate\Support\Collection;
/**
* Interface ReportChartGenerator
*
* @package FireflyIII\Generator\Chart\Report
*/
interface ReportChartGenerator
{
/**
* @param Collection $entries
*
* @return array
*/
public function multiYearInOut(Collection $entries);
/**
* @param string $income
* @param string $expense
* @param int $count
*
* @return array
*/
public function multiYearInOutSummarized($income, $expense, $count);
/**
* @param Collection $entries
*
* @return array
*/
public function yearInOut(Collection $entries);
/**
* @param string $income
* @param string $expense
* @param int $count
*
* @return array
*/
public function yearInOutSummarized($income, $expense, $count);
}

View File

@@ -0,0 +1,73 @@
<?php namespace FireflyIII\Handlers\Events;
use Auth;
use FireflyIII\Events\JournalCreated;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankEvent;
use FireflyIII\Models\TransactionJournal;
/**
* Class ConnectJournalToPiggyBank
*
* @package FireflyIII\Handlers\Events
*/
class ConnectJournalToPiggyBank
{
/**
* Create the event handler.
*
* @codeCoverageIgnore
*
*/
public function __construct()
{
//
}
/**
* Handle the event when journal is saved.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
* @param JournalCreated $event
*
* @return boolean
*/
public function handle(JournalCreated $event)
{
/** @var TransactionJournal $journal */
$journal = $event->journal;
$piggyBankId = $event->piggyBankId;
/** @var PiggyBank $piggyBank */
$piggyBank = Auth::user()->piggybanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']);
if (is_null($piggyBank)) {
return false;
}
// update piggy bank rep for date of transaction journal.
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
if (is_null($repetition)) {
return false;
}
bcscale(2);
$amount = $journal->amount_positive;
// if piggy account matches source account, the amount is positive
if ($piggyBank->account_id == $journal->source_account->id) {
$amount = $amount * -1;
}
$repetition->currentamount = bcadd($repetition->currentamount, $amount);
$repetition->save();
PiggyBankEvent::create(['piggy_bank_id' => $piggyBank->id, 'transaction_journal_id' => $journal->id, 'date' => $journal->date, 'amount' => $amount]);
return true;
}
}

View File

@@ -1,33 +0,0 @@
<?php namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\JournalDeleted;
use Illuminate\Contracts\Queue\ShouldBeQueued;
use Illuminate\Queue\InteractsWithQueue;
class JournalDeletedHandler
{
/**
* Create the event handler.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param JournalDeleted $event
*
* @return void
*/
public function handle(JournalDeleted $event)
{
//
}
}

View File

@@ -0,0 +1,52 @@
<?php namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\JournalSaved;
use Log;
/**
* Class RescanJournal
*
* @codeCoverageIgnore
* @package FireflyIII\Handlers\Events
*/
class RescanJournal
{
/**
* Create the event handler.
*
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param JournalSaved $event
*
* @return void
*/
public function handle(JournalSaved $event)
{
$journal = $event->journal;
Log::debug('Triggered saved event for journal #' . $journal->id . ' (' . $journal->description . ')');
/** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */
$repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface');
$list = $journal->user->bills()->where('active', 1)->where('automatch', 1)->get();
Log::debug('Found ' . $list->count() . ' bills to check.');
/** @var \FireflyIII\Models\Bill $bill */
foreach ($list as $bill) {
Log::debug('Now calling bill #' . $bill->id . ' (' . $bill->name . ')');
$repository->scan($bill, $journal);
}
Log::debug('Done!');
}
}

View File

@@ -0,0 +1,65 @@
<?php namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\JournalSaved;
use FireflyIII\Models\PiggyBankEvent;
use FireflyIII\Models\PiggyBankRepetition;
/**
* Class UpdateJournalConnection
*
* @codeCoverageIgnore
* @package FireflyIII\Handlers\Events
*/
class UpdateJournalConnection
{
/**
* Create the event handler.
*
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param JournalSaved $event
*
* @return void
*/
public function handle(JournalSaved $event)
{
$journal = $event->journal;
// get the event connected to this journal:
/** @var PiggyBankEvent $event */
$event = PiggyBankEvent::where('transaction_journal_id', $journal->id)->first();
if (is_null($event)) {
return;
}
$piggyBank = $event->piggyBank()->first();
$repetition = null;
if ($piggyBank) {
/** @var PiggyBankRepetition $repetition */
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
}
if (is_null($repetition)) {
return;
}
bcscale(2);
$amount = $journal->amount;
$diff = bcsub($amount, $event->amount); // update current repetition
$repetition->currentamount = bcadd($repetition->currentamount, $diff);
$repetition->save();
$event->amount = $amount;
$event->save();
}
}

View File

@@ -0,0 +1,224 @@
<?php
namespace FireflyIII\Helpers\Attachments;
use Auth;
use Config;
use Crypt;
use FireflyIII\Models\Attachment;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\MessageBag;
use Input;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* Class AttachmentHelper
*
* @package FireflyIII\Helpers\Attachments
*/
class AttachmentHelper implements AttachmentHelperInterface
{
/** @var int */
protected $maxUploadSize;
/** @var array */
protected $allowedMimes;
/** @var MessageBag */
public $errors;
/** @var MessageBag */
public $messages;
/**
*
*/
public function __construct()
{
$this->maxUploadSize = Config::get('firefly.maxUploadSize');
$this->allowedMimes = Config::get('firefly.allowedMimes');
$this->errors = new MessageBag;
$this->messages = new MessageBag;
}
/**
* @param Attachment $attachment
*
* @return string
*/
public function getAttachmentLocation(Attachment $attachment)
{
$path = storage_path('upload') . DIRECTORY_SEPARATOR . 'at-' . $attachment->id . '.data';
return $path;
}
/**
* @param Model $model
*
* @return bool
*/
public function saveAttachmentsForModel(Model $model)
{
$files = Input::file('attachments');
if (is_array($files)) {
foreach ($files as $entry) {
if (!is_null($entry)) {
$this->processFile($entry, $model);
}
}
} else {
if (!is_null($files)) {
$this->processFile($files, $model);
}
}
return true;
}
/**
* @param UploadedFile $file
* @param Model $model
*
* @return bool
*/
protected function hasFile(UploadedFile $file, Model $model)
{
$md5 = md5_file($file->getRealPath());
$name = $file->getClientOriginalName();
$class = get_class($model);
$count = Auth::user()->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count();
if ($count > 0) {
$msg = trans('validation.file_already_attached', ['name' => $name]);
$this->errors->add('attachments', $msg);
return true;
}
return false;
}
/**
* @param UploadedFile $file
* @param Model $model
*
* @return bool
*/
protected function validateUpload(UploadedFile $file, Model $model)
{
if (!$this->validMime($file)) {
return false;
}
if (!$this->validSize($file)) {
return false;
}
if ($this->hasFile($file, $model)) {
return false;
}
return true;
}
/**
* @param UploadedFile $file
* @param Model $model
*
* @return bool|Attachment
*/
protected function processFile(UploadedFile $file, Model $model)
{
$validation = $this->validateUpload($file, $model);
if ($validation === false) {
return false;
}
$attachment = new Attachment; // create Attachment object.
$attachment->user()->associate(Auth::user());
$attachment->attachable()->associate($model);
$attachment->md5 = md5_file($file->getRealPath());
$attachment->filename = $file->getClientOriginalName();
$attachment->mime = $file->getMimeType();
$attachment->size = $file->getSize();
$attachment->uploaded = 0;
$attachment->save();
$path = $file->getRealPath(); // encrypt and move file to storage.
$content = file_get_contents($path);
$encrypted = Crypt::encrypt($content);
// store it:
$upload = $this->getAttachmentLocation($attachment);
if (is_writable(dirname($upload))) {
file_put_contents($upload, $encrypted);
}
$attachment->uploaded = 1; // update attachment
$attachment->save();
$name = e($file->getClientOriginalName()); // add message:
$msg = trans('validation.file_attached', ['name' => $name]);
$this->messages->add('attachments', $msg);
// return it.
return $attachment;
}
/**
* @param UploadedFile $file
*
* @return bool
*/
protected function validMime(UploadedFile $file)
{
$mime = e($file->getMimeType());
$name = e($file->getClientOriginalName());
if (!in_array($mime, $this->allowedMimes)) {
$msg = trans('validation.file_invalid_mime', ['name' => $name, 'mime' => $mime]);
$this->errors->add('attachments', $msg);
return false;
}
return true;
}
/**
* @param UploadedFile $file
*
* @return bool
*/
protected function validSize(UploadedFile $file)
{
$size = $file->getSize();
$name = e($file->getClientOriginalName());
if ($size > $this->maxUploadSize) {
$msg = trans('validation.file_too_large', ['name' => $name]);
$this->errors->add('attachments', $msg);
return false;
}
return true;
}
/**
* @return MessageBag
*/
public function getErrors()
{
return $this->errors;
}
/**
* @return MessageBag
*/
public function getMessages()
{
return $this->messages;
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace FireflyIII\Helpers\Attachments;
use FireflyIII\Models\Attachment;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\MessageBag;
/**
* Interface AttachmentHelperInterface
*
* @package FireflyIII\Helpers\Attachments
*/
interface AttachmentHelperInterface
{
/**
* @param Model $model
*
* @return bool
*/
public function saveAttachmentsForModel(Model $model);
/**
* @return MessageBag
*/
public function getErrors();
/**
* @return MessageBag
*/
public function getMessages();
/**
* @param Attachment $attachment
*
* @return mixed
*/
public function getAttachmentLocation(Attachment $attachment);
}

View File

@@ -0,0 +1,90 @@
<?php
namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection;
/**
* @codeCoverageIgnore
* Class Account
*
* @package FireflyIII\Helpers\Collection
*/
class Account
{
/** @var Collection */
protected $accounts;
/** @var float */
protected $difference;
/** @var float */
protected $end;
/** @var float */
protected $start;
/**
* @return \Illuminate\Support\Collection
*/
public function getAccounts()
{
return $this->accounts;
}
/**
* @param \Illuminate\Support\Collection $accounts
*/
public function setAccounts($accounts)
{
$this->accounts = $accounts;
}
/**
* @return float
*/
public function getDifference()
{
return $this->difference;
}
/**
* @param float $difference
*/
public function setDifference($difference)
{
$this->difference = $difference;
}
/**
* @return float
*/
public function getEnd()
{
return $this->end;
}
/**
* @param float $end
*/
public function setEnd($end)
{
$this->end = $end;
}
/**
* @return float
*/
public function getStart()
{
return $this->start;
}
/**
* @param float $start
*/
public function setStart($start)
{
$this->start = $start;
}
}

View File

@@ -0,0 +1,64 @@
<?php
namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection;
/**
* @codeCoverageIgnore
*
* Class Balance
*
* @package FireflyIII\Helpers\Collection
*/
class Balance
{
/** @var BalanceHeader */
protected $balanceHeader;
/** @var Collection */
protected $balanceLines;
/**
*
*/
public function __construct()
{
$this->balanceLines = new Collection;
}
/**
* @param BalanceLine $line
*/
public function addBalanceLine(BalanceLine $line)
{
$this->balanceLines->push($line);
}
/**
* @return BalanceHeader
*/
public function getBalanceHeader()
{
return $this->balanceHeader;
}
/**
* @param BalanceHeader $balanceHeader
*/
public function setBalanceHeader($balanceHeader)
{
$this->balanceHeader = $balanceHeader;
}
/**
* @return \Illuminate\Support\Collection
*/
public function getBalanceLines()
{
return $this->balanceLines;
}
}

View File

@@ -0,0 +1,74 @@
<?php
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Account as AccountModel;
/**
* @codeCoverageIgnore
*
* Class BalanceEntry
*
* @package FireflyIII\Helpers\Collection
*/
class BalanceEntry
{
/** @var AccountModel */
protected $account;
/** @var float */
protected $left = 0.0;
/** @var float */
protected $spent = 0.0;
/**
* @return AccountModel
*/
public function getAccount()
{
return $this->account;
}
/**
* @param AccountModel $account
*/
public function setAccount($account)
{
$this->account = $account;
}
/**
* @return float
*/
public function getLeft()
{
return $this->left;
}
/**
* @param float $left
*/
public function setLeft($left)
{
$this->left = $left;
}
/**
* @return float
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param float $spent
*/
public function setSpent($spent)
{
$this->spent = $spent;
}
}

View File

@@ -0,0 +1,46 @@
<?php
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Account as AccountModel;
use Illuminate\Support\Collection;
/**
* @codeCoverageIgnore
*
* Class BalanceHeader
*
* @package FireflyIII\Helpers\Collection
*/
class BalanceHeader
{
/** @var Collection */
protected $accounts;
/**
*
*/
public function __construct()
{
$this->accounts = new Collection;
}
/**
* @param AccountModel $account
*/
public function addAccount(AccountModel $account)
{
$this->accounts->push($account);
}
/**
* @return Collection
*/
public function getAccounts()
{
return $this->accounts;
}
}

View File

@@ -0,0 +1,153 @@
<?php
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Budget as BudgetModel;
use FireflyIII\Models\LimitRepetition;
use Illuminate\Support\Collection;
/**
* @codeCoverageIgnore
*
* Class BalanceLine
*
* @package FireflyIII\Helpers\Collection
*/
class BalanceLine
{
const ROLE_DEFAULTROLE = 1;
const ROLE_TAGROLE = 2;
const ROLE_DIFFROLE = 3;
/** @var Collection */
protected $balanceEntries;
/** @var BudgetModel */
protected $budget;
/** @var LimitRepetition */
protected $repetition;
protected $role = self::ROLE_DEFAULTROLE;
/**
*
*/
public function __construct()
{
$this->balanceEntries = new Collection;
}
/**
* @param BalanceEntry $balanceEntry
*/
public function addBalanceEntry(BalanceEntry $balanceEntry)
{
$this->balanceEntries->push($balanceEntry);
}
/**
* @return string
*/
public function getTitle()
{
if ($this->getBudget() instanceof BudgetModel) {
return $this->getBudget()->name;
}
if ($this->getRole() == self::ROLE_DEFAULTROLE) {
return trans('firefly.noBudget');
}
if ($this->getRole() == self::ROLE_TAGROLE) {
return trans('firefly.coveredWithTags');
}
if ($this->getRole() == self::ROLE_DIFFROLE) {
return trans('firefly.leftUnbalanced');
}
return '';
}
/**
* @return BudgetModel
*/
public function getBudget()
{
return $this->budget;
}
/**
* @param BudgetModel $budget
*/
public function setBudget($budget)
{
$this->budget = $budget;
}
/**
* @return int
*/
public function getRole()
{
return $this->role;
}
/**
* @param int $role
*/
public function setRole($role)
{
$this->role = $role;
}
/**
* If a BalanceLine has a budget/repetition, each BalanceEntry in this BalanceLine
* should have a "spent" value, which is the amount of money that has been spent
* on the given budget/repetition. If you subtract all those amounts from the budget/repetition's
* total amount, this is returned:
*
* @return float
*/
public function leftOfRepetition()
{
$start = $this->getRepetition() ? $this->getRepetition()->amount : 0;
/** @var BalanceEntry $balanceEntry */
foreach ($this->getBalanceEntries() as $balanceEntry) {
$start += $balanceEntry->getSpent();
}
return $start;
}
/**
* @return LimitRepetition
*/
public function getRepetition()
{
return $this->repetition;
}
/**
* @param LimitRepetition $repetition
*/
public function setRepetition($repetition)
{
$this->repetition = $repetition;
}
/**
* @return Collection
*/
public function getBalanceEntries()
{
return $this->balanceEntries;
}
/**
* @param Collection $balanceEntries
*/
public function setBalanceEntries($balanceEntries)
{
$this->balanceEntries = $balanceEntries;
}
}

View File

@@ -0,0 +1,56 @@
<?php
namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection;
/**
* @codeCoverageIgnore
* Class Bill
*
* @package FireflyIII\Helpers\Collection
*/
class Bill
{
/**
* @var Collection
*/
protected $bills;
/**
*
*/
public function __construct()
{
$this->bills = new Collection;
}
/**
* @param BillLine $bill
*/
public function addBill(BillLine $bill)
{
$this->bills->push($bill);
}
/**
* @return Collection
*/
public function getBills()
{
$set = $this->bills->sortBy(
function (BillLine $bill) {
$active = intval($bill->getBill()->active) == 0 ? 1 : 0;
$name = $bill->getBill()->name;
return $active . $name;
}
);
return $set;
}
}

View File

@@ -0,0 +1,127 @@
<?php
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Bill as BillModel;
/**
* @codeCoverageIgnore
*
* Class BillLine
*
* @package FireflyIII\Helpers\Collection
*/
class BillLine
{
/** @var bool */
protected $active;
/** @var string */
protected $amount;
/** @var BillModel */
protected $bill;
/** @var bool */
protected $hit;
/** @var string */
protected $max;
/** @var string */
protected $min;
/**
* @return string
*/
public function getAmount()
{
return $this->amount;
}
/**
* @param string $amount
*/
public function setAmount($amount)
{
$this->amount = $amount;
}
/**
* @return BillModel
*/
public function getBill()
{
return $this->bill;
}
/**
* @param BillModel $bill
*/
public function setBill($bill)
{
$this->bill = $bill;
}
/**
* @return string
*/
public function getMax()
{
return $this->max;
}
/**
* @param string $max
*/
public function setMax($max)
{
$this->max = $max;
}
/**
* @return string
*/
public function getMin()
{
return $this->min;
}
/**
* @param string $min
*/
public function setMin($min)
{
$this->min = $min;
}
/**
* @return boolean
*/
public function isActive()
{
return $this->active;
}
/**
* @param boolean $active
*/
public function setActive($active)
{
$this->active = $active;
}
/**
* @return boolean
*/
public function isHit()
{
return $this->hit;
}
/**
* @param boolean $hit
*/
public function setHit($hit)
{
$this->hit = $hit;
}
}

View File

@@ -0,0 +1,156 @@
<?php
namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection;
/**
* @codeCoverageIgnore
*
* Class Budget
*
* @package FireflyIII\Helpers\Collection
*/
class Budget
{
/** @var Collection */
protected $budgetLines;
/** @var string */
protected $budgeted = '0';
/** @var string */
protected $left = '0';
/** @var string */
protected $overspent = '0';
/** @var string */
protected $spent = '0';
/**
*
*/
public function __construct()
{
$this->budgetLines = new Collection;
}
/**
* @param BudgetLine $budgetLine
*/
public function addBudgetLine(BudgetLine $budgetLine)
{
$this->budgetLines->push($budgetLine);
}
/**
* @param float $add
*/
public function addBudgeted($add)
{
$add = strval(round($add, 2));
bcscale(2);
$this->budgeted = bcadd($this->budgeted, $add);
}
/**
* @param float $add
*/
public function addLeft($add)
{
$add = strval(round($add, 2));
bcscale(2);
$this->left = bcadd($this->left, $add);
}
/**
* @param float $add
*/
public function addOverspent($add)
{
$add = strval(round($add, 2));
bcscale(2);
$this->overspent = bcadd($this->overspent, $add);
}
/**
* @param float $add
*/
public function addSpent($add)
{
$add = strval(round($add, 2));
bcscale(2);
$this->spent = bcadd($this->spent, $add);
}
/**
* @return \Illuminate\Support\Collection
*/
public function getBudgetLines()
{
return $this->budgetLines;
}
/**
* @return string
*/
public function getBudgeted()
{
return $this->budgeted;
}
/**
* @param string $budgeted
*/
public function setBudgeted($budgeted)
{
$this->budgeted = $budgeted;
}
/**
* @return string
*/
public function getLeft()
{
return $this->left;
}
/**
* @param string $left
*/
public function setLeft($left)
{
$this->left = $left;
}
/**
* @return string
*/
public function getOverspent()
{
return $this->overspent;
}
/**
* @param string $overspent
*/
public function setOverspent($overspent)
{
$this->overspent = strval(round($overspent, 2));
}
/**
* @return string
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param string $spent
*/
public function setSpent($spent)
{
$this->spent = strval(round($spent, 2));
}
}

View File

@@ -0,0 +1,128 @@
<?php
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Budget as BudgetModel;
use FireflyIII\Models\LimitRepetition;
/**
* @codeCoverageIgnore
*
* Class BudgetLine
*
* @package FireflyIII\Helpers\Collection
*/
class BudgetLine
{
/** @var BudgetModel */
protected $budget;
/** @var float */
protected $budgeted = 0;
/** @var float */
protected $left = 0;
/** @var float */
protected $overspent = 0;
/** @var LimitRepetition */
protected $repetition;
/** @var float */
protected $spent = 0;
/**
* @return BudgetModel
*/
public function getBudget()
{
return $this->budget;
}
/**
* @param BudgetModel $budget
*/
public function setBudget($budget)
{
$this->budget = $budget;
}
/**
* @return float
*/
public function getBudgeted()
{
return $this->budgeted;
}
/**
* @param float $budgeted
*/
public function setBudgeted($budgeted)
{
$this->budgeted = $budgeted;
}
/**
* @return float
*/
public function getLeft()
{
return $this->left;
}
/**
* @param float $left
*/
public function setLeft($left)
{
$this->left = $left;
}
/**
* @return float
*/
public function getOverspent()
{
return $this->overspent;
}
/**
* @param float $overspent
*/
public function setOverspent($overspent)
{
$this->overspent = $overspent;
}
/**
* @return LimitRepetition
*/
public function getRepetition()
{
return $this->repetition;
}
/**
* @param LimitRepetition $repetition
*/
public function setRepetition($repetition)
{
$this->repetition = $repetition;
}
/**
* @return float
*/
public function getSpent()
{
return $this->spent;
}
/**
* @param float $spent
*/
public function setSpent($spent)
{
$this->spent = $spent;
}
}

View File

@@ -0,0 +1,78 @@
<?php
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Category as CategoryModel;
use Illuminate\Support\Collection;
/**
* @codeCoverageIgnore
*
* Class Category
*
* @package FireflyIII\Helpers\Collection
*/
class Category
{
/** @var Collection */
protected $categories;
/** @var string */
protected $total = '0';
/**
*
*/
public function __construct()
{
$this->categories = new Collection;
}
/**
* @param CategoryModel $category
*/
public function addCategory(CategoryModel $category)
{
// spent is minus zero for an expense report:
if ($category->spent < 0) {
$this->categories->push($category);
$this->addTotal($category->spent);
}
}
/**
* @param float $add
*/
public function addTotal($add)
{
$add = strval(round($add, 2));
bcscale(2);
$this->total = bcadd($this->total, $add);
}
/**
* @return Collection
*/
public function getCategories()
{
$set = $this->categories->sortBy(
function (CategoryModel $category) {
return $category->spent;
}
);
return $set;
}
/**
* @return string
*/
public function getTotal()
{
return strval(round($this->total, 2));
}
}

View File

@@ -0,0 +1,100 @@
<?php
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Support\Collection;
use stdClass;
/**
* @codeCoverageIgnore
*
* Class Expense
*
* @package FireflyIII\Helpers\Collection
*/
class Expense
{
/** @var Collection */
protected $expenses;
/** @var string */
protected $total = '0';
/**
*
*/
public function __construct()
{
$this->expenses = new Collection;
}
/**
* @param TransactionJournal $entry
*/
public function addOrCreateExpense(TransactionJournal $entry)
{
bcscale(2);
$accountId = $entry->account_id;
$amount = strval(round($entry->amount, 2));
if (bccomp('0', $amount) === -1) {
$amount = bcmul($amount, '-1');
}
if (!$this->expenses->has($accountId)) {
$newObject = new stdClass;
$newObject->amount = $amount;
$newObject->name = $entry->name;
$newObject->count = 1;
$newObject->id = $accountId;
$this->expenses->put($accountId, $newObject);
} else {
$existing = $this->expenses->get($accountId);
$existing->amount = bcadd($existing->amount, $amount);
$existing->count++;
$this->expenses->put($accountId, $existing);
}
}
/**
* @param $add
*/
public function addToTotal($add)
{
bcscale(2);
$add = strval(round($add, 2));
if (bccomp('0', $add) === -1) {
$add = bcmul($add, '-1');
}
// if amount is positive, the original transaction
// was a transfer. But since this is an expense report,
// that amount must be negative.
$this->total = bcadd($this->total, $add);
}
/**
* @return Collection
*/
public function getExpenses()
{
$set = $this->expenses->sortBy(
function (stdClass $object) {
return $object->amount;
}
);
return $set;
}
/**
* @return string
*/
public function getTotal()
{
return strval(round($this->total, 2));
}
}

View File

@@ -0,0 +1,88 @@
<?php
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Support\Collection;
use stdClass;
/**
* @codeCoverageIgnore
*
* Class Income
*
* @package FireflyIII\Helpers\Collection
*/
class Income
{
/** @var Collection */
protected $incomes;
/** @var string */
protected $total;
/**
*
*/
public function __construct()
{
$this->incomes = new Collection;
}
/**
* @param TransactionJournal $entry
*/
public function addOrCreateIncome(TransactionJournal $entry)
{
$accountId = $entry->account_id;
if (!$this->incomes->has($accountId)) {
$newObject = new stdClass;
$newObject->amount = strval(round($entry->amount_positive, 2));
$newObject->name = $entry->name;
$newObject->count = 1;
$newObject->id = $accountId;
$this->incomes->put($accountId, $newObject);
} else {
bcscale(2);
$existing = $this->incomes->get($accountId);
$existing->amount = bcadd($existing->amount, $entry->amount_positive);
$existing->count++;
$this->incomes->put($accountId, $existing);
}
}
/**
* @param $add
*/
public function addToTotal($add)
{
$add = strval(round($add, 2));
bcscale(2);
$this->total = bcadd($this->total, $add);
}
/**
* @return Collection
*/
public function getIncomes()
{
$set = $this->incomes->sortByDesc(
function (stdClass $object) {
return $object->amount;
}
);
return $set;
}
/**
* @return string
*/
public function getTotal()
{
return strval(round($this->total, 2));
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Account;
use Log;
/**
* Class AccountId
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class AccountId extends BasicConverter implements ConverterInterface
{
/**
* @return Account
*/
public function convert()
{
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
/** @var Account $account */
$account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);
} else {
/** @var Account $account */
$account = Auth::user()->accounts()->find($this->value);
if (!is_null($account)) {
Log::debug('Found ' . $account->accountType->type . ' named "******" with ID: ' . $this->value . ' (not mapped) ');
}
}
return $account;
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use FireflyIII\Models\Account;
/**
* Class Amount
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class Amount extends BasicConverter implements ConverterInterface
{
/**
* @return Account|null
*/
public function convert()
{
if (is_numeric($this->value)) {
return $this->value;
}
return 0;
}
}

View File

@@ -0,0 +1,68 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
/**
* Class AssetAccountIban
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class AssetAccountIban extends BasicConverter implements ConverterInterface
{
/**
* @return Account|null
*/
public function convert()
{
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
$account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);
return $account;
}
if (strlen($this->value) > 0) {
// find or create new account:
$account = $this->findAccount();
$accountType = AccountType::where('type', 'Asset account')->first();
if (is_null($account)) {
// create it if doesn't exist.
$account = Account::firstOrCreateEncrypted(
[
'name' => $this->value,
'iban' => $this->value,
'user_id' => Auth::user()->id,
'account_type_id' => $accountType->id,
'active' => 1,
]
);
}
return $account;
}
return null;
}
/**
* @return Account|null
*/
protected function findAccount()
{
$set = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*']);
/** @var Account $entry */
foreach ($set as $entry) {
if ($entry->iban == $this->value) {
return $entry;
}
}
return null;
}
}

View File

@@ -0,0 +1,51 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
/**
* Class AssetAccountName
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class AssetAccountName extends BasicConverter implements ConverterInterface
{
/**
* @return Account|null
*/
public function convert()
{
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
$account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);
return $account;
}
// find or create new account:
$accountType = AccountType::where('type', 'Asset account')->first();
$set = Auth::user()->accounts()->accountTypeIn(['Asset account', 'Default account'])->get();
/** @var Account $entry */
foreach ($set as $entry) {
if ($entry->name == $this->value) {
return $entry;
}
}
// create it if doesnt exist.
$account = Account::firstOrCreateEncrypted(
[
'name' => $this->value,
'iban' => '',
'user_id' => Auth::user()->id,
'account_type_id' => $accountType->id,
'active' => 1,
]
);
return $account;
}
}

View File

@@ -0,0 +1,122 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
/**
* Class BasicConverter
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class BasicConverter
{
/** @var array */
protected $data;
/** @var string */
protected $field;
/** @var int */
protected $index;
/** @var array */
protected $mapped;
/** @var string */
protected $role;
/** @var string */
protected $value;
/**
* @return array
*/
public function getData()
{
return $this->data;
}
/**
* @param array $data
*/
public function setData(array $data)
{
$this->data = $data;
}
/**
* @return string
*/
public function getField()
{
return $this->field;
}
/**
* @param string $field
*/
public function setField($field)
{
$this->field = $field;
}
/**
* @return int
*/
public function getIndex()
{
return $this->index;
}
/**
* @param int $index
*/
public function setIndex($index)
{
$this->index = $index;
}
/**
* @return array
*/
public function getMapped()
{
return $this->mapped;
}
/**
* @param array $mapped
*/
public function setMapped($mapped)
{
$this->mapped = $mapped;
}
/**
* @return string
*/
public function getRole()
{
return $this->role;
}
/**
* @param string $role
*/
public function setRole($role)
{
$this->role = $role;
}
/**
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* @param string $value
*/
public function setValue($value)
{
$this->value = $value;
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Bill;
/**
* Class BillId
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class BillId extends BasicConverter implements ConverterInterface
{
/**
* @return Bill
*/
public function convert()
{
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
$bill = Auth::user()->bills()->find($this->mapped[$this->index][$this->value]);
} else {
$bill = Auth::user()->bills()->find($this->value);
}
return $bill;
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Bill;
/**
* Class BillName
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class BillName extends BasicConverter implements ConverterInterface
{
/**
* @return Bill
*/
public function convert()
{
$bill = null;
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
$bill = Auth::user()->bills()->find($this->mapped[$this->index][$this->value]);
} else {
$bills = Auth::user()->bills()->get();
/** @var Bill $bill */
foreach ($bills as $bill) {
if ($bill->name == $this->value) {
return $bill;
}
}
}
return $bill;
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Budget;
/**
* Class AccountId
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class BudgetId extends BasicConverter implements ConverterInterface
{
/**
* @return Budget
*/
public function convert()
{
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
$budget = Auth::user()->budgets()->find($this->mapped[$this->index][$this->value]);
} else {
$budget = Auth::user()->budgets()->find($this->value);
}
return $budget;
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Budget;
/**
* Class BudgetName
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class BudgetName extends BasicConverter implements ConverterInterface
{
/**
* @return Budget
*/
public function convert()
{
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
$budget = Auth::user()->budgets()->find($this->mapped[$this->index][$this->value]);
} else {
$budget = Budget::firstOrCreateEncrypted(
[
'name' => $this->value,
'user_id' => Auth::user()->id,
'active' => true,
]
);
}
return $budget;
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Category;
/**
* Class CategoryId
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class CategoryId extends BasicConverter implements ConverterInterface
{
/**
* @return Category
*/
public function convert()
{
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
$category = Auth::user()->categories()->find($this->mapped[$this->index][$this->value]);
} else {
$category = Auth::user()->categories()->find($this->value);
}
return $category;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Category;
/**
* Class CategoryName
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class CategoryName extends BasicConverter implements ConverterInterface
{
/**
* @return Category
*/
public function convert()
{
// is mapped? Then it's easy!
if (isset($this->mapped[$this->index][$this->value])) {
$category = Auth::user()->categories()->find($this->mapped[$this->index][$this->value]);
} else {
$category = Category::firstOrCreateEncrypted(
[
'name' => $this->value,
'user_id' => Auth::user()->id
]
);
}
return $category;
}
}

View File

@@ -0,0 +1,49 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
/**
* Interface ConverterInterface
*
* @package FireflyIII\Helpers\Csv\Converter
*/
interface ConverterInterface
{
/**
* @return mixed
*/
public function convert();
/**
* @param array $data
*/
public function setData(array $data);
/**
* @param string $field
*
*/
public function setField($field);
/**
* @param int $index
*/
public function setIndex($index);
/**
* @param array $mapped
*/
public function setMapped($mapped);
/**
* @param string $role
*/
public function setRole($role);
/**
* @param string $value
*/
public function setValue($value);
}

View File

@@ -0,0 +1,28 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use FireflyIII\Models\TransactionCurrency;
/**
* Class CurrencyCode
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class CurrencyCode extends BasicConverter implements ConverterInterface
{
/**
* @return mixed|static
*/
public function convert()
{
if (isset($this->mapped[$this->index][$this->value])) {
$currency = TransactionCurrency::find($this->mapped[$this->index][$this->value]);
} else {
$currency = TransactionCurrency::whereCode($this->value)->first();
}
return $currency;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use FireflyIII\Models\TransactionCurrency;
/**
* Class CurrencyId
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class CurrencyId extends BasicConverter implements ConverterInterface
{
/**
* @return mixed|static
*/
public function convert()
{
if (isset($this->mapped[$this->index][$this->value])) {
$currency = TransactionCurrency::find($this->mapped[$this->index][$this->value]);
} else {
$currency = TransactionCurrency::find($this->value);
}
return $currency;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use FireflyIII\Models\TransactionCurrency;
/**
* Class CurrencyName
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class CurrencyName extends BasicConverter implements ConverterInterface
{
/**
* @return mixed|static
*/
public function convert()
{
if (isset($this->mapped[$this->index][$this->value])) {
$currency = TransactionCurrency::find($this->mapped[$this->index][$this->value]);
} else {
$currency = TransactionCurrency::whereName($this->value)->first();
}
return $currency;
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use FireflyIII\Models\TransactionCurrency;
/**
* Class CurrencySymbol
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class CurrencySymbol extends BasicConverter implements ConverterInterface
{
/**
* @return mixed|static
*/
public function convert()
{
if (isset($this->mapped[$this->index][$this->value])) {
$currency = TransactionCurrency::find($this->mapped[$this->index][$this->value]);
} else {
$currency = TransactionCurrency::whereSymbol($this->value)->first();
}
return $currency;
}
}

View File

@@ -0,0 +1,39 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use InvalidArgumentException;
use Log;
use Session;
/**
* Class Date
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class Date extends BasicConverter implements ConverterInterface
{
/**
* @return static
* @throws FireflyException
*/
public function convert()
{
$format = Session::get('csv-date-format');
try {
$date = Carbon::createFromFormat($format, $this->value);
} catch (InvalidArgumentException $e) {
Log::error('Date conversion error: ' . $e->getMessage() . '. Value was "' . $this->value . '", format was "' . $format . '".');
$message = trans('firefly.csv_date_parse_error', ['format' => $format, 'value' => $this->value]);
throw new FireflyException($message);
}
return $date;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
/**
* Class Description
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class Description extends BasicConverter implements ConverterInterface
{
/**
* @return mixed
*/
public function convert()
{
return trim($this->data['description'] . ' ' . $this->value);
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use FireflyIII\Models\Account;
/**
* Class Amount
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class Ignore extends BasicConverter implements ConverterInterface
{
/**
* @return Account|null
*/
public function convert()
{
return null;
}
}

View File

@@ -0,0 +1,57 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Account;
use Log;
/**
* Class OpposingAccountIban
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class OpposingAccountIban extends BasicConverter implements ConverterInterface
{
/**
* If mapped, return account. Otherwise, only return the name itself.
*
* @return Account|string
*/
public function convert()
{
if (isset($this->mapped[$this->index][$this->value])) {
$account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);
return $account;
} else {
if (strlen($this->value) > 0) {
$account = $this->findAccount();
if (!is_null($account)) {
return $account;
}
}
return $this->value;
}
}
/**
* @return Account|null
*/
protected function findAccount()
{
$set = Auth::user()->accounts()->get();
/** @var Account $account */
foreach ($set as $account) {
if ($account->iban == $this->value) {
Log::debug('OpposingAccountIban::convert found an Account (#' . $account->id . ': ******) with IBAN ******');
return $account;
}
}
return null;
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Account;
/**
* Class OpposingName
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class OpposingAccountId extends BasicConverter implements ConverterInterface
{
/**
* @return Account
*/
public function convert()
{
if (isset($this->mapped[$this->index][$this->value])) {
$account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);
} else {
$account = Auth::user()->accounts()->find($this->value);
}
return $account;
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Account;
/**
* Class OpposingName
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class OpposingAccountName extends BasicConverter implements ConverterInterface
{
/**
* If mapped, return account. Otherwise, only return the name itself.
*
* @return Account|string
*/
public function convert()
{
if (isset($this->mapped[$this->index][$this->value])) {
$account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);
return $account;
} else {
return $this->value;
}
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
/**
* Class RabobankDebetCredit
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class RabobankDebetCredit extends BasicConverter implements ConverterInterface
{
/**
* @return mixed
*/
public function convert()
{
if ($this->value == 'D') {
return -1;
}
return 1;
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Tag;
use Illuminate\Support\Collection;
/**
* Class TagsComma
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class TagsComma extends BasicConverter implements ConverterInterface
{
/**
* @return Bill
*/
public function convert()
{
$tags = new Collection;
$strings = explode(',', $this->value);
foreach ($strings as $string) {
$tag = Tag::firstOrCreateEncrypted(
[
'tag' => $string,
'tagMode' => 'nothing',
'user_id' => Auth::user()->id,
]
);
$tags->push($tag);
}
$tags = $tags->merge($this->data['tags']);
return $tags;
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace FireflyIII\Helpers\Csv\Converter;
use Auth;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Tag;
use Illuminate\Support\Collection;
/**
* Class TagsSpace
*
* @package FireflyIII\Helpers\Csv\Converter
*/
class TagsSpace extends BasicConverter implements ConverterInterface
{
/**
* @return Bill
*/
public function convert()
{
$tags = new Collection;
$strings = explode(' ', $this->value);
foreach ($strings as $string) {
$tag = Tag::firstOrCreateEncrypted(
[
'tag' => $string,
'tagMode' => 'nothing',
'user_id' => Auth::user()->id,
]
);
$tags->push($tag);
}
$tags = $tags->merge($this->data['tags']);
return $tags;
}
}

283
app/Helpers/Csv/Data.php Normal file
View File

@@ -0,0 +1,283 @@
<?php
namespace FireflyIII\Helpers\Csv;
use Crypt;
use League\Csv\Reader;
use Session;
/**
* Class Data
*
* @package FireflyIII\Helpers\Csv
*/
class Data
{
/** @var string */
protected $csvFileContent;
/** @var string */
protected $csvFileLocation;
/** @var string */
protected $dateFormat;
/** @var bool */
protected $hasHeaders;
/** @var array */
protected $map = [];
/** @var array */
protected $mapped = [];
/** @var Reader */
protected $reader;
/** @var array */
protected $roles = [];
/** @var array */
protected $specifix = [];
/** @var int */
protected $importAccount = 0;
/**
*
*/
public function __construct()
{
$this->sessionHasHeaders();
$this->sessionDateFormat();
$this->sessionCsvFileLocation();
$this->sessionMap();
$this->sessionRoles();
$this->sessionMapped();
$this->sessionSpecifix();
$this->sessionImportAccount();
}
protected function sessionHasHeaders()
{
if (Session::has('csv-has-headers')) {
$this->hasHeaders = (bool)Session::get('csv-has-headers');
}
}
protected function sessionImportAccount()
{
if (Session::has('csv-import-account')) {
$this->importAccount = intval(Session::get('csv-import-account'));
}
}
protected function sessionDateFormat()
{
if (Session::has('csv-date-format')) {
$this->dateFormat = (string)Session::get('csv-date-format');
}
}
protected function sessionCsvFileLocation()
{
if (Session::has('csv-file')) {
$this->csvFileLocation = (string)Session::get('csv-file');
}
}
protected function sessionMap()
{
if (Session::has('csv-map')) {
$this->map = (array)Session::get('csv-map');
}
}
protected function sessionRoles()
{
if (Session::has('csv-roles')) {
$this->roles = (array)Session::get('csv-roles');
}
}
protected function sessionMapped()
{
if (Session::has('csv-mapped')) {
$this->mapped = (array)Session::get('csv-mapped');
}
}
protected function sessionSpecifix()
{
if (Session::has('csv-specifix')) {
$this->specifix = (array)Session::get('csv-specifix');
}
}
/**
* @return string
*/
public function getDateFormat()
{
return $this->dateFormat;
}
/**
* @param mixed $dateFormat
*/
public function setDateFormat($dateFormat)
{
Session::put('csv-date-format', $dateFormat);
$this->dateFormat = $dateFormat;
}
/**
* @param int $importAccount
*/
public function setImportAccount($importAccount)
{
Session::put('csv-import-account', $importAccount);
$this->importAccount = $importAccount;
}
/**
* @return bool
*/
public function hasHeaders()
{
return $this->hasHeaders;
}
/**
* @param bool $hasHeaders
*/
public function setHasHeaders($hasHeaders)
{
Session::put('csv-has-headers', $hasHeaders);
$this->hasHeaders = $hasHeaders;
}
/**
* @return array
*/
public function getMap()
{
return $this->map;
}
/**
* @param array $map
*/
public function setMap(array $map)
{
Session::put('csv-map', $map);
$this->map = $map;
}
/**
* @return array
*/
public function getMapped()
{
return $this->mapped;
}
/**
* @param array $mapped
*/
public function setMapped(array $mapped)
{
Session::put('csv-mapped', $mapped);
$this->mapped = $mapped;
}
/**
* @return Reader
*/
public function getReader()
{
if (strlen($this->csvFileContent) === 0) {
$this->loadCsvFile();
}
if (is_null($this->reader)) {
$this->reader = Reader::createFromString($this->getCsvFileContent());
}
return $this->reader;
}
protected function loadCsvFile()
{
$file = $this->getCsvFileLocation();
$content = file_get_contents($file);
$contentDecrypted = Crypt::decrypt($content);
$this->setCsvFileContent($contentDecrypted);
}
/**
* @return string
*/
public function getCsvFileLocation()
{
return $this->csvFileLocation;
}
/**
* @param string $csvFileLocation
*/
public function setCsvFileLocation($csvFileLocation)
{
Session::put('csv-file', $csvFileLocation);
$this->csvFileLocation = $csvFileLocation;
}
/**
* @return string
*/
public function getCsvFileContent()
{
return $this->csvFileContent;
}
/**
* @param string $csvFileContent
*/
public function setCsvFileContent($csvFileContent)
{
$this->csvFileContent = $csvFileContent;
}
/**
* @return array
*/
public function getRoles()
{
return $this->roles;
}
/**
* @param array $roles
*/
public function setRoles(array $roles)
{
Session::put('csv-roles', $roles);
$this->roles = $roles;
}
/**
* @return array
*/
public function getSpecifix()
{
return is_array($this->specifix) ? $this->specifix : [];
}
/**
* @param array $specifix
*/
public function setSpecifix($specifix)
{
Session::put('csv-specifix', $specifix);
$this->specifix = $specifix;
}
}

View File

@@ -0,0 +1,371 @@
<?php
namespace FireflyIII\Helpers\Csv;
use Auth;
use Config;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Csv\Converter\ConverterInterface;
use FireflyIII\Helpers\Csv\PostProcessing\PostProcessorInterface;
use FireflyIII\Helpers\Csv\Specifix\SpecifixInterface;
use FireflyIII\Models\Account;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
use Log;
/**
* Class Importer
*
* @package FireflyIII\Helpers\Csv
*/
class Importer
{
/** @var Data */
protected $data;
/** @var array */
protected $errors;
/** @var array */
protected $importData;
/** @var array */
protected $importRow;
/** @var int */
protected $imported = 0;
/** @var array */
protected $map;
/** @var array */
protected $mapped;
/** @var array */
protected $roles;
/** @var int */
protected $rows = 0;
/** @var array */
protected $specifix = [];
/** @var Collection */
protected $journals;
/**
* Used by CsvController.
*
* @return array
*/
public function getErrors()
{
return $this->errors;
}
/**
* Used by CsvController
*
* @return int
*/
public function getImported()
{
return $this->imported;
}
/**
* Used by CsvController
*
* @return int
*/
public function getRows()
{
return $this->rows;
}
/**
* @return Collection
*/
public function getJournals()
{
return $this->journals;
}
/**
* @throws FireflyException
*/
public function run()
{
set_time_limit(0);
$this->journals = new Collection;
$this->map = $this->data->getMap();
$this->roles = $this->data->getRoles();
$this->mapped = $this->data->getMapped();
$this->specifix = $this->data->getSpecifix();
foreach ($this->data->getReader() as $index => $row) {
if ($this->parseRow($index)) {
Log::debug('--- Importing row ' . $index);
$this->rows++;
$result = $this->importRow($row);
if (!($result instanceof TransactionJournal)) {
Log::error('Caught error at row #' . $index . ': ' . $result);
$this->errors[$index] = $result;
} else {
$this->imported++;
$this->journals->push($result);
}
Log::debug('---');
}
}
}
/**
* @param int $index
*
* @return bool
*/
protected function parseRow($index)
{
return (($this->data->hasHeaders() && $index >= 1) || !$this->data->hasHeaders());
}
/**
* @param $row
*
* @throws FireflyException
* @return string|bool
*/
protected function importRow($row)
{
$data = $this->getFiller(); // These fields are necessary to create a new transaction journal. Some are optional
foreach ($row as $index => $value) {
$role = isset($this->roles[$index]) ? $this->roles[$index] : '_ignore';
$class = Config::get('csv.roles.' . $role . '.converter');
$field = Config::get('csv.roles.' . $role . '.field');
Log::debug('Column #' . $index . ' (role: ' . $role . ') : converter ' . $class . ' stores its data into field ' . $field . ':');
/** @var ConverterInterface $converter */
$converter = app('FireflyIII\Helpers\Csv\Converter\\' . $class);
$converter->setData($data); // the complete array so far.
$converter->setField($field);
$converter->setIndex($index);
$converter->setMapped($this->mapped);
$converter->setValue($value);
$converter->setRole($role);
$data[$field] = $converter->convert();
}
// move to class vars.
$this->importData = $data;
$this->importRow = $row;
unset($data, $row);
// post processing and validating.
$this->postProcess();
$result = $this->validateData();
if (!($result === true)) {
return $result; // return error.
}
$journal = $this->createTransactionJournal();
return $journal;
}
/**
* @return array
*/
protected function getFiller()
{
$filler = [];
foreach (Config::get('csv.roles') as $role) {
if (isset($role['field'])) {
$fieldName = $role['field'];
$filler[$fieldName] = null;
}
}
// some extra's:
$filler['bill-id'] = null;
$filler['opposing-account-object'] = null;
$filler['asset-account-object'] = null;
$filler['amount-modifier'] = '1';
return $filler;
}
/**
* Row denotes the original data.
*
* @return void
*/
protected function postProcess()
{
// do bank specific fixes (must be enabled but now all of them.
foreach ($this->getSpecifix() as $className) {
/** @var SpecifixInterface $specifix */
$specifix = app('FireflyIII\Helpers\Csv\Specifix\\' . $className);
$specifix->setData($this->importData);
$specifix->setRow($this->importRow);
Log::debug('Now post-process specifix named ' . $className . ':');
$this->importData = $specifix->fix();
}
$set = Config::get('csv.post_processors');
foreach ($set as $className) {
/** @var PostProcessorInterface $postProcessor */
$postProcessor = app('FireflyIII\Helpers\Csv\PostProcessing\\' . $className);
$postProcessor->setData($this->importData);
Log::debug('Now post-process processor named ' . $className . ':');
$this->importData = $postProcessor->process();
}
}
/**
* @return array
*/
public function getSpecifix()
{
return is_array($this->specifix) ? $this->specifix : [];
}
/**
*
* @return bool|string
*/
protected function validateData()
{
if (is_null($this->importData['date']) && is_null($this->importData['date-rent'])) {
return 'No date value for this row.';
}
if (is_null($this->importData['opposing-account-object'])) {
return 'Opposing account is null';
}
if (!($this->importData['asset-account-object'] instanceof Account)) {
return 'No asset account to import into.';
}
return true;
}
/**
*
* @return TransactionJournal|string
*/
protected function createTransactionJournal()
{
bcscale(2);
$date = $this->importData['date'];
if (is_null($this->importData['date'])) {
$date = $this->importData['date-rent'];
}
$transactionType = $this->getTransactionType(); // defaults to deposit
$errors = new MessageBag;
$journal = TransactionJournal::create(
['user_id' => Auth::user()->id, 'transaction_type_id' => $transactionType->id, 'transaction_currency_id' => $this->importData['currency']->id,
'description' => $this->importData['description'], 'completed' => 0, 'date' => $date, 'bill_id' => $this->importData['bill-id'],]
);
if ($journal->getErrors()->count() == 0) {
// first transaction
$accountId = $this->importData['asset-account-object']->id; // create first transaction:
$amount = $this->importData['amount'];
$transaction = Transaction::create(['transaction_journal_id' => $journal->id, 'account_id' => $accountId, 'amount' => $amount]);
$errors = $transaction->getErrors();
// second transaction
$accountId = $this->importData['opposing-account-object']->id; // create second transaction:
$amount = bcmul($this->importData['amount'], -1);
$transaction = Transaction::create(['transaction_journal_id' => $journal->id, 'account_id' => $accountId, 'amount' => $amount]);
$errors = $transaction->getErrors()->merge($errors);
}
if ($errors->count() == 0) {
$journal->completed = 1;
$journal->save();
} else {
$text = join(',', $errors->all());
return $text;
}
$this->saveBudget($journal);
$this->saveCategory($journal);
$this->saveTags($journal);
// some debug info:
$journalId = $journal->id;
$type = $journal->getTransactionType();
/** @var Account $asset */
$asset = $this->importData['asset-account-object'];
/** @var Account $opposing */
$opposing = $this->importData['opposing-account-object'];
Log::info('Created journal #' . $journalId . ' of type ' . $type . '!');
Log::info('Asset account ****** (#' . $asset->id . ') lost/gained: ' . $this->importData['amount']);
Log::info($opposing->accountType->type . ' ****** (#' . $opposing->id . ') lost/gained: ' . bcmul($this->importData['amount'], -1));
return $journal;
}
/**
* @return TransactionType
*/
protected function getTransactionType()
{
$transactionType = TransactionType::where('type', TransactionType::DEPOSIT)->first();
if ($this->importData['amount'] < 0) {
$transactionType = TransactionType::where('type', TransactionType::WITHDRAWAL)->first();
}
if (in_array($this->importData['opposing-account-object']->accountType->type, ['Asset account', 'Default account'])) {
$transactionType = TransactionType::where('type', TransactionType::TRANSFER)->first();
}
return $transactionType;
}
/**
* @param TransactionJournal $journal
*/
protected function saveBudget(TransactionJournal $journal)
{
// add budget:
if (!is_null($this->importData['budget'])) {
$journal->budgets()->save($this->importData['budget']);
}
}
/**
* @param TransactionJournal $journal
*/
protected function saveCategory(TransactionJournal $journal)
{
// add category:
if (!is_null($this->importData['category'])) {
$journal->categories()->save($this->importData['category']);
}
}
/**
* @param TransactionJournal $journal
*/
protected function saveTags(TransactionJournal $journal)
{
if (!is_null($this->importData['tags'])) {
foreach ($this->importData['tags'] as $tag) {
$journal->tags()->save($tag);
}
}
}
/**
* @param Data $data
*/
public function setData($data)
{
$this->data = $data;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace FireflyIII\Helpers\Csv\Mapper;
use Auth;
use FireflyIII\Models\Account;
/**
* Class AnyAccount
*
* @package FireflyIII\Helpers\Csv\Mapper
*/
class AnyAccount implements MapperInterface
{
/**
* @return array
*/
public function getMap()
{
$result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
$list = [];
/** @var Account $account */
foreach ($result as $account) {
$list[$account->id] = $account->name . ' (' . $account->accountType->type . ')';
}
asort($list);
$list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
}

View File

@@ -0,0 +1,45 @@
<?php
namespace FireflyIII\Helpers\Csv\Mapper;
use Auth;
use FireflyIII\Models\Account;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* Class AssetAccount
*
* @package FireflyIII\Helpers\Csv\Mapper
*/
class AssetAccount implements MapperInterface
{
/**
* @return array
*/
public function getMap()
{
$result = Auth::user()->accounts()->with(
['accountmeta' => function (HasMany $query) {
$query->where('name', 'accountRole');
}]
)->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
$list = [];
/** @var Account $account */
foreach ($result as $account) {
$name = $account->name;
if (strlen($account->iban) > 0) {
$name .= ' (' . $account->iban . ')';
}
$list[$account->id] = $name;
}
asort($list);
$list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace FireflyIII\Helpers\Csv\Mapper;
use Auth;
use FireflyIII\Models\Bill as BillModel;
/**
* Class Bill
*
* @package FireflyIII\Helpers\Csv\Mapper
*/
class Bill implements MapperInterface
{
/**
* @return array
*/
public function getMap()
{
$result = Auth::user()->bills()->get(['bills.*']);
$list = [];
/** @var BillModel $bill */
foreach ($result as $bill) {
$list[$bill->id] = $bill->name . ' [' . $bill->match . ']';
}
asort($list);
$list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace FireflyIII\Helpers\Csv\Mapper;
use Auth;
use FireflyIII\Models\Budget as BudgetModel;
/**
* Class Budget
*
* @package FireflyIII\Helpers\Csv\Mapper
*/
class Budget implements MapperInterface
{
/**
* @return array
*/
public function getMap()
{
$result = Auth::user()->budgets()->get(['budgets.*']);
$list = [];
/** @var BudgetModel $budget */
foreach ($result as $budget) {
$list[$budget->id] = $budget->name;
}
asort($list);
$list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace FireflyIII\Helpers\Csv\Mapper;
use Auth;
use FireflyIII\Models\Category as CategoryModel;
/**
* Class Category
*
* @package FireflyIII\Helpers\Csv\Mapper
*/
class Category implements MapperInterface
{
/**
* @return array
*/
public function getMap()
{
$result = Auth::user()->categories()->get(['categories.*']);
$list = [];
/** @var CategoryModel $category */
foreach ($result as $category) {
$list[$category->id] = $category->name;
}
asort($list);
$list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace FireflyIII\Helpers\Csv\Mapper;
/**
* Interface MapperInterface
*
* @package FireflyIII\Helpers\Csv\Mapper
*/
interface MapperInterface
{
/**
* @return array
*/
public function getMap();
}

View File

@@ -0,0 +1,34 @@
<?php
namespace FireflyIII\Helpers\Csv\Mapper;
use Auth;
use FireflyIII\Models\Tag as TagModel;
/**
* Class Tag
*
* @package FireflyIII\Helpers\Csv\Mapper
*/
class Tag implements MapperInterface
{
/**
* @return array
*/
public function getMap()
{
$result = Auth::user()->budgets()->get(['tags.*']);
$list = [];
/** @var TagModel $tag */
foreach ($result as $tag) {
$list[$tag->id] = $tag->tag;
}
asort($list);
$list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace FireflyIII\Helpers\Csv\Mapper;
use FireflyIII\Models\TransactionCurrency as TC;
/**
* Class TransactionCurrency
*
* @package FireflyIII\Helpers\Csv\Mapper
*/
class TransactionCurrency implements MapperInterface
{
/**
* @return array
*/
public function getMap()
{
$currencies = TC::get();
$list = [];
foreach ($currencies as $currency) {
$list[$currency->id] = $currency->name . ' (' . $currency->code . ')';
}
asort($list);
$list = [0 => trans('firefly.csv_do_not_map')] + $list;
return $list;
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace FireflyIII\Helpers\Csv\PostProcessing;
/**
* Class Amount
*
* @package FireflyIII\Helpers\Csv\PostProcessing
*/
class Amount implements PostProcessorInterface
{
/** @var array */
protected $data;
/**
* @return array
*/
public function process()
{
bcscale(2);
$this->data['amount'] = bcmul($this->data['amount'], $this->data['amount-modifier']);
return $this->data;
}
/**
* @param array $data
*/
public function setData(array $data)
{
$this->data = $data;
}
}

View File

@@ -0,0 +1,185 @@
<?php
namespace FireflyIII\Helpers\Csv\PostProcessing;
use Auth;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use Log;
use Validator;
/**
* Class AssetAccount
*
* @package FireflyIII\Helpers\Csv\PostProcessing
*/
class AssetAccount implements PostProcessorInterface
{
/** @var array */
protected $data;
/**
* @return array
*/
public function process()
{
$result = $this->checkIdNameObject(); // has object in ID or Name?
if (!is_null($result)) {
return $result;
}
$result = $this->checkIbanString();
if (!is_null($result)) {
return $result;
}
$result = $this->checkNameString();
if (!is_null($result)) {
return $result;
}
return null;
}
/**
* @param array $data
*/
public function setData(array $data)
{
$this->data = $data;
}
/**
* @return array
*/
protected function checkIdNameObject()
{
if ($this->data['asset-account-id'] instanceof Account) { // first priority. try to find the account based on ID, if any
$this->data['asset-account-object'] = $this->data['asset-account-id'];
return $this->data;
}
if ($this->data['asset-account-iban'] instanceof Account) { // second: try to find the account based on IBAN, if any.
$this->data['asset-account-object'] = $this->data['asset-account-iban'];
return $this->data;
}
return null;
}
/**
* @return array|null
*/
protected function checkIbanString()
{
$rules = ['iban' => 'iban'];
$check = ['iban' => $this->data['asset-account-iban']];
$validator = Validator::make($check, $rules);
if (!$validator->fails()) {
$this->data['asset-account-object'] = $this->parseIbanString();
return $this->data;
}
return null;
}
/**
* @return Account|null
*/
protected function parseIbanString()
{
// create by name and/or iban.
$accounts = Auth::user()->accounts()->get();
foreach ($accounts as $entry) {
if ($entry->iban == $this->data['asset-account-iban']) {
return $entry;
}
}
$account = $this->createAccount();
return $account;
}
/**
* @return Account|null
*/
protected function createAccount()
{
$accountType = $this->getAccountType();
// create if not exists:
$name = is_string($this->data['asset-account-name']) && strlen($this->data['asset-account-name']) > 0 ? $this->data['asset-account-name']
: $this->data['asset-account-iban'];
$account = Account::firstOrCreateEncrypted(
[
'user_id' => Auth::user()->id,
'account_type_id' => $accountType->id,
'name' => $name,
'iban' => $this->data['asset-account-iban'],
'active' => true,
]
);
return $account;
}
/**
*
* @return AccountType
*/
protected function getAccountType()
{
return AccountType::where('type', 'Asset account')->first();
}
/**
* @return array|null
*/
protected function checkNameString()
{
if ($this->data['asset-account-name'] instanceof Account) { // third: try to find account based on name, if any.
$this->data['asset-account-object'] = $this->data['asset-account-name'];
return $this->data;
}
if (is_string($this->data['asset-account-name'])) {
$this->data['asset-account-object'] = $this->parseNameString();
return $this->data;
}
return null;
}
/**
* @return Account|null
*/
protected function parseNameString()
{
$accountType = $this->getAccountType();
$accounts = Auth::user()->accounts()->where('account_type_id', $accountType->id)->get();
foreach ($accounts as $entry) {
if ($entry->name == $this->data['asset-account-name']) {
Log::debug('Found an asset account with this name (#' . $entry->id . ': ******)');
return $entry;
}
}
// create if not exists:
$account = Account::firstOrCreateEncrypted(
[
'user_id' => Auth::user()->id,
'account_type_id' => $accountType->id,
'name' => $this->data['asset-account-name'],
'iban' => '',
'active' => true,
]
);
return $account;
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace FireflyIII\Helpers\Csv\PostProcessing;
/**
* Class Bill
*
* @package FireflyIII\Helpers\Csv\PostProcessing
*/
class Bill implements PostProcessorInterface
{
/** @var array */
protected $data;
/**
* @return array
*/
public function process()
{
// get bill id.
if (!is_null($this->data['bill'])) {
$this->data['bill-id'] = $this->data['bill']->id;
}
return $this->data;
}
/**
* @param array $data
*/
public function setData(array $data)
{
$this->data = $data;
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace FireflyIII\Helpers\Csv\PostProcessing;
use FireflyIII\Models\TransactionCurrency;
use Preferences;
/**
* Class Currency
*
* @package FireflyIII\Helpers\Csv\PostProcessing
*/
class Currency implements PostProcessorInterface
{
/** @var array */
protected $data;
/**
* @return array
*/
public function process()
{
// fix currency
if (is_null($this->data['currency'])) {
$currencyPreference = Preferences::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR'));
$this->data['currency'] = TransactionCurrency::whereCode($currencyPreference->data)->first();
}
return $this->data;
}
/**
* @param array $data
*/
public function setData(array $data)
{
$this->data = $data;
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace FireflyIII\Helpers\Csv\PostProcessing;
/**
* Class Description
*
* @package FireflyIII\Helpers\Csv\PostProcessing
*/
class Description implements PostProcessorInterface
{
/** @var array */
protected $data;
/**
* @return array
*/
public function process()
{
$this->data['description'] = trim($this->data['description']);
if (strlen($this->data['description']) == 0) {
$this->data['description'] = trans('firefly.csv_empty_description');
}
return $this->data;
}
/**
* @param array $data
*/
public function setData(array $data)
{
$this->data = $data;
}
}

View File

@@ -0,0 +1,210 @@
<?php
namespace FireflyIII\Helpers\Csv\PostProcessing;
use Auth;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use Log;
use Validator;
/**
* Class OpposingAccount
*
* @package FireflyIII\Helpers\Csv\PostProcessing
*/
class OpposingAccount implements PostProcessorInterface
{
/** @var array */
protected $data;
/**
* @return array
*/
public function process()
{
// three values:
// opposing-account-id, opposing-account-iban, opposing-account-name
$result = $this->checkIdNameObject();
if (!is_null($result)) {
return $result;
}
$result = $this->checkIbanString();
if (!is_null($result)) {
return $result;
}
$result = $this->checkNameString();
if (!is_null($result)) {
return $result;
}
return null;
}
/**
* @param array $data
*/
public function setData(array $data)
{
$this->data = $data;
}
/**
* @return array
*/
protected function checkIdNameObject()
{
if ($this->data['opposing-account-id'] instanceof Account) { // first priority. try to find the account based on ID, if any
Log::debug('OpposingAccountPostProcession: opposing-account-id is an Account.');
$this->data['opposing-account-object'] = $this->data['opposing-account-id'];
return $this->data;
}
if ($this->data['opposing-account-iban'] instanceof Account) { // second: try to find the account based on IBAN, if any.
Log::debug('OpposingAccountPostProcession: opposing-account-iban is an Account.');
$this->data['opposing-account-object'] = $this->data['opposing-account-iban'];
return $this->data;
}
return null;
}
/**
* @return array|null
*/
protected function checkIbanString()
{
$rules = ['iban' => 'iban'];
$iban = $this->data['opposing-account-iban'];
$check = ['iban' => $iban];
$validator = Validator::make($check, $rules);
if (is_string($iban) && strlen($iban) > 0 && !$validator->fails()) {
Log::debug('OpposingAccountPostProcession: opposing-account-iban is a string (******).');
$this->data['opposing-account-object'] = $this->parseIbanString();
return $this->data;
}
return null;
}
/**
* @return Account|null
*/
protected function parseIbanString()
{
// create by name and/or iban.
$accounts = Auth::user()->accounts()->get();
foreach ($accounts as $entry) {
if ($entry->iban == $this->data['opposing-account-iban']) {
Log::debug('OpposingAccountPostProcession: opposing-account-iban matches an Account.');
return $entry;
}
}
$account = $this->createAccount();
return $account;
}
/**
* @return Account|null
*/
protected function createAccount()
{
$accountType = $this->getAccountType();
// create if not exists:
$name = is_string($this->data['opposing-account-name']) && strlen($this->data['opposing-account-name']) > 0 ? $this->data['opposing-account-name']
: $this->data['opposing-account-iban'];
$account = Account::firstOrCreateEncrypted(
[
'user_id' => Auth::user()->id,
'account_type_id' => $accountType->id,
'name' => $name,
'iban' => $this->data['opposing-account-iban'],
'active' => true,
]
);
Log::debug('OpposingAccountPostProcession: created a new account.');
return $account;
}
/**
*
* @return AccountType
*/
protected function getAccountType()
{
// opposing account type:
if ($this->data['amount'] < 0) {
// create expense account:
return AccountType::where('type', 'Expense account')->first();
} else {
// create revenue account:
return AccountType::where('type', 'Revenue account')->first();
}
}
/**
* @return array|null
*/
protected function checkNameString()
{
if ($this->data['opposing-account-name'] instanceof Account) { // third: try to find account based on name, if any.
Log::debug('OpposingAccountPostProcession: opposing-account-name is an Account.');
$this->data['opposing-account-object'] = $this->data['opposing-account-name'];
return $this->data;
}
if (is_string($this->data['opposing-account-name'])) {
$this->data['opposing-account-object'] = $this->parseNameString();
return $this->data;
}
return null;
}
/**
* @return Account|null
*/
protected function parseNameString()
{
$accountType = $this->getAccountType();
$accounts = Auth::user()->accounts()->where('account_type_id', $accountType->id)->get();
foreach ($accounts as $entry) {
if ($entry->name == $this->data['opposing-account-name']) {
Log::debug('Found an account with this name (#' . $entry->id . ': ******)');
return $entry;
}
}
// create if not exists:
$account = Account::firstOrCreateEncrypted(
[
'user_id' => Auth::user()->id,
'account_type_id' => $accountType->id,
'name' => $this->data['opposing-account-name'],
'iban' => '',
'active' => true,
]
);
return $account;
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* Created by PhpStorm.
* User: sander
* Date: 05/07/15
* Time: 19:20
*/
namespace FireflyIII\Helpers\Csv\PostProcessing;
/**
* Interface PostProcessorInterface
*
* @package FireflyIII\Helpers\Csv\PostProcessing
*/
interface PostProcessorInterface
{
/**
* @return array
*/
public function process();
/**
* @param array $data
*/
public function setData(array $data);
}

View File

@@ -0,0 +1,45 @@
<?php
namespace FireflyIII\Helpers\Csv\Specifix;
/**
* Class Dummy
*
* @package FireflyIII\Helpers\Csv\Specifix
*/
class Dummy
{
/** @var array */
protected $data;
/** @var array */
protected $row;
/**
* @return array
*/
public function fix()
{
return $this->data;
}
/**
* @param array $data
*/
public function setData($data)
{
$this->data = $data;
}
/**
* @param array $row
*/
public function setRow($row)
{
$this->row = $row;
}
}

View File

@@ -0,0 +1,66 @@
<?php
namespace FireflyIII\Helpers\Csv\Specifix;
use Log;
/**
* Class RabobankDescription
*
* @package FireflyIII\Helpers\Csv\Specifix
*/
class RabobankDescription
{
/** @var array */
protected $data;
/** @var array */
protected $row;
/**
* @return array
*/
public function fix()
{
$this->rabobankFixEmptyOpposing();
return $this->data;
}
/**
* Fixes Rabobank specific thing.
*/
protected function rabobankFixEmptyOpposing()
{
Log::debug('RaboSpecifix: Opposing account name is "******".');
if (is_string($this->data['opposing-account-name']) && strlen($this->data['opposing-account-name']) == 0) {
Log::debug('RaboSpecifix: opp-name is zero length, changed to: "******"');
$this->data['opposing-account-name'] = $this->row[10];
Log::debug('Description was: "******".');
$this->data['description'] = trim(str_replace($this->row[10], '', $this->data['description']));
Log::debug('Description is now: "******".');
}
}
/**
* @param array $data
*/
public function setData($data)
{
$this->data = $data;
}
/**
* @param array $row
*/
public function setRow($row)
{
$this->row = $row;
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace FireflyIII\Helpers\Csv\Specifix;
/**
* Interface SpecifixInterface
*
* @package FireflyIII\Helpers\Csv\Specifix
*/
interface SpecifixInterface
{
/**
* Implement bank and locale related fixes.
*/
public function fix();
/**
* @param array $data
*/
public function setData($data);
/**
* @param array $row
*/
public function setRow($row);
}

194
app/Helpers/Csv/Wizard.php Normal file
View File

@@ -0,0 +1,194 @@
<?php
namespace FireflyIII\Helpers\Csv;
use Auth;
use Config;
use Crypt;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Csv\Mapper\MapperInterface;
use League\Csv\Reader;
use Log;
use ReflectionException;
use Session;
/**
* Class Wizard
*
* @package FireflyIII\Helpers\Csv
*/
class Wizard implements WizardInterface
{
/**
* @param Reader $reader
* @param array $map
* @param bool $hasHeaders
*
* @return array
*/
public function getMappableValues($reader, array $map, $hasHeaders)
{
$values = [];
/*
* Loop over the CSV and collect mappable data:
*/
$keys = array_keys($map);
foreach ($reader as $index => $row) {
if ($this->useRow($hasHeaders, $index)) {
// collect all map values
foreach ($keys as $column) {
$values[$column][] = $row[$column];
}
}
}
/*
* Make each one unique.
*/
$values = $this->uniqueRecursive($values);
return $values;
}
/**
* @param array $roles
* @param mixed $map
*
* @return array
*/
public function processSelectedMapping(array $roles, $map)
{
$configRoles = Config::get('csv.roles');
$maps = [];
if (is_array($map)) {
foreach ($map as $index => $field) {
if (isset($roles[$index])) {
$name = $roles[$index];
if ($configRoles[$name]['mappable']) {
$maps[$index] = $name;
}
}
}
}
return $maps;
}
/**
* @param mixed $input
*
* @return array
*/
public function processSelectedRoles($input)
{
$roles = [];
/*
* Store all rows for each column:
*/
if (is_array($input)) {
foreach ($input as $index => $role) {
if ($role != '_ignore') {
$roles[$index] = $role;
}
}
}
return $roles;
}
/**
* @param array $fields
*
* @return bool
*/
public function sessionHasValues(array $fields)
{
foreach ($fields as $field) {
if (!Session::has($field)) {
Log::error('Session is missing field: ' . $field);
return false;
}
}
return true;
}
/**
* @param array $map
*
* @return array
* @throws FireflyException
*/
public function showOptions(array $map)
{
$options = [];
foreach ($map as $index => $columnRole) {
$mapper = Config::get('csv.roles.' . $columnRole . '.mapper');
if (is_null($mapper)) {
throw new FireflyException('Cannot map field of type "' . $columnRole . '".');
}
$class = 'FireflyIII\Helpers\Csv\Mapper\\' . $mapper;
try {
/** @var MapperInterface $mapObject */
$mapObject = app($class);
} catch (ReflectionException $e) {
throw new FireflyException('Column "' . $columnRole . '" cannot be mapped because class ' . $mapper . ' does not exist.');
}
$set = $mapObject->getMap();
$options[$index] = $set;
}
return $options;
}
/**
* @param $path
*
* @return string
*/
public function storeCsvFile($path)
{
$time = str_replace(' ', '-', microtime());
$fileName = 'csv-upload-' . Auth::user()->id . '-' . $time . '.csv.encrypted';
$fullPath = storage_path('upload') . DIRECTORY_SEPARATOR . $fileName;
$content = file_get_contents($path);
$contentEncrypted = Crypt::encrypt($content);
file_put_contents($fullPath, $contentEncrypted);
return $fullPath;
}
/**
* @param bool $hasHeaders
* @param int $index
*
* @return bool
*/
protected function useRow($hasHeaders, $index)
{
return ($hasHeaders && $index > 1) || !$hasHeaders;
}
/**
* @param array $array
*
* @return array
*/
protected function uniqueRecursive(array $array)
{
foreach ($array as $column => $found) {
$array[$column] = array_unique($found);
}
return $array;
}
}

View File

@@ -0,0 +1,59 @@
<?php
namespace FireflyIII\Helpers\Csv;
use League\Csv\Reader;
/**
* Interface WizardInterface
*
* @package FireflyIII\Helpers\Csv
*/
interface WizardInterface
{
/**
* @param Reader $reader
* @param array $map
* @param bool $hasHeaders
*
* @return array
*/
public function getMappableValues($reader, array $map, $hasHeaders);
/**
* @param array $roles
* @param mixed $map
*
* @return array
*/
public function processSelectedMapping(array $roles, $map);
/**
* @param mixed $input
*
* @return array
*/
public function processSelectedRoles($input);
/**
* @param array $fields
*
* @return bool
*/
public function sessionHasValues(array $fields);
/**
* @param array $map
*
* @return array
*/
public function showOptions(array $map);
/**
* @param $path
*
* @return string
*/
public function storeCsvFile($path);
}

99
app/Helpers/Help/Help.php Normal file
View File

@@ -0,0 +1,99 @@
<?php
namespace FireflyIII\Helpers\Help;
use Cache;
use ErrorException;
use League\CommonMark\CommonMarkConverter;
use Log;
use Route;
/**
* Class Help
*
* @package FireflyIII\Helpers\Help
*/
class Help implements HelpInterface
{
/**
* @codeCoverageIgnore
*
* @param $key
*
* @return string
*/
public function getFromCache($key)
{
return Cache::get($key);
}
/**
* @codeCoverageIgnore
*
* @param $route
*
* @return array
*/
public function getFromGithub($route)
{
$uri = 'https://raw.githubusercontent.com/JC5/firefly-iii-help/master/en/' . e($route) . '.md';
$routeIndex = str_replace('.', '-', $route);
$title = trans('help.' . $routeIndex);
$content = [
'text' => '<p>There is no help for this route!</p>',
'title' => $title,
];
try {
$content['text'] = file_get_contents($uri);
} catch (ErrorException $e) {
Log::error(trim($e->getMessage()));
}
if (strlen(trim($content['text'])) == 0) {
$content['text'] = '<p>There is no help for this route.</p>';
}
$converter = new CommonMarkConverter();
$content['text'] = $converter->convertToHtml($content['text']);
return $content;
}
/**
* @codeCoverageIgnore
*
* @param $route
*
* @return bool
*/
public function hasRoute($route)
{
return Route::has($route);
}
/**
* @codeCoverageIgnore
*
* @param $route
*
* @return bool
*/
public function inCache($route)
{
return Cache::has('help.' . $route . '.title') && Cache::has('help.' . $route . '.text');
}
/**
* @codeCoverageIgnore
*
* @param $route
* @param array $content
*
* @internal param $title
*/
public function putInCache($route, array $content)
{
Cache::put('help.' . $route . '.text', $content['text'], 10080); // a week.
Cache::put('help.' . $route . '.title', $content['title'], 10080);
}
}

View File

@@ -0,0 +1,48 @@
<?php
namespace FireflyIII\Helpers\Help;
/**
* Interface HelpInterface
*
* @package FireflyIII\Helpers\Help
*/
interface HelpInterface
{
/**
* @param $key
*
* @return string
*/
public function getFromCache($key);
/**
* @param $route
*
* @return array
*/
public function getFromGithub($route);
/**
* @param $route
*
* @return bool
*/
public function hasRoute($route);
/**
* @param $route
*
* @return bool
*/
public function inCache($route);
/**
* @param $route
* @param array $content
*
* @return void
*/
public function putInCache($route, array $content);
}

View File

@@ -2,11 +2,25 @@
namespace FireflyIII\Helpers\Report;
use Auth;
use Carbon\Carbon;
use FireflyIII\Helpers\Collection\Account as AccountCollection;
use FireflyIII\Helpers\Collection\Balance;
use FireflyIII\Helpers\Collection\BalanceEntry;
use FireflyIII\Helpers\Collection\BalanceHeader;
use FireflyIII\Helpers\Collection\BalanceLine;
use FireflyIII\Helpers\Collection\Bill as BillCollection;
use FireflyIII\Helpers\Collection\BillLine;
use FireflyIII\Helpers\Collection\Budget as BudgetCollection;
use FireflyIII\Helpers\Collection\BudgetLine;
use FireflyIII\Helpers\Collection\Category as CategoryCollection;
use FireflyIII\Helpers\Collection\Expense;
use FireflyIII\Helpers\Collection\Income;
use FireflyIII\Models\Account;
use Illuminate\Database\Query\JoinClause;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Budget as BudgetModel;
use FireflyIII\Models\LimitRepetition;
use Illuminate\Support\Collection;
use Steam;
/**
* Class ReportHelper
@@ -16,76 +30,45 @@ use Illuminate\Support\Collection;
class ReportHelper implements ReportHelperInterface
{
/**
* This methods fails to take in account transfers FROM shared accounts.
*
* @param Carbon $start
* @param Carbon $end
* @param int $limit
*
* @return Collection
*/
public function expensesGroupedByAccount(Carbon $start, Carbon $end, $limit = 15)
{
$result = $this->_queries->journalsByExpenseAccount($start, $end);
$array = $this->_helper->makeArray($result);
$limited = $this->_helper->limitArray($array, $limit);
/** @var ReportQueryInterface */
protected $query;
return $limited;
/**
* @codeCoverageIgnore
*
* @param ReportQueryInterface $query
*
*/
public function __construct(ReportQueryInterface $query)
{
$this->query = $query;
}
/**
* @return Carbon
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return CategoryCollection
*/
public function firstDate()
public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts)
{
$journal = Auth::user()->transactionjournals()->orderBy('date', 'ASC')->first();
if ($journal) {
return $journal->date;
$object = new CategoryCollection;
/**
* GET CATEGORIES:
*/
/** @var \FireflyIII\Repositories\Category\CategoryRepositoryInterface $repository */
$repository = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
$set = $repository->getCategories();
foreach ($set as $category) {
$spent = $repository->balanceInPeriod($category, $start, $end, $accounts);
$category->spent = $spent;
$object->addCategory($category);
}
return Carbon::now();
}
/**
* This method gets some kind of list for a monthly overview.
*
* @param Carbon $date
*
* @return Collection
*/
public function getBudgetsForMonth(Carbon $date)
{
$start = clone $date;
$start->startOfMonth();
$end = clone $date;
$end->endOfMonth();
// all budgets
$set = \Auth::user()->budgets()
->leftJoin(
'budget_limits', function (JoinClause $join) use ($date) {
$join->on('budget_limits.budget_id', '=', 'budgets.id')->where('budget_limits.startdate', '=', $date->format('Y-m-d'));
}
)
->get(['budgets.*', 'budget_limits.amount as amount']);
$budgets = $this->_helper->makeArray($set);
$amountSet = $this->_queries->journalsByBudget($start, $end);
$amounts = $this->_helper->makeArray($amountSet);
$combined = $this->_helper->mergeArrays($budgets, $amounts);
$combined[0]['spent'] = isset($combined[0]['spent']) ? $combined[0]['spent'] : 0.0;
$combined[0]['amount'] = isset($combined[0]['amount']) ? $combined[0]['amount'] : 0.0;
$combined[0]['name'] = 'No budget';
// find transactions to shared expense accounts, which are without a budget by default:
$transfers = $this->_queries->sharedExpenses($start, $end);
foreach ($transfers as $transfer) {
$combined[0]['spent'] += floatval($transfer->amount) * -1;
}
return $combined;
return $object;
}
/**
@@ -95,14 +78,29 @@ class ReportHelper implements ReportHelperInterface
*/
public function listOfMonths(Carbon $date)
{
$start = clone $date;
$end = Carbon::now();
$months = [];
while ($start <= $end) {
$months[] = [
'formatted' => $start->format('F Y'),
'month' => intval($start->format('m')),
'year' => intval($start->format('Y')),
$year = $start->year;
if (!isset($months[$year])) {
$months[$year] = [
'start' => Carbon::createFromDate($year, 1, 1)->format('Y-m-d'),
'end' => Carbon::createFromDate($year, 12, 31)->format('Y-m-d'),
'months' => [],
];
}
$currentEnd = clone $start;
$currentEnd->endOfMonth();
$months[$year]['months'][] = [
'formatted' => $start->formatLocalized('%B %Y'),
'start' => $start->format('Y-m-d'),
'end' => $currentEnd->format('Y-m-d'),
'month' => $start->month,
'year' => $year,
];
$start->addMonth();
}
@@ -111,65 +109,305 @@ class ReportHelper implements ReportHelperInterface
}
/**
* @param Carbon $date
* This method generates a full report for the given period on all
* given accounts
*
* @return array
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return AccountCollection
*/
public function listOfYears(Carbon $date)
public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts)
{
$start = clone $date;
$end = Carbon::now();
$years = [];
while ($start <= $end) {
$years[] = $start->format('Y');
$start->addYear();
$startAmount = '0';
$endAmount = '0';
$diff = '0';
bcscale(2);
$accounts->each(
function (Account $account) use ($start, $end) {
/**
* The balance for today always incorporates transactions
* made on today. So to get todays "start" balance, we sub one
* day.
*/
$yesterday = clone $start;
$yesterday->subDay();
/** @noinspection PhpParamsInspection */
$account->startBalance = Steam::balance($account, $yesterday);
$account->endBalance = Steam::balance($account, $end);
}
);
// summarize:
foreach ($accounts as $account) {
$startAmount = bcadd($startAmount, $account->startBalance);
$endAmount = bcadd($endAmount, $account->endBalance);
$diff = bcadd($diff, bcsub($account->endBalance, $account->startBalance));
}
return $years;
$object = new AccountCollection;
$object->setStart($startAmount);
$object->setEnd($endAmount);
$object->setDifference($diff);
$object->setAccounts($accounts);
return $object;
}
/**
* @param Carbon $date
* Get a full report on the users incomes during the period for the given accounts.
*
* @return array
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return Income
*/
public function yearBalanceReport(Carbon $date)
public function getIncomeReport($start, $end, Collection $accounts)
{
$start = clone $date;
$end = clone $date;
$sharedAccounts = [];
$sharedCollection = \Auth::user()->accounts()
->leftJoin('account_meta', 'account_meta.account_id', '=', 'accounts.id')
->where('account_meta.name', '=', 'accountRole')
->where('account_meta.data', '=', json_encode('sharedExpense'))
->get(['accounts.id']);
foreach ($sharedCollection as $account) {
$sharedAccounts[] = $account->id;
$object = new Income;
$set = $this->query->incomeInPeriod($start, $end, $accounts);
foreach ($set as $entry) {
$object->addToTotal($entry->amount_positive);
$object->addOrCreateIncome($entry);
}
$accounts = \Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->get(['accounts.*'])->filter(
function (Account $account) use ($sharedAccounts) {
if (!in_array($account->id, $sharedAccounts)) {
return $account;
}
return $object;
}
return null;
/**
* Get a full report on the users expenses during the period for a list of accounts.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return Expense
*/
public function getExpenseReport($start, $end, Collection $accounts)
{
$object = new Expense;
$set = $this->query->expenseInPeriod($start, $end, $accounts);
foreach ($set as $entry) {
$object->addToTotal($entry->amount); // can be positive, if it's a transfer
$object->addOrCreateExpense($entry);
}
return $object;
}
/**
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return BudgetCollection
*/
public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts)
{
$object = new BudgetCollection;
/** @var \FireflyIII\Repositories\Budget\BudgetRepositoryInterface $repository */
$repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
$set = $repository->getBudgets();
bcscale(2);
foreach ($set as $budget) {
$repetitions = $repository->getBudgetLimitRepetitions($budget, $start, $end);
// no repetition(s) for this budget:
if ($repetitions->count() == 0) {
$spent = $repository->balanceInPeriod($budget, $start, $end, $accounts);
$budgetLine = new BudgetLine;
$budgetLine->setBudget($budget);
$budgetLine->setOverspent($spent);
$object->addOverspent($spent);
$object->addBudgetLine($budgetLine);
continue;
}
);
$report = [];
$start->startOfYear()->subDay();
$end->endOfYear();
// one or more repetitions for budget:
/** @var LimitRepetition $repetition */
foreach ($repetitions as $repetition) {
$budgetLine = new BudgetLine;
$budgetLine->setBudget($budget);
$budgetLine->setRepetition($repetition);
$expenses = $repository->balanceInPeriod($budget, $start, $end, $accounts);
// 200 en -100 is 100, vergeleken met 0 === 1
// 200 en -200 is 0, vergeleken met 0 === 0
// 200 en -300 is -100, vergeleken met 0 === -1
$left = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? bcadd($repetition->amount, $expenses) : 0;
$spent = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? $expenses : '0';
$overspent = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? '0' : bcadd($expenses, $repetition->amount);
$budgetLine->setLeft($left);
$budgetLine->setSpent($spent);
$budgetLine->setOverspent($overspent);
$budgetLine->setBudgeted($repetition->amount);
$object->addBudgeted($repetition->amount);
$object->addSpent($spent);
$object->addLeft($left);
$object->addOverspent($overspent);
$object->addBudgetLine($budgetLine);
}
}
// stuff outside of budgets:
$noBudget = $repository->getWithoutBudgetSum($start, $end);
$budgetLine = new BudgetLine;
$budgetLine->setOverspent($noBudget);
$budgetLine->setSpent($noBudget);
$object->addOverspent($noBudget);
$object->addBudgetLine($budgetLine);
return $object;
}
/**
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return Balance
*/
public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts)
{
$repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
$tagRepository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface');
$balance = new Balance;
// build a balance header:
$header = new BalanceHeader;
$budgets = $repository->getBudgets();
foreach ($accounts as $account) {
$header->addAccount($account);
}
/** @var BudgetModel $budget */
foreach ($budgets as $budget) {
$line = new BalanceLine;
$line->setBudget($budget);
// get budget amount for current period:
$rep = $repository->getCurrentRepetition($budget, $start, $end);
// could be null?
$line->setRepetition($rep);
// loop accounts:
foreach ($accounts as $account) {
$balanceEntry = new BalanceEntry;
$balanceEntry->setAccount($account);
// get spent:
$spent = $this->query->spentInBudget($account, $budget, $start, $end); // I think shared is irrelevant.
$balanceEntry->setSpent($spent);
$line->addBalanceEntry($balanceEntry);
}
// add line to balance:
$balance->addBalanceLine($line);
}
// then a new line for without budget.
// and one for the tags:
// and one for "left unbalanced".
$empty = new BalanceLine;
$tags = new BalanceLine;
$diffLine = new BalanceLine;
$tags->setRole(BalanceLine::ROLE_TAGROLE);
$diffLine->setRole(BalanceLine::ROLE_DIFFROLE);
foreach ($accounts as $account) {
$report[] = [
'start' => \Steam::balance($account, $start),
'end' => \Steam::balance($account, $end),
'account' => $account,
'shared' => $account->accountRole == 'sharedExpense'
];
$spent = $this->query->spentNoBudget($account, $start, $end);
$left = $tagRepository->coveredByBalancingActs($account, $start, $end);
bcscale(2);
$diff = bcadd($spent, $left);
// budget
$budgetEntry = new BalanceEntry;
$budgetEntry->setAccount($account);
$budgetEntry->setSpent($spent);
$empty->addBalanceEntry($budgetEntry);
// balanced by tags
$tagEntry = new BalanceEntry;
$tagEntry->setAccount($account);
$tagEntry->setLeft($left);
$tags->addBalanceEntry($tagEntry);
// difference:
$diffEntry = new BalanceEntry;
$diffEntry->setAccount($account);
$diffEntry->setSpent($diff);
$diffLine->addBalanceEntry($diffEntry);
}
return $report;
$balance->addBalanceLine($empty);
$balance->addBalanceLine($tags);
$balance->addBalanceLine($diffLine);
$balance->setBalanceHeader($header);
return $balance;
}
}
/**
* This method generates a full report for the given period on all
* the users bills and their payments.
*
* Excludes bills which have not had a payment on the mentioned accounts.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return BillCollection
*/
public function getBillReport(Carbon $start, Carbon $end, Collection $accounts)
{
/** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */
$repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface');
$bills = $repository->getBillsForAccounts($accounts);
$collection = new BillCollection;
/** @var Bill $bill */
foreach ($bills as $bill) {
$billLine = new BillLine;
$billLine->setBill($bill);
$billLine->setActive(intval($bill->active) == 1);
$billLine->setMin($bill->amount_min);
$billLine->setMax($bill->amount_max);
// is hit in period?
bcscale(2);
$set = $repository->getJournalsInRange($bill, $start, $end);
if ($set->count() == 0) {
$billLine->setHit(false);
} else {
$billLine->setHit(true);
$amount = '0';
foreach ($set as $entry) {
$amount = bcadd($amount, $entry->amount);
}
$billLine->setAmount($amount);
}
$collection->addBill($billLine);
}
return $collection;
}
}

Some files were not shown because too many files have changed in this diff Show More