dao-treasury 0.0.32__cp311-cp311-win_amd64.whl → 0.0.33__cp311-cp311-win_amd64.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.cp311-win_amd64.pyd +0 -0
- dao_treasury/.grafana/provisioning/dashboards/dashboards.yaml +31 -5
- dao_treasury/.grafana/provisioning/dashboards/summary/Monthly.json +5 -10
- dao_treasury/.grafana/provisioning/dashboards/transactions/Treasury Transactions.json +13 -13
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow (Including Unsorted).json +834 -0
- dao_treasury/.grafana/provisioning/dashboards/treasury/Cashflow.json +25 -428
- dao_treasury/.grafana/provisioning/dashboards/treasury/Operating Cashflow.json +491 -0
- dao_treasury/_docker.cp311-win_amd64.pyd +0 -0
- dao_treasury/_nicknames.cp311-win_amd64.pyd +0 -0
- dao_treasury/_wallet.cp311-win_amd64.pyd +0 -0
- dao_treasury/constants.cp311-win_amd64.pyd +0 -0
- dao_treasury/db.py +58 -31
- dao_treasury/sorting/__init__.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/__init__.py +109 -6
- dao_treasury/sorting/_matchers.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/_rules.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/factory.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/rule.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/rules/__init__.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/rules/ignore/__init__.cp311-win_amd64.pyd +0 -0
- dao_treasury/sorting/rules/ignore/llamapay.cp311-win_amd64.pyd +0 -0
- dao_treasury/streams/__init__.cp311-win_amd64.pyd +0 -0
- dao_treasury/streams/llamapay.cp311-win_amd64.pyd +0 -0
- dao_treasury/types.cp311-win_amd64.pyd +0 -0
- {dao_treasury-0.0.32.dist-info → dao_treasury-0.0.33.dist-info}/METADATA +2 -2
- {dao_treasury-0.0.32.dist-info → dao_treasury-0.0.33.dist-info}/RECORD +28 -26
- {dao_treasury-0.0.32.dist-info → dao_treasury-0.0.33.dist-info}/WHEEL +0 -0
- {dao_treasury-0.0.32.dist-info → dao_treasury-0.0.33.dist-info}/top_level.txt +0 -0
@@ -18,7 +18,6 @@
|
|
18
18
|
"editable": true,
|
19
19
|
"fiscalYearStartMonth": 0,
|
20
20
|
"graphTooltip": 1,
|
21
|
-
"id": 5,
|
22
21
|
"links": [],
|
23
22
|
"liveNow": false,
|
24
23
|
"panels": [
|
@@ -71,9 +70,9 @@
|
|
71
70
|
"targets": [
|
72
71
|
{
|
73
72
|
"datasource": "SQLite",
|
74
|
-
"queryText": "
|
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",
|
75
74
|
"queryType": "table",
|
76
|
-
"rawQueryText": "
|
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",
|
77
76
|
"refId": "A",
|
78
77
|
"timeColumns": [
|
79
78
|
"time",
|
@@ -133,9 +132,9 @@
|
|
133
132
|
"targets": [
|
134
133
|
{
|
135
134
|
"datasource": "SQLite",
|
136
|
-
"queryText": "
|
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",
|
137
136
|
"queryType": "table",
|
138
|
-
"rawQueryText": "
|
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",
|
139
138
|
"refId": "A",
|
140
139
|
"timeColumns": [
|
141
140
|
"time",
|
@@ -195,9 +194,9 @@
|
|
195
194
|
"targets": [
|
196
195
|
{
|
197
196
|
"datasource": "SQLite",
|
198
|
-
"queryText": "
|
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",
|
199
198
|
"queryType": "table",
|
200
|
-
"rawQueryText": "
|
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",
|
201
200
|
"refId": "A",
|
202
201
|
"timeColumns": [
|
203
202
|
"time",
|
@@ -205,7 +204,7 @@
|
|
205
204
|
]
|
206
205
|
}
|
207
206
|
],
|
208
|
-
"title": "Cost
|
207
|
+
"title": "Cost of Revenue",
|
209
208
|
"type": "stat"
|
210
209
|
},
|
211
210
|
{
|
@@ -257,9 +256,9 @@
|
|
257
256
|
"targets": [
|
258
257
|
{
|
259
258
|
"datasource": "SQLite",
|
260
|
-
"queryText": "
|
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",
|
261
260
|
"queryType": "table",
|
262
|
-
"rawQueryText": "
|
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",
|
263
262
|
"refId": "A",
|
264
263
|
"timeColumns": [
|
265
264
|
"time",
|
@@ -319,9 +318,9 @@
|
|
319
318
|
"targets": [
|
320
319
|
{
|
321
320
|
"datasource": "SQLite",
|
322
|
-
"queryText": "
|
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",
|
323
322
|
"queryType": "table",
|
324
|
-
"rawQueryText": "
|
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",
|
325
324
|
"refId": "A",
|
326
325
|
"timeColumns": [
|
327
326
|
"time",
|
@@ -382,9 +381,9 @@
|
|
382
381
|
"targets": [
|
383
382
|
{
|
384
383
|
"datasource": "SQLite",
|
385
|
-
"queryText": "
|
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",
|
386
385
|
"queryType": "table",
|
387
|
-
"rawQueryText": "
|
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",
|
388
387
|
"refId": "A",
|
389
388
|
"timeColumns": [
|
390
389
|
"time",
|
@@ -478,7 +477,7 @@
|
|
478
477
|
},
|
479
478
|
"gridPos": {
|
480
479
|
"h": 12,
|
481
|
-
"w":
|
480
|
+
"w": 24,
|
482
481
|
"x": 0,
|
483
482
|
"y": 4
|
484
483
|
},
|
@@ -498,9 +497,9 @@
|
|
498
497
|
"targets": [
|
499
498
|
{
|
500
499
|
"datasource": "SQLite",
|
501
|
-
"queryText": "
|
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;",
|
502
501
|
"queryType": "table",
|
503
|
-
"rawQueryText": "
|
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;",
|
504
503
|
"refId": "A",
|
505
504
|
"timeColumns": [
|
506
505
|
"timestamp"
|
@@ -523,7 +522,6 @@
|
|
523
522
|
"options": {
|
524
523
|
"conversions": [
|
525
524
|
{
|
526
|
-
"dateFormat": "YYYY-WW",
|
527
525
|
"destinationType": "time",
|
528
526
|
"targetField": "timestamp"
|
529
527
|
}
|
@@ -535,404 +533,45 @@
|
|
535
533
|
"id": "groupBy",
|
536
534
|
"options": {
|
537
535
|
"fields": {
|
538
|
-
"
|
539
|
-
"aggregations": [
|
540
|
-
"sum"
|
541
|
-
],
|
542
|
-
"operation": "aggregate"
|
543
|
-
},
|
544
|
-
"Total Expenses": {
|
545
|
-
"aggregations": [
|
546
|
-
"sum"
|
547
|
-
],
|
548
|
-
"operation": "aggregate"
|
549
|
-
},
|
550
|
-
"Total Revenue": {
|
536
|
+
"Cost of Revenue": {
|
551
537
|
"aggregations": [
|
552
538
|
"sum"
|
553
539
|
],
|
554
540
|
"operation": "aggregate"
|
555
541
|
},
|
556
|
-
"
|
542
|
+
"Expenses": {
|
557
543
|
"aggregations": [
|
558
544
|
"sum"
|
559
545
|
],
|
560
546
|
"operation": "aggregate"
|
561
547
|
},
|
562
|
-
"
|
548
|
+
"Net": {
|
563
549
|
"aggregations": [
|
564
550
|
"sum"
|
565
551
|
],
|
566
552
|
"operation": "aggregate"
|
567
553
|
},
|
568
|
-
"
|
554
|
+
"Other Expenses": {
|
569
555
|
"aggregations": [
|
570
556
|
"sum"
|
571
557
|
],
|
572
558
|
"operation": "aggregate"
|
573
559
|
},
|
574
|
-
"
|
560
|
+
"Other Income": {
|
575
561
|
"aggregations": [
|
576
562
|
"sum"
|
577
563
|
],
|
578
564
|
"operation": "aggregate"
|
579
565
|
},
|
580
|
-
"
|
566
|
+
"Revenue": {
|
581
567
|
"aggregations": [
|
582
568
|
"sum"
|
583
569
|
],
|
584
570
|
"operation": "aggregate"
|
585
571
|
},
|
586
|
-
"
|
572
|
+
"Timestamp": {
|
587
573
|
"aggregations": [],
|
588
574
|
"operation": "groupby"
|
589
|
-
}
|
590
|
-
}
|
591
|
-
}
|
592
|
-
}
|
593
|
-
],
|
594
|
-
"type": "timeseries"
|
595
|
-
},
|
596
|
-
{
|
597
|
-
"datasource": "SQLite",
|
598
|
-
"description": "",
|
599
|
-
"fieldConfig": {
|
600
|
-
"defaults": {
|
601
|
-
"color": {
|
602
|
-
"mode": "thresholds"
|
603
|
-
},
|
604
|
-
"mappings": [],
|
605
|
-
"thresholds": {
|
606
|
-
"mode": "absolute",
|
607
|
-
"steps": [
|
608
|
-
{
|
609
|
-
"color": "green",
|
610
|
-
"value": null
|
611
|
-
},
|
612
|
-
{
|
613
|
-
"color": "red",
|
614
|
-
"value": 80
|
615
|
-
}
|
616
|
-
]
|
617
|
-
}
|
618
|
-
},
|
619
|
-
"overrides": []
|
620
|
-
},
|
621
|
-
"gridPos": {
|
622
|
-
"h": 4,
|
623
|
-
"w": 4,
|
624
|
-
"x": 20,
|
625
|
-
"y": 4
|
626
|
-
},
|
627
|
-
"id": 8,
|
628
|
-
"options": {
|
629
|
-
"colorMode": "value",
|
630
|
-
"graphMode": "area",
|
631
|
-
"justifyMode": "auto",
|
632
|
-
"orientation": "auto",
|
633
|
-
"reduceOptions": {
|
634
|
-
"calcs": [
|
635
|
-
"lastNotNull"
|
636
|
-
],
|
637
|
-
"fields": "",
|
638
|
-
"values": false
|
639
|
-
},
|
640
|
-
"textMode": "auto"
|
641
|
-
},
|
642
|
-
"pluginVersion": "10.2.0",
|
643
|
-
"targets": [
|
644
|
-
{
|
645
|
-
"datasource": "SQLite",
|
646
|
-
"queryText": "WITH RECURSIVE group_hierarchy (txgroup_id, top_category, parent_txgroup) AS (\n SELECT txgroup_id, name AS top_category, parent_txgroup\n FROM txgroups\n WHERE parent_txgroup IS NULL\n\n UNION ALL\n\n SELECT\n child.txgroup_id,\n parent.top_category,\n child.parent_txgroup\n FROM txgroups AS child\n JOIN group_hierarchy AS parent\n ON child.parent_txgroup = parent.txgroup_id\n)\nSELECT\n SUM(t.value_usd) AS total_revenue\nFROM general_ledger t\nJOIN group_hierarchy gh USING (txgroup_id)\nWHERE gh.top_category = 'Sort Me (Inbound)'\n AND t.timestamp >= $__from/1000\n AND t.timestamp <= $__to/1000\n",
|
647
|
-
"queryType": "table",
|
648
|
-
"rawQueryText": "WITH RECURSIVE group_hierarchy (txgroup_id, top_category, parent_txgroup) AS (\n SELECT txgroup_id, name AS top_category, parent_txgroup\n FROM txgroups\n WHERE parent_txgroup IS NULL\n\n UNION ALL\n\n SELECT\n child.txgroup_id,\n parent.top_category,\n child.parent_txgroup\n FROM txgroups AS child\n JOIN group_hierarchy AS parent\n ON child.parent_txgroup = parent.txgroup_id\n)\nSELECT\n SUM(t.value_usd) AS total_revenue\nFROM general_ledger t\nJOIN group_hierarchy gh USING (txgroup_id)\nWHERE gh.top_category = 'Sort Me (Inbound)'\n AND t.timestamp >= $__from/1000\n AND t.timestamp <= $__to/1000\n",
|
649
|
-
"refId": "A",
|
650
|
-
"timeColumns": [
|
651
|
-
"time",
|
652
|
-
"ts"
|
653
|
-
]
|
654
|
-
}
|
655
|
-
],
|
656
|
-
"title": "Unsorted (Inbound)",
|
657
|
-
"type": "stat"
|
658
|
-
},
|
659
|
-
{
|
660
|
-
"datasource": "SQLite",
|
661
|
-
"description": "",
|
662
|
-
"fieldConfig": {
|
663
|
-
"defaults": {
|
664
|
-
"color": {
|
665
|
-
"mode": "thresholds"
|
666
|
-
},
|
667
|
-
"mappings": [],
|
668
|
-
"thresholds": {
|
669
|
-
"mode": "absolute",
|
670
|
-
"steps": [
|
671
|
-
{
|
672
|
-
"color": "green",
|
673
|
-
"value": null
|
674
|
-
},
|
675
|
-
{
|
676
|
-
"color": "red",
|
677
|
-
"value": 80
|
678
|
-
}
|
679
|
-
]
|
680
|
-
}
|
681
|
-
},
|
682
|
-
"overrides": []
|
683
|
-
},
|
684
|
-
"gridPos": {
|
685
|
-
"h": 4,
|
686
|
-
"w": 4,
|
687
|
-
"x": 20,
|
688
|
-
"y": 8
|
689
|
-
},
|
690
|
-
"id": 9,
|
691
|
-
"options": {
|
692
|
-
"colorMode": "value",
|
693
|
-
"graphMode": "area",
|
694
|
-
"justifyMode": "auto",
|
695
|
-
"orientation": "auto",
|
696
|
-
"reduceOptions": {
|
697
|
-
"calcs": [
|
698
|
-
"lastNotNull"
|
699
|
-
],
|
700
|
-
"fields": "",
|
701
|
-
"values": false
|
702
|
-
},
|
703
|
-
"textMode": "auto"
|
704
|
-
},
|
705
|
-
"pluginVersion": "10.2.0",
|
706
|
-
"targets": [
|
707
|
-
{
|
708
|
-
"datasource": "SQLite",
|
709
|
-
"queryText": "WITH RECURSIVE group_hierarchy (txgroup_id, top_category, parent_txgroup) AS (\n SELECT txgroup_id, name AS top_category, parent_txgroup\n FROM txgroups\n WHERE parent_txgroup IS NULL\n\n UNION ALL\n\n SELECT\n child.txgroup_id,\n parent.top_category,\n child.parent_txgroup\n FROM txgroups AS child\n JOIN group_hierarchy AS parent\n ON child.parent_txgroup = parent.txgroup_id\n)\nSELECT\n SUM(t.value_usd) AS total_revenue\nFROM general_ledger t\nJOIN group_hierarchy gh USING (txgroup_id)\nWHERE gh.top_category = 'Sort Me (Outbound)'\n AND t.timestamp >= $__from/1000\n AND t.timestamp <= $__to/1000\n",
|
710
|
-
"queryType": "table",
|
711
|
-
"rawQueryText": "WITH RECURSIVE group_hierarchy (txgroup_id, top_category, parent_txgroup) AS (\n SELECT txgroup_id, name AS top_category, parent_txgroup\n FROM txgroups\n WHERE parent_txgroup IS NULL\n\n UNION ALL\n\n SELECT\n child.txgroup_id,\n parent.top_category,\n child.parent_txgroup\n FROM txgroups AS child\n JOIN group_hierarchy AS parent\n ON child.parent_txgroup = parent.txgroup_id\n)\nSELECT\n SUM(t.value_usd) AS total_revenue\nFROM general_ledger t\nJOIN group_hierarchy gh USING (txgroup_id)\nWHERE gh.top_category = 'Sort Me (Outbound)'\n AND t.timestamp >= $__from/1000\n AND t.timestamp <= $__to/1000\n",
|
712
|
-
"refId": "A",
|
713
|
-
"timeColumns": [
|
714
|
-
"time",
|
715
|
-
"ts"
|
716
|
-
]
|
717
|
-
}
|
718
|
-
],
|
719
|
-
"title": "Unsorted (Outbound)",
|
720
|
-
"type": "stat"
|
721
|
-
},
|
722
|
-
{
|
723
|
-
"datasource": "SQLite",
|
724
|
-
"description": "",
|
725
|
-
"fieldConfig": {
|
726
|
-
"defaults": {
|
727
|
-
"color": {
|
728
|
-
"mode": "thresholds"
|
729
|
-
},
|
730
|
-
"mappings": [],
|
731
|
-
"thresholds": {
|
732
|
-
"mode": "absolute",
|
733
|
-
"steps": [
|
734
|
-
{
|
735
|
-
"color": "green",
|
736
|
-
"value": null
|
737
|
-
},
|
738
|
-
{
|
739
|
-
"color": "red",
|
740
|
-
"value": 80
|
741
|
-
}
|
742
|
-
]
|
743
|
-
}
|
744
|
-
},
|
745
|
-
"overrides": []
|
746
|
-
},
|
747
|
-
"gridPos": {
|
748
|
-
"h": 4,
|
749
|
-
"w": 4,
|
750
|
-
"x": 20,
|
751
|
-
"y": 12
|
752
|
-
},
|
753
|
-
"id": 6,
|
754
|
-
"options": {
|
755
|
-
"colorMode": "value",
|
756
|
-
"graphMode": "area",
|
757
|
-
"justifyMode": "auto",
|
758
|
-
"orientation": "auto",
|
759
|
-
"reduceOptions": {
|
760
|
-
"calcs": [
|
761
|
-
"lastNotNull"
|
762
|
-
],
|
763
|
-
"fields": "",
|
764
|
-
"values": false
|
765
|
-
},
|
766
|
-
"textMode": "auto"
|
767
|
-
},
|
768
|
-
"pluginVersion": "10.2.0",
|
769
|
-
"targets": [
|
770
|
-
{
|
771
|
-
"datasource": "SQLite",
|
772
|
-
"queryText": "WITH RECURSIVE group_hierarchy (txgroup_id, top_category, parent_txgroup) AS (\n SELECT\n txgroup_id,\n name AS top_category,\n parent_txgroup\n FROM txgroups\n WHERE parent_txgroup IS NULL\n\n UNION ALL\n\n SELECT\n child.txgroup_id,\n parent.top_category,\n child.parent_txgroup\n FROM txgroups AS child\n JOIN group_hierarchy AS parent\n ON child.parent_txgroup = parent.txgroup_id\n)\nSELECT\n (\n -- Revenue\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n -- Cost of Revenue\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n -- Expenses\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n -- Other Income\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n -- Other Expenses\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n -- Sort Me (Inbound)\n + SUM(CASE WHEN gh.top_category = 'Sort Me (Inbound)' THEN t.value_usd ELSE 0 END)\n -- Sort Me (Outbound)\n - SUM(CASE WHEN gh.top_category = 'Sort Me (Outbound)' THEN t.value_usd ELSE 0 END)\n ) AS total_net\nFROM general_ledger t\nJOIN group_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000\n AND t.timestamp <= $__to/1000",
|
773
|
-
"queryType": "table",
|
774
|
-
"rawQueryText": "WITH RECURSIVE group_hierarchy (txgroup_id, top_category, parent_txgroup) AS (\n SELECT\n txgroup_id,\n name AS top_category,\n parent_txgroup\n FROM txgroups\n WHERE parent_txgroup IS NULL\n\n UNION ALL\n\n SELECT\n child.txgroup_id,\n parent.top_category,\n child.parent_txgroup\n FROM txgroups AS child\n JOIN group_hierarchy AS parent\n ON child.parent_txgroup = parent.txgroup_id\n)\nSELECT\n (\n -- Revenue\n SUM(CASE WHEN gh.top_category = 'Revenue' THEN t.value_usd ELSE 0 END)\n -- Cost of Revenue\n - SUM(CASE WHEN gh.top_category = 'Cost of Revenue' THEN t.value_usd ELSE 0 END)\n -- Expenses\n - SUM(CASE WHEN gh.top_category = 'Expenses' THEN t.value_usd ELSE 0 END)\n -- Other Income\n + SUM(CASE WHEN gh.top_category = 'Other Income' THEN t.value_usd ELSE 0 END)\n -- Other Expenses\n - SUM(CASE WHEN gh.top_category = 'Other Expenses' THEN t.value_usd ELSE 0 END)\n -- Sort Me (Inbound)\n + SUM(CASE WHEN gh.top_category = 'Sort Me (Inbound)' THEN t.value_usd ELSE 0 END)\n -- Sort Me (Outbound)\n - SUM(CASE WHEN gh.top_category = 'Sort Me (Outbound)' THEN t.value_usd ELSE 0 END)\n ) AS total_net\nFROM general_ledger t\nJOIN group_hierarchy gh USING (txgroup_id)\nWHERE t.timestamp >= $__from/1000\n AND t.timestamp <= $__to/1000",
|
775
|
-
"refId": "A",
|
776
|
-
"timeColumns": [
|
777
|
-
"time",
|
778
|
-
"ts"
|
779
|
-
]
|
780
|
-
}
|
781
|
-
],
|
782
|
-
"title": "Total",
|
783
|
-
"type": "stat"
|
784
|
-
},
|
785
|
-
{
|
786
|
-
"datasource": "SQLite",
|
787
|
-
"description": "",
|
788
|
-
"fieldConfig": {
|
789
|
-
"defaults": {
|
790
|
-
"color": {
|
791
|
-
"mode": "palette-classic"
|
792
|
-
},
|
793
|
-
"custom": {
|
794
|
-
"axisBorderShow": false,
|
795
|
-
"axisCenteredZero": false,
|
796
|
-
"axisColorMode": "text",
|
797
|
-
"axisLabel": "",
|
798
|
-
"axisPlacement": "auto",
|
799
|
-
"barAlignment": 0,
|
800
|
-
"drawStyle": "bars",
|
801
|
-
"fillOpacity": 70,
|
802
|
-
"gradientMode": "none",
|
803
|
-
"hideFrom": {
|
804
|
-
"legend": false,
|
805
|
-
"tooltip": false,
|
806
|
-
"viz": false
|
807
|
-
},
|
808
|
-
"insertNulls": false,
|
809
|
-
"lineInterpolation": "linear",
|
810
|
-
"lineWidth": 1,
|
811
|
-
"pointSize": 5,
|
812
|
-
"scaleDistribution": {
|
813
|
-
"type": "linear"
|
814
|
-
},
|
815
|
-
"showPoints": "auto",
|
816
|
-
"spanNulls": false,
|
817
|
-
"stacking": {
|
818
|
-
"group": "A",
|
819
|
-
"mode": "normal"
|
820
|
-
},
|
821
|
-
"thresholdsStyle": {
|
822
|
-
"mode": "off"
|
823
|
-
}
|
824
|
-
},
|
825
|
-
"mappings": [],
|
826
|
-
"thresholds": {
|
827
|
-
"mode": "absolute",
|
828
|
-
"steps": [
|
829
|
-
{
|
830
|
-
"color": "green",
|
831
|
-
"value": null
|
832
|
-
},
|
833
|
-
{
|
834
|
-
"color": "red",
|
835
|
-
"value": 80
|
836
|
-
}
|
837
|
-
]
|
838
|
-
}
|
839
|
-
},
|
840
|
-
"overrides": [
|
841
|
-
{
|
842
|
-
"matcher": {
|
843
|
-
"id": "byName",
|
844
|
-
"options": "Net (incl. Unsorted) (sum)"
|
845
|
-
},
|
846
|
-
"properties": [
|
847
|
-
{
|
848
|
-
"id": "custom.drawStyle",
|
849
|
-
"value": "line"
|
850
|
-
},
|
851
|
-
{
|
852
|
-
"id": "custom.stacking",
|
853
|
-
"value": {
|
854
|
-
"group": "A",
|
855
|
-
"mode": "none"
|
856
|
-
}
|
857
|
-
},
|
858
|
-
{
|
859
|
-
"id": "custom.fillOpacity",
|
860
|
-
"value": 19
|
861
|
-
}
|
862
|
-
]
|
863
|
-
}
|
864
|
-
]
|
865
|
-
},
|
866
|
-
"gridPos": {
|
867
|
-
"h": 11,
|
868
|
-
"w": 24,
|
869
|
-
"x": 0,
|
870
|
-
"y": 16
|
871
|
-
},
|
872
|
-
"id": 12,
|
873
|
-
"options": {
|
874
|
-
"legend": {
|
875
|
-
"calcs": [],
|
876
|
-
"displayMode": "list",
|
877
|
-
"placement": "bottom",
|
878
|
-
"showLegend": true
|
879
|
-
},
|
880
|
-
"tooltip": {
|
881
|
-
"mode": "single",
|
882
|
-
"sort": "none"
|
883
|
-
}
|
884
|
-
},
|
885
|
-
"targets": [
|
886
|
-
{
|
887
|
-
"datasource": "SQLite",
|
888
|
-
"queryText": "WITH RECURSIVE group_hierarchy (txgroup_id, top_category, parent_txgroup) AS (\n SELECT\n txgroup_id,\n name AS top_category,\n parent_txgroup\n FROM txgroups\n WHERE parent_txgroup IS NULL\n\n UNION ALL\n\n SELECT\n child.txgroup_id,\n parent.top_category,\n child.parent_txgroup\n FROM txgroups AS child\n JOIN group_hierarchy AS parent\n ON child.parent_txgroup = parent.txgroup_id\n)\nSELECT\n t.timestamp,\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN t.value_usd ELSE 0 END) AS \"Total Revenue (incl. Unsorted)\",\n SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses (incl. Unsorted)\",\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN t.value_usd ELSE 0 END) AS \"Net (incl. Unsorted)\"\nFROM general_ledger AS t\nJOIN group_hierarchy gh\n ON t.txgroup_id = gh.txgroup_id\nWHERE t.timestamp >= $__from/1000\n AND t.timestamp <= $__to/1000\nGROUP BY timestamp\nORDER BY timestamp;",
|
889
|
-
"queryType": "table",
|
890
|
-
"rawQueryText": "WITH RECURSIVE group_hierarchy (txgroup_id, top_category, parent_txgroup) AS (\n SELECT\n txgroup_id,\n name AS top_category,\n parent_txgroup\n FROM txgroups\n WHERE parent_txgroup IS NULL\n\n UNION ALL\n\n SELECT\n child.txgroup_id,\n parent.top_category,\n child.parent_txgroup\n FROM txgroups AS child\n JOIN group_hierarchy AS parent\n ON child.parent_txgroup = parent.txgroup_id\n)\nSELECT\n t.timestamp,\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN t.value_usd ELSE 0 END) AS \"Total Revenue (incl. Unsorted)\",\n SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN t.value_usd ELSE 0 END) * -1 AS \"Total Expenses (incl. Unsorted)\",\n SUM(CASE WHEN gh.top_category in ('Revenue', 'Other Income','Sort Me (Inbound)') THEN t.value_usd ELSE 0 END) - SUM(CASE WHEN gh.top_category in ('Cost of Revenue','Expenses','Other Expenses','Sort Me (Outbound)') THEN t.value_usd ELSE 0 END) AS \"Net (incl. Unsorted)\"\nFROM general_ledger AS t\nJOIN group_hierarchy gh\n ON t.txgroup_id = gh.txgroup_id\nWHERE t.timestamp >= $__from/1000\n AND t.timestamp <= $__to/1000\nGROUP BY timestamp\nORDER BY timestamp;",
|
891
|
-
"refId": "A",
|
892
|
-
"timeColumns": [
|
893
|
-
"timestamp"
|
894
|
-
]
|
895
|
-
}
|
896
|
-
],
|
897
|
-
"title": "Weekly Cashflow (incl. Unsorted)",
|
898
|
-
"transformations": [
|
899
|
-
{
|
900
|
-
"id": "formatTime",
|
901
|
-
"options": {
|
902
|
-
"outputFormat": "YYYY-WW",
|
903
|
-
"timeField": "timestamp",
|
904
|
-
"timezone": "browser",
|
905
|
-
"useTimezone": true
|
906
|
-
}
|
907
|
-
},
|
908
|
-
{
|
909
|
-
"id": "convertFieldType",
|
910
|
-
"options": {
|
911
|
-
"conversions": [
|
912
|
-
{
|
913
|
-
"dateFormat": "YYYY-WW",
|
914
|
-
"destinationType": "time",
|
915
|
-
"targetField": "timestamp"
|
916
|
-
}
|
917
|
-
],
|
918
|
-
"fields": {}
|
919
|
-
}
|
920
|
-
},
|
921
|
-
{
|
922
|
-
"id": "groupBy",
|
923
|
-
"options": {
|
924
|
-
"fields": {
|
925
|
-
"Net": {
|
926
|
-
"aggregations": [
|
927
|
-
"sum"
|
928
|
-
],
|
929
|
-
"operation": "aggregate"
|
930
|
-
},
|
931
|
-
"Net (incl. Unsorted)": {
|
932
|
-
"aggregations": [
|
933
|
-
"sum"
|
934
|
-
],
|
935
|
-
"operation": "aggregate"
|
936
575
|
},
|
937
576
|
"Total Expenses": {
|
938
577
|
"aggregations": [
|
@@ -940,54 +579,12 @@
|
|
940
579
|
],
|
941
580
|
"operation": "aggregate"
|
942
581
|
},
|
943
|
-
"Total Expenses (incl. Unsorted)": {
|
944
|
-
"aggregations": [
|
945
|
-
"sum"
|
946
|
-
],
|
947
|
-
"operation": "aggregate"
|
948
|
-
},
|
949
582
|
"Total Revenue": {
|
950
583
|
"aggregations": [
|
951
584
|
"sum"
|
952
585
|
],
|
953
586
|
"operation": "aggregate"
|
954
587
|
},
|
955
|
-
"Total Revenue (incl. Unsorted)": {
|
956
|
-
"aggregations": [
|
957
|
-
"sum"
|
958
|
-
],
|
959
|
-
"operation": "aggregate"
|
960
|
-
},
|
961
|
-
"cost_of_revenue": {
|
962
|
-
"aggregations": [
|
963
|
-
"sum"
|
964
|
-
],
|
965
|
-
"operation": "aggregate"
|
966
|
-
},
|
967
|
-
"expenses": {
|
968
|
-
"aggregations": [
|
969
|
-
"sum"
|
970
|
-
],
|
971
|
-
"operation": "aggregate"
|
972
|
-
},
|
973
|
-
"other_expenses": {
|
974
|
-
"aggregations": [
|
975
|
-
"sum"
|
976
|
-
],
|
977
|
-
"operation": "aggregate"
|
978
|
-
},
|
979
|
-
"other_income": {
|
980
|
-
"aggregations": [
|
981
|
-
"sum"
|
982
|
-
],
|
983
|
-
"operation": "aggregate"
|
984
|
-
},
|
985
|
-
"revenue": {
|
986
|
-
"aggregations": [
|
987
|
-
"sum"
|
988
|
-
],
|
989
|
-
"operation": "aggregate"
|
990
|
-
},
|
991
588
|
"timestamp": {
|
992
589
|
"aggregations": [],
|
993
590
|
"operation": "groupby"
|
@@ -1011,8 +608,8 @@
|
|
1011
608
|
},
|
1012
609
|
"timepicker": {},
|
1013
610
|
"timezone": "",
|
1014
|
-
"title": "Cashflow Summary",
|
1015
|
-
"uid": "
|
611
|
+
"title": "Total Cashflow Summary",
|
612
|
+
"uid": "7e2b1c8a-4e2d-4b7a-9c1a-2f8e6b7d9c3f",
|
1016
613
|
"version": 1,
|
1017
614
|
"weekStart": ""
|
1018
615
|
}
|