-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathfinanse.html
More file actions
241 lines (223 loc) · 8.02 KB
/
Copy pathfinanse.html
File metadata and controls
241 lines (223 loc) · 8.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
{% include dues.txt %}
<head>
<meta name="robots" content="noindex">
<title>Finanse HSŁ - dashboard</title>
<meta charset="UTF-8" />
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script>
function pokazWiecej() {
document.getElementById("ukryjMnie").style.display = "none";
document.getElementById("ukryte").style.display = "block";
}
</script>
<style>
body {
font-family: 'Arial';
font-size: 16pt;
}
#main {
width: 900px;
margin: auto;
}
table {
margin-top: 20px;
}
caption {
font-size: 24pt;
text-align: left;
}
table, th, td {
border: 1px solid #bcbcbc;
border-collapse: collapse;
}
td.name {
width: 600px;
}
td.value {
width: 300px;
text-align: right;
}
thead {
background-color: #62B5FF;
color: white;
}
.negative {
color: #B2140C;
}
</style>
</head>
<div id="main">
{% assign kody_okresow = "monthly,quarterly,yearly" | split: "," %}
{% assign nazwy_okresow = "Miesięcznie,Kwartalnie,Rocznie" | split: "," %}
{% assign sufiksy_okresow = ",_quarterly,_yearly" | split: "," %}
<p>
{% for nazwa_okresu in nazwy_okresow %}
{% assign forloop_index = forloop.index0 %}
{% if page.period == kody_okresow[forloop.index0] %}
[{{ nazwa_okresu }}]
{% else %}
[<a href="finanse{{ sufiksy_okresow[forloop.index0] }}.html">{{ nazwa_okresu }}</a>]
{% endif %}
{% endfor %}
</p>
<div id="plot-main" style="width:100%;height:300px;"></div>
<script>
Plotly.newPlot('plot-main', [
{% assign kategorie = "Bilans,Wydatki,Przychody" | split: "," %}
{% for kategoria in kategorie %}
{% if kategoria == 'Saldo' %}
{% continue %}
{% endif %}
{
name: '{{ kategoria }}',
mode: 'scatter',
x: [{% for miesiac in site.data.dues.by_period[kategoria][page.period] %}{% if forloop.first %}{% else %}, {% endif %} "{{ miesiac[0] | remove_first: "20" }}" {% endfor %}] ,
y: [
{% for miesiac in site.data.dues.by_period[kategoria][page.period] %}
{% if forloop.first %}{% else %}, {% endif %}
{% assign suma=0 %}
{% for podkategoria in miesiac[1] %}
{% assign suma=suma | plus: podkategoria[1] %}
{% endfor %}
"{{ suma }}"
{% endfor %}
] ,
line: {width: 0},
fill: 'tozeroy'
},
{% endfor %}
], {
showlegend: true,
legend: {
x: 1,
xanchor: 'left',
y: 1
},
margin: {l: 50, r: 50, b: 50, t: 25, pad: 4},
xaxis: { type: 'category', }
});
</script>
<table>
<caption>
Aktualna "poduszka finansowa" (na {{ site.data.dues_config.obligations_reserve_months }} mies)
</caption>
<thead>
<tr>
<th>NAZWA</th>
<th>MIESIĘCZNIE</th>
</tr>
</thead>
<tbody>
{% assign dues_reserved_obligations_total_monthly = 0 %}
{% for obligation in site.data.dues_config.obligations %}
<tr>
{% assign current_obligation = obligation[1].amount_pln |divided_by: obligation[1].every_months %}
<td class="name">{{ obligation[0] }}</td>
<td class="value">{{ current_obligation|round: 2 }} zł</td>
{% assign dues_reserved_obligations_total_monthly = dues_reserved_obligations_total_monthly| plus: current_obligation %}
</tr>
{% endfor %}
<tr style="font-weight: bold">
<td class="name"><strong>Cykliczne razem x {{ site.data.dues_config.obligations_reserve_months }} mies</td>
{% assign dues_reserved_obligations_total = dues_reserved_obligations_total_monthly|times: site.data.dues_config.obligations_reserve_months %}
<td class="value">{{ dues_reserved_obligations_total | round: 2 }} zł</td>
</tr>
{% assign oneoff_reservations_total = 0 %}
{% for reservation in site.data.dues_config.reservations %}
<tr>
<td class="name">{{ reservation[0] }}</td>
<td class="value">{{ reservation[1].amount_pln | round: 2 }} zł</td>
{% assign oneoff_reservations_total = oneoff_reservations_total|plus: reservation[1].amount_pln %}
</tr>
{% endfor %}
<tr style="font-weight: bold">
<td class="name"><strong>Jednorazowe razem</td>
<td class="value">{{ oneoff_reservations_total | round: 2 }} zł</td>
</tr>
<tr style="font-weight: bold">
{% assign reservations_total = oneoff_reservations_total|plus: dues_reserved_obligations_total %}
<td class="name"><strong>Cykliczne + jednorazowe</td>
<td class="value">{{ reservations_total | round: 2 }} zł</td>
</tr>
<tr>
<td class="name">Wolne środki</td>
<td class="value">{{ dues_total_unreserved | round: 2 }} zł</td>
</tr>
</tbody>
</table>
{% assign ukryte="nie" %}
{% for miesiac in site.data.dues.by_period.Bilans[page.period] reversed %}
{% assign numer_miesiaca=miesiac[0] %}
<table>
<caption>
{{ miesiac[0] }}
</caption>
<thead>
<tr>
<th>NAZWA</th>
<th>WARTOŚĆ</th>
</tr>
</thead>
<tbody>
{% for kategoria in site.data.dues.by_period %}
{% assign suma=0 %}
{% assign ile_podkategorii=kategoria[1][page.period][numer_miesiaca] | size %}
{% for podkategoria in kategoria[1][page.period][numer_miesiaca] %}
<tr>
<td class="name">{{ kategoria[0] }}{% if ile_podkategorii > 1 and podkategoria[0] != "Suma" %}: {{ podkategoria[0] }}{% endif %}</td>
<td class="value {% if kategoria[0] == "Wydatki" or podkategoria[1] < 0 %}negative{% endif %}">
{% assign suma=suma | plus: podkategoria[1] %}
{% if kategoria[0] == "Wydatki" %}-{% endif %}{{ podkategoria[1] | round: 2 }} zł
</td>
</tr>
{% endfor %}
{% assign ilosc_elementow = kategoria[1][numer_miesiaca] | size %}
{% if ilosc_elementow > 1 %}
<tr>
<td class="name">{{ kategoria[0] }}: Suma</td>
<td class="value {% if kategoria[0] == "Wydatki" %}negative{% endif %}">
{% assign suma=suma | plus: podkategoria[1] %}
{% if kategoria[0] == "Wydatki" %}-{% endif %}{{ suma | round: 2 }} zł
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
<br />
<!--
<div id="plot-month-2020-11" style="width:100%;height:300px;"></div>
<script>
plot('plot-month-2020-11', {
title: 'Dochód / Wydatki',
margin: {l: 50, r: 0, b: 25, t: 50, pad: 4}
}, [
{
name: 'Dochód',
type: 'pie',
domain: {x: [0.0, 0.48], y: [0.0, 1.0]},
values: [1120.0],
labels: ["SK\u0141ADKI"],
}, {
name: 'Wydatki',
type: 'pie',
domain: {x: [0.5, 1.0], y: [0.0, 1.0]},
values: [1205.2, 86.15],
labels: ["RACHUNKI: CZYNSZ", "RACHUNKI: INTERNET"],
}
]);
</script>
-->
<hr/>
{% if forloop.index == 3 %}
{% if forloop.last %}
{% else %}
<a href="javascript:pokazWiecej();" id="ukryjMnie">(Pokaż więcej miesięcy)</a><div style="display: none" id="ukryte">
{% assign ukryte="tak" %}
{% endif %}
{% endif %}
{% endfor %}
{% if ukryte=="tak" %}
</div>
{% endif %}
<p>Ten dashboard jest <a href="https://web.archive.org/web/20230331100456/https://finanse.hs-silesia.pl/">zerżnięty</a> od Hackerspace Silesia🕯️. Całość jest w fazie beta i może brakować niektórych wpisów, zwłaszcza po stronie kosztów.</p><p> Linki: <a href="https://wiki.hs-ldz.pl/Finanse">[Wiki]</a>, <a href="https://docs.google.com/spreadsheets/d/13wSrGyC35I6sExcASG-5LAAX1B-1KP9aOz2nt_m5Tns/edit?usp=sharing">[Symulacja]</a>, <a href="https://github.com/hakierspejs/homepage/blob/main/_layouts/finanse.html">[Src]</a> </p>