dao-treasury 0.0.42__cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bf2b4fe1f86ad2ea158b__mypyc.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +60 -0
- dao_treasury/.grafana/provisioning/dashboards/streams/LlamaPay.json +225 -0
- dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +107 -0
- dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +387 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +835 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +615 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +492 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Treasury.json +2018 -0
- dao_treasury/.grafana/provisioning/datasources/datasources.yaml +17 -0
- dao_treasury/ENVIRONMENT_VARIABLES.py +20 -0
- dao_treasury/__init__.py +62 -0
- dao_treasury/_docker.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/_docker.py +190 -0
- dao_treasury/_nicknames.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/_nicknames.py +32 -0
- dao_treasury/_wallet.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/_wallet.py +250 -0
- dao_treasury/constants.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/constants.py +34 -0
- dao_treasury/db.py +1408 -0
- dao_treasury/docker-compose.yaml +41 -0
- dao_treasury/main.py +247 -0
- dao_treasury/py.typed +0 -0
- dao_treasury/sorting/__init__.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/__init__.py +295 -0
- dao_treasury/sorting/_matchers.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/_matchers.py +387 -0
- dao_treasury/sorting/_rules.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/_rules.py +235 -0
- dao_treasury/sorting/factory.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/factory.py +299 -0
- dao_treasury/sorting/rule.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/rule.py +346 -0
- dao_treasury/sorting/rules/__init__.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/rules/__init__.py +1 -0
- dao_treasury/sorting/rules/ignore/__init__.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/rules/ignore/__init__.py +1 -0
- dao_treasury/sorting/rules/ignore/llamapay.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/sorting/rules/ignore/llamapay.py +20 -0
- dao_treasury/streams/__init__.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/streams/__init__.py +0 -0
- dao_treasury/streams/llamapay.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/streams/llamapay.py +388 -0
- dao_treasury/treasury.py +191 -0
- dao_treasury/types.cpython-310-i386-linux-gnu.so +0 -0
- dao_treasury/types.py +133 -0
- dao_treasury-0.0.42.dist-info/METADATA +119 -0
- dao_treasury-0.0.42.dist-info/RECORD +51 -0
- dao_treasury-0.0.42.dist-info/WHEEL +7 -0
- dao_treasury-0.0.42.dist-info/top_level.txt +2 -0
@@ -0,0 +1,615 @@
|
|
1
|
+
{
|
2
|
+
"annotations": {
|
3
|
+
"list": [
|
4
|
+
{
|
5
|
+
"builtIn": 1,
|
6
|
+
"datasource": {
|
7
|
+
"type": "grafana",
|
8
|
+
"uid": "-- Grafana --"
|
9
|
+
},
|
10
|
+
"enable": true,
|
11
|
+
"hide": true,
|
12
|
+
"iconColor": "rgba(0, 211, 255, 1)",
|
13
|
+
"name": "Annotations & Alerts",
|
14
|
+
"type": "dashboard"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
},
|
18
|
+
"editable": true,
|
19
|
+
"fiscalYearStartMonth": 0,
|
20
|
+
"graphTooltip": 1,
|
21
|
+
"links": [],
|
22
|
+
"liveNow": false,
|
23
|
+
"panels": [
|
24
|
+
{
|
25
|
+
"datasource": "SQLite",
|
26
|
+
"fieldConfig": {
|
27
|
+
"defaults": {
|
28
|
+
"color": {
|
29
|
+
"mode": "thresholds"
|
30
|
+
},
|
31
|
+
"mappings": [],
|
32
|
+
"thresholds": {
|
33
|
+
"mode": "absolute",
|
34
|
+
"steps": [
|
35
|
+
{
|
36
|
+
"color": "green",
|
37
|
+
"value": null
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"color": "red",
|
41
|
+
"value": 80
|
42
|
+
}
|
43
|
+
]
|
44
|
+
}
|
45
|
+
},
|
46
|
+
"overrides": []
|
47
|
+
},
|
48
|
+
"gridPos": {
|
49
|
+
"h": 4,
|
50
|
+
"w": 4,
|
51
|
+
"x": 0,
|
52
|
+
"y": 0
|
53
|
+
},
|
54
|
+
"id": 1,
|
55
|
+
"options": {
|
56
|
+
"colorMode": "value",
|
57
|
+
"graphMode": "area",
|
58
|
+
"justifyMode": "auto",
|
59
|
+
"orientation": "auto",
|
60
|
+
"reduceOptions": {
|
61
|
+
"calcs": [
|
62
|
+
"lastNotNull"
|
63
|
+
],
|
64
|
+
"fields": "",
|
65
|
+
"values": false
|
66
|
+
},
|
67
|
+
"textMode": "auto"
|
68
|
+
},
|
69
|
+
"pluginVersion": "10.2.0",
|
70
|
+
"targets": [
|
71
|
+
{
|
72
|
+
"datasource": "SQLite",
|
73
|
+
"queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
74
|
+
"queryType": "table",
|
75
|
+
"rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
76
|
+
"refId": "A",
|
77
|
+
"timeColumns": [
|
78
|
+
"time",
|
79
|
+
"ts"
|
80
|
+
]
|
81
|
+
}
|
82
|
+
],
|
83
|
+
"title": "Revenue",
|
84
|
+
"type": "stat"
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"datasource": "SQLite",
|
88
|
+
"fieldConfig": {
|
89
|
+
"defaults": {
|
90
|
+
"color": {
|
91
|
+
"mode": "thresholds"
|
92
|
+
},
|
93
|
+
"mappings": [],
|
94
|
+
"thresholds": {
|
95
|
+
"mode": "absolute",
|
96
|
+
"steps": [
|
97
|
+
{
|
98
|
+
"color": "green",
|
99
|
+
"value": null
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"color": "red",
|
103
|
+
"value": 80
|
104
|
+
}
|
105
|
+
]
|
106
|
+
}
|
107
|
+
},
|
108
|
+
"overrides": []
|
109
|
+
},
|
110
|
+
"gridPos": {
|
111
|
+
"h": 4,
|
112
|
+
"w": 4,
|
113
|
+
"x": 4,
|
114
|
+
"y": 0
|
115
|
+
},
|
116
|
+
"id": 2,
|
117
|
+
"options": {
|
118
|
+
"colorMode": "value",
|
119
|
+
"graphMode": "area",
|
120
|
+
"justifyMode": "auto",
|
121
|
+
"orientation": "auto",
|
122
|
+
"reduceOptions": {
|
123
|
+
"calcs": [
|
124
|
+
"lastNotNull"
|
125
|
+
],
|
126
|
+
"fields": "",
|
127
|
+
"values": false
|
128
|
+
},
|
129
|
+
"textMode": "auto"
|
130
|
+
},
|
131
|
+
"pluginVersion": "10.2.0",
|
132
|
+
"targets": [
|
133
|
+
{
|
134
|
+
"datasource": "SQLite",
|
135
|
+
"queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
136
|
+
"queryType": "table",
|
137
|
+
"rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
138
|
+
"refId": "A",
|
139
|
+
"timeColumns": [
|
140
|
+
"time",
|
141
|
+
"ts"
|
142
|
+
]
|
143
|
+
}
|
144
|
+
],
|
145
|
+
"title": "Expenses",
|
146
|
+
"type": "stat"
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"datasource": "SQLite",
|
150
|
+
"fieldConfig": {
|
151
|
+
"defaults": {
|
152
|
+
"color": {
|
153
|
+
"mode": "thresholds"
|
154
|
+
},
|
155
|
+
"mappings": [],
|
156
|
+
"thresholds": {
|
157
|
+
"mode": "absolute",
|
158
|
+
"steps": [
|
159
|
+
{
|
160
|
+
"color": "green",
|
161
|
+
"value": null
|
162
|
+
},
|
163
|
+
{
|
164
|
+
"color": "red",
|
165
|
+
"value": 80
|
166
|
+
}
|
167
|
+
]
|
168
|
+
}
|
169
|
+
},
|
170
|
+
"overrides": []
|
171
|
+
},
|
172
|
+
"gridPos": {
|
173
|
+
"h": 4,
|
174
|
+
"w": 4,
|
175
|
+
"x": 8,
|
176
|
+
"y": 0
|
177
|
+
},
|
178
|
+
"id": 3,
|
179
|
+
"options": {
|
180
|
+
"colorMode": "value",
|
181
|
+
"graphMode": "area",
|
182
|
+
"justifyMode": "auto",
|
183
|
+
"orientation": "auto",
|
184
|
+
"reduceOptions": {
|
185
|
+
"calcs": [
|
186
|
+
"lastNotNull"
|
187
|
+
],
|
188
|
+
"fields": "",
|
189
|
+
"values": false
|
190
|
+
},
|
191
|
+
"textMode": "auto"
|
192
|
+
},
|
193
|
+
"pluginVersion": "10.2.0",
|
194
|
+
"targets": [
|
195
|
+
{
|
196
|
+
"datasource": "SQLite",
|
197
|
+
"queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
198
|
+
"queryType": "table",
|
199
|
+
"rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Cost of Revenue' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
200
|
+
"refId": "A",
|
201
|
+
"timeColumns": [
|
202
|
+
"time",
|
203
|
+
"ts"
|
204
|
+
]
|
205
|
+
}
|
206
|
+
],
|
207
|
+
"title": "Cost of Revenue",
|
208
|
+
"type": "stat"
|
209
|
+
},
|
210
|
+
{
|
211
|
+
"datasource": "SQLite",
|
212
|
+
"fieldConfig": {
|
213
|
+
"defaults": {
|
214
|
+
"color": {
|
215
|
+
"mode": "thresholds"
|
216
|
+
},
|
217
|
+
"mappings": [],
|
218
|
+
"thresholds": {
|
219
|
+
"mode": "absolute",
|
220
|
+
"steps": [
|
221
|
+
{
|
222
|
+
"color": "green",
|
223
|
+
"value": null
|
224
|
+
},
|
225
|
+
{
|
226
|
+
"color": "red",
|
227
|
+
"value": 80
|
228
|
+
}
|
229
|
+
]
|
230
|
+
}
|
231
|
+
},
|
232
|
+
"overrides": []
|
233
|
+
},
|
234
|
+
"gridPos": {
|
235
|
+
"h": 4,
|
236
|
+
"w": 4,
|
237
|
+
"x": 12,
|
238
|
+
"y": 0
|
239
|
+
},
|
240
|
+
"id": 4,
|
241
|
+
"options": {
|
242
|
+
"colorMode": "value",
|
243
|
+
"graphMode": "area",
|
244
|
+
"justifyMode": "auto",
|
245
|
+
"orientation": "auto",
|
246
|
+
"reduceOptions": {
|
247
|
+
"calcs": [
|
248
|
+
"lastNotNull"
|
249
|
+
],
|
250
|
+
"fields": "",
|
251
|
+
"values": false
|
252
|
+
},
|
253
|
+
"textMode": "auto"
|
254
|
+
},
|
255
|
+
"pluginVersion": "10.2.0",
|
256
|
+
"targets": [
|
257
|
+
{
|
258
|
+
"datasource": "SQLite",
|
259
|
+
"queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
260
|
+
"queryType": "table",
|
261
|
+
"rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Income' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
262
|
+
"refId": "A",
|
263
|
+
"timeColumns": [
|
264
|
+
"time",
|
265
|
+
"ts"
|
266
|
+
]
|
267
|
+
}
|
268
|
+
],
|
269
|
+
"title": "Other Income",
|
270
|
+
"type": "stat"
|
271
|
+
},
|
272
|
+
{
|
273
|
+
"datasource": "SQLite",
|
274
|
+
"fieldConfig": {
|
275
|
+
"defaults": {
|
276
|
+
"color": {
|
277
|
+
"mode": "thresholds"
|
278
|
+
},
|
279
|
+
"mappings": [],
|
280
|
+
"thresholds": {
|
281
|
+
"mode": "absolute",
|
282
|
+
"steps": [
|
283
|
+
{
|
284
|
+
"color": "green",
|
285
|
+
"value": null
|
286
|
+
},
|
287
|
+
{
|
288
|
+
"color": "red",
|
289
|
+
"value": 80
|
290
|
+
}
|
291
|
+
]
|
292
|
+
}
|
293
|
+
},
|
294
|
+
"overrides": []
|
295
|
+
},
|
296
|
+
"gridPos": {
|
297
|
+
"h": 4,
|
298
|
+
"w": 4,
|
299
|
+
"x": 16,
|
300
|
+
"y": 0
|
301
|
+
},
|
302
|
+
"id": 5,
|
303
|
+
"options": {
|
304
|
+
"colorMode": "value",
|
305
|
+
"graphMode": "area",
|
306
|
+
"justifyMode": "auto",
|
307
|
+
"orientation": "auto",
|
308
|
+
"reduceOptions": {
|
309
|
+
"calcs": [
|
310
|
+
"lastNotNull"
|
311
|
+
],
|
312
|
+
"fields": "",
|
313
|
+
"values": false
|
314
|
+
},
|
315
|
+
"textMode": "auto"
|
316
|
+
},
|
317
|
+
"pluginVersion": "10.2.0",
|
318
|
+
"targets": [
|
319
|
+
{
|
320
|
+
"datasource": "SQLite",
|
321
|
+
"queryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
322
|
+
"queryType": "table",
|
323
|
+
"rawQueryText": "SELECT SUM(t.value_usd) AS total_revenue FROM general_ledger t JOIN txgroup_hierarchy gh USING (txgroup_id) WHERE gh.top_category = 'Other Expenses' AND t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
324
|
+
"refId": "A",
|
325
|
+
"timeColumns": [
|
326
|
+
"time",
|
327
|
+
"ts"
|
328
|
+
]
|
329
|
+
}
|
330
|
+
],
|
331
|
+
"title": "Other Expenses",
|
332
|
+
"type": "stat"
|
333
|
+
},
|
334
|
+
{
|
335
|
+
"datasource": "SQLite",
|
336
|
+
"description": "",
|
337
|
+
"fieldConfig": {
|
338
|
+
"defaults": {
|
339
|
+
"color": {
|
340
|
+
"mode": "thresholds"
|
341
|
+
},
|
342
|
+
"mappings": [],
|
343
|
+
"thresholds": {
|
344
|
+
"mode": "absolute",
|
345
|
+
"steps": [
|
346
|
+
{
|
347
|
+
"color": "green",
|
348
|
+
"value": null
|
349
|
+
},
|
350
|
+
{
|
351
|
+
"color": "red",
|
352
|
+
"value": 80
|
353
|
+
}
|
354
|
+
]
|
355
|
+
}
|
356
|
+
},
|
357
|
+
"overrides": []
|
358
|
+
},
|
359
|
+
"gridPos": {
|
360
|
+
"h": 4,
|
361
|
+
"w": 4,
|
362
|
+
"x": 20,
|
363
|
+
"y": 0
|
364
|
+
},
|
365
|
+
"id": 10,
|
366
|
+
"options": {
|
367
|
+
"colorMode": "value",
|
368
|
+
"graphMode": "area",
|
369
|
+
"justifyMode": "auto",
|
370
|
+
"orientation": "auto",
|
371
|
+
"reduceOptions": {
|
372
|
+
"calcs": [
|
373
|
+
"lastNotNull"
|
374
|
+
],
|
375
|
+
"fields": "",
|
376
|
+
"values": false
|
377
|
+
},
|
378
|
+
"textMode": "auto"
|
379
|
+
},
|
380
|
+
"pluginVersion": "10.2.0",
|
381
|
+
"targets": [
|
382
|
+
{
|
383
|
+
"datasource": "SQLite",
|
384
|
+
"queryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
385
|
+
"queryType": "table",
|
386
|
+
"rawQueryText": "SELECT (\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n) AS total_net\nFROM general_ledger t\nJOIN txgroup_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000",
|
387
|
+
"refId": "A",
|
388
|
+
"timeColumns": [
|
389
|
+
"time",
|
390
|
+
"ts"
|
391
|
+
]
|
392
|
+
}
|
393
|
+
],
|
394
|
+
"title": "Sorted Total",
|
395
|
+
"type": "stat"
|
396
|
+
},
|
397
|
+
{
|
398
|
+
"datasource": "SQLite",
|
399
|
+
"description": "",
|
400
|
+
"fieldConfig": {
|
401
|
+
"defaults": {
|
402
|
+
"color": {
|
403
|
+
"mode": "palette-classic"
|
404
|
+
},
|
405
|
+
"custom": {
|
406
|
+
"axisBorderShow": false,
|
407
|
+
"axisCenteredZero": false,
|
408
|
+
"axisColorMode": "text",
|
409
|
+
"axisLabel": "",
|
410
|
+
"axisPlacement": "auto",
|
411
|
+
"barAlignment": 0,
|
412
|
+
"drawStyle": "bars",
|
413
|
+
"fillOpacity": 70,
|
414
|
+
"gradientMode": "none",
|
415
|
+
"hideFrom": {
|
416
|
+
"legend": false,
|
417
|
+
"tooltip": false,
|
418
|
+
"viz": false
|
419
|
+
},
|
420
|
+
"insertNulls": false,
|
421
|
+
"lineInterpolation": "linear",
|
422
|
+
"lineWidth": 1,
|
423
|
+
"pointSize": 5,
|
424
|
+
"scaleDistribution": {
|
425
|
+
"type": "linear"
|
426
|
+
},
|
427
|
+
"showPoints": "auto",
|
428
|
+
"spanNulls": false,
|
429
|
+
"stacking": {
|
430
|
+
"group": "A",
|
431
|
+
"mode": "normal"
|
432
|
+
},
|
433
|
+
"thresholdsStyle": {
|
434
|
+
"mode": "off"
|
435
|
+
}
|
436
|
+
},
|
437
|
+
"mappings": [],
|
438
|
+
"thresholds": {
|
439
|
+
"mode": "absolute",
|
440
|
+
"steps": [
|
441
|
+
{
|
442
|
+
"color": "green",
|
443
|
+
"value": null
|
444
|
+
},
|
445
|
+
{
|
446
|
+
"color": "red",
|
447
|
+
"value": 80
|
448
|
+
}
|
449
|
+
]
|
450
|
+
}
|
451
|
+
},
|
452
|
+
"overrides": [
|
453
|
+
{
|
454
|
+
"matcher": {
|
455
|
+
"id": "byName",
|
456
|
+
"options": "Net (sum)"
|
457
|
+
},
|
458
|
+
"properties": [
|
459
|
+
{
|
460
|
+
"id": "custom.drawStyle",
|
461
|
+
"value": "line"
|
462
|
+
},
|
463
|
+
{
|
464
|
+
"id": "custom.stacking",
|
465
|
+
"value": {
|
466
|
+
"group": "A",
|
467
|
+
"mode": "none"
|
468
|
+
}
|
469
|
+
},
|
470
|
+
{
|
471
|
+
"id": "custom.fillOpacity",
|
472
|
+
"value": 19
|
473
|
+
}
|
474
|
+
]
|
475
|
+
}
|
476
|
+
]
|
477
|
+
},
|
478
|
+
"gridPos": {
|
479
|
+
"h": 12,
|
480
|
+
"w": 24,
|
481
|
+
"x": 0,
|
482
|
+
"y": 4
|
483
|
+
},
|
484
|
+
"id": 11,
|
485
|
+
"options": {
|
486
|
+
"legend": {
|
487
|
+
"calcs": [],
|
488
|
+
"displayMode": "list",
|
489
|
+
"placement": "bottom",
|
490
|
+
"showLegend": true
|
491
|
+
},
|
492
|
+
"tooltip": {
|
493
|
+
"mode": "single",
|
494
|
+
"sort": "none"
|
495
|
+
}
|
496
|
+
},
|
497
|
+
"targets": [
|
498
|
+
{
|
499
|
+
"datasource": "SQLite",
|
500
|
+
"queryText": "SELECT t.timestamp, SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) AS \"Total Revenue\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) AS \"Net\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 GROUP BY timestamp ORDER BY timestamp;",
|
501
|
+
"queryType": "table",
|
502
|
+
"rawQueryText": "SELECT t.timestamp, SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) AS \"Total Revenue\", SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses\", SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses') THEN t.value_usd ELSE 0 END) AS \"Net\" FROM general_ledger AS t JOIN txgroup_hierarchy gh ON t.txgroup_id = gh.txgroup_id WHERE t.timestamp >= $__from/1000 AND t.timestamp <= $__to/1000 GROUP BY timestamp ORDER BY timestamp;",
|
503
|
+
"refId": "A",
|
504
|
+
"timeColumns": [
|
505
|
+
"timestamp"
|
506
|
+
]
|
507
|
+
}
|
508
|
+
],
|
509
|
+
"title": "Weekly Cashflow",
|
510
|
+
"transformations": [
|
511
|
+
{
|
512
|
+
"id": "formatTime",
|
513
|
+
"options": {
|
514
|
+
"outputFormat": "YYYY-WW",
|
515
|
+
"timeField": "timestamp",
|
516
|
+
"timezone": "browser",
|
517
|
+
"useTimezone": true
|
518
|
+
}
|
519
|
+
},
|
520
|
+
{
|
521
|
+
"id": "convertFieldType",
|
522
|
+
"options": {
|
523
|
+
"conversions": [
|
524
|
+
{
|
525
|
+
"destinationType": "time",
|
526
|
+
"targetField": "timestamp"
|
527
|
+
}
|
528
|
+
],
|
529
|
+
"fields": {}
|
530
|
+
}
|
531
|
+
},
|
532
|
+
{
|
533
|
+
"id": "groupBy",
|
534
|
+
"options": {
|
535
|
+
"fields": {
|
536
|
+
"Cost of Revenue": {
|
537
|
+
"aggregations": [
|
538
|
+
"sum"
|
539
|
+
],
|
540
|
+
"operation": "aggregate"
|
541
|
+
},
|
542
|
+
"Expenses": {
|
543
|
+
"aggregations": [
|
544
|
+
"sum"
|
545
|
+
],
|
546
|
+
"operation": "aggregate"
|
547
|
+
},
|
548
|
+
"Net": {
|
549
|
+
"aggregations": [
|
550
|
+
"sum"
|
551
|
+
],
|
552
|
+
"operation": "aggregate"
|
553
|
+
},
|
554
|
+
"Other Expenses": {
|
555
|
+
"aggregations": [
|
556
|
+
"sum"
|
557
|
+
],
|
558
|
+
"operation": "aggregate"
|
559
|
+
},
|
560
|
+
"Other Income": {
|
561
|
+
"aggregations": [
|
562
|
+
"sum"
|
563
|
+
],
|
564
|
+
"operation": "aggregate"
|
565
|
+
},
|
566
|
+
"Revenue": {
|
567
|
+
"aggregations": [
|
568
|
+
"sum"
|
569
|
+
],
|
570
|
+
"operation": "aggregate"
|
571
|
+
},
|
572
|
+
"Timestamp": {
|
573
|
+
"aggregations": [],
|
574
|
+
"operation": "groupby"
|
575
|
+
},
|
576
|
+
"Total Expenses": {
|
577
|
+
"aggregations": [
|
578
|
+
"sum"
|
579
|
+
],
|
580
|
+
"operation": "aggregate"
|
581
|
+
},
|
582
|
+
"Total Revenue": {
|
583
|
+
"aggregations": [
|
584
|
+
"sum"
|
585
|
+
],
|
586
|
+
"operation": "aggregate"
|
587
|
+
},
|
588
|
+
"timestamp": {
|
589
|
+
"aggregations": [],
|
590
|
+
"operation": "groupby"
|
591
|
+
}
|
592
|
+
}
|
593
|
+
}
|
594
|
+
}
|
595
|
+
],
|
596
|
+
"type": "timeseries"
|
597
|
+
}
|
598
|
+
],
|
599
|
+
"refresh": "",
|
600
|
+
"schemaVersion": 38,
|
601
|
+
"tags": [],
|
602
|
+
"templating": {
|
603
|
+
"list": []
|
604
|
+
},
|
605
|
+
"time": {
|
606
|
+
"from": "now-6M",
|
607
|
+
"to": "now"
|
608
|
+
},
|
609
|
+
"timepicker": {},
|
610
|
+
"timezone": "",
|
611
|
+
"title": "Total Cashflow Summary",
|
612
|
+
"uid": "7e2b1c8a-4e2d-4b7a-9c1a-2f8e6b7d9c3f",
|
613
|
+
"version": 1,
|
614
|
+
"weekStart": ""
|
615
|
+
}
|