chellow 1723718933.0.0__py3-none-any.whl → 1724062841.0.0__py3-none-any.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.
Potentially problematic release.
This version of chellow might be problematic. Click here for more details.
- chellow/e/views.py +17 -4
- chellow/reports/report_59.py +52 -56
- chellow/templates/e/channel_add.html +38 -18
- {chellow-1723718933.0.0.dist-info → chellow-1724062841.0.0.dist-info}/METADATA +1 -1
- {chellow-1723718933.0.0.dist-info → chellow-1724062841.0.0.dist-info}/RECORD +6 -6
- {chellow-1723718933.0.0.dist-info → chellow-1724062841.0.0.dist-info}/WHEEL +0 -0
chellow/e/views.py
CHANGED
|
@@ -37,6 +37,7 @@ from chellow.models import (
|
|
|
37
37
|
BatchFile,
|
|
38
38
|
Bill,
|
|
39
39
|
BillType,
|
|
40
|
+
CHANNEL_TYPES,
|
|
40
41
|
Channel,
|
|
41
42
|
ClockInterval,
|
|
42
43
|
Comm,
|
|
@@ -193,13 +194,25 @@ def csv_bills_get():
|
|
|
193
194
|
|
|
194
195
|
@e.route("/eras/<int:era_id>/add_channel")
|
|
195
196
|
def channel_add_get(era_id):
|
|
197
|
+
channel_sets = {True: set(CHANNEL_TYPES), False: set(CHANNEL_TYPES)}
|
|
196
198
|
era = Era.get_by_id(g.sess, era_id)
|
|
197
|
-
channels = (
|
|
198
|
-
|
|
199
|
-
.
|
|
199
|
+
channels = g.sess.scalars(
|
|
200
|
+
select(Channel)
|
|
201
|
+
.where(Channel.era == era)
|
|
200
202
|
.order_by(Channel.imp_related, Channel.channel_type)
|
|
203
|
+
).all()
|
|
204
|
+
for channel in channels:
|
|
205
|
+
channel_sets[channel.imp_related].remove(channel.channel_type)
|
|
206
|
+
add_channels = [
|
|
207
|
+
{"imp_related": imp_related, "channel_type": channel_type}
|
|
208
|
+
for imp_related, channel_set in channel_sets.items()
|
|
209
|
+
for channel_type in CHANNEL_TYPES
|
|
210
|
+
if channel_type in channel_set
|
|
211
|
+
]
|
|
212
|
+
|
|
213
|
+
return render_template(
|
|
214
|
+
"channel_add.html", era=era, channels=channels, add_channels=add_channels
|
|
201
215
|
)
|
|
202
|
-
return render_template("channel_add.html", era=era, channels=channels)
|
|
203
216
|
|
|
204
217
|
|
|
205
218
|
@e.route("/eras/<int:era_id>/add_channel", methods=["POST"])
|
chellow/reports/report_59.py
CHANGED
|
@@ -152,7 +152,7 @@ def _process_site(
|
|
|
152
152
|
for xname in ("kwh", "net-gbp"):
|
|
153
153
|
vals[f"{sname}-{xname}"] = 0
|
|
154
154
|
for suf in ("kwh", "net-gbp", "vat-gbp", "gross-gbp"):
|
|
155
|
-
vals[f"billed-import-
|
|
155
|
+
vals[f"billed-import-{suf}"] = 0
|
|
156
156
|
|
|
157
157
|
if imp_mpan_core == "displaced":
|
|
158
158
|
try:
|
|
@@ -173,15 +173,15 @@ def _process_site(
|
|
|
173
173
|
},
|
|
174
174
|
)
|
|
175
175
|
|
|
176
|
-
vals["billed-
|
|
177
|
-
vals["billed-
|
|
178
|
-
vals["billed-
|
|
179
|
-
vals["billed-
|
|
180
|
-
vals["billed-
|
|
181
|
-
vals["billed-
|
|
182
|
-
vals["billed-
|
|
183
|
-
vals["billed-
|
|
184
|
-
vals["billed-
|
|
176
|
+
vals["billed-import-supplier-net-gbp"] = None
|
|
177
|
+
vals["billed-import-supplier-vat-gbp"] = None
|
|
178
|
+
vals["billed-import-supplier-gross-gbp"] = None
|
|
179
|
+
vals["billed-import-dc-net-gbp"] = None
|
|
180
|
+
vals["billed-import-dc-vat-gbp"] = None
|
|
181
|
+
vals["billed-import-dc-gross-gbp"] = None
|
|
182
|
+
vals["billed-import-mop-net-gbp"] = None
|
|
183
|
+
vals["billed-import-mop-vat-gbp"] = None
|
|
184
|
+
vals["billed-import-mop-gross-gbp"] = None
|
|
185
185
|
|
|
186
186
|
vals["used-kwh"] = vals["displaced-kwh"] = sum(
|
|
187
187
|
hh["msp-kwh"] for hh in imp_ss.hh_data
|
|
@@ -225,9 +225,9 @@ def _process_site(
|
|
|
225
225
|
site_sources.add(source_code)
|
|
226
226
|
|
|
227
227
|
for suf in ("net-gbp", "vat-gbp", "gross-gbp"):
|
|
228
|
-
vals["billed-
|
|
229
|
-
vals["billed-
|
|
230
|
-
vals["billed-
|
|
228
|
+
vals[f"billed-import-supplier-{suf}"] = 0
|
|
229
|
+
vals[f"billed-import-dc-{suf}"] = 0
|
|
230
|
+
vals[f"billed-import-mop-{suf}"] = 0
|
|
231
231
|
|
|
232
232
|
if imp_ss is None:
|
|
233
233
|
imp_bad_hhs = imp_bad_kwh = imp_supplier_contract_name = None
|
|
@@ -399,13 +399,13 @@ def _process_site(
|
|
|
399
399
|
min(bill_finish, sss.finish_date) - max(bill_start, sss.start_date)
|
|
400
400
|
).total_seconds() + (30 * 60)
|
|
401
401
|
proportion = overlap_duration / bill_duration
|
|
402
|
-
vals["billed-import-
|
|
402
|
+
vals["billed-import-kwh"] += proportion * float(bill.kwh)
|
|
403
403
|
bill_prop_net_gbp = proportion * float(bill.net)
|
|
404
404
|
bill_prop_vat_gbp = proportion * float(bill.vat)
|
|
405
405
|
bill_prop_gross_gbp = proportion * float(bill.gross)
|
|
406
|
-
vals["billed-import-
|
|
407
|
-
vals["billed-import-
|
|
408
|
-
vals["billed-import-
|
|
406
|
+
vals["billed-import-net-gbp"] += bill_prop_net_gbp
|
|
407
|
+
vals["billed-import-vat-gbp"] += bill_prop_vat_gbp
|
|
408
|
+
vals["billed-import-gross-gbp"] += bill_prop_gross_gbp
|
|
409
409
|
if bill_role_code == "X":
|
|
410
410
|
role_name = "supplier"
|
|
411
411
|
elif bill_role_code == "C":
|
|
@@ -415,9 +415,9 @@ def _process_site(
|
|
|
415
415
|
else:
|
|
416
416
|
raise BadRequest("Role code not recognized.")
|
|
417
417
|
|
|
418
|
-
vals[f"billed-{role_name}-
|
|
419
|
-
vals[f"billed-{role_name}-
|
|
420
|
-
vals[f"billed-{role_name}-
|
|
418
|
+
vals[f"billed-import-{role_name}-net-gbp"] += bill_prop_net_gbp
|
|
419
|
+
vals[f"billed-import-{role_name}-vat-gbp"] += bill_prop_vat_gbp
|
|
420
|
+
vals[f"billed-import-{role_name}-gross-gbp"] += bill_prop_gross_gbp
|
|
421
421
|
|
|
422
422
|
vals["imp-mpan-core"] = imp_mpan_core
|
|
423
423
|
vals["exp-mpan-core"] = exp_mpan_core
|
|
@@ -555,10 +555,10 @@ def _process_site(
|
|
|
555
555
|
for sname in ("kwh", "net-gbp"):
|
|
556
556
|
vals[f"{name}-{sname}"] = 0
|
|
557
557
|
for suf in ("kwh", "net-gbp", "vat-gbp", "gross-gbp"):
|
|
558
|
-
vals[f"billed-import-
|
|
559
|
-
vals[f"billed-
|
|
560
|
-
vals[f"billed-
|
|
561
|
-
vals[f"billed-
|
|
558
|
+
vals[f"billed-import-{suf}"] = 0
|
|
559
|
+
vals[f"billed-import-supplier-{suf}"] = 0
|
|
560
|
+
vals[f"billed-import-dc-{suf}"] = 0
|
|
561
|
+
vals[f"billed-import-mop-{suf}"] = 0
|
|
562
562
|
|
|
563
563
|
for bill in bills:
|
|
564
564
|
bill_role_code = bill.batch.contract.market_role.code
|
|
@@ -586,16 +586,12 @@ def _process_site(
|
|
|
586
586
|
raise BadRequest("Role code not recognized.")
|
|
587
587
|
|
|
588
588
|
for data in vals, site_data:
|
|
589
|
-
data["billed-import-
|
|
590
|
-
data["billed-import-
|
|
589
|
+
data["billed-import-kwh"] += bill_prop_kwh
|
|
590
|
+
data["billed-import-net-gbp"] += bill_prop_net_gbp
|
|
591
|
+
data[f"billed-import-{key}-net-gbp"] += bill_prop_net_gbp
|
|
592
|
+
data[f"billed-import-{key}-vat-gbp"] += bill_prop_vat_gbp
|
|
591
593
|
data[
|
|
592
|
-
f"billed-{key}-
|
|
593
|
-
] += bill_prop_net_gbp
|
|
594
|
-
data[
|
|
595
|
-
f"billed-{key}-import-grid-vat-gbp"
|
|
596
|
-
] += bill_prop_vat_gbp
|
|
597
|
-
data[
|
|
598
|
-
f"billed-{key}-import-grid-gross-gbp"
|
|
594
|
+
f"billed-import-{key}-gross-gbp"
|
|
599
595
|
] += bill_prop_gross_gbp
|
|
600
596
|
|
|
601
597
|
era_rows.append([make_val(vals.get(t)) for t in era_titles])
|
|
@@ -644,10 +640,10 @@ def _process_site(
|
|
|
644
640
|
for sname in ("kwh", "net-gbp"):
|
|
645
641
|
month_data[f"{name}-{sname}"] = 0
|
|
646
642
|
for suf in ("kwh", "net-gbp", "vat-gbp", "gross-gbp"):
|
|
647
|
-
month_data["billed-import-
|
|
648
|
-
month_data["billed-
|
|
649
|
-
month_data["billed-
|
|
650
|
-
month_data["billed-
|
|
643
|
+
month_data["billed-import-{suf}"],
|
|
644
|
+
month_data["billed-import-supplier-{suf}"] = 0
|
|
645
|
+
month_data["billed-import-dc-{suf}"] = 0
|
|
646
|
+
month_data["billed-import-mop-{suf}"] = 0
|
|
651
647
|
|
|
652
648
|
for bill in bills:
|
|
653
649
|
bill_role_code = bill.batch.contract.market_role.code
|
|
@@ -675,17 +671,17 @@ def _process_site(
|
|
|
675
671
|
raise BadRequest("Role code not recognized.")
|
|
676
672
|
|
|
677
673
|
for data in month_data, site_data:
|
|
678
|
-
data["billed-import-
|
|
679
|
-
data["billed-import-
|
|
680
|
-
data[f"billed-{role_name}-
|
|
674
|
+
data["billed-import-kwh"] += bill_prop_kwh
|
|
675
|
+
data["billed-import-net-gbp"] += bill_prop_net_gbp
|
|
676
|
+
data[f"billed-import-{role_name}-kwh"] += bill_prop_kwh
|
|
681
677
|
data[
|
|
682
|
-
f"billed-{role_name}-
|
|
678
|
+
f"billed-import-{role_name}-net-gbp"
|
|
683
679
|
] += bill_prop_net_gbp
|
|
684
680
|
data[
|
|
685
|
-
f"billed-{role_name}-
|
|
681
|
+
f"billed-import-{role_name}-vat-gbp"
|
|
686
682
|
] += bill_prop_vat_gbp
|
|
687
683
|
data[
|
|
688
|
-
f"billed-{role_name}-
|
|
684
|
+
f"billed-import-{role_name}-gross-gbp"
|
|
689
685
|
] += bill_prop_gross_gbp
|
|
690
686
|
|
|
691
687
|
imp_supplier_contract = first_era.imp_supplier_contract
|
|
@@ -957,19 +953,19 @@ def content(
|
|
|
957
953
|
"displaced-net-gbp",
|
|
958
954
|
"used-net-gbp",
|
|
959
955
|
"used-3rd-party-net-gbp",
|
|
960
|
-
"billed-import-
|
|
961
|
-
"billed-import-
|
|
962
|
-
"billed-import-
|
|
963
|
-
"billed-import-
|
|
964
|
-
"billed-
|
|
965
|
-
"billed-
|
|
966
|
-
"billed-
|
|
967
|
-
"billed-
|
|
968
|
-
"billed-
|
|
969
|
-
"billed-
|
|
970
|
-
"billed-
|
|
971
|
-
"billed-
|
|
972
|
-
"billed-
|
|
956
|
+
"billed-import-kwh",
|
|
957
|
+
"billed-import-net-gbp",
|
|
958
|
+
"billed-import-vat-gbp",
|
|
959
|
+
"billed-import-gross-gbp",
|
|
960
|
+
"billed-import-supplier-net-gbp",
|
|
961
|
+
"billed-import-supplier-vat-gbp",
|
|
962
|
+
"billed-import-supplier-gross-gbp",
|
|
963
|
+
"billed-import-dc-net-gbp",
|
|
964
|
+
"billed-import-dc-vat-gbp",
|
|
965
|
+
"billed-import-dc-gross-gbp",
|
|
966
|
+
"billed-import-mop-net-gbp",
|
|
967
|
+
"billed-import-mop-vat-gbp",
|
|
968
|
+
"billed-import-mop-gross-gbp",
|
|
973
969
|
]
|
|
974
970
|
|
|
975
971
|
title_dict = {}
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
{% endblock %}
|
|
14
14
|
|
|
15
15
|
{% block content %}
|
|
16
|
+
|
|
16
17
|
<table>
|
|
17
18
|
<caption>Existing Channels</caption>
|
|
18
19
|
<thead>
|
|
19
20
|
<tr>
|
|
21
|
+
<th>View</th>
|
|
20
22
|
<th>Import / Export Related?</th>
|
|
21
23
|
<th>Type</th>
|
|
22
24
|
</tr>
|
|
@@ -24,6 +26,7 @@
|
|
|
24
26
|
<tbody>
|
|
25
27
|
{% for channel in channels %}
|
|
26
28
|
<tr>
|
|
29
|
+
<td><a href="/e/channels/{{channel.id}}">View</a></td>
|
|
27
30
|
<td>
|
|
28
31
|
{% if channel.imp_related %}
|
|
29
32
|
Import
|
|
@@ -39,23 +42,40 @@
|
|
|
39
42
|
<tbody>
|
|
40
43
|
</table>
|
|
41
44
|
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
<table>
|
|
46
|
+
<caption>Add Channels</caption>
|
|
47
|
+
<thead>
|
|
48
|
+
<tr>
|
|
49
|
+
<th>Import / Export Related?</th>
|
|
50
|
+
<th>Type</th>
|
|
51
|
+
<th>Add</th>
|
|
52
|
+
</tr>
|
|
53
|
+
</thead>
|
|
54
|
+
<tbody>
|
|
55
|
+
{% for channel in add_channels %}
|
|
56
|
+
<tr>
|
|
57
|
+
<td>
|
|
58
|
+
{% if channel.imp_related %}
|
|
59
|
+
Import
|
|
60
|
+
{% else %}
|
|
61
|
+
Export
|
|
62
|
+
{% endif %}
|
|
63
|
+
</td>
|
|
64
|
+
<td>
|
|
65
|
+
{{channel.channel_type}}
|
|
66
|
+
</td>
|
|
67
|
+
<td>
|
|
68
|
+
<form action="/e/eras/{{era.id}}/add_channel" method="post">
|
|
69
|
+
<fieldset>
|
|
70
|
+
<input type="hidden" name="imp_related" value="{{channel.imp_related|lower}}">
|
|
71
|
+
<input type="hidden" name="channel_type" value="{{channel.channel_type}}">
|
|
72
|
+
<input type="submit" value="Add">
|
|
73
|
+
</fieldset>
|
|
74
|
+
</form>
|
|
75
|
+
</td>
|
|
76
|
+
</tr>
|
|
77
|
+
{% endfor %}
|
|
78
|
+
<tbody>
|
|
79
|
+
</table>
|
|
60
80
|
|
|
61
81
|
{% endblock %}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1724062841.0.0
|
|
4
4
|
Summary: Web Application for checking UK energy bills.
|
|
5
5
|
Project-URL: Homepage, https://github.com/WessexWater/chellow
|
|
6
6
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
@@ -38,7 +38,7 @@ chellow/e/system_price.py,sha256=6w5J7bzwFAZubE2zdOFRiS8IIrVP8hkoIOaG2yCt-Ic,623
|
|
|
38
38
|
chellow/e/tlms.py,sha256=M33D6YpMixu2KkwSCzDRM3kThLgShg8exp63Obo75l8,8905
|
|
39
39
|
chellow/e/tnuos.py,sha256=XseYztPUsQXNKuBmystO2kzzwAG9ehCZgpGBTdgSk-A,4313
|
|
40
40
|
chellow/e/triad.py,sha256=lIQj7EdUrcFwEqleuHZXYU_bfzIwNOqUVVxB3NPQt4A,13710
|
|
41
|
-
chellow/e/views.py,sha256=
|
|
41
|
+
chellow/e/views.py,sha256=Kptq1umJm8_E3Dv__0kfllFDwspZxB9zGCZGvkG17NQ,215553
|
|
42
42
|
chellow/e/bill_parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=UgWXDPzQkQghyj_lfgBqoSJpHB-t-qOdSaB8qY6GLog,4071
|
|
44
44
|
chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=-HMoIfa_utXYKA44RuC0Xqv3vd2HLeQU_4P0iBUd3WA,4219
|
|
@@ -85,7 +85,7 @@ chellow/reports/report_33.py,sha256=laVz-itDbJTdvC6LxLEeuY0eKpYx43Un4adiExPTEEE,
|
|
|
85
85
|
chellow/reports/report_387.py,sha256=kmBZopb0AOivcowO2nPjRj6LnV0_QjCDXLwqPL7IGVE,5672
|
|
86
86
|
chellow/reports/report_41.py,sha256=QQeTshA1Og7N3wPaoZ8ynJzwsvZ1mgSFc7DDkVqIZoM,7447
|
|
87
87
|
chellow/reports/report_429.py,sha256=8WlLqyfMyvIF5Kc6CE0MKwcT5xwmR_Ao99Ef72yAOVc,12668
|
|
88
|
-
chellow/reports/report_59.py,sha256=
|
|
88
|
+
chellow/reports/report_59.py,sha256=FGXgKhJwKGBfa0lknaDfvZshV3KRoz5NRbFkbB1f73w,48010
|
|
89
89
|
chellow/reports/report_81.py,sha256=NkT6dZeMo7Z0AkJemD_Xv8Ut5PIZ9vn8Ia1Q_DS9v54,5611
|
|
90
90
|
chellow/reports/report_87.py,sha256=j2gdBOapaVY1ZnlNlw14RPx58_k8eUkc3oRSnKuCsNA,7057
|
|
91
91
|
chellow/reports/report_asset_comparison.py,sha256=UN298MHuzyUDUiiZr7F_Ua6SrdVOlFLjgKjnIbrA-14,6118
|
|
@@ -156,7 +156,7 @@ chellow/templates/user_roles.html,sha256=Pfjr4uApEmJl8t9s0qJTxigQcAVYw7gpV_ECE8c
|
|
|
156
156
|
chellow/templates/users.html,sha256=dBB0yOvsoYbY_I9le1XGqZ0SlesUbWMqfRGlZOtOgNs,2244
|
|
157
157
|
chellow/templates/e/asset_comparison.html,sha256=QyN3WMw8YoFaSWUvD2NOnRLdLdB3Kv6m3t8Id8Mb6_A,678
|
|
158
158
|
chellow/templates/e/channel.html,sha256=R5fhdsHvhB7k57Rw_gviUQ7_EXBGwP05E691V1BUNSQ,2056
|
|
159
|
-
chellow/templates/e/channel_add.html,sha256=
|
|
159
|
+
chellow/templates/e/channel_add.html,sha256=szwQJBHx2kAoSFomXDHD0N_7PSd4drqOoAWhM-jvSqM,1676
|
|
160
160
|
chellow/templates/e/channel_edit.html,sha256=OUkdiS2NBQ_w4gmxRxXAcRToM5BT8DWWJrtQMFs-GUU,2198
|
|
161
161
|
chellow/templates/e/channel_snag.html,sha256=wBJ5KBfeJdAeRmaB0qu0AD9Z4nM5fn6tJ_8bNqTWtoo,1477
|
|
162
162
|
chellow/templates/e/channel_snag_edit.html,sha256=sUFI4Ml3F1B35x8_t_Pz3hWuQN9Xtxr3kt4u8hdxNwY,1911
|
|
@@ -365,6 +365,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
|
|
|
365
365
|
chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
|
|
366
366
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
367
367
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
368
|
-
chellow-
|
|
369
|
-
chellow-
|
|
370
|
-
chellow-
|
|
368
|
+
chellow-1724062841.0.0.dist-info/METADATA,sha256=L-vg7G-J1TW5xMY0_1DmdfO8vbz6ON965HNP1o1FIvk,12241
|
|
369
|
+
chellow-1724062841.0.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
370
|
+
chellow-1724062841.0.0.dist-info/RECORD,,
|
|
File without changes
|