Compare commits
1047 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
552b4b67a6 | ||
|
7fbf359efd | ||
|
052b804855 | ||
|
67cc611495 | ||
|
7e2c24b82e | ||
|
4a6bbd4dca | ||
|
166bfba5b9 | ||
|
87b8ac5f4e | ||
|
46b4100291 | ||
|
83090ade94 | ||
|
44b7a42d5a | ||
|
1a5617d430 | ||
|
fa818e0924 | ||
|
f87b531fe1 | ||
|
82fd0c4d37 | ||
|
26ceb9e3be | ||
|
743458b853 | ||
|
920e5f6fbe | ||
|
fc0dd22769 | ||
|
c7c61ce280 | ||
|
5f5a603f71 | ||
|
d611858883 | ||
|
dbc9ce76a0 | ||
|
62386e2e40 | ||
|
5aa7ab5e37 | ||
|
be1b57eab7 | ||
|
ad5c8b41e2 | ||
|
09752b25ad | ||
|
3f317f961b | ||
|
d6d6a62fda | ||
|
528833b831 | ||
|
95e2bca4a6 | ||
|
dfd3327108 | ||
|
653befbcd4 | ||
|
33202efcdc | ||
|
77a37411ba | ||
|
491f221741 | ||
|
e8e125a598 | ||
|
cb01ae0ac5 | ||
|
a09469c01f | ||
|
662f398b08 | ||
|
d7aef627b8 | ||
|
87bcf293aa | ||
|
0171831ebb | ||
|
50cc455f0f | ||
|
47a7729358 | ||
|
6d508e61a0 | ||
|
8ef9223d84 | ||
|
e58ea4d0c7 | ||
|
9629ba916e | ||
|
aad4df1596 | ||
|
30ed25f80a | ||
|
8b7000681c | ||
|
221adbf3db | ||
|
39129d8cd0 | ||
|
2c2d444906 | ||
|
04a1d785bf | ||
|
c0a0aa4652 | ||
|
21c24fd7f0 | ||
|
beb358f8ee | ||
|
e3cd11ec2e | ||
|
ee08fc2421 | ||
|
ae30f7920b | ||
|
f4786c3ec8 | ||
|
8b9e4d2539 | ||
|
d7ca7ed632 | ||
|
1346b25fc7 | ||
|
15d9314503 | ||
|
93f4006c9e | ||
|
16182fec6c | ||
|
99606ba936 | ||
|
be1ed56d42 | ||
|
d7fb6f83b8 | ||
|
665f1f470a | ||
|
7867f26120 | ||
|
8e195bf811 | ||
|
e3403dc87f | ||
|
5844e95488 | ||
|
cb3a1f2ff6 | ||
|
f95edb06a9 | ||
|
86d13060bc | ||
|
0b8c2f6f8d | ||
|
589cafc64f | ||
|
448dc7b5c3 | ||
|
10cfde6cab | ||
|
e48eb2ce2f | ||
|
20a30a2d1d | ||
|
2e5b8418ae | ||
|
054fd229d2 | ||
|
9bdf2c8877 | ||
|
04f858a355 | ||
|
a9bf405a65 | ||
|
463c866cfa | ||
|
03fe0c8fff | ||
|
102d9f3510 | ||
|
3cf9a40c42 | ||
|
ff33267296 | ||
|
f0dab5bdb9 | ||
|
209a907c61 | ||
|
c7984d4363 | ||
|
a388313e1c | ||
|
a3933cb307 | ||
|
89c82d9be9 | ||
|
6e6311a1a1 | ||
|
69b334ed8a | ||
|
a84b6f377f | ||
|
ee5db4e4cc | ||
|
20f3322e5a | ||
|
1e84bc3743 | ||
|
7f198cbd50 | ||
|
1c7d5ccefc | ||
|
41dc4d994e | ||
|
490733bdd1 | ||
|
ed8cf8c431 | ||
|
a7e1f85c4d | ||
|
4b8919420d | ||
|
9afc5d67a4 | ||
|
72afaddd7c | ||
|
8ae3182e1c | ||
|
9d7e16b390 | ||
|
3a2ed202ad | ||
|
9e4b9b98ab | ||
|
e65fb7d995 | ||
|
7197830edc | ||
|
687603ae84 | ||
|
23fc25f926 | ||
|
e0c1f07f92 | ||
|
9424aa3378 | ||
|
57e6e0945f | ||
|
d87a033f29 | ||
|
10481895e6 | ||
|
813432f386 | ||
|
aba78c9776 | ||
|
8dc56bcee0 | ||
|
32b6e030ef | ||
|
a27f5d2474 | ||
|
e2fe8cfb75 | ||
|
9f1c346365 | ||
|
3e56803e95 | ||
|
fc5feb054d | ||
|
8fc233e436 | ||
|
22303eb2ff | ||
|
d6477ff9ff | ||
|
a0f6f13650 | ||
|
1dd213d587 | ||
|
569e51afbe | ||
|
ff06a4ed0d | ||
|
ea3fdb0668 | ||
|
bd917f6484 | ||
|
ee96311222 | ||
|
135153ff9c | ||
|
fdb98133c8 | ||
|
ad4e2c0a85 | ||
|
e38cb263aa | ||
|
0922136389 | ||
|
2a05517a30 | ||
|
a0ee924aeb | ||
|
1595afce68 | ||
|
4919d730c8 | ||
|
1407d6cc66 | ||
|
55b092e7a0 | ||
|
93afb754f3 | ||
|
81c0ea8f5c | ||
|
6faacd3781 | ||
|
ea1e9e407f | ||
|
d4f5aa1578 | ||
|
1cbbf3fa5d | ||
|
dad3dc71ca | ||
|
afb1e9f230 | ||
|
c33dd1ecee | ||
|
7e31a29b12 | ||
|
9a69ce309e | ||
|
b99bfcd02e | ||
|
adb16e4560 | ||
|
953c38563b | ||
|
89ee9c058a | ||
|
bac7a73555 | ||
|
5fb6ff230b | ||
|
605a718418 | ||
|
994542c75d | ||
|
d5fdce02fa | ||
|
d3637de0c3 | ||
|
63acbb222d | ||
|
5e1fe157b6 | ||
|
8e811da967 | ||
|
fb23108f4e | ||
|
a0220eb5f8 | ||
|
c16cbd5bc8 | ||
|
2d0673e1bc | ||
|
a90e00d577 | ||
|
8db96025a3 | ||
|
595596d73f | ||
|
240797e92a | ||
|
6cafb91680 | ||
|
852ce3e32f | ||
|
6b9c9458fa | ||
|
970ce917b0 | ||
|
db46d450bf | ||
|
db806b92dd | ||
|
6765f08b07 | ||
|
99d75ba14b | ||
|
0e8ce5680c | ||
|
fd01b54a14 | ||
|
ce6253bbd7 | ||
|
4fd33f19c6 | ||
|
01ae278f09 | ||
|
7907c71e47 | ||
|
4e44733dcc | ||
|
dd1d7bb02a | ||
|
6f933b3bd1 | ||
|
243530b750 | ||
|
ea984281b0 | ||
|
92cd3d60b9 | ||
|
5920ccee04 | ||
|
569fec4610 | ||
|
5770edcde2 | ||
|
1fb0a64f31 | ||
|
fe66d089ad | ||
|
cef10b4d4e | ||
|
b45aa6446d | ||
|
61749312b2 | ||
|
842bb2c5a6 | ||
|
4358fe99b1 | ||
|
3fda8b3714 | ||
|
09f3274adc | ||
|
029224f708 | ||
|
e87cce12f8 | ||
|
7660667153 | ||
|
222b3008d5 | ||
|
398cf0b312 | ||
|
5ad8be2483 | ||
|
6fe319702d | ||
|
32c89f9a98 | ||
|
64f983786e | ||
|
16438b416d | ||
|
52cd292a69 | ||
|
53b501df19 | ||
|
477acafc4c | ||
|
ab9146b7c6 | ||
|
4d15913e18 | ||
|
63a91811e2 | ||
|
9df4da6173 | ||
|
643927799b | ||
|
2652e23089 | ||
|
b70c5ae41e | ||
|
c53d9b2855 | ||
|
2f6712be87 | ||
|
37f78985ae | ||
|
34ac9bc71a | ||
|
19ff2484fd | ||
|
b7ef2211d9 | ||
|
c5206a4559 | ||
|
894296f63d | ||
|
61526df245 | ||
|
92549c4485 | ||
|
6014892d4d | ||
|
9515ce6807 | ||
|
1adb0f2f0e | ||
|
00b1b54347 | ||
|
282ce041e1 | ||
|
3215c4ee4b | ||
|
fce00c95c9 | ||
|
0a69ab1dc2 | ||
|
94771d250a | ||
|
b8395a1dbb | ||
|
0436cd1584 | ||
|
2c774bb94c | ||
|
b879d90b0d | ||
|
ba52b5c328 | ||
|
bf61de13f4 | ||
|
b26e67ae07 | ||
|
edafd16c75 | ||
|
c62e3dcb78 | ||
|
68be58c9f2 | ||
|
a25a499ed4 | ||
|
97f67912f4 | ||
|
e2f3788ff5 | ||
|
fd1f06c2cb | ||
|
2db8d25038 | ||
|
d618ddc8c5 | ||
|
79aa0afc97 | ||
|
e53d294c1c | ||
|
aedc3fdff9 | ||
|
b67dfeced2 | ||
|
65dbfcba5c | ||
|
8f14c78ba1 | ||
|
be1b64bb78 | ||
|
a34c285820 | ||
|
298f0c194d | ||
|
f5ad569aba | ||
|
c70df01532 | ||
|
03e115e066 | ||
|
b88fce35ad | ||
|
d214e9ff49 | ||
|
bd8382c005 | ||
|
18cb815e45 | ||
|
800e8aca6e | ||
|
63a6e0754b | ||
|
4abc271805 | ||
|
22cca3858c | ||
|
b816fbdf82 | ||
|
d400060b8b | ||
|
c88cfa2d9d | ||
|
b060027304 | ||
|
d4787aca9c | ||
|
69ae2e93f8 | ||
|
82a37c62c1 | ||
|
ca69970242 | ||
|
fac3853d95 | ||
|
9dd2f447cc | ||
|
ecbd7ca95b | ||
|
0c52d54d7d | ||
|
78276ac66b | ||
|
ca0a22d755 | ||
|
47361fd77a | ||
|
1af6fd5d74 | ||
|
51df78ad2d | ||
|
84a3e68eb5 | ||
|
b2904e09d8 | ||
|
fc42a621e4 | ||
|
a1c4fb73cd | ||
|
c18f19db97 | ||
|
ebc712f6b5 | ||
|
ef0057d88d | ||
|
a8fdfdd5e0 | ||
|
89f7e1ba2a | ||
|
6508b4058f | ||
|
bec5d93af6 | ||
|
1125fcd6c5 | ||
|
ff43a547a6 | ||
|
ca8684146c | ||
|
44bea62383 | ||
|
8dc2faa5e5 | ||
|
f4867d1d09 | ||
|
8d172801b5 | ||
|
db6e6dfe4a | ||
|
61007a95a6 | ||
|
bf138670e8 | ||
|
0e59f7433c | ||
|
9a033ac62a | ||
|
789412ee6a | ||
|
91125d20ef | ||
|
292b3672e2 | ||
|
14ef6b753c | ||
|
55fcb97a10 | ||
|
6b8ec544c1 | ||
|
c0aad385cd | ||
|
ecfb5e4711 | ||
|
46c9967a68 | ||
|
176c44e2b9 | ||
|
5957cf5ff8 | ||
|
436a270524 | ||
|
7a1c14b766 | ||
|
721c4aa888 | ||
|
638aab4eea | ||
|
9aa44f7458 | ||
|
1e887a2a8d | ||
|
78571ad121 | ||
|
8e5ec79097 | ||
|
fc351f36b1 | ||
|
80204147f7 | ||
|
d599b8e5ea | ||
|
208ef9d664 | ||
|
c14da542d1 | ||
|
451832cb2b | ||
|
1409aeb8ed | ||
|
342f24cfe4 | ||
|
8aedfd5153 | ||
|
33b099456f | ||
|
42cb40102f | ||
|
2fbeaaccd3 | ||
|
57fb75bef4 | ||
|
5c0e22cd31 | ||
|
879f74e521 | ||
|
e5a2e1a8c7 | ||
|
884d6c59a2 | ||
|
c206a95d55 | ||
|
8b4ef4e2da | ||
|
bac5238589 | ||
|
ae05d4d51d | ||
|
9d22bbee1c | ||
|
1d6007b848 | ||
|
3157339e44 | ||
|
b31d5eefd1 | ||
|
e47398dc71 | ||
|
757d472704 | ||
|
9d0ae99602 | ||
|
0d9ceb6fde | ||
|
cb665d4016 | ||
|
9673dc96d9 | ||
|
2295091427 | ||
|
45f4395f26 | ||
|
d9aa074330 | ||
|
33c20c8dc4 | ||
|
8101f910f0 | ||
|
8fb6c1a0c8 | ||
|
978e3e615c | ||
|
b3b8981b4b | ||
|
015064e5af | ||
|
7ef8ff60a5 | ||
|
4c3f54699e | ||
|
3bf5040324 | ||
|
ed9e5b31fa | ||
|
506e97e12d | ||
|
9365f9ab60 | ||
|
dd1e9ecb32 | ||
|
d3a2bf174d | ||
|
311020ff2e | ||
|
a6df3ac1fb | ||
|
d313b50e39 | ||
|
b23eb07018 | ||
|
2116486fe0 | ||
|
eed8fe22c6 | ||
|
1cec91e4bf | ||
|
8decf8ab9f | ||
|
79b0c20adb | ||
|
65647ca822 | ||
|
18fafcd45f | ||
|
b7723f4487 | ||
|
6418df87bb | ||
|
daa88c5be1 | ||
|
707b70b136 | ||
|
f9b3b6f7d3 | ||
|
b295eef970 | ||
|
f13dace7ad | ||
|
8dfc40ed3e | ||
|
2e637031ac | ||
|
de9ef20014 | ||
|
4f50689d0e | ||
|
082392f9e0 | ||
|
aca2ef08f1 | ||
|
90fcec4ca8 | ||
|
c90db28b9e | ||
|
56b617bd57 | ||
|
06d58c16d8 | ||
|
b1a807139a | ||
|
ac07736040 | ||
|
c68ba8d510 | ||
|
470802c93b | ||
|
c58745b6ce | ||
|
9eea4749f0 | ||
|
251206fb75 | ||
|
b53a6c5703 | ||
|
8c6972d12d | ||
|
fe0d88b7b3 | ||
|
658b6de9c7 | ||
|
4ea89c3811 | ||
|
2d3d71f46a | ||
|
80a6f431b6 | ||
|
0644729148 | ||
|
07da48e5ea | ||
|
b3f565819b | ||
|
af4abfbed9 | ||
|
eb0011cb46 | ||
|
444439fdab | ||
|
a0e66b913b | ||
|
96c780c804 | ||
|
4f1f46aa93 | ||
|
1d9f76ee5a | ||
|
a7ceda7eea | ||
|
baec4c4d70 | ||
|
4fa850048c | ||
|
8163655a24 | ||
|
4cabf8d2e3 | ||
|
db2f08fa96 | ||
|
a68be2fed7 | ||
|
c3e9aea3a7 | ||
|
40c38af766 | ||
|
fc2cee7a54 | ||
|
3d4feff7de | ||
|
f63c6875cd | ||
|
115b72149c | ||
|
a7e8118c83 | ||
|
8569cc5ac6 | ||
|
7a0ffce36f | ||
|
c573d95ec5 | ||
|
d3e1fba4e0 | ||
|
e7dd087b52 | ||
|
c7cb79906c | ||
|
3c3f80c5a0 | ||
|
e20fb3c3ac | ||
|
e3986a4dd4 | ||
|
a3926e3996 | ||
|
e737683efb | ||
|
0157c4ed65 | ||
|
058ade266d | ||
|
e0adb4c397 | ||
|
35aa61bb23 | ||
|
27236d19cf | ||
|
063ca3121a | ||
|
b8521c6875 | ||
|
e3798d6462 | ||
|
387a3e541f | ||
|
42a3b411e4 | ||
|
25c7ec4175 | ||
|
7ec11765da | ||
|
d57ae126b7 | ||
|
87f133555c | ||
|
db9883d851 | ||
|
8dad5ff7db | ||
|
fc36f9cd8c | ||
|
563c668e3f | ||
|
b3df1f3d26 | ||
|
1ac3f7af3b | ||
|
6cbb86aed7 | ||
|
e459a8c88b | ||
|
ca003b7d4d | ||
|
03f873a6d3 | ||
|
5dbec53847 | ||
|
49dfad9b0c | ||
|
4ee0462d1b | ||
|
3f78be4471 | ||
|
d93fad39ac | ||
|
aa3429bb0e | ||
|
d88246f2f6 | ||
|
201db34936 | ||
|
47709dfc7c | ||
|
2aaafc54ee | ||
|
e211881691 | ||
|
0d32f16041 | ||
|
2082e8d462 | ||
|
bfc95cfc57 | ||
|
35aeb7e04a | ||
|
adcddb09cd | ||
|
56199f899f | ||
|
ca5c845064 | ||
|
a8ac69f008 | ||
|
b9309bc7b1 | ||
|
41596feb56 | ||
|
cf1813b413 | ||
|
5b267c0e95 | ||
|
3741f70c29 | ||
|
1f37ea3d3c | ||
|
283ee076c7 | ||
|
b13a878927 | ||
|
364eb2838e | ||
|
94631ca8d7 | ||
|
2ed095d58f | ||
|
9c10e3970d | ||
|
0cf4f44e95 | ||
|
89638a0094 | ||
|
d7531cf4ff | ||
|
2c5acb8ecd | ||
|
824c317f74 | ||
|
d208fd1772 | ||
|
f145aaded9 | ||
|
c7043478f6 | ||
|
d16bb7f394 | ||
|
3ed314dbc6 | ||
|
e8c5942e33 | ||
|
96c704760c | ||
|
70c99f18e1 | ||
|
5e2bdb6356 | ||
|
dd13285f04 | ||
|
561a5bf699 | ||
|
f2d794e372 | ||
|
f0931b8438 | ||
|
aadb9addd5 | ||
|
66abb50d23 | ||
|
4eca99b745 | ||
|
a95a265d47 | ||
|
b0e70c25d0 | ||
|
8914bd6b9a | ||
|
26751e10ee | ||
|
579ee9f199 | ||
|
48fcb76ba4 | ||
|
b872bbbb42 | ||
|
73c88aa11f | ||
|
aa1700b7b4 | ||
|
1aa8e43bdf | ||
|
fa8200d3e2 | ||
|
bd9fcc6e8d | ||
|
6167667f9a | ||
|
1081379689 | ||
|
712526f1c3 | ||
|
7c0cfc5596 | ||
|
edd0dcbcef | ||
|
b322d67ffc | ||
|
38dbac199d | ||
|
6eb695c5eb | ||
|
b0fd5889aa | ||
|
b181f2edf0 | ||
|
376940e089 | ||
|
1c0762a3df | ||
|
df39f5ab98 | ||
|
9cd1ae1220 | ||
|
3ddef6fe78 | ||
|
b8c78217e8 | ||
|
3a1b514982 | ||
|
5d34dab2ef | ||
|
541ed1e764 | ||
|
5e764a345e | ||
|
33de51c4aa | ||
|
5aa038e195 | ||
|
0fe437c66b | ||
|
790d156503 | ||
|
9f515bea20 | ||
|
1422adac3f | ||
|
5f17e41190 | ||
|
0d9daaffe8 | ||
|
e1f3bf8d45 | ||
|
20a7723e63 | ||
|
5ffa6d9500 | ||
|
86956969ce | ||
|
13beb888c1 | ||
|
c1d4caf1a9 | ||
|
5e9a605ae4 | ||
|
c79d0ed276 | ||
|
6204e575a2 | ||
|
19f181723a | ||
|
4a49bf8799 | ||
|
8128c6aed6 | ||
|
45dfc74ab3 | ||
|
72c4ecced7 | ||
|
d21187df6a | ||
|
bf33025569 | ||
|
065620aec9 | ||
|
e8e0fbc988 | ||
|
21e61d08dd | ||
|
ca9cc50423 | ||
|
0fde74883f | ||
|
c1d12e5129 | ||
|
8ee6cd6c41 | ||
|
bb09ea5fa2 | ||
|
6b92ef9d71 | ||
|
a49f8a27e2 | ||
|
d0b3b4b186 | ||
|
0bd688962b | ||
|
c737ceb63f | ||
|
d24e5b9eca | ||
|
d68c2b5b8f | ||
|
6803707b1f | ||
|
13574d812f | ||
|
f4e95bdbca | ||
|
eb83023864 | ||
|
10c81fdfba | ||
|
7c47723992 | ||
|
0154183800 | ||
|
a2b0ea9c5b | ||
|
c49caf663c | ||
|
17e6698133 | ||
|
a7b99b1bb5 | ||
|
8d6a217f22 | ||
|
d5b1722c0c | ||
|
0d9a81f0e4 | ||
|
821a443e44 | ||
|
9d8d54e5c8 | ||
|
411739277d | ||
|
fa71feb9fb | ||
|
00f9194bfa | ||
|
a3e955400f | ||
|
05060cee5b | ||
|
c10148753a | ||
|
53bb64641b | ||
|
9a124bb3b2 | ||
|
91568cf919 | ||
|
b149a816dd | ||
|
bf35ecc07a | ||
|
711a1a1d4f | ||
|
a27b686446 | ||
|
1f6180ce5d | ||
|
b5032a7597 | ||
|
5073fd937c | ||
|
f0cb63fd48 | ||
|
f7642beb7c | ||
|
48c26c5837 | ||
|
65a899bf25 | ||
|
5d0cdc4ffa | ||
|
1d979778e8 | ||
|
917b8b40cf | ||
|
466ec92492 | ||
|
4ff5f526ba | ||
|
8460ee2dc4 | ||
|
fa39330ceb | ||
|
1857bb17d9 | ||
|
fe54b2fa3a | ||
|
4fbf0291e6 | ||
|
8bfcc3315a | ||
|
c8f6b42ce6 | ||
|
8f5289b7dc | ||
|
281e3f706b | ||
|
6dfa027ae2 | ||
|
623cd51b1c | ||
|
3d9e723a0e | ||
|
4a2b7cfc4e | ||
|
c15bee4511 | ||
|
f4afcd29e0 | ||
|
770e77a862 | ||
|
684d1dc432 | ||
|
ec9ddb2bfb | ||
|
a5f8aa914f | ||
|
ae06f1b8f0 | ||
|
e8f76d896b | ||
|
07ecb3f0e8 | ||
|
893f2d2c55 | ||
|
395a7bb33c | ||
|
636b371b86 | ||
|
f0783df123 | ||
|
fa54763425 | ||
|
cf2cd9680b | ||
|
47aa996b6b | ||
|
6442887c1a | ||
|
7a34536c80 | ||
|
e9a67b1c82 | ||
|
bc4cf1a367 | ||
|
a1d40a5748 | ||
|
e42f858166 | ||
|
75e0d19b4e | ||
|
5801eba22a | ||
|
fd3f756640 | ||
|
bd1672fd7b | ||
|
2c36820622 | ||
|
ff1d1e5b8f | ||
|
de0371dd1c | ||
|
d6f4bbf4bc | ||
|
5fc1e6ad64 | ||
|
c37d772759 | ||
|
fe2efd88cf | ||
|
5a2f48f529 | ||
|
4459d09a90 | ||
|
79fcd874f7 | ||
|
643655a612 | ||
|
adb0717ade | ||
|
1feae802c2 | ||
|
ec146d4cbe | ||
|
3399b133ae | ||
|
1637190c27 | ||
|
79f94771c3 | ||
|
018af62826 | ||
|
69bd292ed8 | ||
|
ac63a082aa | ||
|
e15bb05823 | ||
|
5528663727 | ||
|
1a204d31e7 | ||
|
0fe4273d4d | ||
|
abf0fdcf35 | ||
|
78074a5a54 | ||
|
dcc2b9c1cb | ||
|
b5a005dcc5 | ||
|
4c2d9e0eee | ||
|
fb73baca6a | ||
|
0be3dd4fe4 | ||
|
8e89899070 | ||
|
5e47492318 | ||
|
aa2d78f36a | ||
|
0cbed2d5d2 | ||
|
3914796e4e | ||
|
b9dac5ff55 | ||
|
1285a88660 | ||
|
96e0d4e29f | ||
|
9bb8a9ccd1 | ||
|
d9611bd84f | ||
|
915afa4534 | ||
|
5105c94233 | ||
|
899d4fe611 | ||
|
d45a12e544 | ||
|
302fc876d9 | ||
|
f6a25db17c | ||
|
da11303539 | ||
|
07ebe71839 | ||
|
eba9c4e039 | ||
|
7d80120611 | ||
|
f2ea5fb253 | ||
|
451ab6c531 | ||
|
796b63fcc5 | ||
|
7d8b3e6513 | ||
|
b2026106ec | ||
|
dba92d73c4 | ||
|
b09a250a03 | ||
|
c6f69f63fc | ||
|
3a7faa7368 | ||
|
f863c01a1d | ||
|
8a98204a69 | ||
|
77e52f42a6 | ||
|
704c0922e8 | ||
|
371ce37be4 | ||
|
152fb3f885 | ||
|
3ff83cd431 | ||
|
a9d5b6ef92 | ||
|
229f718754 | ||
|
646b65918d | ||
|
5e596a9cb7 | ||
|
353db6c4a5 | ||
|
959a1a08f0 | ||
|
3e510bd3f6 | ||
|
b68d5c4374 | ||
|
dc348a72c8 | ||
|
5e5d4eca4b | ||
|
96b5d174d1 | ||
|
df1da32745 | ||
|
a7c198048e | ||
|
e3599c002b | ||
|
094f6a7476 | ||
|
c3b4849fa0 | ||
|
dfd6c5379c | ||
|
9aa53c11e0 | ||
|
b0d93621a8 | ||
|
a337d9a599 | ||
|
615d90c8f4 | ||
|
7ffd77dc76 | ||
|
96fdf4fd93 | ||
|
27b8ce0f7f | ||
|
e057c4d79c | ||
|
8263fa41dd | ||
|
eeae4d215d | ||
|
646ed0d4dd | ||
|
ac54032f55 | ||
|
3aaf356054 | ||
|
2c786e6a38 | ||
|
355baa7fef | ||
|
01468c2663 | ||
|
c7341c9194 | ||
|
1e947870a6 | ||
|
311c1a3c84 | ||
|
84e380e4d0 | ||
|
4cad2eb0c4 | ||
|
4bc3af7176 | ||
|
e80298f815 | ||
|
14971cf249 | ||
|
b79dcd7f23 | ||
|
395aaad9c6 | ||
|
29f763d4e4 | ||
|
2f943c91d2 | ||
|
91c96311de | ||
|
0f929faa16 | ||
|
7a40c34cf0 | ||
|
462d987de9 | ||
|
f64e8d8973 | ||
|
21222eb697 | ||
|
e47d6fb3ac | ||
|
c7fc10ac89 | ||
|
e8b528f520 | ||
|
b22de7bf70 | ||
|
ec119c8f6e | ||
|
a20b38598e | ||
|
aa0eb47205 | ||
|
723db9d71e | ||
|
1d8dc3d65d | ||
|
fe2716876a | ||
|
fac0e97e5d | ||
|
449d009c28 | ||
|
55b2e6fe25 | ||
|
9989b3b9da | ||
|
7ab1cbfc1f | ||
|
62d19c3902 | ||
|
19700e7ee3 | ||
|
de3e8edd6d | ||
|
deda48af4a | ||
|
7688d7c619 | ||
|
76328b5c45 | ||
|
1de17bf06f | ||
|
6724daf995 | ||
|
7caca053a1 | ||
|
ae1bf8c017 | ||
|
d20b0da438 | ||
|
a0218d7df1 | ||
|
5ae5d67b91 | ||
|
8493ed7603 | ||
|
804b681d40 | ||
|
e8303bd059 | ||
|
ac6c5d4e32 | ||
|
90b0d0d52c | ||
|
4093bdbd3e | ||
|
a2097cf981 | ||
|
6a33d0c9dc | ||
|
525d5fb427 | ||
|
e4946b8cd5 | ||
|
76b32df622 | ||
|
bc1079364d | ||
|
8602febe9d | ||
|
d55dfe27dc | ||
|
90c16e2a07 | ||
|
149c1cd9b1 | ||
|
20f1a43369 | ||
|
e8fb8f993d | ||
|
f0c782dc01 | ||
|
50c13e6d20 | ||
|
69bedd035f | ||
|
85337f0a31 | ||
|
f8a7e2f98e | ||
|
ec90a49d43 | ||
|
5812b150c6 | ||
|
c7ebc7273f | ||
|
5226c87304 | ||
|
25dd1c5d35 | ||
|
c5a9e5e56d | ||
|
47ed70d671 | ||
|
cb5526f469 | ||
|
a4f128077f | ||
|
7140ba76d5 | ||
|
872e8f2de6 | ||
|
6c14e9d083 | ||
|
e4b1812b46 | ||
|
1c2c6bb1d0 | ||
|
baefd4f93b | ||
|
4270fe07ab | ||
|
e4ae925d2b | ||
|
dc599361a4 | ||
|
738a311f49 | ||
|
71f6ba3418 | ||
|
d1d573c408 | ||
|
50e39a4a75 | ||
|
8635fe7ebb | ||
|
6b57d4397a | ||
|
8f2b898b2b | ||
|
0d1d360d18 | ||
|
def3b3a155 | ||
|
d344512743 | ||
|
19eef71133 | ||
|
61d58a354e | ||
|
be868d37f2 | ||
|
20bb151cf3 | ||
|
77f889aba6 | ||
|
1e69a54972 | ||
|
6b7a47ca28 | ||
|
c3fdd3b5f7 | ||
|
e9f2121667 | ||
|
161e9e1e11 | ||
|
e336a45f79 | ||
|
9c09f93908 | ||
|
582398e7f6 | ||
|
b118635abd | ||
|
ac0d4a75b5 | ||
|
c212d5c5ea | ||
|
08ac27cccf | ||
|
0b5cab99cf | ||
|
cc0057cc56 | ||
|
1ce49b814b | ||
|
5bbaaece38 | ||
|
30bc4ccfa7 | ||
|
4f64f1d754 | ||
|
c0e578dd47 | ||
|
2b82fca2cf | ||
|
f0028b33e9 | ||
|
7ddea23375 | ||
|
83edccacc6 | ||
|
75e95d6452 | ||
|
423bb4bbcd | ||
|
43585c563c | ||
|
2564a41d05 | ||
|
a0bb1e3625 | ||
|
9b4fd57f51 | ||
|
e67709e339 | ||
|
0c4e913f30 | ||
|
c6de0e51c7 | ||
|
69e85adadf | ||
|
b34068207f | ||
|
68b7b4b3a4 | ||
|
5e3ee30e66 | ||
|
aaf7d12b46 | ||
|
729a348657 | ||
|
0fca6eb810 | ||
|
5a0ae8530c | ||
|
7949c9ad74 | ||
|
6fb9362f7e | ||
|
3481d364cc | ||
|
373b9cdd9f | ||
|
75af63e6ac | ||
|
5aa62a1be4 | ||
|
aede8bf0e0 | ||
|
9ab7abcb95 | ||
|
f87b28afd9 | ||
|
8661f6d1ac | ||
|
4536b4b2b4 | ||
|
655f03940b | ||
|
4122de7823 | ||
|
0f4c67d24e | ||
|
20e8c45819 | ||
|
2b8b844fb2 | ||
|
3284b8764f | ||
|
d19946336e | ||
|
770a220808 | ||
|
78b71e72f1 | ||
|
19990f49b0 | ||
|
8208d44466 | ||
|
002b2b6dee | ||
|
c207167b14 | ||
|
cfc066e911 | ||
|
3a1d011841 | ||
|
7d05c0da9c | ||
|
1d7f2ca9e4 | ||
|
ea2e0d7546 | ||
|
64b79ee64c | ||
|
8a00101470 | ||
|
01aba73f5b | ||
|
71e31346e8 | ||
|
483cce9880 | ||
|
c8db39a91e | ||
|
6d398a2edf | ||
|
bd3c8119ba | ||
|
16aa78d13c | ||
|
3be5cca60a | ||
|
bc3dfb96fd | ||
|
e78e98a6cf | ||
|
9db0e48f63 | ||
|
3de52b6bc1 | ||
|
be52abbe3b | ||
|
ac55b0fafb | ||
|
887b6789fc | ||
|
ff50fec112 | ||
|
4538ef3cf9 | ||
|
a872cf7061 | ||
|
2d8ca363db | ||
|
8e8b011587 | ||
|
4241ae035e | ||
|
3ef569d280 | ||
|
6fe28b15df | ||
|
a609a47138 | ||
|
b575b87f77 | ||
|
7c5ee8a67d | ||
|
452c14bece | ||
|
57f63ba752 | ||
|
5f153b8a01 | ||
|
1be49876df | ||
|
a79b2a7773 | ||
|
cdf6e5a487 | ||
|
7c82f45604 | ||
|
4d49701203 | ||
|
d48cc69898 | ||
|
af466a1d75 | ||
|
b9599d3aa1 | ||
|
dbebfe7c07 | ||
|
ddf54fdb83 | ||
|
619138d294 | ||
|
126b19bf2d | ||
|
cc76adf7b6 | ||
|
83bcb56a6a | ||
|
6e88a70661 | ||
|
6755a9878b | ||
|
b8ef7593ee | ||
|
602cc26f0f | ||
|
62271fe064 | ||
|
83f5f776a6 | ||
|
2a5566a820 | ||
|
398e547d06 | ||
|
ba957196da | ||
|
b5c4a24133 | ||
|
cc688dc112 | ||
|
91b5eaff80 | ||
|
4a52503cb3 | ||
|
bcd7e7ea94 | ||
|
ba9ae54fbb | ||
|
39e05c9991 | ||
|
8962f90bcc | ||
|
daf3a95db0 | ||
|
1c9ebafe2b | ||
|
00b3df4455 |
55
.env.docker
Normal file
@@ -0,0 +1,55 @@
|
||||
APP_ENV=${FF_APP_ENV}
|
||||
APP_DEBUG=false
|
||||
APP_FORCE_SSL=false
|
||||
APP_FORCE_ROOT=
|
||||
APP_KEY=${FF_APP_KEY}
|
||||
APP_LOG=daily
|
||||
APP_LOG_LEVEL=warning
|
||||
APP_URL=http://localhost
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=${FF_DB_HOST}
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=${FF_DB_NAME}
|
||||
DB_USERNAME=${FF_DB_USER}
|
||||
DB_PASSWORD=${FF_DB_PASSWORD}
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=sync
|
||||
|
||||
COOKIE_PATH="/"
|
||||
COOKIE_DOMAIN=
|
||||
COOKIE_SECURE=false
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_FROM=changeme@example.com
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
|
||||
SEND_REGISTRATION_MAIL=true
|
||||
SEND_ERROR_MESSAGE=true
|
||||
SHOW_INCOMPLETE_TRANSLATIONS=false
|
||||
|
||||
CACHE_PREFIX=firefly
|
||||
|
||||
GOOGLE_MAPS_API_KEY=
|
||||
ANALYTICS_ID=
|
||||
SITE_OWNER=mail@example.com
|
||||
USE_ENCRYPTION=true
|
||||
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_APP_ID=
|
||||
|
||||
DEMO_USERNAME=
|
||||
DEMO_PASSWORD=
|
||||
|
@@ -3,6 +3,7 @@ APP_DEBUG=false
|
||||
APP_FORCE_SSL=false
|
||||
APP_FORCE_ROOT=
|
||||
APP_KEY=SomeRandomStringOf32CharsExactly
|
||||
APP_LOG=daily
|
||||
APP_LOG_LEVEL=warning
|
||||
APP_URL=http://localhost
|
||||
|
||||
@@ -40,9 +41,12 @@ SHOW_INCOMPLETE_TRANSLATIONS=false
|
||||
|
||||
CACHE_PREFIX=firefly
|
||||
|
||||
EXCHANGE_RATE_SERVICE=fixerio
|
||||
|
||||
GOOGLE_MAPS_API_KEY=
|
||||
ANALYTICS_ID=
|
||||
SITE_OWNER=mail@example.com
|
||||
USE_ENCRYPTION=true
|
||||
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
|
55
.env.sandstorm
Executable file
@@ -0,0 +1,55 @@
|
||||
APP_ENV=production
|
||||
APP_DEBUG=true
|
||||
APP_FORCE_SSL=false
|
||||
APP_FORCE_ROOT=
|
||||
APP_KEY=SomeRandomStringOf32CharsExactly
|
||||
APP_LOG=syslog
|
||||
APP_LOG_LEVEL=debug
|
||||
APP_URL=http://localhost
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=firefly
|
||||
DB_USERNAME=firefly
|
||||
DB_PASSWORD=firefly
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=sync
|
||||
|
||||
COOKIE_PATH="/"
|
||||
COOKIE_DOMAIN=
|
||||
COOKIE_SECURE=false
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_FROM=changeme@example.com
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
|
||||
SEND_REGISTRATION_MAIL=true
|
||||
SEND_ERROR_MESSAGE=true
|
||||
SHOW_INCOMPLETE_TRANSLATIONS=false
|
||||
|
||||
CACHE_PREFIX=firefly
|
||||
|
||||
GOOGLE_MAPS_API_KEY=
|
||||
ANALYTICS_ID=
|
||||
SITE_OWNER=mail@example.com
|
||||
USE_ENCRYPTION=true
|
||||
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_APP_ID=
|
||||
|
||||
DEMO_USERNAME=
|
||||
DEMO_PASSWORD=
|
||||
|
@@ -3,6 +3,7 @@ APP_DEBUG=true
|
||||
APP_FORCE_SSL=false
|
||||
APP_FORCE_ROOT=
|
||||
APP_KEY=TestTestTestTestTestTestTestTest
|
||||
APP_LOG=daily
|
||||
APP_LOG_LEVEL=debug
|
||||
APP_URL=http://localhost
|
||||
|
||||
|
1
.github/CONTRIBUTING
vendored
@@ -1 +0,0 @@
|
||||
If you are requesting a new feature, please check out the list of [often requested features](https://firefly-iii.github.io/requested-features/) first. Thanks!
|
23
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# Welcome to Firefly III on Github!
|
||||
|
||||
:+1::tada: Thank you for taking the time to contribute something to Firefly III!
|
||||
|
||||
## Feature requests
|
||||
|
||||
If you are requesting a new feature, please check out the list of [often requested features](https://firefly-iii.github.io/requested-features/).
|
||||
|
||||
## Bugs
|
||||
|
||||
If you find a bug, please take the time and see if the [demo site](https://firefly-iii.nder.be/) is also suffering from this bug. Include as many log files and details as you think are necessary.
|
||||
|
||||
## Installation problems
|
||||
|
||||
Take the time to read the [installation guide FAQ](https://firefly-iii.github.io/installation-guide-faq/) and make sure you search through closed issues for the problems other people have had. Your problem may be among them!
|
||||
|
||||
## Pull requests
|
||||
|
||||
I can only accept pull requests against the `develop` branch, never the `master` branch.
|
||||
|
||||
## Translations :us: :fr: :de:
|
||||
|
||||
If you see a spelling error, grammatical error or a weird translation in your language, please join [our CrowdIn](https://crowdin.com/project/firefly-iii) project. There, you can submit your translations and fixes. The GitHub repository will download these automatically and they will be included in the next release.
|
7
.gitignore
vendored
@@ -1,14 +1,7 @@
|
||||
/node_modules
|
||||
/public/storage
|
||||
/vendor
|
||||
/.idea
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
.env
|
||||
_development
|
||||
.env.local
|
||||
result.html
|
||||
test-import.sh
|
||||
test-import-report.txt
|
||||
public/google*.html
|
||||
.env.backup
|
||||
|
5
.sandstorm/.gitattributes
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
# vagrant-spk creates shell scripts, which must end in \n, even on a \r\n system.
|
||||
*.sh text eol=lf
|
||||
|
5
.sandstorm/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
# This file stores a list of sub-paths of .sandstorm/ that should be ignored by git.
|
||||
.vagrant
|
||||
|
103
.sandstorm/Vagrantfile
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# Guess at a reasonable name for the VM based on the folder vagrant-spk is
|
||||
# run from. The timestamp is there to avoid conflicts if you have multiple
|
||||
# folders with the same name.
|
||||
VM_NAME = File.basename(File.dirname(File.dirname(__FILE__))) + "_sandstorm_#{Time.now.utc.to_i}"
|
||||
|
||||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
# Base on the Sandstorm snapshots of the official Debian 8 (jessie) box.
|
||||
config.vm.box = "sandstorm/debian-jessie64"
|
||||
|
||||
if Vagrant.has_plugin?("vagrant-vbguest") then
|
||||
# vagrant-vbguest is a Vagrant plugin that upgrades
|
||||
# the version of VirtualBox Guest Additions within each
|
||||
# guest. If you have the vagrant-vbguest plugin, then it
|
||||
# needs to know how to compile kernel modules, etc., and so
|
||||
# we give it this hint about operating system type.
|
||||
config.vm.guest = "debian"
|
||||
end
|
||||
|
||||
# We forward port 6080, the Sandstorm web port, so that developers can
|
||||
# visit their sandstorm app from their browser as local.sandstorm.io:6080
|
||||
# (aka 127.0.0.1:6080).
|
||||
config.vm.network :forwarded_port, guest: 6080, host: 6080
|
||||
|
||||
# Use a shell script to "provision" the box. This installs Sandstorm using
|
||||
# the bundled installer.
|
||||
config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/global-setup.sh", keep_color: true
|
||||
# Then, do stack-specific and app-specific setup.
|
||||
config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/setup.sh", keep_color: true
|
||||
|
||||
# Shared folders are configured per-provider since vboxsf can't handle >4096 open files,
|
||||
# NFS requires privilege escalation every time you bring a VM up,
|
||||
# and 9p is only available on libvirt.
|
||||
|
||||
# Calculate the number of CPUs and the amount of RAM the system has,
|
||||
# in a platform-dependent way; further logic below.
|
||||
cpus = nil
|
||||
total_kB_ram = nil
|
||||
|
||||
host = RbConfig::CONFIG['host_os']
|
||||
if host =~ /darwin/
|
||||
cpus = `sysctl -n hw.ncpu`.to_i
|
||||
total_kB_ram = `sysctl -n hw.memsize`.to_i / 1024
|
||||
elsif host =~ /linux/
|
||||
cpus = `nproc`.to_i
|
||||
total_kB_ram = `grep MemTotal /proc/meminfo | awk '{print $2}'`.to_i
|
||||
elsif host =~ /mingw/
|
||||
# powershell may not be available on Windows XP and Vista, so wrap this in a rescue block
|
||||
begin
|
||||
cpus = `powershell -Command "(Get-WmiObject Win32_Processor -Property NumberOfLogicalProcessors | Select-Object -Property NumberOfLogicalProcessors | Measure-Object NumberOfLogicalProcessors -Sum).Sum"`.to_i
|
||||
total_kB_ram = `powershell -Command "Get-CimInstance -class cim_physicalmemory | % $_.Capacity}"`.to_i / 1024
|
||||
rescue
|
||||
end
|
||||
end
|
||||
# Use the same number of CPUs within Vagrant as the system, with 1
|
||||
# as a default.
|
||||
#
|
||||
# Use at least 512MB of RAM, and if the system has more than 2GB of
|
||||
# RAM, use 1/4 of the system RAM. This seems a reasonable compromise
|
||||
# between having the Vagrant guest operating system not run out of
|
||||
# RAM entirely (which it basically would if we went much lower than
|
||||
# 512MB) and also allowing it to use up a healthily large amount of
|
||||
# RAM so it can run faster on systems that can afford it.
|
||||
if cpus.nil? or cpus.zero?
|
||||
cpus = 1
|
||||
end
|
||||
if total_kB_ram.nil? or total_kB_ram < 2048000
|
||||
assign_ram_mb = 512
|
||||
else
|
||||
assign_ram_mb = (total_kB_ram / 1024 / 4)
|
||||
end
|
||||
# Actually apply these CPU/memory values to the providers.
|
||||
config.vm.provider :virtualbox do |vb, override|
|
||||
vb.cpus = cpus
|
||||
vb.memory = assign_ram_mb
|
||||
vb.name = VM_NAME
|
||||
vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"]
|
||||
|
||||
# /opt/app and /host-dot-sandstorm are used by vagrant-spk
|
||||
override.vm.synced_folder "..", "/opt/app"
|
||||
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm"
|
||||
# /vagrant is not used by vagrant-spk; we need this line so it gets disabled; if we removed the
|
||||
# line, vagrant would automatically insert a synced folder in /vagrant, which is not what we want.
|
||||
override.vm.synced_folder "..", "/vagrant", disabled: true
|
||||
end
|
||||
config.vm.provider :libvirt do |libvirt, override|
|
||||
libvirt.cpus = cpus
|
||||
libvirt.memory = assign_ram_mb
|
||||
libvirt.default_prefix = VM_NAME
|
||||
|
||||
# /opt/app and /host-dot-sandstorm are used by vagrant-spk
|
||||
override.vm.synced_folder "..", "/opt/app", type: "9p", accessmode: "passthrough"
|
||||
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough"
|
||||
# /vagrant is not used by vagrant-spk; we need this line so it gets disabled; if we removed the
|
||||
# line, vagrant would automatically insert a synced folder in /vagrant, which is not what we want.
|
||||
override.vm.synced_folder "..", "/vagrant", type: "9p", accessmode: "passthrough", disabled: true
|
||||
end
|
||||
end
|
BIN
.sandstorm/app-graphics/firefly-iii-128.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
.sandstorm/app-graphics/firefly-iii-150.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
.sandstorm/app-graphics/firefly-iii-24.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
.sandstorm/app-graphics/firefly-iii-48.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
21
.sandstorm/build.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# Checks if there's a composer.json, and if so, installs/runs composer.
|
||||
# This script only runs once, when the app connects to sandstorm.
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
|
||||
cd /opt/app
|
||||
|
||||
cp .env.sandstorm .env
|
||||
|
||||
if [ -f /opt/app/composer.json ] ; then
|
||||
if [ ! -f composer.phar ] ; then
|
||||
curl -sS https://getcomposer.org/installer | php
|
||||
fi
|
||||
php composer.phar install --no-dev --no-suggest
|
||||
fi
|
||||
|
||||
# link storage folder
|
||||
rm -rf /opt/app/storage
|
||||
ln -s /var/storage /opt/app
|
3
.sandstorm/changelog.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# 3.4.3
|
||||
|
||||
* Initial release on Sandstorm.io
|
3
.sandstorm/description.md
Normal file
@@ -0,0 +1,3 @@
|
||||
"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 works on the principle that if you know where you’re money is going, you can stop it from going there.
|
44
.sandstorm/global-setup.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Set options for curl. Since we only want to show errors from these curl commands, we also use
|
||||
# 'cat' to buffer the output; for more information:
|
||||
# https://github.com/sandstorm-io/vagrant-spk/issues/158
|
||||
|
||||
CURL_OPTS="--silent --show-error"
|
||||
echo localhost > /etc/hostname
|
||||
hostname localhost
|
||||
|
||||
# The following line copies stderr through stderr to cat without accidentally leaving it in the
|
||||
# output file. Be careful when changing. See: https://github.com/sandstorm-io/vagrant-spk/pull/159
|
||||
curl $CURL_OPTS https://install.sandstorm.io/ 2>&1 > /host-dot-sandstorm/caches/install.sh | cat
|
||||
|
||||
SANDSTORM_CURRENT_VERSION=$(curl $CURL_OPTS -f "https://install.sandstorm.io/dev?from=0&type=install")
|
||||
SANDSTORM_PACKAGE="sandstorm-$SANDSTORM_CURRENT_VERSION.tar.xz"
|
||||
if [[ ! -f /host-dot-sandstorm/caches/$SANDSTORM_PACKAGE ]] ; then
|
||||
echo -n "Downloading Sandstorm version ${SANDSTORM_CURRENT_VERSION}..."
|
||||
curl $CURL_OPTS --output "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "https://dl.sandstorm.io/$SANDSTORM_PACKAGE" 2>&1 | cat
|
||||
mv "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE"
|
||||
echo "...done."
|
||||
fi
|
||||
if [ ! -e /opt/sandstorm/latest/sandstorm ] ; then
|
||||
echo -n "Installing Sandstorm version ${SANDSTORM_CURRENT_VERSION}..."
|
||||
bash /host-dot-sandstorm/caches/install.sh -d -e "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" >/dev/null
|
||||
echo "...done."
|
||||
fi
|
||||
modprobe ip_tables
|
||||
# Make the vagrant user part of the sandstorm group so that commands like
|
||||
# `spk dev` work.
|
||||
usermod -a -G 'sandstorm' 'vagrant'
|
||||
# Bind to all addresses, so the vagrant port-forward works.
|
||||
sudo sed --in-place='' \
|
||||
--expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \
|
||||
/opt/sandstorm/sandstorm.conf
|
||||
sudo service sandstorm restart
|
||||
# Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP
|
||||
GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3)
|
||||
if nc -z "$GATEWAY_IP" 3142 ; then
|
||||
echo "Acquire::http::Proxy \"http://$GATEWAY_IP:3142\";" > /etc/apt/apt.conf.d/80httpproxy
|
||||
fi
|
||||
# Configure apt to retry fetching things that fail to download.
|
||||
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80sandstorm-retry
|
62
.sandstorm/launcher.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Runs every time we create a new grain!
|
||||
|
||||
# Create a bunch of folders under the clean /var that php, nginx, and mysql expect to exist
|
||||
mkdir -p /var/lib/mysql
|
||||
mkdir -p /var/lib/nginx
|
||||
mkdir -p /var/lib/php/sessions/
|
||||
mkdir -p /var/log
|
||||
mkdir -p /var/log/mysql
|
||||
mkdir -p /var/log/nginx
|
||||
# Wipe /var/run, since pidfiles and socket files from previous launches should go away
|
||||
# TODO someday: I'd prefer a tmpfs for these.
|
||||
rm -rf /var/run
|
||||
mkdir -p /var/run
|
||||
rm -rf /var/tmp
|
||||
mkdir -p /var/tmp
|
||||
mkdir -p /var/run/mysqld
|
||||
|
||||
# make storage directories
|
||||
rm -rf /var/storage
|
||||
mkdir -p /var/storage/app/public
|
||||
mkdir -p /var/storage/build
|
||||
mkdir -p /var/storage/database
|
||||
mkdir -p /var/storage/debugbar
|
||||
mkdir -p /var/storage/export
|
||||
mkdir -p /var/storage/framework/cache
|
||||
mkdir -p /var/storage/framework/sessions
|
||||
mkdir -p /var/storage/framework/views
|
||||
mkdir -p /var/storage/logs
|
||||
mkdir -p /var/storage/upload
|
||||
|
||||
|
||||
# Ensure mysql tables created
|
||||
HOME=/etc/mysql /usr/bin/mysql_install_db --force
|
||||
|
||||
# Spawn mysqld, php
|
||||
HOME=/etc/mysql /usr/sbin/mysqld &
|
||||
|
||||
/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf &
|
||||
|
||||
# Wait until mysql and php have bound their sockets, indicating readiness
|
||||
while [ ! -e /var/run/mysqld/mysqld.sock ] ; do
|
||||
echo "waiting for mysql to be available at /var/run/mysqld/mysqld.sock"
|
||||
sleep .5
|
||||
done
|
||||
while [ ! -e /var/run/php7.0-fpm.sock ] ; do
|
||||
echo "waiting for php7.0-fpm to be available at /var/run/php7.0-fpm.sock"
|
||||
sleep .5
|
||||
done
|
||||
|
||||
echo "Installing database.."
|
||||
# Install database for Firefly III
|
||||
echo "CREATE DATABASE IF NOT EXISTS firefly; GRANT ALL on firefly.* TO 'firefly'@'localhost' IDENTIFIED BY 'firefly';" | mysql -uroot
|
||||
echo "Done!"
|
||||
|
||||
echo "Migrating..."
|
||||
php /opt/app/artisan migrate --seed --force
|
||||
echo "Done!"
|
||||
|
||||
# Start nginx.
|
||||
/usr/sbin/nginx -c /opt/app/.sandstorm/service-config/nginx.conf -g "daemon off;"
|
BIN
.sandstorm/pgp-keyring
Normal file
BIN
.sandstorm/pgp-signature
Normal file
1542
.sandstorm/sandstorm-files.list
Normal file
188
.sandstorm/sandstorm-pkgdef.capnp
Normal file
@@ -0,0 +1,188 @@
|
||||
@0x9411e6c8b3c8a4b6;
|
||||
|
||||
using Spk = import "/sandstorm/package.capnp";
|
||||
# This imports:
|
||||
# $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp
|
||||
# Check out that file to see the full, documented package definition format.
|
||||
|
||||
const pkgdef :Spk.PackageDefinition = (
|
||||
# The package definition. Note that the spk tool looks specifically for the
|
||||
# "pkgdef" constant.
|
||||
|
||||
id = "uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70",
|
||||
# Your app ID is actually its public key. The private key was placed in
|
||||
# your keyring. All updates must be signed with the same key.
|
||||
|
||||
manifest = (
|
||||
appTitle = (defaultText = "Firefly III"),
|
||||
appVersion = 1,
|
||||
appMarketingVersion = (defaultText = "3.4.6"),
|
||||
actions = [
|
||||
# Define your "new document" handlers here.
|
||||
( nounPhrase = (defaultText = "administration"),
|
||||
command = .myCommand
|
||||
# The command to run when starting for the first time. (".myCommand"
|
||||
# is just a constant defined at the bottom of the file.)
|
||||
)
|
||||
],
|
||||
|
||||
continueCommand = .myCommand,
|
||||
# This is the command called to start your app back up after it has been
|
||||
# shut down for inactivity. Here we're using the same command as for
|
||||
# starting a new instance, but you could use different commands for each
|
||||
# case.
|
||||
|
||||
metadata = (
|
||||
icons = (
|
||||
appGrid = (png = (dpi1x = embed "app-graphics/firefly-iii-128.png")),
|
||||
grain = (png = (dpi1x = embed "app-graphics/firefly-iii-24.png",
|
||||
dpi2x = embed "app-graphics/firefly-iii-48.png")),
|
||||
market = (png = (dpi1x = embed "app-graphics/firefly-iii-150.png"))
|
||||
),
|
||||
|
||||
website = "https://firefly-iii.github.io/",
|
||||
codeUrl = "https://github.com/firefly-iii/firefly-iii",
|
||||
#license = (openSource = mit),
|
||||
license = (proprietary = (defaultText = embed "../LICENSE")),
|
||||
# The license this package is distributed under. See
|
||||
# https://docs.sandstorm.io/en/latest/developing/publishing-apps/#license
|
||||
|
||||
categories = [productivity],
|
||||
# A list of categories/genres to which this app belongs, sorted with best fit first.
|
||||
# See the list of categories at
|
||||
# https://docs.sandstorm.io/en/latest/developing/publishing-apps/#categories
|
||||
|
||||
author = (
|
||||
contactEmail = "thegrumpydictator@gmail.com",
|
||||
upstreamAuthor = "James Cole",
|
||||
pgpSignature = embed "pgp-signature",
|
||||
),
|
||||
|
||||
pgpKeyring = embed "pgp-keyring",
|
||||
description = (defaultText = embed "description.md"),
|
||||
shortDescription = (defaultText = "Financial management"),
|
||||
screenshots = [
|
||||
# Screenshots to use for marketing purposes. Examples below.
|
||||
# Sizes are given in device-independent pixels, so if you took these
|
||||
# screenshots on a Retina-style high DPI screen, divide each dimension by two.
|
||||
|
||||
(width = 1200, height = 1000, png = embed "screenshots/screenshot-1.png"),
|
||||
(width = 1200, height = 1000, png = embed "screenshots/screenshot-2.png"),
|
||||
(width = 1200, height = 1518, png = embed "screenshots/screenshot-3.png"),
|
||||
|
||||
],
|
||||
changeLog = (defaultText = embed "changelog.md"),
|
||||
),
|
||||
),
|
||||
|
||||
sourceMap = (
|
||||
# Here we defined where to look for files to copy into your package. The
|
||||
# `spk dev` command actually figures out what files your app needs
|
||||
# automatically by running it on a FUSE filesystem. So, the mappings
|
||||
# here are only to tell it where to find files that the app wants.
|
||||
searchPath = [
|
||||
( sourcePath = "." ), # Search this directory first.
|
||||
( sourcePath = "/", # Then search the system root directory.
|
||||
hidePaths = [ "home", "proc", "sys",
|
||||
"etc/passwd", "etc/hosts", "etc/host.conf",
|
||||
"etc/nsswitch.conf", "etc/resolv.conf" ]
|
||||
# You probably don't want the app pulling files from these places,
|
||||
# so we hide them. Note that /dev, /var, and /tmp are implicitly
|
||||
# hidden because Sandstorm itself provides them.
|
||||
)
|
||||
]
|
||||
),
|
||||
|
||||
fileList = "sandstorm-files.list",
|
||||
# `spk dev` will write a list of all the files your app uses to this file.
|
||||
# You should review it later, before shipping your app.
|
||||
|
||||
alwaysInclude = ["app","bootstrap","config","database","public","resources","routes"],
|
||||
# Fill this list with more names of files or directories that should be
|
||||
# included in your package, even if not listed in sandstorm-files.list.
|
||||
# Use this to force-include stuff that you know you need but which may
|
||||
# not have been detected as a dependency during `spk dev`. If you list
|
||||
# a directory here, its entire contents will be included recursively.
|
||||
|
||||
#bridgeConfig = (
|
||||
# # Used for integrating permissions and roles into the Sandstorm shell
|
||||
# # and for sandstorm-http-bridge to pass to your app.
|
||||
# # Uncomment this block and adjust the permissions and roles to make
|
||||
# # sense for your app.
|
||||
# # For more information, see high-level documentation at
|
||||
# # https://docs.sandstorm.io/en/latest/developing/auth/
|
||||
# # and advanced details in the "BridgeConfig" section of
|
||||
# # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/package.capnp
|
||||
# viewInfo = (
|
||||
# # For details on the viewInfo field, consult "ViewInfo" in
|
||||
# # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/grain.capnp
|
||||
#
|
||||
# permissions = [
|
||||
# # Permissions which a user may or may not possess. A user's current
|
||||
# # permissions are passed to the app as a comma-separated list of `name`
|
||||
# # fields in the X-Sandstorm-Permissions header with each request.
|
||||
# #
|
||||
# # IMPORTANT: only ever append to this list! Reordering or removing fields
|
||||
# # will change behavior and permissions for existing grains! To deprecate a
|
||||
# # permission, or for more information, see "PermissionDef" in
|
||||
# # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/grain.capnp
|
||||
# (
|
||||
# name = "editor",
|
||||
# # Name of the permission, used as an identifier for the permission in cases where string
|
||||
# # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.
|
||||
#
|
||||
# title = (defaultText = "editor"),
|
||||
# # Display name of the permission, e.g. to display in a checklist of permissions
|
||||
# # that may be assigned when sharing.
|
||||
#
|
||||
# description = (defaultText = "grants ability to modify data"),
|
||||
# # Prose describing what this role means, suitable for a tool tip or similar help text.
|
||||
# ),
|
||||
# ],
|
||||
# roles = [
|
||||
# # Roles are logical collections of permissions. For instance, your app may have
|
||||
# # a "viewer" role and an "editor" role
|
||||
# (
|
||||
# title = (defaultText = "editor"),
|
||||
# # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.
|
||||
#
|
||||
# permissions = [true],
|
||||
# # An array indicating which permissions this role carries.
|
||||
# # It should be the same length as the permissions array in
|
||||
# # viewInfo, and the order of the lists must match.
|
||||
#
|
||||
# verbPhrase = (defaultText = "can make changes to the document"),
|
||||
# # Brief explanatory text to show in the sharing UI indicating
|
||||
# # what a user assigned this role will be able to do with the grain.
|
||||
#
|
||||
# description = (defaultText = "editors may view all site data and change settings."),
|
||||
# # Prose describing what this role means, suitable for a tool tip or similar help text.
|
||||
# ),
|
||||
# (
|
||||
# title = (defaultText = "viewer"),
|
||||
# permissions = [false],
|
||||
# verbPhrase = (defaultText = "can view the document"),
|
||||
# description = (defaultText = "viewers may view what other users have written."),
|
||||
# ),
|
||||
# ],
|
||||
# ),
|
||||
# #apiPath = "/api",
|
||||
# # Apps can export an API to the world. The API is to be used primarily by Javascript
|
||||
# # code and native apps, so it can't serve out regular HTML to browsers. If a request
|
||||
# # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with
|
||||
# # this string, if specified.
|
||||
#),
|
||||
);
|
||||
|
||||
const myCommand :Spk.Manifest.Command = (
|
||||
# Here we define the command used to start up your server.
|
||||
argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"],
|
||||
environ = [
|
||||
# Note that this defines the *entire* environment seen by your app.
|
||||
(key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
|
||||
(key = "SANDSTORM", value = "1"),
|
||||
# Export SANDSTORM=1 into the environment, so that apps running within Sandstorm
|
||||
# can detect if $SANDSTORM="1" at runtime, switching UI and/or backend to use
|
||||
# the app's Sandstorm-specific integration code.
|
||||
]
|
||||
);
|
BIN
.sandstorm/screenshots/screenshot-1.png
Normal file
After Width: | Height: | Size: 177 KiB |
BIN
.sandstorm/screenshots/screenshot-2.png
Normal file
After Width: | Height: | Size: 222 KiB |
BIN
.sandstorm/screenshots/screenshot-3.png
Normal file
After Width: | Height: | Size: 280 KiB |
89
.sandstorm/service-config/mime.types
Normal file
@@ -0,0 +1,89 @@
|
||||
|
||||
types {
|
||||
text/html html htm shtml;
|
||||
text/css css;
|
||||
text/xml xml;
|
||||
image/gif gif;
|
||||
image/jpeg jpeg jpg;
|
||||
application/javascript js;
|
||||
application/atom+xml atom;
|
||||
application/rss+xml rss;
|
||||
|
||||
text/mathml mml;
|
||||
text/plain txt;
|
||||
text/vnd.sun.j2me.app-descriptor jad;
|
||||
text/vnd.wap.wml wml;
|
||||
text/x-component htc;
|
||||
|
||||
image/png png;
|
||||
image/tiff tif tiff;
|
||||
image/vnd.wap.wbmp wbmp;
|
||||
image/x-icon ico;
|
||||
image/x-jng jng;
|
||||
image/x-ms-bmp bmp;
|
||||
image/svg+xml svg svgz;
|
||||
image/webp webp;
|
||||
|
||||
application/font-woff woff;
|
||||
application/java-archive jar war ear;
|
||||
application/json json;
|
||||
application/mac-binhex40 hqx;
|
||||
application/msword doc;
|
||||
application/pdf pdf;
|
||||
application/postscript ps eps ai;
|
||||
application/rtf rtf;
|
||||
application/vnd.apple.mpegurl m3u8;
|
||||
application/vnd.ms-excel xls;
|
||||
application/vnd.ms-fontobject eot;
|
||||
application/vnd.ms-powerpoint ppt;
|
||||
application/vnd.wap.wmlc wmlc;
|
||||
application/vnd.google-earth.kml+xml kml;
|
||||
application/vnd.google-earth.kmz kmz;
|
||||
application/x-7z-compressed 7z;
|
||||
application/x-cocoa cco;
|
||||
application/x-java-archive-diff jardiff;
|
||||
application/x-java-jnlp-file jnlp;
|
||||
application/x-makeself run;
|
||||
application/x-perl pl pm;
|
||||
application/x-pilot prc pdb;
|
||||
application/x-rar-compressed rar;
|
||||
application/x-redhat-package-manager rpm;
|
||||
application/x-sea sea;
|
||||
application/x-shockwave-flash swf;
|
||||
application/x-stuffit sit;
|
||||
application/x-tcl tcl tk;
|
||||
application/x-x509-ca-cert der pem crt;
|
||||
application/x-xpinstall xpi;
|
||||
application/xhtml+xml xhtml;
|
||||
application/xspf+xml xspf;
|
||||
application/zip zip;
|
||||
|
||||
application/octet-stream bin exe dll;
|
||||
application/octet-stream deb;
|
||||
application/octet-stream dmg;
|
||||
application/octet-stream iso img;
|
||||
application/octet-stream msi msp msm;
|
||||
|
||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
|
||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
|
||||
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
|
||||
|
||||
audio/midi mid midi kar;
|
||||
audio/mpeg mp3;
|
||||
audio/ogg ogg;
|
||||
audio/x-m4a m4a;
|
||||
audio/x-realaudio ra;
|
||||
|
||||
video/3gpp 3gpp 3gp;
|
||||
video/mp2t ts;
|
||||
video/mp4 mp4;
|
||||
video/mpeg mpeg mpg;
|
||||
video/quicktime mov;
|
||||
video/webm webm;
|
||||
video/x-flv flv;
|
||||
video/x-m4v m4v;
|
||||
video/x-mng mng;
|
||||
video/x-ms-asf asx asf;
|
||||
video/x-ms-wmv wmv;
|
||||
video/x-msvideo avi;
|
||||
}
|
87
.sandstorm/service-config/nginx.conf
Normal file
@@ -0,0 +1,87 @@
|
||||
worker_processes 4;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
# Basic Settings
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
# server_names_hash_bucket_size 64;
|
||||
server_tokens off;
|
||||
server_name_in_redirect off;
|
||||
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
# Logging
|
||||
access_log off;
|
||||
error_log stderr;
|
||||
|
||||
# Prevent nginx from adding compression; this interacts badly with Sandstorm
|
||||
# WebSession due to https://github.com/sandstorm-io/sandstorm/issues/289
|
||||
gzip off;
|
||||
|
||||
# Trust the sandstorm-http-bridge's X-Forwarded-Proto.
|
||||
map $http_x_forwarded_proto $fe_https {
|
||||
default "";
|
||||
https on;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8000 default_server;
|
||||
listen [::]:8000 default_server ipv6only=on;
|
||||
|
||||
# Allow arbitrarily large bodies - Sandstorm can handle them, and requests
|
||||
# are authenticated already, so there's no reason for apps to add additional
|
||||
# limits by default.
|
||||
client_max_body_size 0;
|
||||
|
||||
server_name localhost;
|
||||
root /opt/app/public;
|
||||
location / {
|
||||
index index.php;
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
autoindex on;
|
||||
sendfile off;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_pass unix:/var/run/php7.0-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
|
||||
|
||||
fastcgi_param QUERY_STRING $query_string;
|
||||
fastcgi_param REQUEST_METHOD $request_method;
|
||||
fastcgi_param CONTENT_TYPE $content_type;
|
||||
fastcgi_param CONTENT_LENGTH $content_length;
|
||||
|
||||
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||
fastcgi_param REQUEST_URI $request_uri;
|
||||
fastcgi_param DOCUMENT_URI $document_uri;
|
||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||
fastcgi_param HTTPS $fe_https if_not_empty;
|
||||
|
||||
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
||||
|
||||
fastcgi_param REMOTE_ADDR $remote_addr;
|
||||
fastcgi_param REMOTE_PORT $remote_port;
|
||||
fastcgi_param SERVER_ADDR $server_addr;
|
||||
fastcgi_param SERVER_PORT $server_port;
|
||||
fastcgi_param SERVER_NAME $server_name;
|
||||
|
||||
# PHP only, required if PHP was built with --enable-force-cgi-redirect
|
||||
#fastcgi_param REDIRECT_STATUS 200;
|
||||
}
|
||||
}
|
||||
}
|
61
.sandstorm/setup.sh
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
|
||||
# When you change this file, you must take manual action. Read this doc:
|
||||
# - https://docs.sandstorm.io/en/latest/vagrant-spk/customizing/#setupsh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# install packages so we can install apt-add-repository.
|
||||
apt-get update
|
||||
apt-get install -y python-software-properties software-properties-common
|
||||
|
||||
# actually add repository
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E9C74FEEA2098A6E
|
||||
add-apt-repository "deb http://packages.dotdeb.org jessie all"
|
||||
|
||||
# install packages.
|
||||
apt-get update
|
||||
apt-get install -y nginx php7.0-fpm php7.0-mysql php7.0-cli php7.0-curl git php7.0-dev php7.0-intl php7.0-dom php7.0-mbstring php7.0-bcmath mysql-server
|
||||
service nginx stop
|
||||
service php7.0-fpm stop
|
||||
service mysql stop
|
||||
systemctl disable nginx
|
||||
systemctl disable php7.0-fpm
|
||||
systemctl disable mysql
|
||||
# patch /etc/php/7.0/fpm/pool.d/www.conf to not change uid/gid to www-data
|
||||
sed --in-place='' \
|
||||
--expression='s/^listen.owner = www-data/;listen.owner = www-data/' \
|
||||
--expression='s/^listen.group = www-data/;listen.group = www-data/' \
|
||||
/etc/php/7.0/fpm/pool.d/www.conf
|
||||
# patch /etc/php/7.0/fpm/php-fpm.conf to not have a pidfile
|
||||
sed --in-place='' \
|
||||
--expression='s/^pid =/;pid =/' \
|
||||
/etc/php/7.0/fpm/php-fpm.conf
|
||||
|
||||
# move sock file to better dir:
|
||||
sed --in-place='' \
|
||||
--expression='s/^listen = \/run\/php\/php7.0-fpm.sock/listen = \/var\/run\/php7.0-fpm.sock/' \
|
||||
/etc/php/7.0/fpm/pool.d/www.conf
|
||||
|
||||
# patch /etc/php/7.0/fpm/pool.d/www.conf to no clear environment variables
|
||||
# so we can pass in SANDSTORM=1 to apps
|
||||
sed --in-place='' \
|
||||
--expression='s/^;clear_env = no/clear_env=no/' \
|
||||
/etc/php/7.0/fpm/pool.d/www.conf
|
||||
# patch mysql conf to not change uid, and to use /var/tmp over /tmp
|
||||
# for secure-file-priv see https://github.com/sandstorm-io/vagrant-spk/issues/195
|
||||
sed --in-place='' \
|
||||
--expression='s/^user\t\t= mysql/#user\t\t= mysql/' \
|
||||
--expression='s,^tmpdir\t\t= /tmp,tmpdir\t\t= /var/tmp,' \
|
||||
--expression='/\[mysqld]/ a\ secure-file-priv = ""\' \
|
||||
/etc/mysql/my.cnf
|
||||
# patch mysql conf to use smaller transaction logs to save disk space
|
||||
cat <<EOF > /etc/mysql/conf.d/sandstorm.cnf
|
||||
[mysqld]
|
||||
# Set the transaction log file to the minimum allowed size to save disk space.
|
||||
# innodb_log_file_size = 1048576
|
||||
# Set the main data file to grow by 1MB at a time, rather than 8MB at a time.
|
||||
innodb_autoextend_increment = 1
|
||||
EOF
|
1
.sandstorm/stack
Normal file
@@ -0,0 +1 @@
|
||||
lemp
|
23
.travis.yml
@@ -1,17 +1,32 @@
|
||||
language: php
|
||||
sudo: false
|
||||
php:
|
||||
- '7.0'
|
||||
- 7.0
|
||||
- 7.1
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- vendor
|
||||
- $HOME/.composer/cache
|
||||
|
||||
install:
|
||||
- phpenv config-rm xdebug.ini
|
||||
- rm composer.lock
|
||||
- composer update --no-scripts
|
||||
- cp .env.testing .env
|
||||
- php artisan clear-compiled
|
||||
- php artisan optimize
|
||||
- php artisan env
|
||||
- cp .env.testing .env
|
||||
- mv storage/database/databasecopy.sqlite storage/database/database.sqlite
|
||||
- mkdir -p build/logs
|
||||
|
||||
script:
|
||||
- phpunit
|
||||
- phpunit -c phpunit.coverage.xml
|
||||
|
||||
after_success:
|
||||
- travis_retry php vendor/bin/coveralls -x storage/build/clover.xml
|
||||
|
||||
# safelist
|
||||
branches:
|
||||
only:
|
||||
- develop
|
||||
- master
|
271
CHANGELOG.md
@@ -2,30 +2,170 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [4.4.2] - 2017-04-27
|
||||
### Fixed
|
||||
Fixed a bug where the opening balance could not be stored.
|
||||
|
||||
## [4.4.1] - 2017-04-27
|
||||
|
||||
### Added
|
||||
- Support for deployment on Heroku
|
||||
|
||||
### Fixed
|
||||
- Bug in new-user routine.
|
||||
|
||||
## [4.4.0] - 2017-04-23
|
||||
### Added
|
||||
- Firefly III can now handle foreign currencies better, including some code to get the exchange rate live from the web.
|
||||
- Can now make rules for attachments, see #608, as suggested by dzaikos.
|
||||
|
||||
### Fixed
|
||||
- Fixed #629, reported by forcaeluz
|
||||
- Fixed #630, reported by welbert
|
||||
- And more various bug fixes.
|
||||
|
||||
## [4.3.8] - 2017-04-08
|
||||
|
||||
### Added
|
||||
- Better overview / show pages.
|
||||
- #628, as reported by [xzaz](https://github.com/xzaz).
|
||||
- Greatly expanded test coverage
|
||||
|
||||
### Fixed
|
||||
- #619, as reported by [dfiel](https://github.com/dfiel).
|
||||
- #620, as reported by [forcaeluz](https://github.com/forcaeluz).
|
||||
- Attempt to fix #624, as reported by [TheSerenin](https://github.com/TheSerenin).
|
||||
- Favicon link is relative now, fixed by [welbert](https://github.com/welbert).
|
||||
- Some search bugs
|
||||
|
||||
## [4.3.7] - 2017-03-06
|
||||
### Added
|
||||
- Nice user friendly views for empty lists.
|
||||
- Extended contribution guidelines.
|
||||
- First version of financial report filtered on tags.
|
||||
- Suggested monthly savings for piggy banks, by [Zsub](https://github.com/Zsub)
|
||||
- Better test coverage.
|
||||
|
||||
### Changed
|
||||
- Slightly changed tag overview.
|
||||
- Consistent icon for bill in list.
|
||||
- Slightly changed account overview.
|
||||
|
||||
### Removed
|
||||
- Removed IDE specific views from .gitignore, issue #598
|
||||
|
||||
### Fixed
|
||||
- Force key generation during installation.
|
||||
- The `date` function takes the fieldname where a date is stored, not the literal date by [Zsub](https://github.com/Zsub)
|
||||
- Improved budget frontpage chart, as suggested by [skibbipl](https://github.com/skibbipl)
|
||||
- Issue #602 and #607, as reported by [skibbipl](https://github.com/skibbipl) and [dzaikos](https://github.com/dzaikos).
|
||||
- Issue #605, as reported by [Zsub](https://github.com/Zsub).
|
||||
- Issue #599, as reported by [leander091](https://github.com/leander091).
|
||||
- Issue #610, as reported by [skibbipl](https://github.com/skibbipl).
|
||||
- Issue #611, as reported by [ragnarkarlsson](https://github.com/ragnarkarlsson).
|
||||
- Issue #612, as reported by [ragnarkarlsson](https://github.com/ragnarkarlsson).
|
||||
- Issue #614, as reported by [worldworm](https://github.com/worldworm).
|
||||
- Various other bug fixes.
|
||||
|
||||
## [4.3.6] - 2017-02-20
|
||||
### Fixed
|
||||
- #578, reported by [xpfgsyb](https://github.com/xpfgsyb).
|
||||
|
||||
## [4.3.5] - 2017-02-19
|
||||
### Added
|
||||
- Beta support for Sandstorm.IO
|
||||
- Docker support by [@schoentoon](https://github.com/schoentoon), [@elohmeier](https://github.com/elohmeier), [@patrickkostjens](https://github.com/patrickkostjens) and [@crash7](https://github.com/crash7)!
|
||||
- Can now use special keywords in the search to search for specic dates, categories, etc.
|
||||
|
||||
### Changed
|
||||
- Updated to laravel 5.4!
|
||||
- User friendly error message
|
||||
- Updated locales to support more operating systems, first reported in #536 by [dabenzel](https://github.com/dabenzel)
|
||||
- Updated budget report
|
||||
- Improved 404 page
|
||||
- Smooth curves, improved by [elamperti](https://github.com/elamperti).
|
||||
|
||||
### Fixed
|
||||
- #549
|
||||
- #553
|
||||
- Fixed #559 reported by [elamperti](https://github.com/elamperti).
|
||||
- #565, as reported by a user over the mail
|
||||
- #566, as reported by [dspeckmann](https://github.com/dspeckmann)
|
||||
- #567, as reported by [winsomniak](https://github.com/winsomniak)
|
||||
- #569, as reported by [winsomniak](https://github.com/winsomniak)
|
||||
- #572, as reported by [zjean](https://github.com/zjean)
|
||||
- Many issues with the transaction filters which will fix reports (they tended to display the wrong amount).
|
||||
|
||||
## [4.3.4] - 2017-02-02
|
||||
### Fixed
|
||||
- Fixed bug #550, reported by [worldworm](https://github.com/worldworm)!
|
||||
- Fixed bug #551, reported by [t-me](https://github.com/t-me)!
|
||||
|
||||
## [4.3.3] - 2017-01-30
|
||||
|
||||
_The 100th release of Firefly!_
|
||||
|
||||
### Added
|
||||
- Add locales to Docker (#534) by [elohmeier](https://github.com/elohmeier).
|
||||
- Optional database encryption. On by default.
|
||||
- Datepicker for Firefox and other browsers.
|
||||
- New instruction block for updating and installing.
|
||||
- Ability to clone transactions.
|
||||
- Use multi-select Bootstrap thing instead of massive lists of checkboxes.
|
||||
|
||||
### Removed
|
||||
- Lots of old Javascript
|
||||
|
||||
### Fixed
|
||||
- Missing sort broke various charts
|
||||
- Bug in reports that made amounts behave weird
|
||||
- Various bug fixes
|
||||
|
||||
### Security
|
||||
- Tested FF against the naughty string list.
|
||||
|
||||
## [4.3.2] - 2017-01-09
|
||||
|
||||
An intermediate release because something in the Twig and Twigbridge libraries is broken and I have to make sure it doesn't affect you guys. But some cool features were on their way so there's that oo.
|
||||
|
||||
### Added
|
||||
- Some code for issue #475, consistent overviews.
|
||||
- Better currency display. Make sure you have locale packages installed.
|
||||
|
||||
### Changed
|
||||
- Uses a new version of Laravel.
|
||||
|
||||
### Fixed
|
||||
- The password reset routine was broken.
|
||||
- Issue #522, thanks to [xpfgsyb](https://github.com/xpfgsyb)
|
||||
- Issue #524, thanks to [worldworm](https://github.com/worldworm)
|
||||
- Issue #526, thanks to [worldworm](https://github.com/worldworm)
|
||||
- Issue #528, thanks to [skibbipl](https://github.com/skibbipl)
|
||||
- Various other fixes.
|
||||
|
||||
## [4.3.1] - 2017-01-04
|
||||
### Added
|
||||
- Support for Russian and Polish.
|
||||
- Support for a proper demo website.
|
||||
- Support for custom decimal places in currencies (#506, suggested by @xpfgsyb).
|
||||
- Most amounts are now right-aligned (#511, suggested by @xpfgsyb).
|
||||
- Support for custom decimal places in currencies (#506, suggested by [xpfgsyb](https://github.com/xpfgsyb)).
|
||||
- Most amounts are now right-aligned (#511, suggested by [xpfgsyb](https://github.com/xpfgsyb)).
|
||||
- German is now a "complete" language, more than 75% translated!
|
||||
|
||||
### Changed
|
||||
- **[New Github repository!](github.com/firefly-iii/firefly-iii)**
|
||||
- Better category overview.
|
||||
- #502, thanks to @zjean
|
||||
- #502, thanks to [zjean](https://github.com/zjean)
|
||||
|
||||
### Removed
|
||||
- Removed a lot of administration functions.
|
||||
- Removed ability to activate users.
|
||||
|
||||
### Fixed
|
||||
- #501, thanks to @zjean
|
||||
- #513, thanks to @skibbipl
|
||||
- #501, thanks to [zjean](https://github.com/zjean)
|
||||
- #513, thanks to [skibbipl](https://github.com/skibbipl)
|
||||
|
||||
### Security
|
||||
- #519, thanks to @xpfgsyb
|
||||
- #519, thanks to [xpfgsyb](https://github.com/xpfgsyb)
|
||||
|
||||
## [4.3.0] - 2015-12-26
|
||||
### Added
|
||||
@@ -58,7 +198,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Fixed
|
||||
- Various bugs
|
||||
- Issue #472 thanks to @zjean
|
||||
- Issue #472 thanks to [zjean](https://github.com/zjean)
|
||||
|
||||
## [4.2.1] - 2016-12-09
|
||||
### Added
|
||||
@@ -83,25 +223,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Updated all email messages.
|
||||
- Made some fonts local
|
||||
|
||||
|
||||
### Deprecated
|
||||
- Initial release.
|
||||
|
||||
### Removed
|
||||
- Initial release.
|
||||
|
||||
### Fixed
|
||||
- Issue #408
|
||||
- Various issues with split journals
|
||||
- Issue #414, thx @zjean
|
||||
- Issue #419, thx @schwalberich
|
||||
- Issue #422, thx @xzaz
|
||||
- Various import bugs, such as #416 (@zjean)
|
||||
|
||||
|
||||
### Security
|
||||
- Initial release.
|
||||
|
||||
- Issue #414, thx [zjean](https://github.com/zjean)
|
||||
- Issue #419, thx [schwalberich](https://github.com/schwalberich)
|
||||
- Issue #422, thx [xzaz](https://github.com/xzaz)
|
||||
- Various import bugs, such as #416 ([zjean](https://github.com/zjean))
|
||||
|
||||
## [4.1.7] - 2016-11-19
|
||||
### Added
|
||||
@@ -118,9 +246,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Fixed
|
||||
- Made all pages more mobile friendly.
|
||||
- Fixed #395 found by @marcoveeneman.
|
||||
- Fixed #398 found by @marcoveeneman.
|
||||
- Fixed #401 found by @marcoveeneman.
|
||||
- Fixed #395 found by [marcoveeneman](https://github.com/marcoveeneman).
|
||||
- Fixed #398 found by [marcoveeneman](https://github.com/marcoveeneman).
|
||||
- Fixed #401 found by [marcoveeneman](https://github.com/marcoveeneman).
|
||||
- Many optimizations.
|
||||
- Updated many libraries.
|
||||
- Various bugs found by myself.
|
||||
@@ -132,13 +260,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Changed
|
||||
- Greatly expanded help pages and their function.
|
||||
- Built a new transaction collector, which I think was the idea of @roberthorlings originally.
|
||||
- Built a new transaction collector, which I think was the idea of [roberthorlings](https://github.com/roberthorlings) originally.
|
||||
- Rebuilt seach engine.
|
||||
|
||||
### Fixed
|
||||
- #375, thanks to @schoentoon which made it impossible to resurrect currencies.
|
||||
- #370 thanks to @ksmolder
|
||||
- #378, thanks to @HomelessAvatar
|
||||
- #375, thanks to [schoentoon](https://github.com/schoentoon) which made it impossible to resurrect currencies.
|
||||
- #370 thanks to [ksmolder](https://github.com/ksmolder)
|
||||
- #378, thanks to [HomelessAvatar](https://github.com/HomelessAvatar)
|
||||
|
||||
## [4.1.5] - 2016-11-01
|
||||
### Changed
|
||||
@@ -151,7 +279,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [4.1.4] - 2016-10-30
|
||||
### Added
|
||||
- New Dockerfile thanks to @schoentoon
|
||||
- New Dockerfile thanks to [schoentoon](https://github.com/schoentoon)
|
||||
- Added changing the destination account as rule action.
|
||||
- Added changing the source account as rule action.
|
||||
- Can convert transactions into different types.
|
||||
@@ -164,10 +292,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Change error message to refer to solution.
|
||||
|
||||
### Fixed
|
||||
- #367 thanks to @HungryFeline
|
||||
- #366 thanks to @3mz3t
|
||||
- #362 and #341 thanks to @bnw
|
||||
- #355 thanks to @roberthorlings
|
||||
- #367 thanks to [HungryFeline](https://github.com/HungryFeline)
|
||||
- #366 thanks to [3mz3t](https://github.com/3mz3t)
|
||||
- #362 and #341 thanks to [bnw](https://github.com/bnw)
|
||||
- #355 thanks to [roberthorlings](https://github.com/roberthorlings)
|
||||
|
||||
## [4.1.3] - 2016-10-22
|
||||
### Fixed
|
||||
@@ -199,80 +327,65 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Fixed
|
||||
- #357, where non utf-8 files would break Firefly.
|
||||
- Tab delimiter is not properly loaded from import configuration (@roberthorlings)
|
||||
- Tab delimiter is not properly loaded from import configuration ([roberthorlings](https://github.com/roberthorlings))
|
||||
- System response to yearly bills
|
||||
|
||||
## [4.0.2] - 2016-10-14
|
||||
### Added
|
||||
- Added ``intl`` dependency to composer file to ease installation (thanks @telyn)
|
||||
- Added ``intl`` dependency to composer file to ease installation (thanks [telyn](https://github.com/telyn))
|
||||
- Added support for Croatian.
|
||||
|
||||
### Changed
|
||||
- Updated all copyright notices to refer to the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/)
|
||||
- Fixed #344
|
||||
- Fixed #346, thanks to @SanderKleykens
|
||||
- Fixed #346, thanks to [SanderKleykens](https://github.com/SanderKleykens)
|
||||
- #351
|
||||
- Did some internal remodelling.
|
||||
|
||||
### Fixed
|
||||
- PostgreSQL compatibility thanks to @SanderKleykens
|
||||
- @RobertHorlings fixed a bug in the ABN Amro import specific.
|
||||
- PostgreSQL compatibility thanks to [SanderKleykens](https://github.com/SanderKleykens)
|
||||
- [roberthorlings](https://github.com/roberthorlings) fixed a bug in the ABN Amro import specific.
|
||||
|
||||
|
||||
## [4.0.1] - 2016-10-04
|
||||
### Added
|
||||
- New ING import specific by @tomwerf
|
||||
- New ING import specific by [tomwerf](https://github.com/tomwerf)
|
||||
- New Presidents Choice specific to fix #307
|
||||
- Added some trimming (#335)
|
||||
|
||||
### Changed
|
||||
- Initial release.
|
||||
|
||||
### Deprecated
|
||||
- Initial release.
|
||||
|
||||
### Removed
|
||||
- Initial release.
|
||||
|
||||
### Fixed
|
||||
- Fixed a bug where incoming transactions would not be properly filtered in several reports.
|
||||
- #334 by @cyberkov
|
||||
- #334 by [cyberkov](https://github.com/cyberkov)
|
||||
- #337
|
||||
- #336
|
||||
- #338 found by @roberthorlings
|
||||
|
||||
### Security
|
||||
- Initial release.
|
||||
|
||||
|
||||
|
||||
- #338 found by [roberthorlings](https://github.com/roberthorlings)
|
||||
|
||||
## [4.0.0] - 2015-09-26
|
||||
### Added
|
||||
- Upgraded to Laravel 5.3, most other libraries upgraded as well.
|
||||
- Added GBP as currency, thanks to @Mortalife
|
||||
- Added GBP as currency, thanks to [Mortalife](https://github.com/Mortalife)
|
||||
|
||||
### Changed
|
||||
- Jump to version 4.0.0.
|
||||
- Firefly III is now subject to a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/) license. Previous versions of this software are still MIT licensed.
|
||||
|
||||
### Fixed
|
||||
- Support for specific decimal places, thanks to @Mortalife
|
||||
- Support for specific decimal places, thanks to [Mortalife](https://github.com/Mortalife)
|
||||
- Various CSS fixes
|
||||
- Various bugs, thanks to @fuf, @sandermulders and @vissert
|
||||
- Various bugs, thanks to [fuf](https://github.com/fuf), [sandermulders](https://github.com/sandermulders) and [vissert](https://github.com/vissert)
|
||||
- Various queries optimized for MySQL 5.7
|
||||
|
||||
## [3.10.4] - 2015-09-14
|
||||
### Fixed
|
||||
- Migration fix by @sandermulders
|
||||
- Tricky import bug fix thanks to @vissert
|
||||
- Currency preference will be correctly pulled from user settings, thanks to @fuf
|
||||
- Migration fix by [sandermulders](https://github.com/sandermulders)
|
||||
- Tricky import bug fix thanks to [vissert](https://github.com/vissert)
|
||||
- Currency preference will be correctly pulled from user settings, thanks to [fuf](https://github.com/fuf)
|
||||
- Simplified code for upgrade instructions.
|
||||
|
||||
|
||||
## [3.10.3] - 2016-08-29
|
||||
### Added
|
||||
- More fields for mass-edit, thanks to @Vissert (#282)
|
||||
- More fields for mass-edit, thanks to [vissert](https://github.com/vissert) (#282)
|
||||
- First start of German translation
|
||||
|
||||
### Changed
|
||||
@@ -283,7 +396,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Fixed
|
||||
- A bug in the translation routine broke the import.
|
||||
- It was possible to destroy your Firefly installation by removing all currencies. Thanks @mondjef
|
||||
- It was possible to destroy your Firefly installation by removing all currencies. Thanks [mondjef](https://github.com/mondjef)
|
||||
- Translation bugs.
|
||||
- Import bug.
|
||||
|
||||
@@ -303,8 +416,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Fixed
|
||||
- Bug in the mass edit routines.
|
||||
- Firefly III over a proxy will now work (see [issue #290](https://github.com/firefly-iii/firefly-iii/issues/290)), thanks @dfiel for reporting.
|
||||
- Sneaky bug in the import routine, fixed by @Bonno
|
||||
- Firefly III over a proxy will now work (see [issue #290](https://github.com/firefly-iii/firefly-iii/issues/290)), thanks [dfiel](https://github.com/dfiel) for reporting.
|
||||
- Sneaky bug in the import routine, fixed by [Bonno](https://github.com/Bonno)
|
||||
|
||||
## [3.10.1] - 2016-08-25
|
||||
### Added
|
||||
@@ -324,7 +437,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Fixed a bug where a migration would check an empty table name.
|
||||
- Fixed various bugs in the import routine.
|
||||
- Fixed various bugs in the piggy banks pages.
|
||||
- Fixed a bug in the ``firefly:verify`` routine
|
||||
- Fixed a bug in the `firefly:verify` routine
|
||||
|
||||
## [3.10] - 2015-05-25
|
||||
### Added
|
||||
@@ -342,25 +455,25 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
### Fixed
|
||||
- Issue #264
|
||||
- Issue #265
|
||||
- Fixed amount calculation problems, #266, thanks @xzaz
|
||||
- Fixed amount calculation problems, #266, thanks [xzaz](https://github.com/xzaz)
|
||||
- Issue #271
|
||||
- Issue #278, #273, thanks @StevenReitsma and @rubella
|
||||
- Issue #278, #273, thanks [StevenReitsma](https://github.com/StevenReitsma) and [rubella](https://github.com/rubella)
|
||||
- Bug in attachment download routine would report the wrong size to the user's browser.
|
||||
- Various NULL errors fixed.
|
||||
- Various strict typing errors fixed.
|
||||
- Fixed pagination problems, #276, thanks @xzaz
|
||||
- Fixed pagination problems, #276, thanks [xzaz](https://github.com/xzaz)
|
||||
- Fixed a bug where an expense would be assigned to a piggy bank if you created a transfer first.
|
||||
- Bulk update problems, #280, thanks @stickgrinder
|
||||
- Bulk update problems, #280, thanks [stickgrinder](https://github.com/stickgrinder)
|
||||
- Fixed various problems with amount reporting of split transactions.
|
||||
|
||||
[3.9.1]
|
||||
## [3.9.1]
|
||||
### Fixed
|
||||
- Fixed a bug where removing money from a piggy bank would not work. See issue #265 and #269
|
||||
|
||||
[3.9.0]
|
||||
## [3.9.0]
|
||||
### Added
|
||||
- @zjean has added code that allows you to force "https://"-URL's.
|
||||
- @tonicospinelli has added Portuguese (Brazil) translations.
|
||||
- [zjean](https://github.com/zjean) has added code that allows you to force "https://"-URL's.
|
||||
- [tonicospinelli](https://github.com/tonicospinelli) has added Portuguese (Brazil) translations.
|
||||
- Firefly III supports the *splitting* of transactions:
|
||||
- A withdrawal (expense) can be split into multiple sub-transactions (with multiple destinations)
|
||||
- Likewise for deposits (incomes). You can set multiple sources.
|
||||
@@ -391,7 +504,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
### Fixed
|
||||
- Several CSV related bugs.
|
||||
- Several other bugs.
|
||||
- Bugs fixed by @Bonno.
|
||||
- Bugs fixed by [Bonno](https://github.com/Bonno).
|
||||
|
||||
## [3.8.3] - 2016-04-17
|
||||
### Added
|
||||
@@ -438,7 +551,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
### Added
|
||||
- Two factor authentication, thanks to the excellent work of [zjean](https://github.com/zjean).
|
||||
- A new chart showing your net worth in year and multi-year reports.
|
||||
- You can now see if your current or future rules actually match any transactions, thanks to the excellent work of @roberthorlings.
|
||||
- You can now see if your current or future rules actually match any transactions, thanks to the excellent work of [roberthorlings](https://github.com/roberthorlings).
|
||||
- New date fields for transactions. They are not used yet in reports or anything, but they can be filled in.
|
||||
- New routine to export your data.
|
||||
- Firefly III will mail the site owner when blocked users try to login, or when blocked domains are used in registrations.
|
||||
|
@@ -11,12 +11,17 @@ RUN apt-get update -y && \
|
||||
libtidy-dev \
|
||||
libxml2-dev \
|
||||
libsqlite3-dev \
|
||||
libbz2-dev && \
|
||||
libbz2-dev \
|
||||
gettext-base \
|
||||
locales && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN docker-php-ext-install -j$(nproc) curl gd intl json mcrypt readline tidy zip bcmath xml mbstring pdo_sqlite pdo_mysql bz2
|
||||
|
||||
# Generate locales supported by firefly
|
||||
RUN echo "en_US.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
|
||||
|
||||
# Enable apache mod rewrite..
|
||||
RUN a2enmod rewrite
|
||||
|
||||
@@ -40,3 +45,5 @@ WORKDIR /var/www/firefly-iii
|
||||
RUN composer install --no-scripts --no-dev
|
||||
|
||||
USER root
|
||||
|
||||
ENTRYPOINT ["/var/www/firefly-iii/docker/entrypoint.sh"]
|
||||
|
1
Procfile
Normal file
@@ -0,0 +1 @@
|
||||
web: vendor/bin/heroku-php-nginx -C nginx_app.conf public/
|
10
README.md
@@ -1,6 +1,6 @@
|
||||
# Firefly III: A personal finances manager
|
||||
|
||||
[](https://secure.php.net/downloads.php#v7.0.4) [](https://packagist.org/packages/grumpydictator/firefly-iii) [](https://scrutinizer-ci.com/g/firefly-iii/firefly-iii/?branch=master) [](https://travis-ci.org/firefly-iii/firefly-iii) [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=44UKUT455HUFA)
|
||||
[](https://secure.php.net/downloads.php) [](https://packagist.org/packages/grumpydictator/firefly-iii) [](https://creativecommons.org/licenses/by-sa/4.0/) [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=44UKUT455HUFA)
|
||||
|
||||
[](https://i.nder.be/h2b37243) [](https://i.nder.be/hv70pbwc)
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
## Try it out!
|
||||
|
||||
Try out Firefly III on the [demo site](https://firefly-iii.nder.be/).
|
||||
[](https://heroku.com/deploy?template=https://github.com/firefly-iii/firefly-iii/tree/master)
|
||||
|
||||
## Installation
|
||||
|
||||
To install Firefly III, you'll need a web server (preferrably on Linux) and access to the command line. Then, please read the [installation guide](https://firefly-iii.github.io/installation-guide/).
|
||||
To install Firefly III, you'll need a web server (preferrably on Linux) and access to the command line. Then, please read the [installation guide](https://firefly-iii.github.io/using-installing.html).
|
||||
|
||||
## More about Firefly III
|
||||
|
||||
@@ -26,7 +26,7 @@ Firefly works on the principle that if you know where you're money is going, you
|
||||
|
||||
- Firefly can import any CSV file, so migrating from other systems is easy.
|
||||
- Firefly runs on your own server, so you are fully in control of your data. Remember, there is no such thing as "the cloud", it’s just somebody else’s computer!
|
||||
- Firefly has lots of features without becoming fancy or bloated.
|
||||
- Firefly has lots of features without being fancy or bloated.
|
||||
- If you feel you're missing something you can just ask me and I'll add it!
|
||||
|
||||
Firefly is pretty awesome. [You can read more about Firefly III, and its features, on the Github Pages](https://firefly-iii.github.io/).
|
||||
@@ -34,3 +34,5 @@ Firefly is pretty awesome. [You can read more about Firefly III, and its feature
|
||||
If you like Firefly and if it helps you save lots of money, why not send me [a dime for every dollar saved](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=44UKUT455HUFA) (this is a joke, although the Paypal form works just fine, try it!)
|
||||
|
||||
If you want to contact me, please open an issue or [email me](mailto:thegrumpydictator@gmail.com).
|
||||
|
||||
[](https://travis-ci.org/firefly-iii/firefly-iii) [](https://scrutinizer-ci.com/g/firefly-iii/firefly-iii/?branch=master) [](https://coveralls.io/github/firefly-iii/firefly-iii?branch=master)
|
||||
|
59
app.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "Firefly III",
|
||||
"description": "A free and open source personal finances manager",
|
||||
"repository": "https://github.com/firefly-iii/firefly-iii",
|
||||
"logo": "https://raw.githubusercontent.com/firefly-iii/firefly-iii/master/public/mstile-150x150.png",
|
||||
"keywords": [
|
||||
"finance",
|
||||
"finances",
|
||||
"manager",
|
||||
"management",
|
||||
"euro",
|
||||
"dollar",
|
||||
"laravel",
|
||||
"money",
|
||||
"currency",
|
||||
"financials",
|
||||
"financial",
|
||||
"budgets",
|
||||
"administration",
|
||||
"tool",
|
||||
"tooling",
|
||||
"help",
|
||||
"helper",
|
||||
"assistant",
|
||||
"planning",
|
||||
"organizing",
|
||||
"bills",
|
||||
"personal finance",
|
||||
"budgets",
|
||||
"budgeting",
|
||||
"budgeting tool",
|
||||
"budgeting application",
|
||||
"transactions",
|
||||
"self hosted",
|
||||
"self-hosted",
|
||||
"transfers",
|
||||
"management"
|
||||
],
|
||||
"website": "https://firefly-iii.github.io/",
|
||||
"addons": [
|
||||
{
|
||||
"plan": "heroku-postgresql"
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"postdeploy": "export APP_KEY=$(php artisan --no-ansi key:generate --show)"
|
||||
},
|
||||
"buildpacks": [
|
||||
{
|
||||
"url": "heroku/php"
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"APP_KEY": {
|
||||
"description": "This key is used to encrypt your data.",
|
||||
"value": "base64:If1gJN4pyycXTq+WS5TjneDympKuu+8SKvTl6RZnhJg="
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* ConfigureLogging.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
*
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Bootstrap;
|
||||
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Foundation\Bootstrap\ConfigureLogging as IlluminateConfigureLogging;
|
||||
use Illuminate\Log\Writer;
|
||||
|
||||
/**
|
||||
* Class ConfigureLogging
|
||||
*
|
||||
* @package FireflyIII\Bootstrap
|
||||
*/
|
||||
class ConfigureLogging extends IlluminateConfigureLogging
|
||||
{
|
||||
|
||||
/**
|
||||
* Configure the Monolog handlers for the application.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Foundation\Application $app
|
||||
* @param \Illuminate\Log\Writer $log
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureDailyHandler(Application $app, Writer $log)
|
||||
{
|
||||
$config = $app->make('config');
|
||||
|
||||
$maxFiles = $config->get('app.log_max_files');
|
||||
|
||||
$log->useDailyFiles(
|
||||
$app->storagePath() . '/logs/firefly-iii.log', is_null($maxFiles) ? 5 : $maxFiles,
|
||||
$config->get('app.log_level', 'debug')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the Monolog handlers for the application.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Foundation\Application $app
|
||||
* @param \Illuminate\Log\Writer $log
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureSingleHandler(Application $app, Writer $log)
|
||||
{
|
||||
$log->useFiles(
|
||||
$app->storagePath() . '/logs/firefly-iii.log',
|
||||
$app->make('config')->get('app.log_level', 'debug')
|
||||
);
|
||||
}
|
||||
}
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -79,11 +79,12 @@ class CreateImport extends Command
|
||||
$this->info(sprintf('Type of import: %s', $type));
|
||||
|
||||
/** @var ImportJobRepositoryInterface $jobRepository */
|
||||
$jobRepository = app(ImportJobRepositoryInterface::class, [$user]);
|
||||
$job = $jobRepository->create($type);
|
||||
$jobRepository = app(ImportJobRepositoryInterface::class);
|
||||
$jobRepository->setUser($user);
|
||||
$job = $jobRepository->create($type);
|
||||
$this->line(sprintf('Created job "%s"...', $job->key));
|
||||
|
||||
Artisan::call('firefly:encrypt', ['file' => $file, 'key' => $job->key]);
|
||||
Artisan::call('firefly:encrypt-file', ['file' => $file, 'key' => $job->key]);
|
||||
$this->line('Stored import data...');
|
||||
|
||||
$job->configuration = $configurationData;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -35,7 +35,7 @@ class EncryptFile extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'firefly:encrypt {file} {key}';
|
||||
protected $signature = 'firefly:encrypt-file {file} {key}';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -58,7 +58,12 @@ class Import extends Command
|
||||
{
|
||||
Log::debug('Start start-import command');
|
||||
$jobKey = $this->argument('key');
|
||||
$job = ImportJob::whereKey($jobKey)->first();
|
||||
$job = ImportJob::where('key', $jobKey)->first();
|
||||
if (is_null($job)) {
|
||||
$this->error(sprintf('No job found with key "%s"', $jobKey));
|
||||
|
||||
return;
|
||||
}
|
||||
if (!$this->isValid($job)) {
|
||||
Log::error('Job is not valid for some reason. Exit.');
|
||||
|
||||
|
@@ -1,86 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* MoveRepository.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
*
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class MoveRepository
|
||||
*
|
||||
* @package FireflyIII\Console\Commands
|
||||
*/
|
||||
class MoveRepository extends Command
|
||||
{
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Alerts the user that the Github repository will move, if they are interested to know this.';
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'firefly:github-move';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$moveDate = new Carbon('2017-01-01');
|
||||
$final = new Carbon('2017-03-01');
|
||||
$now = new Carbon;
|
||||
|
||||
// display message before 2017-01-01
|
||||
if ($moveDate > $now) {
|
||||
$this->line('+------------------------------------------------------------------------------+');
|
||||
$this->line('');
|
||||
$this->line('The Github repository for Firefly III will MOVE');
|
||||
$this->line('This move will be on January 1st 2017');
|
||||
$this->line('');
|
||||
$this->error('READ THIS WIKI PAGE FOR MORE INFORMATION');
|
||||
$this->line('');
|
||||
$this->info('https://github.com/firefly-iii/help/wiki/New-Github-repository');
|
||||
$this->line('');
|
||||
$this->line('+------------------------------------------------------------------------------+');
|
||||
}
|
||||
|
||||
// display message after 2017-01-01 but before 2017-03-01
|
||||
if ($moveDate <= $now && $now <= $final) {
|
||||
$this->line('+------------------------------------------------------------------------------+');
|
||||
$this->line('');
|
||||
$this->line('The Github repository for Firefly III has MOVED');
|
||||
$this->line('This move was on January 1st 2017!');
|
||||
$this->line('');
|
||||
$this->error('READ THIS WIKI PAGE FOR MORE INFORMATION');
|
||||
$this->line('');
|
||||
$this->info('https://github.com/firefly-iii/help/wiki/New-Github-repository');
|
||||
$this->line('');
|
||||
$this->line('+------------------------------------------------------------------------------+');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
|
@@ -9,19 +9,28 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountMeta;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Models\LimitRepetition;
|
||||
use FireflyIII\Models\PiggyBankEvent;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Log;
|
||||
use Preferences;
|
||||
use Schema;
|
||||
|
||||
/**
|
||||
@@ -60,8 +69,15 @@ class UpgradeDatabase extends Command
|
||||
{
|
||||
$this->setTransactionIdentifier();
|
||||
$this->migrateRepetitions();
|
||||
$this->repairPiggyBanks();
|
||||
$this->updateAccountCurrencies();
|
||||
$this->updateJournalCurrencies();
|
||||
$this->info('Firefly III database is up to date.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate budget repetitions to new format.
|
||||
*/
|
||||
private function migrateRepetitions()
|
||||
{
|
||||
if (!Schema::hasTable('budget_limits')) {
|
||||
@@ -69,7 +85,9 @@ class UpgradeDatabase extends Command
|
||||
}
|
||||
// get all budget limits with end_date NULL
|
||||
$set = BudgetLimit::whereNull('end_date')->get();
|
||||
$this->line(sprintf('Found %d budget limit(s) to update', $set->count()));
|
||||
if ($set->count() > 0) {
|
||||
$this->line(sprintf('Found %d budget limit(s) to update', $set->count()));
|
||||
}
|
||||
/** @var BudgetLimit $budgetLimit */
|
||||
foreach ($set as $budgetLimit) {
|
||||
// get limit repetition (should be just one):
|
||||
@@ -84,6 +102,37 @@ class UpgradeDatabase extends Command
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Make sure there are only transfers linked to piggy bank events.
|
||||
*/
|
||||
private function repairPiggyBanks()
|
||||
{
|
||||
// if table does not exist, return false
|
||||
if (!Schema::hasTable('piggy_bank_events')) {
|
||||
return;
|
||||
}
|
||||
$set = PiggyBankEvent::with(['PiggyBank', 'TransactionJournal', 'TransactionJournal.TransactionType'])->get();
|
||||
/** @var PiggyBankEvent $event */
|
||||
foreach ($set as $event) {
|
||||
|
||||
if (is_null($event->transaction_journal_id)) {
|
||||
continue;
|
||||
}
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $event->transactionJournal()->first();
|
||||
if (is_null($journal)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$type = $journal->transactionType->type;
|
||||
if ($type !== TransactionType::TRANSFER) {
|
||||
$event->transaction_journal_id = null;
|
||||
$event->save();
|
||||
$this->line(sprintf('Piggy bank #%d was referenced by an invalid event. This has been fixed.', $event->piggy_bank_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is strangely complex, because the HAVING modifier is a no-no. And subqueries in Laravel are weird.
|
||||
*/
|
||||
@@ -112,6 +161,57 @@ class UpgradeDatabase extends Command
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function updateAccountCurrencies()
|
||||
{
|
||||
$accounts = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
|
||||
->whereIn('account_types.type', [AccountType::DEFAULT, AccountType::ASSET])->get(['accounts.*']);
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
// get users preference, fall back to system pref.
|
||||
$defaultCurrencyCode = Preferences::getForUser($account->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data;
|
||||
$defaultCurrency = TransactionCurrency::where('code', $defaultCurrencyCode)->first();
|
||||
$accountCurrency = intval($account->getMeta('currency_id'));
|
||||
$openingBalance = $account->getOpeningBalance();
|
||||
$openingBalanceCurrency = intval($openingBalance->transaction_currency_id);
|
||||
|
||||
// both 0? set to default currency:
|
||||
if ($accountCurrency === 0 && $openingBalanceCurrency === 0) {
|
||||
AccountMeta::create(['account_id' => $account->id, 'name' => 'currency_id', 'data' => $defaultCurrency->id]);
|
||||
$this->line(sprintf('Account #%d ("%s") now has a currency setting (%s).', $account->id, $account->name, $defaultCurrencyCode));
|
||||
continue;
|
||||
}
|
||||
|
||||
// opening balance 0, account not zero? just continue:
|
||||
if ($accountCurrency > 0 && $openingBalanceCurrency === 0) {
|
||||
continue;
|
||||
}
|
||||
// account is set to 0, opening balance is not?
|
||||
if ($accountCurrency === 0 && $openingBalanceCurrency > 0) {
|
||||
AccountMeta::create(['account_id' => $account->id, 'name' => 'currency_id', 'data' => $openingBalanceCurrency]);
|
||||
$this->line(sprintf('Account #%d ("%s") now has a currency setting (%s).', $account->id, $account->name, $defaultCurrencyCode));
|
||||
continue;
|
||||
}
|
||||
|
||||
// both are equal, just continue:
|
||||
if ($accountCurrency === $openingBalanceCurrency) {
|
||||
continue;
|
||||
}
|
||||
// do not match:
|
||||
if ($accountCurrency !== $openingBalanceCurrency) {
|
||||
// update opening balance:
|
||||
$openingBalance->transaction_currency_id = $accountCurrency;
|
||||
$openingBalance->save();
|
||||
$this->line(sprintf('Account #%d ("%s") now has a correct currency for opening balance.', $account->id, $account->name));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* grab all positive transactiosn from this journal that are not deleted. for each one, grab the negative opposing one
|
||||
* which has 0 as an identifier and give it the same identifier.
|
||||
@@ -151,9 +251,87 @@ class UpgradeDatabase extends Command
|
||||
$opposing->save();
|
||||
$processed[] = $transaction->id;
|
||||
$processed[] = $opposing->id;
|
||||
$this->line(sprintf('Database upgrade for journal #%d, transactions #%d and #%d', $journalId, $transaction->id, $opposing->id));
|
||||
}
|
||||
$identifier++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes sure that withdrawals, deposits and transfers have
|
||||
* a currency setting matching their respective accounts
|
||||
*/
|
||||
private function updateJournalCurrencies()
|
||||
{
|
||||
$types = [
|
||||
TransactionType::WITHDRAWAL => '<',
|
||||
TransactionType::DEPOSIT => '>',
|
||||
];
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$notification = '%s #%d uses %s but should use %s. It has been updated. Please verify this in Firefly III.';
|
||||
$transfer = 'Transfer #%d has been updated to use the correct currencies. Please verify this in Firefly III.';
|
||||
|
||||
foreach ($types as $type => $operator) {
|
||||
$set = TransactionJournal
|
||||
::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')->leftJoin(
|
||||
'transactions', function (JoinClause $join) use ($operator) {
|
||||
$join->on('transaction_journals.id', '=', 'transactions.transaction_journal_id')->where('transactions.amount', $operator, '0');
|
||||
}
|
||||
)
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
|
||||
->leftJoin('account_meta', 'account_meta.account_id', '=', 'accounts.id')
|
||||
->where('transaction_types.type', $type)
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('transaction_journals.transaction_currency_id', '!=', DB::raw('account_meta.data'))
|
||||
->get(['transaction_journals.*', 'account_meta.data as expected_currency_id', 'transactions.amount as transaction_amount']);
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($set as $journal) {
|
||||
$expectedCurrency = $repository->find(intval($journal->expected_currency_id));
|
||||
$line = sprintf($notification, $type, $journal->id, $journal->transactionCurrency->code, $expectedCurrency->code);
|
||||
|
||||
$journal->setMeta('foreign_amount', $journal->transaction_amount);
|
||||
$journal->setMeta('foreign_currency_id', $journal->transaction_currency_id);
|
||||
$journal->transaction_currency_id = $expectedCurrency->id;
|
||||
$journal->save();
|
||||
$this->line($line);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* For transfers it's slightly different. Both source and destination
|
||||
* must match the respective currency preference. So we must verify ALL
|
||||
* transactions.
|
||||
*/
|
||||
$set = TransactionJournal
|
||||
::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->where('transaction_types.type', TransactionType::TRANSFER)
|
||||
->get(['transaction_journals.*']);
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($set as $journal) {
|
||||
$updated = false;
|
||||
/** @var Transaction $sourceTransaction */
|
||||
$sourceTransaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||
$sourceCurrency = $repository->find(intval($sourceTransaction->account->getMeta('currency_id')));
|
||||
|
||||
if ($sourceCurrency->id !== $journal->transaction_currency_id) {
|
||||
$updated = true;
|
||||
$journal->transaction_currency_id = $sourceCurrency->id;
|
||||
$journal->save();
|
||||
}
|
||||
|
||||
// destination
|
||||
$destinationTransaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
$destinationCurrency = $repository->find(intval($destinationTransaction->account->getMeta('currency_id')));
|
||||
|
||||
if ($destinationCurrency->id !== $journal->transaction_currency_id) {
|
||||
$updated = true;
|
||||
$journal->deleteMeta('foreign_amount');
|
||||
$journal->deleteMeta('foreign_currency_id');
|
||||
$journal->setMeta('foreign_amount', $destinationTransaction->amount);
|
||||
$journal->setMeta('foreign_currency_id', $destinationCurrency->id);
|
||||
}
|
||||
if ($updated) {
|
||||
$line = sprintf($transfer, $journal->id);
|
||||
$this->line($line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -33,7 +33,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'firefly:upgrade-instructions';
|
||||
protected $signature = 'firefly:instructions {task}';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -49,11 +49,47 @@ class UpgradeFireflyInstructions extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
|
||||
if ($this->argument('task') == 'update') {
|
||||
$this->updateInstructions();
|
||||
}
|
||||
if ($this->argument('task') == 'install') {
|
||||
$this->installInstructions();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a nice box
|
||||
*
|
||||
* @param string $text
|
||||
*/
|
||||
private function boxed(string $text)
|
||||
{
|
||||
$parts = explode("\n", wordwrap($text));
|
||||
foreach ($parts as $string) {
|
||||
$this->line('| ' . sprintf('%-77s', $string) . '|');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a nice info box
|
||||
*
|
||||
* @param string $text
|
||||
*/
|
||||
private function boxedInfo(string $text)
|
||||
{
|
||||
$parts = explode("\n", wordwrap($text));
|
||||
foreach ($parts as $string) {
|
||||
$this->info('| ' . sprintf('%-77s', $string) . '|');
|
||||
}
|
||||
}
|
||||
|
||||
private function installInstructions()
|
||||
{
|
||||
/** @var string $version */
|
||||
$version = config('firefly.version');
|
||||
$config = config('upgrade.text');
|
||||
$text = null;
|
||||
$config = config('upgrade.text.install');
|
||||
$text = '';
|
||||
foreach (array_keys($config) as $compare) {
|
||||
// if string starts with:
|
||||
$len = strlen($compare);
|
||||
@@ -62,22 +98,69 @@ class UpgradeFireflyInstructions extends Command
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->showLine();
|
||||
$this->boxed('');
|
||||
if (is_null($text)) {
|
||||
$this->line(sprintf('Thank you for installing Firefly III, v%s', $version));
|
||||
$this->info('There are no extra upgrade instructions.');
|
||||
$this->line('Firefly III should be ready for use.');
|
||||
|
||||
$this->boxed(sprintf('Thank you for installin Firefly III, v%s!', $version));
|
||||
$this->boxedInfo('There are no extra installation instructions.');
|
||||
$this->boxed('Firefly III should be ready for use.');
|
||||
$this->boxed('');
|
||||
$this->showLine();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->line('+------------------------------------------------------------------------------+');
|
||||
$this->line('');
|
||||
$this->line(sprintf('Thank you for installing Firefly III, v%s', $version));
|
||||
$this->info(wordwrap($text));
|
||||
$this->line('');
|
||||
$this->line('+------------------------------------------------------------------------------+');
|
||||
$this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version));
|
||||
$this->boxedInfo($text);
|
||||
$this->boxed('');
|
||||
$this->showLine();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a line
|
||||
*/
|
||||
private function showLine()
|
||||
{
|
||||
$line = '+';
|
||||
for ($i = 0; $i < 78; $i++) {
|
||||
$line .= '-';
|
||||
}
|
||||
$line .= '+';
|
||||
$this->line($line);
|
||||
|
||||
}
|
||||
|
||||
private function updateInstructions()
|
||||
{
|
||||
/** @var string $version */
|
||||
$version = config('firefly.version');
|
||||
$config = config('upgrade.text.upgrade');
|
||||
$text = '';
|
||||
foreach (array_keys($config) as $compare) {
|
||||
// if string starts with:
|
||||
$len = strlen($compare);
|
||||
if (substr($version, 0, $len) === $compare) {
|
||||
$text = $config[$compare];
|
||||
}
|
||||
|
||||
}
|
||||
$this->showLine();
|
||||
$this->boxed('');
|
||||
if (is_null($text)) {
|
||||
|
||||
$this->boxed(sprintf('Thank you for updating to Firefly III, v%s', $version));
|
||||
$this->boxedInfo('There are no extra upgrade instructions.');
|
||||
$this->boxed('Firefly III should be ready for use.');
|
||||
$this->boxed('');
|
||||
$this->showLine();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->boxed(sprintf('Thank you for updating to Firefly III, v%s!', $version));
|
||||
$this->boxedInfo($text);
|
||||
$this->boxed('');
|
||||
$this->showLine();
|
||||
}
|
||||
}
|
||||
|
66
app/Console/Commands/UseEncryption.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UseEncryption extends Command
|
||||
{
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'This command will make sure that entries in the database will be encrypted (or not) according to the settings in .env';
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'firefly:use-encryption';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
//
|
||||
$this->handleObjects('Account', 'name', 'encrypted');
|
||||
$this->handleObjects('Bill', 'name', 'name_encrypted');
|
||||
$this->handleObjects('Bill', 'match', 'match_encrypted');
|
||||
$this->handleObjects('Budget', 'name', 'encrypted');
|
||||
$this->handleObjects('Category', 'name', 'encrypted');
|
||||
$this->handleObjects('PiggyBank', 'name', 'encrypted');
|
||||
$this->handleObjects('TransactionJournal', 'description', 'encrypted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $field
|
||||
* @param string $indicator
|
||||
*/
|
||||
public function handleObjects(string $class, string $field, string $indicator)
|
||||
{
|
||||
$fqn = sprintf('FireflyIII\Models\%s', $class);
|
||||
$encrypt = config('firefly.encryption') ? 0 : 1;
|
||||
$set = $fqn::where($indicator, $encrypt)->get();
|
||||
|
||||
foreach ($set as $entry) {
|
||||
$newName = $entry->$field;
|
||||
$entry->$field = $newName;
|
||||
$entry->save();
|
||||
}
|
||||
|
||||
$this->line(sprintf('Updated %d %s.', $set->count(), strtolower(Str::plural($class))));
|
||||
}
|
||||
}
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -93,6 +93,7 @@ class VerifyDatabase extends Command
|
||||
|
||||
// report on journals with the wrong types of accounts.
|
||||
$this->reportIncorrectJournals();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +132,7 @@ class VerifyDatabase extends Command
|
||||
/** @var Budget $entry */
|
||||
foreach ($set as $entry) {
|
||||
$line = sprintf(
|
||||
'Notice: User #%d (%s) has budget #%d ("%s") which has no budget limits.',
|
||||
'User #%d (%s) has budget #%d ("%s") which has no budget limits.',
|
||||
$entry->user_id, $entry->email, $entry->id, $entry->name
|
||||
);
|
||||
$this->line($line);
|
||||
@@ -277,7 +278,7 @@ class VerifyDatabase extends Command
|
||||
}
|
||||
|
||||
$line = sprintf(
|
||||
'Notice: User #%d (%s) has %s #%d ("%s") which has no transactions.',
|
||||
'User #%d (%s) has %s #%d ("%s") which has no transactions.',
|
||||
$entry->user_id, $entry->email, $name, $entry->id, $objName
|
||||
);
|
||||
$this->line($line);
|
||||
|
@@ -9,17 +9,17 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console;
|
||||
|
||||
use FireflyIII\Console\Commands\CreateImport;
|
||||
use FireflyIII\Console\Commands\EncryptFile;
|
||||
use FireflyIII\Console\Commands\Import;
|
||||
use FireflyIII\Console\Commands\MoveRepository;
|
||||
use FireflyIII\Console\Commands\ScanAttachments;
|
||||
use FireflyIII\Console\Commands\UpgradeDatabase;
|
||||
use FireflyIII\Console\Commands\UpgradeFireflyInstructions;
|
||||
use FireflyIII\Console\Commands\UseEncryption;
|
||||
use FireflyIII\Console\Commands\VerifyDatabase;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
@@ -39,9 +39,8 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected $bootstrappers
|
||||
= [
|
||||
'Illuminate\Foundation\Bootstrap\DetectEnvironment',
|
||||
'Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables',
|
||||
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
|
||||
'FireflyIII\Bootstrap\ConfigureLogging',
|
||||
'Illuminate\Foundation\Bootstrap\HandleExceptions',
|
||||
'Illuminate\Foundation\Bootstrap\RegisterFacades',
|
||||
'Illuminate\Foundation\Bootstrap\SetRequestForConsole',
|
||||
@@ -63,7 +62,7 @@ class Kernel extends ConsoleKernel
|
||||
EncryptFile::class,
|
||||
ScanAttachments::class,
|
||||
UpgradeDatabase::class,
|
||||
MoveRepository::class,
|
||||
UseEncryption::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
/**
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
use ErrorException;
|
||||
@@ -97,6 +98,7 @@ class Handler extends ExceptionHandler
|
||||
'file' => $exception->getFile(),
|
||||
'line' => $exception->getLine(),
|
||||
'code' => $exception->getCode(),
|
||||
'version' => config('firefly.version'),
|
||||
];
|
||||
|
||||
// create job that will mail.
|
||||
@@ -111,9 +113,9 @@ class Handler extends ExceptionHandler
|
||||
/**
|
||||
* Convert an authentication exception into an unauthenticated response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param $request
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
protected function unauthenticated($request)
|
||||
{
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
/**
|
||||
|
@@ -9,14 +9,13 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Crypt;
|
||||
use FireflyIII\Models\Attachment;
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -43,10 +42,8 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
|
||||
|
||||
/**
|
||||
* AttachmentCollector constructor.
|
||||
*
|
||||
* @param ExportJob $job
|
||||
*/
|
||||
public function __construct(ExportJob $job)
|
||||
public function __construct()
|
||||
{
|
||||
/** @var AttachmentRepositoryInterface repository */
|
||||
$this->repository = app(AttachmentRepositoryInterface::class);
|
||||
@@ -54,7 +51,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
|
||||
$this->uploadDisk = Storage::disk('upload');
|
||||
$this->exportDisk = Storage::disk('export');
|
||||
|
||||
parent::__construct($job);
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
@@ -31,13 +31,10 @@ class BasicCollector
|
||||
|
||||
/**
|
||||
* BasicCollector constructor.
|
||||
*
|
||||
* @param ExportJob $job
|
||||
*/
|
||||
public function __construct(ExportJob $job)
|
||||
public function __construct()
|
||||
{
|
||||
$this->entries = new Collection;
|
||||
$this->job = $job;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,5 +53,13 @@ class BasicCollector
|
||||
$this->entries = $entries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ExportJob $job
|
||||
*/
|
||||
public function setJob(ExportJob $job)
|
||||
{
|
||||
$this->job = $job;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -9,10 +9,11 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -40,4 +41,11 @@ interface CollectorInterface
|
||||
*/
|
||||
public function setEntries(Collection $entries);
|
||||
|
||||
/**
|
||||
* @param ExportJob $job
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function setJob(ExportJob $job);
|
||||
|
||||
}
|
||||
|
@@ -9,16 +9,16 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Crypt;
|
||||
use DB;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use Illuminate\Support\Collection;
|
||||
use Steam;
|
||||
|
||||
/**
|
||||
* Class JournalExportCollector
|
||||
@@ -118,7 +118,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
|
||||
);
|
||||
$set->each(
|
||||
function ($obj) {
|
||||
$obj->name = $obj->encrypted === 1 ? Crypt::decrypt($obj->name) : $obj->name;
|
||||
$obj->name = Steam::decrypt(intval($obj->encrypted), $obj->name);
|
||||
}
|
||||
);
|
||||
$array = [];
|
||||
@@ -159,7 +159,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
|
||||
);
|
||||
$set->each(
|
||||
function ($obj) {
|
||||
$obj->name = $obj->encrypted === 1 ? Crypt::decrypt($obj->name) : $obj->name;
|
||||
$obj->name = Steam::decrypt(intval($obj->encrypted), $obj->name);
|
||||
}
|
||||
);
|
||||
$array = [];
|
||||
@@ -202,7 +202,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
|
||||
);
|
||||
$set->each(
|
||||
function ($obj) {
|
||||
$obj->name = $obj->encrypted === 1 ? Crypt::decrypt($obj->name) : $obj->name;
|
||||
$obj->name = Steam::decrypt(intval($obj->encrypted), $obj->name);
|
||||
}
|
||||
);
|
||||
$array = [];
|
||||
@@ -243,7 +243,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
|
||||
);
|
||||
$set->each(
|
||||
function ($obj) {
|
||||
$obj->name = $obj->encrypted === 1 ? Crypt::decrypt($obj->name) : $obj->name;
|
||||
$obj->name = Steam::decrypt(intval($obj->encrypted), $obj->name);
|
||||
}
|
||||
);
|
||||
$array = [];
|
||||
|
@@ -9,12 +9,11 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
use Crypt;
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Log;
|
||||
use Storage;
|
||||
@@ -35,22 +34,12 @@ class UploadCollector extends BasicCollector implements CollectorInterface
|
||||
|
||||
/**
|
||||
* AttachmentCollector constructor.
|
||||
*
|
||||
* @param ExportJob $job
|
||||
*/
|
||||
public function __construct(ExportJob $job)
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($job);
|
||||
|
||||
Log::debug('Going to collect attachments', ['key' => $job->key]);
|
||||
|
||||
// make storage:
|
||||
parent::__construct();
|
||||
$this->uploadDisk = Storage::disk('upload');
|
||||
$this->exportDisk = Storage::disk('export');
|
||||
|
||||
// file names associated with the old import routine.
|
||||
$this->vintageFormat = sprintf('csv-upload-%d-', auth()->user()->id);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,6 +49,11 @@ class UploadCollector extends BasicCollector implements CollectorInterface
|
||||
*/
|
||||
public function run(): bool
|
||||
{
|
||||
Log::debug('Going to collect attachments', ['key' => $this->job->key]);
|
||||
|
||||
// file names associated with the old import routine.
|
||||
$this->vintageFormat = sprintf('csv-upload-%d-', $this->job->user->id);
|
||||
|
||||
// collect old upload files (names beginning with "csv-upload".
|
||||
$this->collectVintageUploads();
|
||||
|
||||
|
@@ -9,11 +9,11 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Entry;
|
||||
|
||||
use Crypt;
|
||||
use Steam;
|
||||
|
||||
/**
|
||||
* To extend the exported object, in case of new features in Firefly III for example,
|
||||
@@ -51,7 +51,6 @@ final class Entry
|
||||
public $destination_account_id;
|
||||
public $destination_account_name;
|
||||
|
||||
|
||||
public $budget_id;
|
||||
public $budget_name;
|
||||
public $category_id;
|
||||
@@ -74,15 +73,15 @@ final class Entry
|
||||
{
|
||||
$entry = new self;
|
||||
$entry->journal_id = $object->transaction_journal_id;
|
||||
$entry->description = self::decrypt($object->journal_encrypted, $object->journal_description);
|
||||
$entry->description = Steam::decrypt(intval($object->journal_encrypted), $object->journal_description);
|
||||
$entry->amount = $object->amount;
|
||||
$entry->date = $object->date;
|
||||
$entry->transaction_type = $object->transaction_type;
|
||||
$entry->currency_code = $object->transaction_currency_code;
|
||||
$entry->source_account_id = $object->account_id;
|
||||
$entry->source_account_name = self::decrypt($object->account_name_encrypted, $object->account_name);
|
||||
$entry->source_account_name = Steam::decrypt(intval($object->account_name_encrypted), $object->account_name);
|
||||
$entry->destination_account_id = $object->opposing_account_id;
|
||||
$entry->destination_account_name = self::decrypt($object->opposing_account_encrypted, $object->opposing_account_name);
|
||||
$entry->destination_account_name = Steam::decrypt(intval($object->opposing_account_encrypted), $object->opposing_account_name);
|
||||
$entry->category_id = $object->category_id ?? '';
|
||||
$entry->category_name = $object->category_name ?? '';
|
||||
$entry->budget_id = $object->budget_id ?? '';
|
||||
@@ -96,19 +95,5 @@ final class Entry
|
||||
return $entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $isEncrypted
|
||||
* @param $value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected static function decrypt(int $isEncrypted, $value)
|
||||
{
|
||||
if ($isEncrypted === 1) {
|
||||
return Crypt::decrypt($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Exporter;
|
||||
|
||||
@@ -26,17 +26,15 @@ class BasicExporter
|
||||
{
|
||||
/** @var ExportJob */
|
||||
protected $job;
|
||||
private $entries;
|
||||
/** @var Collection */
|
||||
private $entries;
|
||||
|
||||
/**
|
||||
* BasicExporter constructor.
|
||||
*
|
||||
* @param ExportJob $job
|
||||
*/
|
||||
public function __construct(ExportJob $job)
|
||||
public function __construct()
|
||||
{
|
||||
$this->entries = new Collection;
|
||||
$this->job = $job;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,5 +53,13 @@ class BasicExporter
|
||||
$this->entries = $entries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ExportJob $job
|
||||
*/
|
||||
public function setJob(ExportJob $job)
|
||||
{
|
||||
$this->job = $job;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -9,12 +9,11 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Exporter;
|
||||
|
||||
use FireflyIII\Export\Entry\Entry;
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use League\Csv\Writer;
|
||||
use SplFileObject;
|
||||
|
||||
@@ -30,13 +29,10 @@ class CsvExporter extends BasicExporter implements ExporterInterface
|
||||
|
||||
/**
|
||||
* CsvExporter constructor.
|
||||
*
|
||||
* @param ExportJob $job
|
||||
*/
|
||||
public function __construct(ExportJob $job)
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($job);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -9,10 +9,11 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Exporter;
|
||||
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@@ -45,4 +46,9 @@ interface ExporterInterface
|
||||
*/
|
||||
public function setEntries(Collection $entries);
|
||||
|
||||
/**
|
||||
* @param ExportJob $job
|
||||
*/
|
||||
public function setJob(ExportJob $job);
|
||||
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export;
|
||||
|
||||
@@ -19,7 +19,6 @@ use FireflyIII\Export\Collector\JournalExportCollector;
|
||||
use FireflyIII\Export\Collector\UploadCollector;
|
||||
use FireflyIII\Export\Entry\Entry;
|
||||
use FireflyIII\Models\ExportJob;
|
||||
use Illuminate\Filesystem\FilesystemAdapter;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use Storage;
|
||||
@@ -54,21 +53,12 @@ class Processor implements ProcessorInterface
|
||||
|
||||
/**
|
||||
* Processor constructor.
|
||||
*
|
||||
* @param array $settings
|
||||
*/
|
||||
public function __construct(array $settings)
|
||||
public function __construct()
|
||||
{
|
||||
// save settings
|
||||
$this->settings = $settings;
|
||||
$this->accounts = $settings['accounts'];
|
||||
$this->exportFormat = $settings['exportFormat'];
|
||||
$this->includeAttachments = $settings['includeAttachments'];
|
||||
$this->includeOldUploads = $settings['includeOldUploads'];
|
||||
$this->job = $settings['job'];
|
||||
$this->journals = new Collection;
|
||||
$this->exportEntries = new Collection;
|
||||
$this->files = new Collection;
|
||||
$this->journals = new Collection;
|
||||
$this->exportEntries = new Collection;
|
||||
$this->files = new Collection;
|
||||
|
||||
}
|
||||
|
||||
@@ -78,7 +68,8 @@ class Processor implements ProcessorInterface
|
||||
public function collectAttachments(): bool
|
||||
{
|
||||
/** @var AttachmentCollector $attachmentCollector */
|
||||
$attachmentCollector = app(AttachmentCollector::class, [$this->job]);
|
||||
$attachmentCollector = app(AttachmentCollector::class);
|
||||
$attachmentCollector->setJob($this->job);
|
||||
$attachmentCollector->setDates($this->settings['startDate'], $this->settings['endDate']);
|
||||
$attachmentCollector->run();
|
||||
$this->files = $this->files->merge($attachmentCollector->getEntries());
|
||||
@@ -92,7 +83,8 @@ class Processor implements ProcessorInterface
|
||||
public function collectJournals(): bool
|
||||
{
|
||||
/** @var JournalExportCollector $collector */
|
||||
$collector = app(JournalExportCollector::class, [$this->job]);
|
||||
$collector = app(JournalExportCollector::class);
|
||||
$collector->setJob($this->job);
|
||||
$collector->setDates($this->settings['startDate'], $this->settings['endDate']);
|
||||
$collector->setAccounts($this->settings['accounts']);
|
||||
$collector->run();
|
||||
@@ -108,7 +100,8 @@ class Processor implements ProcessorInterface
|
||||
public function collectOldUploads(): bool
|
||||
{
|
||||
/** @var UploadCollector $uploadCollector */
|
||||
$uploadCollector = app(UploadCollector::class, [$this->job]);
|
||||
$uploadCollector = app(UploadCollector::class);
|
||||
$uploadCollector->setJob($this->job);
|
||||
$uploadCollector->run();
|
||||
|
||||
$this->files = $this->files->merge($uploadCollector->getEntries());
|
||||
@@ -166,7 +159,8 @@ class Processor implements ProcessorInterface
|
||||
public function exportJournals(): bool
|
||||
{
|
||||
$exporterClass = config('firefly.export_formats.' . $this->exportFormat);
|
||||
$exporter = app($exporterClass, [$this->job]);
|
||||
$exporter = app($exporterClass);
|
||||
$exporter->setJob($this->job);
|
||||
$exporter->setEntries($this->exportEntries);
|
||||
$exporter->run();
|
||||
$this->files->push($exporter->getFileName());
|
||||
@@ -182,6 +176,20 @@ class Processor implements ProcessorInterface
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $settings
|
||||
*/
|
||||
public function setSettings(array $settings)
|
||||
{
|
||||
// save settings
|
||||
$this->settings = $settings;
|
||||
$this->accounts = $settings['accounts'];
|
||||
$this->exportFormat = $settings['exportFormat'];
|
||||
$this->includeAttachments = $settings['includeAttachments'];
|
||||
$this->includeOldUploads = $settings['includeOldUploads'];
|
||||
$this->job = $settings['job'];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export;
|
||||
|
||||
@@ -25,11 +25,8 @@ interface ProcessorInterface
|
||||
|
||||
/**
|
||||
* Processor constructor.
|
||||
*
|
||||
* @param array $settings
|
||||
*
|
||||
*/
|
||||
public function __construct(array $settings);
|
||||
public function __construct();
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
@@ -65,4 +62,9 @@ interface ProcessorInterface
|
||||
* @return Collection
|
||||
*/
|
||||
public function getFiles(): Collection;
|
||||
|
||||
/**
|
||||
* @param array $settings
|
||||
*/
|
||||
public function setSettings(array $settings);
|
||||
}
|
||||
|
@@ -9,11 +9,12 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Chart\Basic;
|
||||
|
||||
use FireflyIII\Support\ChartColour;
|
||||
use Steam;
|
||||
|
||||
/**
|
||||
* Class ChartJsGenerator
|
||||
@@ -80,6 +81,9 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
if (isset($set['fill'])) {
|
||||
$currentSet['fill'] = $set['fill'];
|
||||
}
|
||||
if (isset($set['currency_symbol'])) {
|
||||
$currentSet['currency_symbol'] = $set['currency_symbol'];
|
||||
}
|
||||
|
||||
$chartData['datasets'][] = $currentSet;
|
||||
}
|
||||
@@ -104,15 +108,15 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
],
|
||||
'labels' => [],
|
||||
];
|
||||
|
||||
// sort by value, keep keys.
|
||||
asort($data);
|
||||
|
||||
$index = 0;
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
// make larger than 0
|
||||
if (bccomp($value, '0') === -1) {
|
||||
$value = bcmul($value, '-1');
|
||||
}
|
||||
|
||||
$chartData['datasets'][0]['data'][] = $value;
|
||||
$chartData['datasets'][0]['data'][] = floatval(Steam::positive($value));
|
||||
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
|
||||
$chartData['labels'][] = $key;
|
||||
$index++;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Chart\Basic;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Audit;
|
||||
|
||||
@@ -129,6 +129,16 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param Carbon $date
|
||||
@@ -139,7 +149,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts(new Collection([$account]))->setRange($this->start, $this->end);
|
||||
$journals = $collector->getJournals();
|
||||
$journals = $journals->reverse();
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Audit;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Audit;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Budget;
|
||||
|
||||
@@ -132,51 +132,19 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
* @param int $sortFlag
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return array
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
private function getAverages(Collection $collection, int $sortFlag): array
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface
|
||||
{
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
// opposing name and ID:
|
||||
$opposingId = $transaction->opposing_account_id;
|
||||
|
||||
// is not set?
|
||||
if (!isset($result[$opposingId])) {
|
||||
$name = $transaction->opposing_account_name;
|
||||
$result[$opposingId] = [
|
||||
'name' => $name,
|
||||
'count' => 1,
|
||||
'id' => $opposingId,
|
||||
'average' => $transaction->transaction_amount,
|
||||
'sum' => $transaction->transaction_amount,
|
||||
];
|
||||
continue;
|
||||
}
|
||||
$result[$opposingId]['count']++;
|
||||
$result[$opposingId]['sum'] = bcadd($result[$opposingId]['sum'], $transaction->transaction_amount);
|
||||
$result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], strval($result[$opposingId]['count']));
|
||||
}
|
||||
|
||||
// sort result by average:
|
||||
$average = [];
|
||||
foreach ($result as $key => $row) {
|
||||
$average[$key] = floatval($row['average']);
|
||||
}
|
||||
|
||||
array_multisort($average, $sortFlag, $result);
|
||||
|
||||
return $result;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
private function getExpenses(): Collection
|
||||
protected function getExpenses(): Collection
|
||||
{
|
||||
if ($this->expenses->count() > 0) {
|
||||
Log::debug('Return previous set of expenses.');
|
||||
@@ -185,7 +153,7 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
|
||||
->setTypes([TransactionType::WITHDRAWAL])
|
||||
->setBudgets($this->budgets)->withOpposingAccount()->disableFilter();
|
||||
@@ -198,34 +166,6 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
private function getTopExpenses(): Collection
|
||||
{
|
||||
$transactions = $this->getExpenses()->sortBy('transaction_amount');
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function summarizeByAccount(Collection $collection): array
|
||||
{
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$accountId = $transaction->account_id;
|
||||
$result[$accountId] = $result[$accountId] ?? '0';
|
||||
$result[$accountId] = bcadd($transaction->transaction_amount, $result[$accountId]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Budget;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Budget;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Category;
|
||||
|
||||
@@ -142,51 +142,19 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
* @param int $sortFlag
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return array
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
private function getAverages(Collection $collection, int $sortFlag): array
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface
|
||||
{
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
// opposing name and ID:
|
||||
$opposingId = $transaction->opposing_account_id;
|
||||
|
||||
// is not set?
|
||||
if (!isset($result[$opposingId])) {
|
||||
$name = $transaction->opposing_account_name;
|
||||
$result[$opposingId] = [
|
||||
'name' => $name,
|
||||
'count' => 1,
|
||||
'id' => $opposingId,
|
||||
'average' => $transaction->transaction_amount,
|
||||
'sum' => $transaction->transaction_amount,
|
||||
];
|
||||
continue;
|
||||
}
|
||||
$result[$opposingId]['count']++;
|
||||
$result[$opposingId]['sum'] = bcadd($result[$opposingId]['sum'], $transaction->transaction_amount);
|
||||
$result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], strval($result[$opposingId]['count']));
|
||||
}
|
||||
|
||||
// sort result by average:
|
||||
$average = [];
|
||||
foreach ($result as $key => $row) {
|
||||
$average[$key] = floatval($row['average']);
|
||||
}
|
||||
|
||||
array_multisort($average, $sortFlag, $result);
|
||||
|
||||
return $result;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
private function getExpenses(): Collection
|
||||
protected function getExpenses(): Collection
|
||||
{
|
||||
if ($this->expenses->count() > 0) {
|
||||
Log::debug('Return previous set of expenses.');
|
||||
@@ -195,7 +163,7 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
}
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
|
||||
->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
|
||||
->setCategories($this->categories)->withOpposingAccount()->disableFilter();
|
||||
@@ -211,14 +179,14 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
private function getIncome(): Collection
|
||||
protected function getIncome(): Collection
|
||||
{
|
||||
if ($this->income->count() > 0) {
|
||||
return $this->income;
|
||||
}
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
|
||||
->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
|
||||
->setCategories($this->categories)->withOpposingAccount();
|
||||
@@ -230,85 +198,6 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five.
|
||||
* @param array $spent
|
||||
* @param array $earned
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getObjectSummary(array $spent, array $earned): array
|
||||
{
|
||||
$return = [];
|
||||
|
||||
/**
|
||||
* @var int $accountId
|
||||
* @var string $entry
|
||||
*/
|
||||
foreach ($spent as $objectId => $entry) {
|
||||
if (!isset($return[$objectId])) {
|
||||
$return[$objectId] = ['spent' => 0, 'earned' => 0];
|
||||
}
|
||||
|
||||
$return[$objectId]['spent'] = $entry;
|
||||
}
|
||||
unset($entry);
|
||||
|
||||
/**
|
||||
* @var int $accountId
|
||||
* @var string $entry
|
||||
*/
|
||||
foreach ($earned as $objectId => $entry) {
|
||||
if (!isset($return[$objectId])) {
|
||||
$return[$objectId] = ['spent' => 0, 'earned' => 0];
|
||||
}
|
||||
|
||||
$return[$objectId]['earned'] = $entry;
|
||||
}
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
private function getTopExpenses(): Collection
|
||||
{
|
||||
$transactions = $this->getExpenses()->sortBy('transaction_amount');
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
private function getTopIncome(): Collection
|
||||
{
|
||||
$transactions = $this->getIncome()->sortByDesc('transaction_amount');
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function summarizeByAccount(Collection $collection): array
|
||||
{
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$accountId = $transaction->account_id;
|
||||
$result[$accountId] = $result[$accountId] ?? '0';
|
||||
$result[$accountId] = bcadd($transaction->transaction_amount, $result[$accountId]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Category;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace FireflyIII\Generator\Report\Category;
|
||||
/**
|
||||
* Class MultiYearReportGenerator
|
||||
*
|
||||
* @package FireflyIII\Generator\Report\Audit
|
||||
* @package FireflyIII\Generator\Report\Category
|
||||
*/
|
||||
class MultiYearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Category;
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace FireflyIII\Generator\Report\Category;
|
||||
/**
|
||||
* Class YearReportGenerator
|
||||
*
|
||||
* @package FireflyIII\Generator\Report\Audit
|
||||
* @package FireflyIII\Generator\Report\Category
|
||||
*/
|
||||
class YearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report;
|
||||
|
||||
@@ -49,7 +49,7 @@ class ReportGeneratorFactory
|
||||
$class = sprintf('FireflyIII\Generator\Report\%s\%sReportGenerator', $type, $period);
|
||||
if (class_exists($class)) {
|
||||
/** @var ReportGeneratorInterface $obj */
|
||||
$obj = new $class;
|
||||
$obj = app($class);
|
||||
$obj->setStartDate($start);
|
||||
$obj->setEndDate($end);
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report;
|
||||
|
||||
@@ -64,4 +64,11 @@ interface ReportGeneratorInterface
|
||||
*/
|
||||
public function setStartDate(Carbon $date): ReportGeneratorInterface;
|
||||
|
||||
/**
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface;
|
||||
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Standard;
|
||||
|
||||
@@ -106,4 +106,14 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Standard;
|
||||
|
||||
@@ -103,4 +103,14 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Standard;
|
||||
|
||||
@@ -103,4 +103,14 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report;
|
||||
|
||||
@@ -80,4 +80,124 @@ class Support
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getTopExpenses(): Collection
|
||||
{
|
||||
$transactions = $this->getExpenses()->sortBy('transaction_amount');
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getTopIncome(): Collection
|
||||
{
|
||||
$transactions = $this->getIncome()->sortByDesc('transaction_amount');
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
* @param int $sortFlag
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getAverages(Collection $collection, int $sortFlag): array
|
||||
{
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
// opposing name and ID:
|
||||
$opposingId = $transaction->opposing_account_id;
|
||||
|
||||
// is not set?
|
||||
if (!isset($result[$opposingId])) {
|
||||
$name = $transaction->opposing_account_name;
|
||||
$result[$opposingId] = [
|
||||
'name' => $name,
|
||||
'count' => 1,
|
||||
'id' => $opposingId,
|
||||
'average' => $transaction->transaction_amount,
|
||||
'sum' => $transaction->transaction_amount,
|
||||
];
|
||||
continue;
|
||||
}
|
||||
$result[$opposingId]['count']++;
|
||||
$result[$opposingId]['sum'] = bcadd($result[$opposingId]['sum'], $transaction->transaction_amount);
|
||||
$result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], strval($result[$opposingId]['count']));
|
||||
}
|
||||
|
||||
// sort result by average:
|
||||
$average = [];
|
||||
foreach ($result as $key => $row) {
|
||||
$average[$key] = floatval($row['average']);
|
||||
}
|
||||
|
||||
array_multisort($average, $sortFlag, $result);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five.
|
||||
* @param array $spent
|
||||
* @param array $earned
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getObjectSummary(array $spent, array $earned): array
|
||||
{
|
||||
$return = [];
|
||||
|
||||
/**
|
||||
* @var int $accountId
|
||||
* @var string $entry
|
||||
*/
|
||||
foreach ($spent as $objectId => $entry) {
|
||||
if (!isset($return[$objectId])) {
|
||||
$return[$objectId] = ['spent' => 0, 'earned' => 0];
|
||||
}
|
||||
|
||||
$return[$objectId]['spent'] = $entry;
|
||||
}
|
||||
unset($entry);
|
||||
|
||||
/**
|
||||
* @var int $accountId
|
||||
* @var string $entry
|
||||
*/
|
||||
foreach ($earned as $objectId => $entry) {
|
||||
if (!isset($return[$objectId])) {
|
||||
$return[$objectId] = ['spent' => 0, 'earned' => 0];
|
||||
}
|
||||
|
||||
$return[$objectId]['earned'] = $entry;
|
||||
}
|
||||
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function summarizeByAccount(Collection $collection): array
|
||||
{
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$accountId = $transaction->account_id;
|
||||
$result[$accountId] = $result[$accountId] ?? '0';
|
||||
$result[$accountId] = bcadd($transaction->transaction_amount, $result[$accountId]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
219
app/Generator/Report/Tag/MonthReportGenerator.php
Normal file
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
/**
|
||||
* MonthReportGenerator.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
*
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Tag;
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||
use FireflyIII\Generator\Report\Support;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator
|
||||
*
|
||||
* @package FireflyIII\Generator\Report\Tag
|
||||
*/
|
||||
class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
{
|
||||
|
||||
/** @var Collection */
|
||||
private $accounts;
|
||||
/** @var Carbon */
|
||||
private $end;
|
||||
/** @var Collection */
|
||||
private $expenses;
|
||||
/** @var Collection */
|
||||
private $income;
|
||||
/** @var Carbon */
|
||||
private $start;
|
||||
/** @var Collection */
|
||||
private $tags;
|
||||
|
||||
/**
|
||||
* MonthReportGenerator constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->expenses = new Collection;
|
||||
$this->income = new Collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$tagTags = join(',', $this->tags->pluck('tag')->toArray());
|
||||
$reportType = 'tag';
|
||||
$expenses = $this->getExpenses();
|
||||
$income = $this->getIncome();
|
||||
$accountSummary = $this->getObjectSummary($this->summarizeByAccount($expenses), $this->summarizeByAccount($income));
|
||||
$tagSummary = $this->getObjectSummary($this->summarizeByTag($expenses), $this->summarizeByTag($income));
|
||||
$averageExpenses = $this->getAverages($expenses, SORT_ASC);
|
||||
$averageIncome = $this->getAverages($income, SORT_DESC);
|
||||
$topExpenses = $this->getTopExpenses();
|
||||
$topIncome = $this->getTopIncome();
|
||||
|
||||
|
||||
// render!
|
||||
return view(
|
||||
'reports.tag.month', compact(
|
||||
'accountIds', 'tagTags', 'reportType', 'accountSummary', 'tagSummary', 'averageExpenses', 'averageIncome', 'topIncome',
|
||||
'topExpenses'
|
||||
)
|
||||
)->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setAccounts(Collection $accounts): ReportGeneratorInterface
|
||||
{
|
||||
$this->accounts = $accounts;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $budgets
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setBudgets(Collection $budgets): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $categories
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setCategories(Collection $categories): ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setEndDate(Carbon $date): ReportGeneratorInterface
|
||||
{
|
||||
$this->end = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setStartDate(Carbon $date): ReportGeneratorInterface
|
||||
{
|
||||
$this->start = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
*/
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface
|
||||
{
|
||||
$this->tags = $tags;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
protected function getExpenses(): Collection
|
||||
{
|
||||
if ($this->expenses->count() > 0) {
|
||||
Log::debug('Return previous set of expenses.');
|
||||
|
||||
return $this->expenses;
|
||||
}
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
|
||||
->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
|
||||
->setTags($this->tags)->withOpposingAccount()->disableFilter();
|
||||
|
||||
$accountIds = $this->accounts->pluck('id')->toArray();
|
||||
$transactions = $collector->getJournals();
|
||||
$transactions = self::filterExpenses($transactions, $accountIds);
|
||||
$this->expenses = $transactions;
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
protected function getIncome(): Collection
|
||||
{
|
||||
if ($this->income->count() > 0) {
|
||||
return $this->income;
|
||||
}
|
||||
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
|
||||
->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
|
||||
->setTags($this->tags)->withOpposingAccount();
|
||||
$accountIds = $this->accounts->pluck('id')->toArray();
|
||||
$transactions = $collector->getJournals();
|
||||
$transactions = self::filterIncome($transactions, $accountIds);
|
||||
$this->income = $transactions;
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function summarizeByTag(Collection $collection): array
|
||||
{
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$journal = $transaction->transactionJournal;
|
||||
$journalTags = $journal->tags;
|
||||
/** @var Tag $journalTag */
|
||||
foreach ($journalTags as $journalTag) {
|
||||
$journalTagId = $journalTag->id;
|
||||
$result[$journalTagId] = $result[$journalTagId] ?? '0';
|
||||
$result[$journalTagId] = bcadd($transaction->transaction_amount, $result[$journalTagId]);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
25
app/Generator/Report/Tag/MultiYearReportGenerator.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* MultiYearReportGenerator.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
*
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Tag;
|
||||
|
||||
|
||||
/**
|
||||
* Class MultiYearReportGenerator
|
||||
*
|
||||
* @package FireflyIII\Generator\Report\Tag
|
||||
*/
|
||||
class MultiYearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
/**
|
||||
* Doesn't do anything different.
|
||||
*/
|
||||
}
|
26
app/Generator/Report/Tag/YearReportGenerator.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* YearReportGenerator.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
*
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Generator\Report\Tag;
|
||||
|
||||
|
||||
/**
|
||||
* Class YearReportGenerator
|
||||
*
|
||||
* @package FireflyIII\Generator\Report\Tag
|
||||
*/
|
||||
class YearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
||||
/**
|
||||
* Doesn't do anything different.
|
||||
*/
|
||||
}
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Handlers\Events;
|
||||
|
||||
@@ -20,6 +20,7 @@ use FireflyIII\Models\PiggyBankRepetition;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Rules\Processor;
|
||||
use FireflyIII\Support\Events\BillScanner;
|
||||
use Log;
|
||||
@@ -45,6 +46,16 @@ class StoredJournalEventHandler
|
||||
$piggyBankId = $event->piggyBankId;
|
||||
Log::debug(sprintf('Trying to connect journal %d to piggy bank %d.', $journal->id, $piggyBankId));
|
||||
|
||||
/*
|
||||
* Will only continue when journal is a transfer.
|
||||
*/
|
||||
Log::debug(sprintf('Journal transaction type is %s', $journal->transactionType->type));
|
||||
if ($journal->transactionType->type !== TransactionType::TRANSFER) {
|
||||
Log::info(sprintf('Will not connect %s #%d to a piggy bank.', $journal->transactionType->type, $journal->id));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify existence of piggy bank:
|
||||
*/
|
||||
@@ -57,9 +68,15 @@ class StoredJournalEventHandler
|
||||
/*
|
||||
* Get relevant data:
|
||||
*/
|
||||
$piggyBank = $journal->user->piggyBanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']);
|
||||
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
|
||||
$amount = $this->getExactAmount($journal, $piggyBank, $repetition);
|
||||
$piggyBank = $journal->user->piggyBanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']);
|
||||
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
|
||||
$amount = $this->getExactAmount($journal, $piggyBank, $repetition);
|
||||
if (bccomp($amount, '0') === 0) {
|
||||
Log::debug('Amount is zero, will not create event.');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$repetition->currentamount = bcadd($repetition->currentamount, $amount);
|
||||
$repetition->save();
|
||||
|
||||
@@ -134,8 +151,8 @@ class StoredJournalEventHandler
|
||||
*/
|
||||
private function getExactAmount(TransactionJournal $journal, PiggyBank $piggyBank, PiggyBankRepetition $repetition): string
|
||||
{
|
||||
$amount = TransactionJournal::amountPositive($journal);
|
||||
$sources = TransactionJournal::sourceAccountList($journal)->pluck('id')->toArray();
|
||||
$amount = $journal->amountPositive();
|
||||
$sources = $journal->sourceAccountList()->pluck('id')->toArray();
|
||||
$room = bcsub(strval($piggyBank->targetamount), strval($repetition->currentamount));
|
||||
$compare = bcmul($repetition->currentamount, '-1');
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Handlers\Events;
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Handlers\Events;
|
||||
|
||||
@@ -19,7 +19,6 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use Illuminate\Mail\Message;
|
||||
use Log;
|
||||
use Mail;
|
||||
use Session;
|
||||
use Swift_TransportException;
|
||||
|
||||
/**
|
||||
@@ -54,20 +53,6 @@ class UserEventHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle user logout events.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function logoutUser(): bool
|
||||
{
|
||||
// dump stuff from the session:
|
||||
Session::forget('twofactor-authenticated');
|
||||
Session::forget('twofactor-authenticated-date');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestedNewPassword $event
|
||||
*
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Attachments;
|
||||
|
||||
use Crypt;
|
||||
@@ -32,9 +33,9 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
/** @var MessageBag */
|
||||
public $messages;
|
||||
/** @var array */
|
||||
protected $allowedMimes;
|
||||
protected $allowedMimes = [];
|
||||
/** @var int */
|
||||
protected $maxUploadSize;
|
||||
protected $maxUploadSize = 0;
|
||||
|
||||
/** @var \Illuminate\Contracts\Filesystem\Filesystem */
|
||||
protected $uploadDisk;
|
||||
@@ -44,8 +45,8 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->maxUploadSize = config('firefly.maxUploadSize');
|
||||
$this->allowedMimes = config('firefly.allowedMimes');
|
||||
$this->maxUploadSize = intval(config('firefly.maxUploadSize'));
|
||||
$this->allowedMimes = (array)config('firefly.allowedMimes');
|
||||
$this->errors = new MessageBag;
|
||||
$this->messages = new MessageBag;
|
||||
$this->uploadDisk = Storage::disk('upload');
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Attachments;
|
||||
|
||||
use FireflyIII\Models\Attachment;
|
||||
@@ -42,7 +43,9 @@ interface AttachmentHelperInterface
|
||||
public function getMessages(): MessageBag;
|
||||
|
||||
/**
|
||||
* @param Model $model
|
||||
* @param Model $model
|
||||
*
|
||||
* @param null|array $files
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
@@ -7,20 +7,23 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Chart;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Report\Support;
|
||||
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Steam;
|
||||
|
||||
/**
|
||||
* Class MetaPieChart
|
||||
@@ -45,19 +48,20 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
'account' => ['opposing_account_id'],
|
||||
'budget' => ['transaction_journal_budget_id', 'transaction_budget_id'],
|
||||
'category' => ['transaction_journal_category_id', 'transaction_category_id'],
|
||||
'tag' => [],
|
||||
];
|
||||
|
||||
/** @var array */
|
||||
protected $repositories
|
||||
= [
|
||||
'account' => AccountRepositoryInterface::class,
|
||||
'budget' => BudgetRepositoryInterface::class,
|
||||
'category' => CategoryRepositoryInterface::class,
|
||||
'tag' => TagRepositoryInterface::class,
|
||||
];
|
||||
|
||||
|
||||
/** @var Carbon */
|
||||
protected $start;
|
||||
/** @var Collection */
|
||||
protected $tags;
|
||||
/** @var string */
|
||||
protected $total = '0';
|
||||
/** @var User */
|
||||
@@ -68,6 +72,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
$this->accounts = new Collection;
|
||||
$this->budgets = new Collection;
|
||||
$this->categories = new Collection;
|
||||
$this->tags = new Collection;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +90,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
// also collect all other transactions
|
||||
if ($this->collectOtherObjects && $direction === 'expense') {
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [$this->user]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::WITHDRAWAL]);
|
||||
$journals = $collector->getJournals();
|
||||
$sum = strval($journals->sum('transaction_amount'));
|
||||
@@ -96,7 +101,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
|
||||
if ($this->collectOtherObjects && $direction === 'income') {
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::DEPOSIT]);
|
||||
$journals = $collector->getJournals();
|
||||
$sum = strval($journals->sum('transaction_amount'));
|
||||
@@ -180,6 +185,18 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return MetaPieChartInterface
|
||||
*/
|
||||
public function setTags(Collection $tags): MetaPieChartInterface
|
||||
{
|
||||
$this->tags = $tags;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
@@ -201,7 +218,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
$modifier = 1;
|
||||
}
|
||||
/** @var JournalCollectorInterface $collector */
|
||||
$collector = app(JournalCollectorInterface::class, [auth()->user()]);
|
||||
$collector = app(JournalCollectorInterface::class);
|
||||
$collector->setAccounts($this->accounts);
|
||||
$collector->setRange($this->start, $this->end);
|
||||
$collector->setTypes($types);
|
||||
@@ -217,6 +234,11 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
if ($this->categories->count() > 0) {
|
||||
$collector->setCategories($this->categories);
|
||||
}
|
||||
if ($this->tags->count() > 0) {
|
||||
$collector->setTags($this->tags);
|
||||
$collector->withCategoryInformation();
|
||||
$collector->withBudgetInformation();
|
||||
}
|
||||
|
||||
$accountIds = $this->accounts->pluck('id')->toArray();
|
||||
$transactions = $collector->getJournals();
|
||||
@@ -231,8 +253,13 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function groupByFields(Collection $set, array $fields)
|
||||
protected function groupByFields(Collection $set, array $fields): array
|
||||
{
|
||||
if (count($fields) === 0 && $this->tags->count() > 0) {
|
||||
// do a special group on tags:
|
||||
return $this->groupByTag($set);
|
||||
}
|
||||
|
||||
$grouped = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($set as $transaction) {
|
||||
@@ -258,16 +285,13 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
{
|
||||
$chartData = [];
|
||||
$names = [];
|
||||
$repository = app($this->repositories[$type], [$this->user]);
|
||||
$repository = app($this->repositories[$type]);
|
||||
foreach ($array as $objectId => $amount) {
|
||||
if (!isset($names[$objectId])) {
|
||||
$object = $repository->find(intval($objectId));
|
||||
$names[$objectId] = $object->name;
|
||||
$names[$objectId] = $object->name ?? $object->tag;
|
||||
}
|
||||
if (bccomp($amount, '0') === -1) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
}
|
||||
|
||||
$amount = Steam::positive($amount);
|
||||
$this->total = bcadd($this->total, $amount);
|
||||
$chartData[$names[$objectId]] = $amount;
|
||||
}
|
||||
@@ -275,4 +299,22 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
return $chartData;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function groupByTag(Collection $set): array
|
||||
{
|
||||
$grouped = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($set as $transaction) {
|
||||
$journal = $transaction->transactionJournal;
|
||||
$tags = $journal->tags;
|
||||
/** @var Tag $tag */
|
||||
foreach ($tags as $tag) {
|
||||
$tagId = $tag->id;
|
||||
$grouped[$tagId] = $grouped[$tagId] ?? '0';
|
||||
$grouped[$tagId] = bcadd($transaction->transaction_amount, $grouped[$tagId]);
|
||||
}
|
||||
}
|
||||
|
||||
return $grouped;
|
||||
}
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Chart;
|
||||
|
||||
@@ -72,6 +72,13 @@ interface MetaPieChartInterface
|
||||
*/
|
||||
public function setStart(Carbon $start): MetaPieChartInterface;
|
||||
|
||||
/**
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return MetaPieChartInterface
|
||||
*/
|
||||
public function setTags(Collection $tags): MetaPieChartInterface;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
@@ -79,4 +86,4 @@ interface MetaPieChartInterface
|
||||
*/
|
||||
public function setUser(User $user): MetaPieChartInterface;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,107 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Account.php
|
||||
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This software may be modified and distributed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
||||
*
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
namespace FireflyIII\Helpers\Collection;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class Account
|
||||
*
|
||||
* @package FireflyIII\Helpers\Collection
|
||||
*/
|
||||
class Account
|
||||
{
|
||||
|
||||
/** @var Collection */
|
||||
protected $accounts;
|
||||
/** @var string */
|
||||
protected $difference = '';
|
||||
/** @var string */
|
||||
protected $end = '';
|
||||
/** @var string */
|
||||
protected $start = '';
|
||||
|
||||
/**
|
||||
* Account constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->accounts = new Collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAccounts(): Collection
|
||||
{
|
||||
return $this->accounts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
*/
|
||||
public function setAccounts(Collection $accounts)
|
||||
{
|
||||
$this->accounts = $accounts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDifference(): string
|
||||
{
|
||||
return $this->difference;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $difference
|
||||
*/
|
||||
public function setDifference(string $difference)
|
||||
{
|
||||
$this->difference = $difference;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEnd(): string
|
||||
{
|
||||
return $this->end;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $end
|
||||
*/
|
||||
public function setEnd(string $end)
|
||||
{
|
||||
$this->end = $end;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getStart(): string
|
||||
{
|
||||
return $this->start;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $start
|
||||
*/
|
||||
public function setStart(string $start)
|
||||
{
|
||||
$this->start = $start;
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Collection;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Collection;
|
||||
|
||||
use FireflyIII\Models\Account as AccountModel;
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Collection;
|
||||
|
||||
use FireflyIII\Models\Account as AccountModel;
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Collection;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
@@ -9,7 +9,8 @@
|
||||
* See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Collection;
|
||||
|
||||
|
||||
|