chellow 1716928285.0.0__py3-none-any.whl → 1716973778.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/reports/report_219.py
CHANGED
|
@@ -15,8 +15,8 @@ from chellow.models import (
|
|
|
15
15
|
Bill,
|
|
16
16
|
BillType,
|
|
17
17
|
Era,
|
|
18
|
+
RSession,
|
|
18
19
|
RegisterRead,
|
|
19
|
-
Session,
|
|
20
20
|
Supply,
|
|
21
21
|
User,
|
|
22
22
|
)
|
|
@@ -27,31 +27,33 @@ from chellow.views import chellow_redirect
|
|
|
27
27
|
def content(year, month, months, supply_id, user_id):
|
|
28
28
|
f = None
|
|
29
29
|
try:
|
|
30
|
-
with
|
|
30
|
+
with RSession() as sess:
|
|
31
31
|
user = User.get_by_id(sess, user_id)
|
|
32
32
|
|
|
33
33
|
f = open_file("register_reads.csv", user, mode="w", newline="")
|
|
34
34
|
w = csv.writer(f, lineterminator="\n")
|
|
35
35
|
titles = (
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
36
|
+
"duration_start",
|
|
37
|
+
"duration_finish",
|
|
38
|
+
"site_code",
|
|
39
|
+
"site_name",
|
|
40
|
+
"supply_id",
|
|
41
|
+
"imp_mpan_core",
|
|
42
|
+
"exp_mpan_core",
|
|
43
|
+
"batch_reference",
|
|
44
|
+
"bill_id",
|
|
45
|
+
"bill_reference",
|
|
46
|
+
"bill_issue_date",
|
|
47
|
+
"bill_type",
|
|
48
|
+
"register_read_id",
|
|
49
|
+
"tpr",
|
|
50
|
+
"coefficient",
|
|
51
|
+
"prev_read_date",
|
|
52
|
+
"prev_read_value",
|
|
53
|
+
"prev_read_type",
|
|
54
|
+
"pres_read_date",
|
|
55
|
+
"pres_read_value",
|
|
56
|
+
"pres_read_type",
|
|
55
57
|
)
|
|
56
58
|
w.writerow(titles)
|
|
57
59
|
|
|
@@ -118,6 +120,8 @@ def content(year, month, months, supply_id, user_id):
|
|
|
118
120
|
else:
|
|
119
121
|
era = eras[-1]
|
|
120
122
|
|
|
123
|
+
site = era.get_physical_site(sess)
|
|
124
|
+
|
|
121
125
|
for read in (
|
|
122
126
|
sess.query(RegisterRead)
|
|
123
127
|
.filter(
|
|
@@ -139,28 +143,30 @@ def content(year, month, months, supply_id, user_id):
|
|
|
139
143
|
joinedload(RegisterRead.present_type),
|
|
140
144
|
)
|
|
141
145
|
):
|
|
142
|
-
vals =
|
|
143
|
-
start_date,
|
|
144
|
-
finish_date,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
bill.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"
|
|
155
|
-
read.
|
|
156
|
-
read.
|
|
157
|
-
read.
|
|
158
|
-
read.
|
|
159
|
-
read.
|
|
160
|
-
read.
|
|
161
|
-
read.
|
|
162
|
-
|
|
163
|
-
|
|
146
|
+
vals = {
|
|
147
|
+
"duration_start": start_date,
|
|
148
|
+
"duration_finish": finish_date,
|
|
149
|
+
"site_code": site.code,
|
|
150
|
+
"site_name": site.name,
|
|
151
|
+
"supply_id": supply_id,
|
|
152
|
+
"imp_mpan_core": era.imp_mpan_core,
|
|
153
|
+
"exp_mpan_core": era.exp_mpan_core,
|
|
154
|
+
"batch_reference": batch.reference,
|
|
155
|
+
"bill_id": bill.id,
|
|
156
|
+
"bill_reference": bill.reference,
|
|
157
|
+
"bill_issue_date": bill.issue_date,
|
|
158
|
+
"bill_type": bill_type.code,
|
|
159
|
+
"register_read_id": read.id,
|
|
160
|
+
"tpr": "md" if read.tpr is None else read.tpr.code,
|
|
161
|
+
"coefficient": read.coefficient,
|
|
162
|
+
"prev_read_date": read.previous_date,
|
|
163
|
+
"prev_read_value": read.previous_value,
|
|
164
|
+
"prev_read_type": read.previous_type.code,
|
|
165
|
+
"pres_read_date": read.present_date,
|
|
166
|
+
"pres_read_value": read.present_value,
|
|
167
|
+
"pres_read_type": read.present_type.code,
|
|
168
|
+
}
|
|
169
|
+
w.writerow(csv_make_val(vals.get(t)) for t in titles)
|
|
164
170
|
|
|
165
171
|
# Avoid a long-running transaction
|
|
166
172
|
sess.rollback()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1716973778.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)
|
|
@@ -73,7 +73,7 @@ chellow/reports/report_169.py,sha256=tnTiHmhigcgZ7E8rUSfgzsVYUCW947xBZZq04-KqfK8
|
|
|
73
73
|
chellow/reports/report_181.py,sha256=mCL6vXfrj8r0kL-LilDS0SnSu5tJOzCq7eMJVx9zpEw,4999
|
|
74
74
|
chellow/reports/report_183.py,sha256=DZX-hHJPl_Tbgkt31C_cuLZg_5L2b6iCPQ5foOZizR0,8817
|
|
75
75
|
chellow/reports/report_187.py,sha256=UvpaYHjyJFNV5puYq8_KxfzoBtVrwFgIGUOmC5oGA9A,9956
|
|
76
|
-
chellow/reports/report_219.py,sha256=
|
|
76
|
+
chellow/reports/report_219.py,sha256=cA0lfJKnJg41Zc4_gZB1KUXZ9JeJo0TiTlu5jm1bdDM,7158
|
|
77
77
|
chellow/reports/report_231.py,sha256=gOb1AkXZQvwVpRg5cIenO7iR7Se1_zsWnJp9l2BlgpA,5008
|
|
78
78
|
chellow/reports/report_233.py,sha256=cIatj-HHYW_GNIRsji-DlsmYjt8rUdm_5xujPLOYL8U,4537
|
|
79
79
|
chellow/reports/report_241.py,sha256=AlFmSHnfG2HWv_ICmWX7fNpPwLHjq7mo1QtOTjSKO3k,5384
|
|
@@ -364,6 +364,6 @@ chellow/templates/g/supply_note_edit.html,sha256=6UQf_qbhFDys3cVsTp-c7ABWZpggW9R
|
|
|
364
364
|
chellow/templates/g/supply_notes.html,sha256=WR3YwGh_qqTklSJ7JqWX6BKBc9rk_jMff4RiWZiF2CM,936
|
|
365
365
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
366
366
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
367
|
-
chellow-
|
|
368
|
-
chellow-
|
|
369
|
-
chellow-
|
|
367
|
+
chellow-1716973778.0.0.dist-info/METADATA,sha256=BR86ws0YMWBZHavEOJuh7KngaxixyJ5Mh8yZ1Nwlz2g,12205
|
|
368
|
+
chellow-1716973778.0.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
|
369
|
+
chellow-1716973778.0.0.dist-info/RECORD,,
|
|
File without changes
|