chellow 1715955542.0.0__py3-none-any.whl → 1716370405.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/gas/{bill_parser_edi.py → bill_parser_total_edi.py} +30 -182
- chellow/gas/engine.py +1 -10
- chellow/gas/views.py +27 -5
- chellow/reports/report_59.py +45 -37
- chellow/templates/g/bill_import.html +2 -0
- chellow/templates/g/supply_edit.html +44 -58
- {chellow-1715955542.0.0.dist-info → chellow-1716370405.0.0.dist-info}/METADATA +2 -2
- {chellow-1715955542.0.0.dist-info → chellow-1716370405.0.0.dist-info}/RECORD +9 -9
- {chellow-1715955542.0.0.dist-info → chellow-1716370405.0.0.dist-info}/WHEEL +0 -0
|
@@ -12,27 +12,11 @@ from chellow.utils import HH, to_ct, to_utc
|
|
|
12
12
|
|
|
13
13
|
READ_TYPE_MAP = {"00": "A", "01": "E", "02": "E"}
|
|
14
14
|
|
|
15
|
-
TCOD_MAP = {
|
|
16
|
-
"Energy Bill Discount Scheme": {"PPK": "ebrs"},
|
|
17
|
-
"Energy Bill Relief Scheme": {"PPK": "ebrs"},
|
|
18
|
-
"Energy Bill Relief Scheme Discount": {"PPK": "ebrs"},
|
|
19
|
-
"Unidentified Gas": {"PPK": "ug"},
|
|
20
|
-
"Commodity": {"PPK": "commodity"},
|
|
21
|
-
"Transportation": {"PPD": "transportation_fixed", "PPK": "transportation_variable"},
|
|
22
|
-
"Gas Flexi": {"PPK": "commodity"},
|
|
23
|
-
"Flex - Gas Flexi (New)": {"PPK": "commodity"},
|
|
24
|
-
"Meter Reading": {"PPD": "meter_read"},
|
|
25
|
-
"Meter Reading Credit Oct 19": {"FIX": "meter_read"},
|
|
26
|
-
"Meter Rental": {"PPD": "metering"},
|
|
27
|
-
"CCL": {"PPK": "ccl"},
|
|
28
|
-
"Consumption Based Administration": {"PPK": "admin_variable"},
|
|
29
|
-
"Swing": {"PPK": "swing"},
|
|
30
|
-
}
|
|
31
15
|
|
|
32
16
|
SUPPLIER_CODE_MAP = {
|
|
33
|
-
"STD": "standing",
|
|
34
|
-
"MET": "commodity",
|
|
35
|
-
"CCL": "ccl",
|
|
17
|
+
"STD": ("standing", Decimal("1000"), Decimal("1")),
|
|
18
|
+
"MET": ("commodity", Decimal("100000"), Decimal("1000")),
|
|
19
|
+
"CCL": ("ccl", Decimal("100000"), Decimal("1000")),
|
|
36
20
|
}
|
|
37
21
|
|
|
38
22
|
UNIT_MAP = {"M3": "M3", "HH": "HCUF", "HCUF": "HCUF"}
|
|
@@ -62,16 +46,6 @@ def _process_BCD(elements, headers):
|
|
|
62
46
|
btcd = elements["BTCD"]
|
|
63
47
|
headers["bill_type_code"] = btcd[0]
|
|
64
48
|
|
|
65
|
-
sumo = elements["SUMO"]
|
|
66
|
-
start_date = to_date(sumo[0])
|
|
67
|
-
if start_date is not None:
|
|
68
|
-
headers["start_date"] = start_date
|
|
69
|
-
|
|
70
|
-
if len(sumo) > 1:
|
|
71
|
-
finish_date = _to_finish_date(sumo[1])
|
|
72
|
-
if finish_date is not None:
|
|
73
|
-
headers["finish_date"] = finish_date
|
|
74
|
-
|
|
75
49
|
|
|
76
50
|
def _process_MHD(elements, headers):
|
|
77
51
|
headers.clear()
|
|
@@ -88,62 +62,12 @@ def _process_MHD(elements, headers):
|
|
|
88
62
|
headers["gross"] = Decimal("0.00")
|
|
89
63
|
|
|
90
64
|
|
|
91
|
-
def _process_CCD1(elements, headers):
|
|
92
|
-
mtnr = elements["MTNR"]
|
|
93
|
-
msn = mtnr[0]
|
|
94
|
-
|
|
95
|
-
mloc = elements["MLOC"]
|
|
96
|
-
|
|
97
|
-
# Bug in EDI where MPRN missing in second CCD 1
|
|
98
|
-
if "mprn" not in headers:
|
|
99
|
-
headers["mprn"] = mloc[0]
|
|
100
|
-
|
|
101
|
-
prdt = elements["PRDT"]
|
|
102
|
-
pvdt = elements["PVDT"]
|
|
103
|
-
|
|
104
|
-
pres_read_date = to_date(prdt[0])
|
|
105
|
-
prev_read_date = to_date(pvdt[0])
|
|
106
|
-
|
|
107
|
-
prrd = elements["PRRD"]
|
|
108
|
-
pres_read_value = Decimal(prrd[0])
|
|
109
|
-
pres_read_type = READ_TYPE_MAP[prrd[1]]
|
|
110
|
-
prev_read_value = Decimal(prrd[2])
|
|
111
|
-
prev_read_type = READ_TYPE_MAP[prrd[3]]
|
|
112
|
-
|
|
113
|
-
conb = elements["CONB"]
|
|
114
|
-
unit = UNIT_MAP[conb[1]]
|
|
115
|
-
headers["breakdown"]["units_consumed"] += to_decimal(conb) / Decimal("1000")
|
|
116
|
-
|
|
117
|
-
adjf = elements["ADJF"]
|
|
118
|
-
correction_factor = Decimal(adjf[1]) / Decimal(100000)
|
|
119
|
-
|
|
120
|
-
nuct = elements["NUCT"]
|
|
121
|
-
|
|
122
|
-
headers["kwh"] += to_decimal(nuct) / Decimal("1000")
|
|
123
|
-
|
|
124
|
-
headers["reads"].append(
|
|
125
|
-
{
|
|
126
|
-
"msn": msn,
|
|
127
|
-
"unit": unit,
|
|
128
|
-
"correction_factor": correction_factor,
|
|
129
|
-
"prev_date": prev_read_date,
|
|
130
|
-
"prev_value": prev_read_value,
|
|
131
|
-
"prev_type_code": prev_read_type,
|
|
132
|
-
"pres_date": pres_read_date,
|
|
133
|
-
"pres_value": pres_read_value,
|
|
134
|
-
"pres_type_code": pres_read_type,
|
|
135
|
-
}
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
|
|
139
65
|
NUCT_LOOKUP = {"DAY": "days", "KWH": "kwh"}
|
|
140
66
|
|
|
141
67
|
|
|
142
68
|
def _process_CCD2(elements, headers):
|
|
143
69
|
breakdown = headers["breakdown"]
|
|
144
70
|
ccde = elements["CCDE"]
|
|
145
|
-
ccde_supplier_code = ccde[2]
|
|
146
|
-
tcod = elements["TCOD"]
|
|
147
71
|
nuct = elements["NUCT"]
|
|
148
72
|
mtnr = elements["MTNR"]
|
|
149
73
|
conb = elements["CONB"]
|
|
@@ -151,57 +75,45 @@ def _process_CCD2(elements, headers):
|
|
|
151
75
|
prdt = elements["PRDT"]
|
|
152
76
|
pvdt = elements["PVDT"]
|
|
153
77
|
prrd = elements["PRRD"]
|
|
78
|
+
cppu = elements["CPPU"]
|
|
79
|
+
ctot = elements["CTOT"]
|
|
80
|
+
csdt = elements["CSDT"]
|
|
81
|
+
cedt = elements["CEDT"]
|
|
82
|
+
mloc = elements["MLOC"]
|
|
154
83
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
else:
|
|
158
|
-
tpref_lookup = SUPPLIER_CODE_MAP
|
|
84
|
+
ccde_supplier_code = ccde[2]
|
|
85
|
+
tpref, rate_divisor, units_divisor = SUPPLIER_CODE_MAP[ccde_supplier_code]
|
|
159
86
|
|
|
160
|
-
|
|
87
|
+
rate_str = cppu[0]
|
|
161
88
|
|
|
162
|
-
|
|
163
|
-
if
|
|
164
|
-
rate_key =
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
rate = Decimal(bpri[0]) / Decimal("10000000")
|
|
168
|
-
breakdown[rate_key].add(rate)
|
|
89
|
+
rate_key = f"{tpref}_rate"
|
|
90
|
+
if rate_key not in breakdown:
|
|
91
|
+
breakdown[rate_key] = set()
|
|
92
|
+
rate = Decimal(rate_str) / rate_divisor
|
|
93
|
+
breakdown[rate_key].add(rate)
|
|
169
94
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
else:
|
|
177
|
-
if ccde_supplier_code == "PPK":
|
|
178
|
-
key = f"{tpref}_kwh"
|
|
179
|
-
elif ccde_supplier_code == "PPD":
|
|
180
|
-
key = f"{tpref}_days"
|
|
181
|
-
|
|
182
|
-
breakdown[key] += to_decimal(nuct) / Decimal("1000")
|
|
183
|
-
except KeyError:
|
|
184
|
-
pass
|
|
95
|
+
breakdown[f"{tpref}_gbp"] += to_decimal(ctot) / Decimal("100")
|
|
96
|
+
|
|
97
|
+
suff = NUCT_LOOKUP[nuct[1].strip()]
|
|
98
|
+
key = f"{tpref}_{suff}"
|
|
99
|
+
units_billed = to_decimal(nuct) / units_divisor
|
|
100
|
+
breakdown[key] += units_billed
|
|
185
101
|
|
|
186
102
|
if "start_date" not in headers:
|
|
187
|
-
|
|
188
|
-
start_date = to_date(csdt[0])
|
|
189
|
-
if start_date is not None:
|
|
190
|
-
headers["start_date"] = start_date
|
|
103
|
+
headers["start_date"] = to_date(csdt[0])
|
|
191
104
|
|
|
192
105
|
if "finish_date" not in headers:
|
|
193
|
-
|
|
194
|
-
finish_date = _to_finish_date(cedt[0])
|
|
195
|
-
if finish_date is not None:
|
|
196
|
-
headers["finish_date"] = finish_date
|
|
106
|
+
headers["finish_date"] = _to_finish_date(cedt[0])
|
|
197
107
|
|
|
198
108
|
if "mprn" not in headers:
|
|
199
|
-
mloc = elements["MLOC"]
|
|
200
109
|
headers["mprn"] = mloc[0]
|
|
201
110
|
|
|
202
111
|
if len(conb) > 0 and len(conb[0]) > 0:
|
|
203
112
|
headers["breakdown"]["units_consumed"] += to_decimal(conb) / Decimal("1000")
|
|
204
113
|
|
|
114
|
+
if tpref == "commodity":
|
|
115
|
+
headers["kwh"] += units_billed
|
|
116
|
+
|
|
205
117
|
if len(prrd) > 0 and len(prrd[0]) > 0:
|
|
206
118
|
pres_read_date = to_date(prdt[0])
|
|
207
119
|
prev_read_date = to_date(pvdt[0])
|
|
@@ -229,70 +141,6 @@ def _process_CCD2(elements, headers):
|
|
|
229
141
|
)
|
|
230
142
|
|
|
231
143
|
|
|
232
|
-
def _process_CCD3(elements, headers):
|
|
233
|
-
breakdown = headers["breakdown"]
|
|
234
|
-
ccde = elements["CCDE"]
|
|
235
|
-
ccde_supplier_code = ccde[2]
|
|
236
|
-
tcod = elements["TCOD"]
|
|
237
|
-
|
|
238
|
-
tpref = TCOD_MAP[tcod[1]][ccde_supplier_code]
|
|
239
|
-
|
|
240
|
-
bpri = elements["BPRI"]
|
|
241
|
-
bpri_str = bpri[0]
|
|
242
|
-
if len(bpri_str) > 0:
|
|
243
|
-
rate_key = f"{tpref}_rate"
|
|
244
|
-
if rate_key not in breakdown:
|
|
245
|
-
breakdown[rate_key] = set()
|
|
246
|
-
rate = Decimal(bpri_str) / Decimal("10000000")
|
|
247
|
-
breakdown[rate_key].add(rate)
|
|
248
|
-
|
|
249
|
-
nuct = elements["NUCT"]
|
|
250
|
-
|
|
251
|
-
try:
|
|
252
|
-
ctot = elements["CTOT"]
|
|
253
|
-
breakdown[f"{tpref}_gbp"] += to_decimal(ctot) / Decimal("100")
|
|
254
|
-
|
|
255
|
-
if ccde_supplier_code == "PPK":
|
|
256
|
-
key = f"{tpref}_kwh"
|
|
257
|
-
elif ccde_supplier_code == "PPD":
|
|
258
|
-
key = f"{tpref}_days"
|
|
259
|
-
|
|
260
|
-
breakdown[key] += to_decimal(nuct) / Decimal("1000")
|
|
261
|
-
except KeyError:
|
|
262
|
-
pass
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
def _process_CCD4(elements, headers):
|
|
266
|
-
breakdown = headers["breakdown"]
|
|
267
|
-
ccde = elements["ccde"]
|
|
268
|
-
ccde_supplier_code = ccde[2]
|
|
269
|
-
tcod = elements["TCOD"]
|
|
270
|
-
|
|
271
|
-
tpref = TCOD_MAP[tcod[1]][ccde_supplier_code]
|
|
272
|
-
|
|
273
|
-
bpri = elements["BPRI"]
|
|
274
|
-
rate_key = f"{tpref}_rate"
|
|
275
|
-
if rate_key not in breakdown:
|
|
276
|
-
breakdown[rate_key] = set()
|
|
277
|
-
rate = Decimal(bpri[0]) / Decimal("10000000")
|
|
278
|
-
breakdown[rate_key].add(rate)
|
|
279
|
-
|
|
280
|
-
nuct = elements["NUCT"]
|
|
281
|
-
|
|
282
|
-
try:
|
|
283
|
-
ctot = elements["CTOT"]
|
|
284
|
-
breakdown[tpref + "_gbp"] += to_decimal(ctot) / Decimal("100")
|
|
285
|
-
|
|
286
|
-
if ccde_supplier_code == "PPK":
|
|
287
|
-
key = f"{tpref}_kwh"
|
|
288
|
-
elif ccde_supplier_code == "PPD":
|
|
289
|
-
key = f"{tpref}_days"
|
|
290
|
-
|
|
291
|
-
breakdown[key] += to_decimal(nuct) / Decimal("1000")
|
|
292
|
-
except KeyError:
|
|
293
|
-
pass
|
|
294
|
-
|
|
295
|
-
|
|
296
144
|
def _process_MTR(elements, headers):
|
|
297
145
|
if headers["message_type"] == "UTLBIL":
|
|
298
146
|
breakdown = headers["breakdown"]
|
|
@@ -357,10 +205,10 @@ CODE_FUNCS = {
|
|
|
357
205
|
"ADJ": _process_ADJ,
|
|
358
206
|
"BCD": _process_BCD,
|
|
359
207
|
"BTL": _process_NOOP,
|
|
360
|
-
"CCD1":
|
|
208
|
+
"CCD1": _process_NOOP,
|
|
361
209
|
"CCD2": _process_CCD2,
|
|
362
|
-
"CCD3":
|
|
363
|
-
"CCD4":
|
|
210
|
+
"CCD3": _process_NOOP,
|
|
211
|
+
"CCD4": _process_NOOP,
|
|
364
212
|
"CDT": _process_NOOP,
|
|
365
213
|
"CLO": _process_NOOP,
|
|
366
214
|
"END": _process_NOOP,
|
chellow/gas/engine.py
CHANGED
|
@@ -502,13 +502,6 @@ class GDataSource:
|
|
|
502
502
|
* h["calorific_value"]
|
|
503
503
|
/ 3.6
|
|
504
504
|
)
|
|
505
|
-
h["kwh_avg"] = (
|
|
506
|
-
h["units_consumed"]
|
|
507
|
-
* h["unit_factor"]
|
|
508
|
-
* h["correction_factor"]
|
|
509
|
-
* h["avg_cv"]
|
|
510
|
-
/ 3.6
|
|
511
|
-
)
|
|
512
505
|
h["ug_rate"] = float(
|
|
513
506
|
g_rates(sess, self.caches, "ug", h["start_date"], True)[
|
|
514
507
|
"ug_gbp_per_kwh"
|
|
@@ -703,9 +696,7 @@ def find_cv(sess, caches, dt, g_ldz_code):
|
|
|
703
696
|
avg_cv = year_cache[ct.month]
|
|
704
697
|
except KeyError:
|
|
705
698
|
cv_list = [float(v["cv"]) for v in cvs.values()]
|
|
706
|
-
avg_cv = year_cache[ct.month] =
|
|
707
|
-
sum(cv_list) / len(cv_list), ndigits=1
|
|
708
|
-
)
|
|
699
|
+
avg_cv = year_cache[ct.month] = sum(cv_list) / len(cv_list)
|
|
709
700
|
return cv, avg_cv
|
|
710
701
|
|
|
711
702
|
|
chellow/gas/views.py
CHANGED
|
@@ -289,15 +289,37 @@ def supply_edit_get(g_supply_id):
|
|
|
289
289
|
)
|
|
290
290
|
|
|
291
291
|
|
|
292
|
+
@gas.route("/supplies/<int:g_supply_id>/edit", methods=["DELETE"])
|
|
293
|
+
def supply_edit_delete(g_supply_id):
|
|
294
|
+
g_supply = GSupply.get_by_id(g.sess, g_supply_id)
|
|
295
|
+
try:
|
|
296
|
+
g_supply.delete(g.sess)
|
|
297
|
+
g.sess.commit()
|
|
298
|
+
return hx_redirect("/supplies")
|
|
299
|
+
except BadRequest as e:
|
|
300
|
+
flash(e.description)
|
|
301
|
+
g_eras = g.sess.scalars(
|
|
302
|
+
select(GEra)
|
|
303
|
+
.where(GEra.g_supply == g_supply)
|
|
304
|
+
.order_by(GEra.start_date.desc())
|
|
305
|
+
)
|
|
306
|
+
g_exit_zones = g.sess.query(GExitZone).order_by(GExitZone.code).all()
|
|
307
|
+
return make_response(
|
|
308
|
+
render_template(
|
|
309
|
+
"supply_edit.html",
|
|
310
|
+
g_supply=g_supply,
|
|
311
|
+
g_eras=g_eras,
|
|
312
|
+
g_exit_zones=g_exit_zones,
|
|
313
|
+
),
|
|
314
|
+
400,
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
|
|
292
318
|
@gas.route("/supplies/<int:g_supply_id>/edit", methods=["POST"])
|
|
293
319
|
def supply_edit_post(g_supply_id):
|
|
294
320
|
g_supply = GSupply.get_by_id(g.sess, g_supply_id)
|
|
295
321
|
try:
|
|
296
|
-
if "
|
|
297
|
-
g_supply.delete(g.sess)
|
|
298
|
-
g.sess.commit()
|
|
299
|
-
return chellow_redirect("/supplies", 303)
|
|
300
|
-
elif "insert_g_era" in request.values:
|
|
322
|
+
if "insert_g_era" in request.values:
|
|
301
323
|
start_date = req_date("start")
|
|
302
324
|
g_supply.insert_g_era_at(g.sess, start_date)
|
|
303
325
|
g.sess.commit()
|
chellow/reports/report_59.py
CHANGED
|
@@ -486,7 +486,45 @@ def _process_site(
|
|
|
486
486
|
.all()
|
|
487
487
|
)
|
|
488
488
|
if len(bills) > 0:
|
|
489
|
-
|
|
489
|
+
imp_supplier_contract = last_era.imp_supplier_contract
|
|
490
|
+
imp_supplier_contract_name = (
|
|
491
|
+
None
|
|
492
|
+
if imp_supplier_contract is None
|
|
493
|
+
else imp_supplier_contract.name
|
|
494
|
+
)
|
|
495
|
+
exp_supplier_contract = last_era.exp_supplier_contract
|
|
496
|
+
exp_supplier_contract_name = (
|
|
497
|
+
None
|
|
498
|
+
if exp_supplier_contract is None
|
|
499
|
+
else exp_supplier_contract.name
|
|
500
|
+
)
|
|
501
|
+
era_associates = {
|
|
502
|
+
s.site.code for s in last_era.site_eras if not s.is_physical
|
|
503
|
+
}
|
|
504
|
+
vals = {
|
|
505
|
+
"creation-date": now,
|
|
506
|
+
"start-date": chunk_start,
|
|
507
|
+
"finish-date": chunk_finish,
|
|
508
|
+
"imp-mpan-core": last_era.imp_mpan_core,
|
|
509
|
+
"exp-mpan-core": last_era.exp_mpan_core,
|
|
510
|
+
"site-code": site.code,
|
|
511
|
+
"site-name": site.name,
|
|
512
|
+
"associated-site-codes": era_associates,
|
|
513
|
+
"era-start-date": None,
|
|
514
|
+
"era-finish-date": None,
|
|
515
|
+
"imp-supplier-contract": imp_supplier_contract_name,
|
|
516
|
+
"imp-non-actual-hhs": None,
|
|
517
|
+
"imp-non-actual-kwh": None,
|
|
518
|
+
"exp-supplier-contract": exp_supplier_contract_name,
|
|
519
|
+
"exp-non-actual-hhs": None,
|
|
520
|
+
"exp-non-actual-kwh": None,
|
|
521
|
+
"metering-type": last_era.meter_category,
|
|
522
|
+
"source": last_era.supply.source.code,
|
|
523
|
+
"generator-type": None,
|
|
524
|
+
"supply-name": last_era.supply.name,
|
|
525
|
+
"msn": last_era.msn,
|
|
526
|
+
"pc": last_era.pc.code,
|
|
527
|
+
}
|
|
490
528
|
for name in (
|
|
491
529
|
"import-net",
|
|
492
530
|
"export-net",
|
|
@@ -500,10 +538,10 @@ def _process_site(
|
|
|
500
538
|
"billed-import-net",
|
|
501
539
|
):
|
|
502
540
|
for sname in ("kwh", "gbp"):
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
541
|
+
vals[name + "-" + sname] = 0
|
|
542
|
+
vals["billed-supplier-import-net-gbp"] = 0
|
|
543
|
+
vals["billed-dc-import-net-gbp"] = 0
|
|
544
|
+
vals["billed-mop-import-net-gbp"] = 0
|
|
507
545
|
|
|
508
546
|
for bill in bills:
|
|
509
547
|
bill_role_code = bill.batch.contract.market_role.code
|
|
@@ -528,42 +566,12 @@ def _process_site(
|
|
|
528
566
|
else:
|
|
529
567
|
raise BadRequest("Role code not recognized.")
|
|
530
568
|
|
|
531
|
-
for data in
|
|
569
|
+
for data in vals, site_data:
|
|
532
570
|
data["billed-import-net-kwh"] += bill_prop_kwh
|
|
533
571
|
data["billed-import-net-gbp"] += bill_prop_gbp
|
|
534
572
|
data[key] += bill_prop_gbp
|
|
535
573
|
|
|
536
|
-
|
|
537
|
-
exp_supplier_contract = last_era.exp_supplier_contract
|
|
538
|
-
out = [
|
|
539
|
-
now,
|
|
540
|
-
last_era.imp_mpan_core,
|
|
541
|
-
(
|
|
542
|
-
None
|
|
543
|
-
if imp_supplier_contract is None
|
|
544
|
-
else imp_supplier_contract.name
|
|
545
|
-
),
|
|
546
|
-
last_era.exp_mpan_core,
|
|
547
|
-
(
|
|
548
|
-
None
|
|
549
|
-
if exp_supplier_contract is None
|
|
550
|
-
else exp_supplier_contract.name
|
|
551
|
-
),
|
|
552
|
-
chunk_start,
|
|
553
|
-
last_era.meter_category,
|
|
554
|
-
last_era.supply.source.code,
|
|
555
|
-
None,
|
|
556
|
-
last_era.supply.name,
|
|
557
|
-
last_era.msn,
|
|
558
|
-
last_era.pc.code,
|
|
559
|
-
site.code,
|
|
560
|
-
site.name,
|
|
561
|
-
None,
|
|
562
|
-
start_date,
|
|
563
|
-
finish_date,
|
|
564
|
-
] + [month_data[t] for t in summary_titles]
|
|
565
|
-
|
|
566
|
-
era_rows.append([make_val(v) for v in out])
|
|
574
|
+
era_rows.append([make_val(vals.get(t)) for t in era_titles])
|
|
567
575
|
first_era = (
|
|
568
576
|
sess.execute(
|
|
569
577
|
select(Era).where(Era.supply == supply).order_by(Era.start_date)
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
<th>Issue Date</th>
|
|
46
46
|
<th>Start Date</th>
|
|
47
47
|
<th>Finish Date</th>
|
|
48
|
+
<th>kWh</th>
|
|
48
49
|
<th>Net GBP</th>
|
|
49
50
|
<th>VAT</th>
|
|
50
51
|
<th>Gross GBP</th>
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
<td>{{bill.issue_date|hh_format}}</td>
|
|
73
74
|
<td>{{bill.start_date|hh_format}}</td>
|
|
74
75
|
<td>{{bill.finish_date|hh_format}}</td>
|
|
76
|
+
<td>{{bill.kwh}}</td>
|
|
75
77
|
<td>{{bill.net_gbp}}</td>
|
|
76
78
|
<td>{{bill.vat_gbp}}</td>
|
|
77
79
|
<td>{{bill.gross_gbp}}</td>
|
|
@@ -10,67 +10,53 @@
|
|
|
10
10
|
{% endblock %}
|
|
11
11
|
|
|
12
12
|
{% block content %}
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
<form method="post" action="/g/supplies/{{g_supply.id}}/edit">
|
|
14
|
+
<fieldset>
|
|
15
|
+
<legend>Update this supply</legend>
|
|
16
|
+
<label>Name</label> {{input_text('name', g_supply.name)}}
|
|
17
|
+
<label>MPRN</label> {{input_text('mprn', g_supply.mprn)}}
|
|
18
|
+
<label>Exit Zone</label>
|
|
19
|
+
<select name="g_exit_zone_id">
|
|
20
|
+
{% for g_exit_zone in g_exit_zones %}
|
|
21
|
+
{{input_option(
|
|
22
|
+
'g_exit_zone_id', g_exit_zone.id, g_exit_zone.code, initial=g_supply.g_exit_zone.id)}}
|
|
23
|
+
{% endfor %}
|
|
24
|
+
</select>
|
|
25
|
+
<input type="submit" value="Update">
|
|
26
|
+
</fieldset>
|
|
27
|
+
</form>
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
<form hx-delete="/g/supplies/{{g_supply.id}}/edit"
|
|
30
|
+
hx-confirm="Are you sure you want to delete this supply?">
|
|
31
|
+
<fieldset>
|
|
32
|
+
<legend>Delete this supply</legend>
|
|
33
|
+
<input type="submit" value="Delete">
|
|
34
|
+
</fieldset>
|
|
35
|
+
</form>
|
|
25
36
|
|
|
26
|
-
|
|
37
|
+
<form method="post" action="/g/supplies/{{g_supply.id}}/edit">
|
|
38
|
+
<fieldset>
|
|
39
|
+
<legend>Insert a new era</legend>
|
|
40
|
+
<label>Start date</label> {{input_date('start', None)}}
|
|
41
|
+
<input type="submit" name="insert_g_era" value="Insert">
|
|
42
|
+
</fieldset>
|
|
43
|
+
</form>
|
|
27
44
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</select>
|
|
39
|
-
<input type="submit" value="Update">
|
|
40
|
-
</fieldset>
|
|
41
|
-
</form>
|
|
42
|
-
<br>
|
|
43
|
-
<form action="/g/supplies/{{g_supply.id}}/edit">
|
|
44
|
-
<fieldset>
|
|
45
|
-
<legend>Delete this supply</legend>
|
|
46
|
-
<input type="submit" name="delete" value="Delete">
|
|
47
|
-
</fieldset>
|
|
48
|
-
</form>
|
|
49
|
-
<br>
|
|
50
|
-
<form method="post" action="/g/supplies/{{g_supply.id}}/edit">
|
|
51
|
-
<fieldset>
|
|
52
|
-
<legend>Insert a new era</legend>
|
|
53
|
-
<label>Start date</label> {{input_date('start', None)}}
|
|
54
|
-
<input type="submit" name="insert_g_era" value="Insert">
|
|
55
|
-
</fieldset>
|
|
56
|
-
</form>
|
|
57
|
-
<br>
|
|
58
|
-
<table>
|
|
59
|
-
<caption>Existing Eras</caption>
|
|
60
|
-
<thead>
|
|
45
|
+
<table>
|
|
46
|
+
<caption>Existing Eras</caption>
|
|
47
|
+
<thead>
|
|
48
|
+
<tr>
|
|
49
|
+
<th>Start date</th>
|
|
50
|
+
<th>Finish date</th>
|
|
51
|
+
</tr>
|
|
52
|
+
</thead>
|
|
53
|
+
<tbody>
|
|
54
|
+
{% for g_era in g_eras %}
|
|
61
55
|
<tr>
|
|
62
|
-
<
|
|
63
|
-
<
|
|
56
|
+
<td>{{g_era.start_date|hh_format}}</td>
|
|
57
|
+
<td>{{g_era.finish_date|hh_format}}</td>
|
|
64
58
|
</tr>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<tr>
|
|
69
|
-
<td>{{g_era.start_date|hh_format}}</td>
|
|
70
|
-
<td>{{g_era.finish_date|hh_format}}</td>
|
|
71
|
-
</tr>
|
|
72
|
-
{% endfor %}
|
|
73
|
-
</tbody>
|
|
74
|
-
</table>
|
|
75
|
-
{% endif %}
|
|
59
|
+
{% endfor %}
|
|
60
|
+
</tbody>
|
|
61
|
+
</table>
|
|
76
62
|
{% endblock %}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1716370405.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)
|
|
@@ -20,7 +20,7 @@ Requires-Dist: pympler==1.0.1
|
|
|
20
20
|
Requires-Dist: pypdf==3.17.0
|
|
21
21
|
Requires-Dist: python-dateutil==2.8.2
|
|
22
22
|
Requires-Dist: pytz==2022.6
|
|
23
|
-
Requires-Dist: requests==2.
|
|
23
|
+
Requires-Dist: requests==2.32.2
|
|
24
24
|
Requires-Dist: sqlalchemy==2.0.28
|
|
25
25
|
Requires-Dist: waitress==2.1.2
|
|
26
26
|
Requires-Dist: xlrd==2.0.1
|
|
@@ -58,14 +58,14 @@ chellow/e/bill_parsers/sse_edi.py,sha256=L85DOfNkqexeEIEr8pCBn_2sHJI-zEaw6cogpE3
|
|
|
58
58
|
chellow/e/bill_parsers/sww_xls.py,sha256=QEjiuvwvr5FuWCfqqVw8LaA_vZyAKsvRAS5fw3xtFhM,7533
|
|
59
59
|
chellow/gas/bill_import.py,sha256=w0lPgK_Drzh8rtnEBQe3qFuxrgzZ6qQSgpaGrrGznMU,6549
|
|
60
60
|
chellow/gas/bill_parser_csv.py,sha256=Ecdy-apFT-mWAxddAsM4k1s-9-FpIaOfjP0oFc0rdQg,5557
|
|
61
|
-
chellow/gas/bill_parser_edi.py,sha256=3PGofkIxfxWG1x5WM7pYFi0tfTmvOuusRxEc-76Zvi0,11484
|
|
62
61
|
chellow/gas/bill_parser_engie_edi.py,sha256=Ko0vZP-QdVQ1uuhS_5cdrii60_cM4b_LFJMoY0pZqnk,8950
|
|
62
|
+
chellow/gas/bill_parser_total_edi.py,sha256=k5b9vadgLdEb8dk1E-mZpcKGyxXh1AWYsNiGSUK5CBA,7172
|
|
63
63
|
chellow/gas/ccl.py,sha256=DMlcPUELZi00CaDekVJINYk3GgH5apFrImVdmkbyba0,2913
|
|
64
64
|
chellow/gas/cv.py,sha256=4cdYYQ8Qak6NeYdBCB4YaQ0jX8-UkaydIIdibCQuXxM,7344
|
|
65
65
|
chellow/gas/dn_rate_parser.py,sha256=Mq8rAcUEUxIQOks59bsCKl8GrefvoHbrTCHqon9N0z0,11340
|
|
66
|
-
chellow/gas/engine.py,sha256=
|
|
66
|
+
chellow/gas/engine.py,sha256=jT7m6vddi5GnWd51wCYEVhBS-LZEn1T9ggZX7Y9HGK0,25263
|
|
67
67
|
chellow/gas/transportation.py,sha256=Bkg8TWOs-v0ES-4qqwbleiOhqbE_t2KauUx9JYMZELM,5300
|
|
68
|
-
chellow/gas/views.py,sha256=
|
|
68
|
+
chellow/gas/views.py,sha256=ZIMqByN0uBpf3y9wkMi-VogC1-NaHs-oO7WRVDk9Kkw,57428
|
|
69
69
|
chellow/reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
70
70
|
chellow/reports/report_109.py,sha256=S8fsOwh-jVWGL0RsgyYLdqn00BAvlkBbi4VfTSGI-Mc,11181
|
|
71
71
|
chellow/reports/report_111.py,sha256=qU5MYPQzZ_cEvuERE8bxq93D-dN1yd4oML6FIqd0Jdk,28278
|
|
@@ -84,7 +84,7 @@ chellow/reports/report_33.py,sha256=laVz-itDbJTdvC6LxLEeuY0eKpYx43Un4adiExPTEEE,
|
|
|
84
84
|
chellow/reports/report_387.py,sha256=KcClrEOK5IRvePp0Jgbzs1Gwf-_CqYmEtFFlXrr_Z3E,5670
|
|
85
85
|
chellow/reports/report_41.py,sha256=QQeTshA1Og7N3wPaoZ8ynJzwsvZ1mgSFc7DDkVqIZoM,7447
|
|
86
86
|
chellow/reports/report_429.py,sha256=0GCc0rQnOSG0fusw69yMMOCxnWApBd3P2sGWIg1py9M,12359
|
|
87
|
-
chellow/reports/report_59.py,sha256=
|
|
87
|
+
chellow/reports/report_59.py,sha256=CCFPUspUFgoMt6sMFsdtLYW-inA9rN6D-6Kted6vskA,45458
|
|
88
88
|
chellow/reports/report_81.py,sha256=UYr0Dm4TmCCYUbIWw3hWNI0GdQRhH27vwVk3Ytdsrcg,5288
|
|
89
89
|
chellow/reports/report_87.py,sha256=ZadBo40rUORN0Fi926-dDHeTFn6L-fBzp3b4k7v5MdY,6802
|
|
90
90
|
chellow/reports/report_asset_comparison.py,sha256=UN298MHuzyUDUiiZr7F_Ua6SrdVOlFLjgKjnIbrA-14,6118
|
|
@@ -327,7 +327,7 @@ chellow/templates/g/batches.html,sha256=mnzLroYfhwvL5gFK1PNtI-vS7GcDtcggNd0E15Sh
|
|
|
327
327
|
chellow/templates/g/bill.html,sha256=S8moZ06CDl4_nQQgqyy4mdkyhfvgoQJGZS8ppsluT_E,3455
|
|
328
328
|
chellow/templates/g/bill_add.html,sha256=sDSpUgEbdalDsea1Ma5lgVRgtbFf0bZ042jUdOFeDDk,1674
|
|
329
329
|
chellow/templates/g/bill_edit.html,sha256=ynfUR_lZXLgTK3T0x9GjzAHahuR823ykMpjCWrY8ot8,2754
|
|
330
|
-
chellow/templates/g/bill_import.html,sha256=
|
|
330
|
+
chellow/templates/g/bill_import.html,sha256=gns_IbE7eynbbchydzLtuJ3SgJU2VXlr5211aqiRhe8,4630
|
|
331
331
|
chellow/templates/g/bill_imports.html,sha256=AHC0l0Wkr1RZ9fdGWTqihOEcn8lTZ63Uh9BHqPxfRCU,3157
|
|
332
332
|
chellow/templates/g/dn.html,sha256=ttEdvFANFUCBV8e9tVrZy35-tzsC9dU-biZhAPxE2Bw,481
|
|
333
333
|
chellow/templates/g/dns.html,sha256=RuxXvQ9eHs6B7nVGHtTbW8pdmSAaMbQw2f_BwiLZptM,403
|
|
@@ -358,12 +358,12 @@ chellow/templates/g/supplier_rate_script_add.html,sha256=zMjTkjupOsHFu-peUXL4IKj
|
|
|
358
358
|
chellow/templates/g/supplier_rate_script_edit.html,sha256=GoUqXf52gWEH1iApmNdxOcKLItzpA-o7iQPQ1_in9BA,1950
|
|
359
359
|
chellow/templates/g/supplies.html,sha256=oEAEfZaAuKv7EA6fd3blWjPwv_XKoNHLPlkRJ_afZHs,1267
|
|
360
360
|
chellow/templates/g/supply.html,sha256=Jeqm7AhZQd4uzu-ncRIIeh6DK9NYSvYrLrxmBE4ERIM,10975
|
|
361
|
-
chellow/templates/g/supply_edit.html,sha256=
|
|
361
|
+
chellow/templates/g/supply_edit.html,sha256=F2Ip4xCXLl4eFiRjMLZyUMIiznWw97GF7mN_50QAEWA,1653
|
|
362
362
|
chellow/templates/g/supply_note_add.html,sha256=npmobg9u1xKcgJKSRCwLY_tH5WJ0bAx3i2XZWqfFeHs,744
|
|
363
363
|
chellow/templates/g/supply_note_edit.html,sha256=6UQf_qbhFDys3cVsTp-c7ABWZpggW9R1rhxRKK3h_p8,1043
|
|
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-1716370405.0.0.dist-info/METADATA,sha256=TuaScYTcnRt-YAdvw014lKjfOAS9GaelicnQ1FPdkjI,12205
|
|
368
|
+
chellow-1716370405.0.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
|
369
|
+
chellow-1716370405.0.0.dist-info/RECORD,,
|
|
File without changes
|