chellow 1754914129.0.0__py3-none-any.whl → 1755078653.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/dno_rate_parser.py +232 -51
- chellow/e/duos.py +62 -13
- chellow/e/views.py +45 -0
- chellow/reports/report_111.py +3 -4
- chellow/reports/report_ecoes_comparison.py +23 -2
- chellow/templates/report_run_ecoes_comparison.html +52 -30
- {chellow-1754914129.0.0.dist-info → chellow-1755078653.0.0.dist-info}/METADATA +1 -1
- {chellow-1754914129.0.0.dist-info → chellow-1755078653.0.0.dist-info}/RECORD +9 -9
- {chellow-1754914129.0.0.dist-info → chellow-1755078653.0.0.dist-info}/WHEEL +0 -0
chellow/e/dno_rate_parser.py
CHANGED
|
@@ -145,6 +145,204 @@ BAND_WEEKEND = {
|
|
|
145
145
|
"notes": None,
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
PERIODS = {
|
|
149
|
+
"monday to friday (including bank holidays) april to march inclusive": [
|
|
150
|
+
{
|
|
151
|
+
"weekend": False,
|
|
152
|
+
"start-month": 4,
|
|
153
|
+
"start-day": 1,
|
|
154
|
+
"finish-month": 12,
|
|
155
|
+
"finish-day": 31,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"weekend": False,
|
|
159
|
+
"start-month": 1,
|
|
160
|
+
"start-day": 1,
|
|
161
|
+
"finish-month": 3,
|
|
162
|
+
"finish-day": 31,
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
"monday to friday (including bank holidays) april to october inclusive and march": [
|
|
166
|
+
{
|
|
167
|
+
"weekend": False,
|
|
168
|
+
"start-month": 4,
|
|
169
|
+
"start-day": 1,
|
|
170
|
+
"finish-month": 10,
|
|
171
|
+
"finish-day": 31,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"weekend": False,
|
|
175
|
+
"start-month": 3,
|
|
176
|
+
"start-day": 1,
|
|
177
|
+
"finish-month": 3,
|
|
178
|
+
"finish-day": 31,
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
"monday to friday (including bank holidays) june to august inclusive": [
|
|
182
|
+
{
|
|
183
|
+
"weekend": False,
|
|
184
|
+
"start-month": 6,
|
|
185
|
+
"start-day": 1,
|
|
186
|
+
"finish-month": 8,
|
|
187
|
+
"finish-day": 31,
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
"monday to friday (including bank holidays) november to february inclusive": [
|
|
191
|
+
{
|
|
192
|
+
"weekend": False,
|
|
193
|
+
"start-month": 11,
|
|
194
|
+
"start-day": 1,
|
|
195
|
+
"finish-month": 12,
|
|
196
|
+
"finish-day": 31,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"weekend": False,
|
|
200
|
+
"start-month": 1,
|
|
201
|
+
"start-day": 1,
|
|
202
|
+
"finish-month": 2,
|
|
203
|
+
"finish-day": "last",
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
"monday to friday (including bank holidays) november to february inclusive "
|
|
207
|
+
"(excluding 22nd dec to 4th jan inclusive)": [
|
|
208
|
+
{
|
|
209
|
+
"weekend": False,
|
|
210
|
+
"start-month": 11,
|
|
211
|
+
"start-day": 1,
|
|
212
|
+
"finish-month": 12,
|
|
213
|
+
"finish-day": 21,
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"weekend": False,
|
|
217
|
+
"start-month": 1,
|
|
218
|
+
"start-day": 5,
|
|
219
|
+
"finish-month": 2,
|
|
220
|
+
"finish-day": "last",
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
"monday to friday (including bank holidays) march to october inclusive": [
|
|
224
|
+
{
|
|
225
|
+
"weekend": False,
|
|
226
|
+
"start-month": 3,
|
|
227
|
+
"start-day": 1,
|
|
228
|
+
"finish-month": 10,
|
|
229
|
+
"finish-day": 31,
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
"monday to friday (including bank holidays) mar to oct inclusive": [
|
|
233
|
+
{
|
|
234
|
+
"weekend": False,
|
|
235
|
+
"start-month": 3,
|
|
236
|
+
"start-day": 1,
|
|
237
|
+
"finish-month": 10,
|
|
238
|
+
"finish-day": 31,
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
"monday to friday (including bank holidays) nov to feb inclusive": [
|
|
242
|
+
{
|
|
243
|
+
"weekend": False,
|
|
244
|
+
"start-month": 11,
|
|
245
|
+
"start-day": 1,
|
|
246
|
+
"finish-month": 12,
|
|
247
|
+
"finish-day": 31,
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"weekend": False,
|
|
251
|
+
"start-month": 1,
|
|
252
|
+
"start-day": 1,
|
|
253
|
+
"finish-month": 2,
|
|
254
|
+
"finish-day": "last",
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
(
|
|
258
|
+
"monday to friday nov to feb (excluding 22nd dec to 4th jan inclusive)"
|
|
259
|
+
"monday to friday (including bank holidays) nov to feb inclusive "
|
|
260
|
+
"(excluding 22nd dec to 4th jan inclusive)"
|
|
261
|
+
): [
|
|
262
|
+
{
|
|
263
|
+
"weekend": False,
|
|
264
|
+
"start-month": 11,
|
|
265
|
+
"start-day": 1,
|
|
266
|
+
"finish-month": 12,
|
|
267
|
+
"finish-day": 21,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"weekend": False,
|
|
271
|
+
"start-month": 1,
|
|
272
|
+
"start-day": 5,
|
|
273
|
+
"finish-month": 2,
|
|
274
|
+
"finish-day": "last",
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
(
|
|
278
|
+
"monday to friday (including bank holidays) "
|
|
279
|
+
"mar to oct inclusive (plus 22nd dec to 4th jan inclusive)"
|
|
280
|
+
): [
|
|
281
|
+
{
|
|
282
|
+
"weekend": False,
|
|
283
|
+
"start-month": 3,
|
|
284
|
+
"start-day": 1,
|
|
285
|
+
"finish-month": 10,
|
|
286
|
+
"finish-day": 31,
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"weekend": False,
|
|
290
|
+
"start-month": 12,
|
|
291
|
+
"start-day": 22,
|
|
292
|
+
"finish-month": 12,
|
|
293
|
+
"finish-day": 31,
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"weekend": False,
|
|
297
|
+
"start-month": 1,
|
|
298
|
+
"start-day": 1,
|
|
299
|
+
"finish-month": 1,
|
|
300
|
+
"finish-day": 4,
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
(
|
|
304
|
+
"monday to friday "
|
|
305
|
+
"(including bank holidays) "
|
|
306
|
+
"nov to feb inclusive (excluding 22nd dec to 4th jan inclusive)"
|
|
307
|
+
): [
|
|
308
|
+
{
|
|
309
|
+
"weekend": False,
|
|
310
|
+
"start-month": 11,
|
|
311
|
+
"start-day": 1,
|
|
312
|
+
"finish-month": 12,
|
|
313
|
+
"finish-day": 21,
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"weekend": False,
|
|
317
|
+
"start-month": 1,
|
|
318
|
+
"start-day": 4,
|
|
319
|
+
"finish-month": 2,
|
|
320
|
+
"finish-day": "last",
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
"saturday and sunday all year": [
|
|
324
|
+
{
|
|
325
|
+
"weekend": True,
|
|
326
|
+
"start-month": 1,
|
|
327
|
+
"start-day": 1,
|
|
328
|
+
"finish-month": 12,
|
|
329
|
+
"finish-day": 31,
|
|
330
|
+
}
|
|
331
|
+
],
|
|
332
|
+
(
|
|
333
|
+
"monday to friday (including bank holidays) november to february "
|
|
334
|
+
"monday to friday nov to feb"
|
|
335
|
+
): [
|
|
336
|
+
{
|
|
337
|
+
"weekend": False,
|
|
338
|
+
"start-month": 11,
|
|
339
|
+
"start-day": 1,
|
|
340
|
+
"finish-month": 2,
|
|
341
|
+
"finish-day": "last",
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
}
|
|
345
|
+
|
|
148
346
|
|
|
149
347
|
def str_to_hr(hr_str):
|
|
150
348
|
for sep in (":", "."):
|
|
@@ -209,6 +407,7 @@ def tab_lv_hv(sheet, gsp_rates):
|
|
|
209
407
|
tariffs = gsp_rates["tariffs"] = {}
|
|
210
408
|
|
|
211
409
|
bands = gsp_rates["bands"] = []
|
|
410
|
+
ums_bands = gsp_rates["ums_bands"] = []
|
|
212
411
|
|
|
213
412
|
class State(Enum):
|
|
214
413
|
OUTSIDE = auto()
|
|
@@ -236,15 +435,31 @@ def tab_lv_hv(sheet, gsp_rates):
|
|
|
236
435
|
|
|
237
436
|
if is_weekend is None:
|
|
238
437
|
state = State.OUTSIDE
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
438
|
+
continue
|
|
439
|
+
|
|
440
|
+
for i, band_name in enumerate(("red", "amber")):
|
|
441
|
+
for slot in val_to_slots(get_value(row, i + 1)):
|
|
442
|
+
bands.append(
|
|
443
|
+
{
|
|
444
|
+
"weekend": is_weekend,
|
|
445
|
+
"start": slot["start"],
|
|
446
|
+
"finish": slot["finish"],
|
|
447
|
+
"band": band_name,
|
|
448
|
+
}
|
|
449
|
+
)
|
|
450
|
+
|
|
451
|
+
val_6 = " ".join(get_value(row, 6).split()).lower()
|
|
452
|
+
periods = PERIODS[val_6]
|
|
453
|
+
|
|
454
|
+
for i, band_name in enumerate(("black", "yellow")):
|
|
455
|
+
for slot in val_to_slots(get_value(row, i + 8)):
|
|
456
|
+
for period in periods:
|
|
457
|
+
ums_bands.append(
|
|
243
458
|
{
|
|
244
|
-
"weekend": is_weekend,
|
|
245
|
-
"start": slot["start"],
|
|
246
|
-
"finish": slot["finish"],
|
|
247
459
|
"band": band_name,
|
|
460
|
+
**period,
|
|
461
|
+
"start-decimal-hour": slot["start"],
|
|
462
|
+
"finish-decimal-hour": slot["finish"],
|
|
248
463
|
}
|
|
249
464
|
)
|
|
250
465
|
|
|
@@ -255,6 +470,9 @@ def tab_lv_hv(sheet, gsp_rates):
|
|
|
255
470
|
llfcs_str = ",".join(
|
|
256
471
|
chain(to_llfcs(get_value(row, 1)), to_llfcs(get_value(row, 10)))
|
|
257
472
|
)
|
|
473
|
+
is_ums = "unmetered supplies" in val_0.lower()
|
|
474
|
+
high_band = "black" if is_ums else "red"
|
|
475
|
+
medium_band = "yellow" if is_ums else "amber"
|
|
258
476
|
pcs_str = ",".join(to_pcs(row, 2))
|
|
259
477
|
tariffs[llfcs_str + "_" + pcs_str] = {
|
|
260
478
|
"description": val_0,
|
|
@@ -267,8 +485,10 @@ def tab_lv_hv(sheet, gsp_rates):
|
|
|
267
485
|
"excess-gbp-per-kva-per-day": get_zero_rate(
|
|
268
486
|
row, col_match(title_row, "exce")
|
|
269
487
|
),
|
|
270
|
-
"
|
|
271
|
-
|
|
488
|
+
f"{high_band}-gbp-per-kwh": get_rag_rate(
|
|
489
|
+
row, col_match(title_row, "red")
|
|
490
|
+
),
|
|
491
|
+
f"{medium_band}-gbp-per-kwh": get_rag_rate(
|
|
272
492
|
row, col_match(title_row, "amber")
|
|
273
493
|
),
|
|
274
494
|
"green-gbp-per-kwh": get_rag_rate(
|
|
@@ -344,54 +564,15 @@ def tab_ehv(sheet, gsp_rates):
|
|
|
344
564
|
state = EHV_BLANK
|
|
345
565
|
else:
|
|
346
566
|
period_str = " ".join(get_value(row, 0).split()).lower()
|
|
347
|
-
periods = []
|
|
348
|
-
|
|
349
|
-
if period_str in (
|
|
350
|
-
"monday to friday nov to feb (excluding "
|
|
351
|
-
"22nd dec to 4th jan inclusive)",
|
|
352
|
-
"monday to friday (including bank holidays) nov to feb inclusive "
|
|
353
|
-
"(excluding 22nd dec to 4th jan inclusive)",
|
|
354
|
-
):
|
|
355
|
-
periods.append(
|
|
356
|
-
{
|
|
357
|
-
"weekend": False,
|
|
358
|
-
"start-month": 11,
|
|
359
|
-
"start-day": 1,
|
|
360
|
-
"finish-month": 12,
|
|
361
|
-
"finish-day": 21,
|
|
362
|
-
}
|
|
363
|
-
)
|
|
364
|
-
periods.append(
|
|
365
|
-
{
|
|
366
|
-
"weekend": False,
|
|
367
|
-
"start-month": 1,
|
|
368
|
-
"start-day": 5,
|
|
369
|
-
"finish-month": 2,
|
|
370
|
-
"finish-day": "last",
|
|
371
|
-
}
|
|
372
|
-
)
|
|
373
|
-
|
|
374
|
-
elif period_str in (
|
|
375
|
-
"monday to friday (including bank holidays) november to february",
|
|
376
|
-
"monday to friday nov to feb",
|
|
377
|
-
):
|
|
378
|
-
periods.append(
|
|
379
|
-
{
|
|
380
|
-
"weekend": False,
|
|
381
|
-
"start-month": 11,
|
|
382
|
-
"start-day": 1,
|
|
383
|
-
"finish-month": 2,
|
|
384
|
-
"finish-day": "last",
|
|
385
|
-
}
|
|
386
|
-
)
|
|
567
|
+
periods = PERIODS[period_str]
|
|
387
568
|
|
|
388
569
|
for slot in val_to_slots(get_value(row, 3)):
|
|
389
570
|
for period in periods:
|
|
390
571
|
bands.append(
|
|
391
572
|
{
|
|
392
573
|
**period,
|
|
393
|
-
"start-hour": slot["start"],
|
|
394
|
-
"finish-hour": slot["finish"],
|
|
574
|
+
"start-decimal-hour": slot["start"],
|
|
575
|
+
"finish-decimal-hour": slot["finish"],
|
|
395
576
|
}
|
|
396
577
|
)
|
|
397
578
|
|
chellow/e/duos.py
CHANGED
|
@@ -16,20 +16,17 @@ from chellow.utils import (
|
|
|
16
16
|
)
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
BANDS = ("super-red", "red", "amber", "green")
|
|
20
|
-
|
|
21
|
-
KEYS =
|
|
22
|
-
|
|
23
|
-
band,
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"gbp": f"duos-{band}-gbp",
|
|
29
|
-
},
|
|
30
|
-
)
|
|
19
|
+
BANDS = ("black", "super-red", "red", "amber", "yellow", "green")
|
|
20
|
+
|
|
21
|
+
KEYS = {
|
|
22
|
+
band: {
|
|
23
|
+
"kwh": f"duos-{band}-kwh",
|
|
24
|
+
"tariff-rate": f"{band}-gbp-per-kwh",
|
|
25
|
+
"bill-rate": f"duos-{band}-rate",
|
|
26
|
+
"gbp": f"duos-{band}-gbp",
|
|
27
|
+
}
|
|
31
28
|
for band in BANDS
|
|
32
|
-
|
|
29
|
+
}
|
|
33
30
|
|
|
34
31
|
VL_LOOKUP = {
|
|
35
32
|
"LV": {True: "lv-sub", False: "lv-net"},
|
|
@@ -706,6 +703,58 @@ def datum_2012_02_23(ds, hh):
|
|
|
706
703
|
band = "super-red"
|
|
707
704
|
break
|
|
708
705
|
|
|
706
|
+
bands_cache[start_date] = band
|
|
707
|
+
elif ds.dtc_meter_type_code is None: # unmetered
|
|
708
|
+
try:
|
|
709
|
+
band = gsp_group_cache["ums-bands"][start_date]
|
|
710
|
+
except KeyError:
|
|
711
|
+
try:
|
|
712
|
+
bands_cache = gsp_group_cache["ums-bands"]
|
|
713
|
+
except KeyError:
|
|
714
|
+
bands_cache = gsp_group_cache["ums-bands"] = {}
|
|
715
|
+
|
|
716
|
+
try:
|
|
717
|
+
band = bands_cache[start_date]
|
|
718
|
+
except KeyError:
|
|
719
|
+
band = "green"
|
|
720
|
+
ct_hr = hh["ct-decimal-hour"]
|
|
721
|
+
ct_day = hh["ct-day"]
|
|
722
|
+
ct_month = hh["ct-month"]
|
|
723
|
+
weekend = hh["ct-day-of-week"] > 4
|
|
724
|
+
try:
|
|
725
|
+
slots = ds.hh_rate(ds.dno_contract.id, start_date)[
|
|
726
|
+
ds.gsp_group_code
|
|
727
|
+
]["ums_bands"]
|
|
728
|
+
except KeyError as e:
|
|
729
|
+
raise BadRequest(str(e))
|
|
730
|
+
|
|
731
|
+
for slot in slots:
|
|
732
|
+
if (
|
|
733
|
+
slot["weekend"] == weekend
|
|
734
|
+
and slot["start-decimal-hour"]
|
|
735
|
+
<= ct_hr
|
|
736
|
+
< slot["finish-decimal-hour"]
|
|
737
|
+
and (
|
|
738
|
+
ct_month > slot["start-month"]
|
|
739
|
+
or (
|
|
740
|
+
ct_month == slot["start-month"]
|
|
741
|
+
and ct_day >= slot["start-day"]
|
|
742
|
+
)
|
|
743
|
+
)
|
|
744
|
+
and (
|
|
745
|
+
ct_month < slot["finish-month"]
|
|
746
|
+
or (
|
|
747
|
+
ct_month == slot["finish-month"]
|
|
748
|
+
and (
|
|
749
|
+
slot["finish-day"] == "last"
|
|
750
|
+
or ct_day <= slot["finish-day"]
|
|
751
|
+
)
|
|
752
|
+
)
|
|
753
|
+
)
|
|
754
|
+
):
|
|
755
|
+
band = slot["band"]
|
|
756
|
+
break
|
|
757
|
+
|
|
709
758
|
bands_cache[start_date] = band
|
|
710
759
|
else:
|
|
711
760
|
|
chellow/e/views.py
CHANGED
|
@@ -5730,6 +5730,51 @@ def supply_post(supply_id):
|
|
|
5730
5730
|
f"successfully updated with the MSN {msn}. "
|
|
5731
5731
|
)
|
|
5732
5732
|
flash(msg)
|
|
5733
|
+
|
|
5734
|
+
if "new_llfc" in request.form:
|
|
5735
|
+
start_date_str = req_str("start_date")
|
|
5736
|
+
start_date = parse_hh_start(start_date_str)
|
|
5737
|
+
if start_date is None:
|
|
5738
|
+
raise BadRequest("The date of the MSN change is blank.")
|
|
5739
|
+
|
|
5740
|
+
llfc_code = req_str("llfc_code")
|
|
5741
|
+
llfc = supply.dno.get_llfc_by_code(g.sess, llfc_code)
|
|
5742
|
+
mpan_core = req_str("mpan_core")
|
|
5743
|
+
msg = ""
|
|
5744
|
+
era = supply.find_era_at(g.sess, start_date)
|
|
5745
|
+
if era is not None and era.start_date != start_date:
|
|
5746
|
+
era = supply.insert_era_at(g.sess, start_date)
|
|
5747
|
+
g.sess.commit()
|
|
5748
|
+
for era in supply.find_eras(g.sess, start_date, None):
|
|
5749
|
+
if era.imp_mpan_core == mpan_core:
|
|
5750
|
+
if era.imp_llfc.code == llfc.code:
|
|
5751
|
+
msg += (
|
|
5752
|
+
f"The era at {hh_format(era.start_date)} already has the "
|
|
5753
|
+
f"import LLFC {llfc.code}. "
|
|
5754
|
+
)
|
|
5755
|
+
else:
|
|
5756
|
+
era.imp_llfc = llfc
|
|
5757
|
+
|
|
5758
|
+
g.sess.commit()
|
|
5759
|
+
msg += (
|
|
5760
|
+
f"The era at {hh_format(era.start_date)} has been "
|
|
5761
|
+
f"successfully updated with the import LLFC {llfc.code}. "
|
|
5762
|
+
)
|
|
5763
|
+
elif era.exp_mpan_core == mpan_core:
|
|
5764
|
+
if era.exp_llfc.code == llfc.code:
|
|
5765
|
+
msg += (
|
|
5766
|
+
f"The era at {hh_format(era.start_date)} already has the "
|
|
5767
|
+
f"export LLFC {llfc.code}. "
|
|
5768
|
+
)
|
|
5769
|
+
else:
|
|
5770
|
+
era.exp_llfc = llfc
|
|
5771
|
+
|
|
5772
|
+
g.sess.commit()
|
|
5773
|
+
msg += (
|
|
5774
|
+
f"The era at {hh_format(era.start_date)} has been "
|
|
5775
|
+
f"successfully updated with the export LLFC {llfc.code}. "
|
|
5776
|
+
)
|
|
5777
|
+
flash(msg)
|
|
5733
5778
|
return render_template("supply_post.html")
|
|
5734
5779
|
|
|
5735
5780
|
except BadRequest as e:
|
chellow/reports/report_111.py
CHANGED
|
@@ -321,9 +321,9 @@ def _process_supply(
|
|
|
321
321
|
while len(bill_ids) > 0:
|
|
322
322
|
bill_id = list(sorted(bill_ids))[0]
|
|
323
323
|
bill_ids.remove(bill_id)
|
|
324
|
-
bill = (
|
|
325
|
-
|
|
326
|
-
.
|
|
324
|
+
bill = sess.scalar(
|
|
325
|
+
select(Bill)
|
|
326
|
+
.where(Bill.id == bill_id)
|
|
327
327
|
.options(
|
|
328
328
|
joinedload(Bill.batch),
|
|
329
329
|
joinedload(Bill.bill_type),
|
|
@@ -332,7 +332,6 @@ def _process_supply(
|
|
|
332
332
|
joinedload(Bill.reads).joinedload(RegisterRead.present_type),
|
|
333
333
|
joinedload(Bill.reads).joinedload(RegisterRead.previous_type),
|
|
334
334
|
)
|
|
335
|
-
.one()
|
|
336
335
|
)
|
|
337
336
|
virtual_bill = {"problem": ""}
|
|
338
337
|
supply = bill.supply
|
|
@@ -25,7 +25,7 @@ from chellow.models import (
|
|
|
25
25
|
Supply,
|
|
26
26
|
User,
|
|
27
27
|
)
|
|
28
|
-
from chellow.utils import csv_make_val, req_bool
|
|
28
|
+
from chellow.utils import csv_make_val, req_bool, utc_datetime_now
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
FNAME = "ecoes_comparison"
|
|
@@ -146,6 +146,7 @@ def _process(
|
|
|
146
146
|
report_run,
|
|
147
147
|
):
|
|
148
148
|
writer = csv.writer(f, lineterminator="\n")
|
|
149
|
+
now = utc_datetime_now()
|
|
149
150
|
|
|
150
151
|
mpans = []
|
|
151
152
|
|
|
@@ -274,6 +275,7 @@ def _process(
|
|
|
274
275
|
chellow_pc = ""
|
|
275
276
|
chellow_mtc = ""
|
|
276
277
|
chellow_llfc = ""
|
|
278
|
+
chellow_llfc_desc = ""
|
|
277
279
|
chellow_ssc = ""
|
|
278
280
|
chellow_es = ""
|
|
279
281
|
chellow_supplier = ""
|
|
@@ -287,6 +289,11 @@ def _process(
|
|
|
287
289
|
chellow_supply_id = None
|
|
288
290
|
chellow_era_id = None
|
|
289
291
|
ignore = True
|
|
292
|
+
ecoes_dno_code = ecoes["mpan-core"][:2]
|
|
293
|
+
ecoes_dno = Party.get_dno_by_code(sess, ecoes_dno_code, now)
|
|
294
|
+
ecoes_llfc_desc = ""
|
|
295
|
+
chellow_site_code = ""
|
|
296
|
+
chellow_site_name = ""
|
|
290
297
|
diffs = []
|
|
291
298
|
|
|
292
299
|
try:
|
|
@@ -404,11 +411,17 @@ def _process(
|
|
|
404
411
|
ignore = False
|
|
405
412
|
|
|
406
413
|
chellow_llfc = llfc.code
|
|
407
|
-
|
|
414
|
+
chellow_llfc_desc = llfc.description
|
|
415
|
+
ecoes_llfc_code = ecoes["llfc"].zfill(3)
|
|
416
|
+
if ecoes_llfc_code != chellow_llfc:
|
|
408
417
|
problem += "The LLFCs don't match. "
|
|
409
418
|
ignore = False
|
|
410
419
|
diffs.append("llfc")
|
|
411
420
|
|
|
421
|
+
ecoes_llfc = ecoes_dno.find_llfc_by_code(sess, ecoes_llfc_code, now)
|
|
422
|
+
if ecoes_llfc is not None:
|
|
423
|
+
ecoes_llfc_desc = ecoes_llfc.description
|
|
424
|
+
|
|
412
425
|
chellow_ssc = era.ssc
|
|
413
426
|
if chellow_ssc is None:
|
|
414
427
|
chellow_ssc = ""
|
|
@@ -466,6 +479,10 @@ def _process(
|
|
|
466
479
|
ignore = False
|
|
467
480
|
diffs.append("gsp_group")
|
|
468
481
|
|
|
482
|
+
chellow_site = era.get_physical_site(sess)
|
|
483
|
+
chellow_site_code = chellow_site.code
|
|
484
|
+
chellow_site_name = chellow_site.name
|
|
485
|
+
|
|
469
486
|
chellow_msn = era.msn
|
|
470
487
|
|
|
471
488
|
if set([m.strip() for m in chellow_msn.split(",")]) != set(
|
|
@@ -503,8 +520,10 @@ def _process(
|
|
|
503
520
|
"ecoes_mtc_date": _parse_date(ecoes["mtc-date"]),
|
|
504
521
|
"chellow_mtc": chellow_mtc,
|
|
505
522
|
"ecoes_llfc": ecoes["llfc"],
|
|
523
|
+
"ecoes_llfc_desc": ecoes_llfc_desc,
|
|
506
524
|
"ecoes_llfc_from": _parse_date(ecoes["llfc-from"]),
|
|
507
525
|
"chellow_llfc": chellow_llfc,
|
|
526
|
+
"chellow_llfc_desc": chellow_llfc_desc,
|
|
508
527
|
"ecoes_ssc": ecoes["ssc"],
|
|
509
528
|
"chellow_ssc": chellow_ssc,
|
|
510
529
|
"ecoes_es": ecoes["energisation-status"],
|
|
@@ -533,6 +552,8 @@ def _process(
|
|
|
533
552
|
"address": ", ".join(
|
|
534
553
|
[a for a in address_lines if len(a) > 0 and a != "NULL"]
|
|
535
554
|
),
|
|
555
|
+
"chellow_site_code": chellow_site_code,
|
|
556
|
+
"chellow_site_name": chellow_site_name,
|
|
536
557
|
}
|
|
537
558
|
writer.writerow(csv_make_val(values[t]) for t in titles)
|
|
538
559
|
values["chellow_supplier_contract_id"] = chellow_supplier_contract_id
|
|
@@ -64,26 +64,21 @@
|
|
|
64
64
|
<caption>{{vals['mpan_core_no_spaces']}}</caption>
|
|
65
65
|
<thead>
|
|
66
66
|
<tr>
|
|
67
|
-
<th
|
|
68
|
-
<th
|
|
69
|
-
<th
|
|
70
|
-
<th
|
|
67
|
+
<th>Source</th>
|
|
68
|
+
<th>Mpan Core</th>
|
|
69
|
+
<th>Supplier Contract</th>
|
|
70
|
+
<th>Edit Era</th>
|
|
71
|
+
<th>Edit Supply</th>
|
|
71
72
|
{% for diff in vals['diffs'] %}
|
|
72
|
-
<th
|
|
73
|
-
{% endfor %}
|
|
74
|
-
<th rowspan="2">Problem</th>
|
|
75
|
-
<th rowspan="2">Fix</th>
|
|
76
|
-
<th rowspan="2">ECOES Address</th>
|
|
77
|
-
</tr>
|
|
78
|
-
<tr>
|
|
79
|
-
{% for diff in vals['diffs'] %}
|
|
80
|
-
<th>Chellow</th>
|
|
81
|
-
<th>ECOES</th>
|
|
73
|
+
<th>{{diff}}</th>
|
|
82
74
|
{% endfor %}
|
|
75
|
+
<th>Problem</th>
|
|
76
|
+
<th>Site</th>
|
|
83
77
|
</tr>
|
|
84
78
|
</thead>
|
|
85
79
|
<tbody>
|
|
86
80
|
<tr>
|
|
81
|
+
<td>Chellow</td>
|
|
87
82
|
<td>
|
|
88
83
|
{% if vals['chellow_supply_id'] is none %}
|
|
89
84
|
{{vals['mpan_core']}}
|
|
@@ -99,15 +94,55 @@
|
|
|
99
94
|
</td>
|
|
100
95
|
<td>
|
|
101
96
|
{% if vals['chellow_era_id'] is not none %}
|
|
102
|
-
[<a href="/e/eras/{{vals['chellow_era_id']}}/edit">edit</a>]
|
|
97
|
+
[<a href="/e/eras/{{vals['chellow_era_id']}}/edit">edit</a>]
|
|
103
98
|
{% endif %}
|
|
99
|
+
</td>
|
|
104
100
|
<td>
|
|
105
101
|
{% if vals['chellow_supply_id'] is not none %}
|
|
106
102
|
[<a href="/e/supplies/{{vals['chellow_supply_id']}}/edit">edit</a>]
|
|
107
103
|
{% endif %}
|
|
108
104
|
</td>
|
|
109
105
|
{% for diff in vals['diffs'] %}
|
|
110
|
-
<td>
|
|
106
|
+
<td>
|
|
107
|
+
{{vals['chellow_' + diff]}}
|
|
108
|
+
{% if diff == 'llfc' %}
|
|
109
|
+
- {{vals['chellow_' + diff + '_desc']}}
|
|
110
|
+
<form hx-post="/e/supplies/{{vals['chellow_supply_id']}}">
|
|
111
|
+
<fieldset>
|
|
112
|
+
<input type="hidden" name="llfc_code" value="{{vals['ecoes_llfc']}}">
|
|
113
|
+
<input type="hidden" name="mpan_core" value="{{vals['mpan_core']}}">
|
|
114
|
+
<input type="hidden" name="start_date"
|
|
115
|
+
value="{{vals['ecoes_llfc_from_date']}}">
|
|
116
|
+
<input type="submit" name="new_llfc" value="Fix">
|
|
117
|
+
</fieldset>
|
|
118
|
+
</form>
|
|
119
|
+
{% elif diff == 'msn' %}
|
|
120
|
+
<form hx-post="/e/supplies/{{vals['chellow_supply_id']}}">
|
|
121
|
+
<fieldset>
|
|
122
|
+
<input type="hidden" name="msn" value="{{vals['ecoes_msn']}}">
|
|
123
|
+
<input type="hidden" name="start_date"
|
|
124
|
+
value="{{vals['ecoes_msn_install_date']}}">
|
|
125
|
+
<input type="submit" name="new_msn" value="Fix MSN">
|
|
126
|
+
</fieldset>
|
|
127
|
+
</form>
|
|
128
|
+
{% endif %}
|
|
129
|
+
</td>
|
|
130
|
+
{% endfor %}
|
|
131
|
+
<td rowspan="2">{{vals['problem']}}</td>
|
|
132
|
+
<td>{{vals['chellow_site_code']}} {{vals['chellow_site_name']}}</td>
|
|
133
|
+
</tr>
|
|
134
|
+
<tr>
|
|
135
|
+
<td>
|
|
136
|
+
ECOES
|
|
137
|
+
</td>
|
|
138
|
+
<td>
|
|
139
|
+
</td>
|
|
140
|
+
<td>
|
|
141
|
+
</td>
|
|
142
|
+
<td>
|
|
143
|
+
<td>
|
|
144
|
+
</td>
|
|
145
|
+
{% for diff in vals['diffs'] %}
|
|
111
146
|
<td>{{vals['ecoes_' + diff]}}
|
|
112
147
|
{% if diff == 'msn' %}
|
|
113
148
|
- {{vals['ecoes_msn_install_date']}}
|
|
@@ -116,7 +151,7 @@
|
|
|
116
151
|
{% elif diff == 'mtc' %}
|
|
117
152
|
- {{vals['ecoes_mtc_date']}}
|
|
118
153
|
{% elif diff == 'llfc' %}
|
|
119
|
-
- {{vals['ecoes_llfc_from']}}
|
|
154
|
+
{{vals['ecoes_llfc_desc']}} - From {{vals['ecoes_llfc_from']}}
|
|
120
155
|
{% elif diff == 'mop' %}
|
|
121
156
|
- {{vals['ecoes_mop_appoint_date']}}
|
|
122
157
|
{% elif diff == 'gsp_group' %}
|
|
@@ -124,19 +159,6 @@
|
|
|
124
159
|
{% endif %}
|
|
125
160
|
</td>
|
|
126
161
|
{% endfor %}
|
|
127
|
-
<td>{{vals['problem']}}</td>
|
|
128
|
-
<td>
|
|
129
|
-
{% if 'msn' in vals['diffs'] %}
|
|
130
|
-
<form hx-post="/e/supplies/{{vals['chellow_supply_id']}}">
|
|
131
|
-
<fieldset>
|
|
132
|
-
<input type="hidden" name="msn" value="{{vals['ecoes_msn']}}">
|
|
133
|
-
<input type="hidden" name="start_date"
|
|
134
|
-
value="{{vals['ecoes_msn_install_date']}}">
|
|
135
|
-
<input type="submit" name="new_msn" value="Fix MSN">
|
|
136
|
-
</fieldset>
|
|
137
|
-
</form>
|
|
138
|
-
{% endif %}
|
|
139
|
-
</td>
|
|
140
162
|
<td>{{vals['address']}}</td>
|
|
141
163
|
</tr>
|
|
142
164
|
</tbody>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1755078653.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)
|
|
@@ -22,8 +22,8 @@ chellow/e/bsuos.py,sha256=2L7pgiGbV4k1Udfzjj4B2Qye02sV_FhNjwh7_sIxXFg,15525
|
|
|
22
22
|
chellow/e/ccl.py,sha256=30dh_SvlgzsTQPPAJNZWILaMvbeDsv9-P-S1JxS5_SQ,3184
|
|
23
23
|
chellow/e/cfd.py,sha256=CWLdYeNjgqT6Ro8YRf4vhwXIAJ2aV4Wi6HLNClVSeaQ,14260
|
|
24
24
|
chellow/e/computer.py,sha256=lt4Zlr8EOClL1acuuvKA-tNPCI5RRHnAZbsaGQnB9j4,68835
|
|
25
|
-
chellow/e/dno_rate_parser.py,sha256=
|
|
26
|
-
chellow/e/duos.py,sha256=
|
|
25
|
+
chellow/e/dno_rate_parser.py,sha256=PRJnRHsoMdNQTzXfHet8PptXOcNUURKhVpwd9Dzt2Q4,26503
|
|
26
|
+
chellow/e/duos.py,sha256=3jOOnRP633xfzC7OhqWWW48H34T-NZosss9CNW6HQQs,33004
|
|
27
27
|
chellow/e/elexon.py,sha256=eOmX_wpxj6Ty6eaEgGAgXX-MgyJkYQSAT6DtJeP1rUE,5544
|
|
28
28
|
chellow/e/energy_management.py,sha256=tRQJ-7_caG91oKnh5qIuK9qE_Nr3BmZ3ddaj5GTHIKQ,10487
|
|
29
29
|
chellow/e/hh_importer.py,sha256=JBVCNSpM-DMu9_io516KojvujwZEQq6upDSsMbtu_sI,21511
|
|
@@ -44,7 +44,7 @@ chellow/e/system_price.py,sha256=6w5J7bzwFAZubE2zdOFRiS8IIrVP8hkoIOaG2yCt-Ic,623
|
|
|
44
44
|
chellow/e/tlms.py,sha256=pyL32hPiYd09FbpXVMnBjHsWFEQHs-Az945V7EShGiY,9116
|
|
45
45
|
chellow/e/tnuos.py,sha256=NBmc-f3oezrl4gviAKobljHfICTpBKxxxEGBGJi_lRk,4927
|
|
46
46
|
chellow/e/triad.py,sha256=uQIngSrz8irBXQ0Rp_s8nAUzu-y2Ms7aj4B38_Ff8y8,13720
|
|
47
|
-
chellow/e/views.py,sha256=
|
|
47
|
+
chellow/e/views.py,sha256=EJbKApeJsRqgjJdOZRk5Oah3HlA1ys5vJXUhF6LoYQA,222489
|
|
48
48
|
chellow/e/bill_parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=opjXRrqrgBTbSKzL0JfTLP0fnz3DL3oRZZ4P0DifQ3I,4119
|
|
50
50
|
chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=-HMoIfa_utXYKA44RuC0Xqv3vd2HLeQU_4P0iBUd3WA,4219
|
|
@@ -79,7 +79,7 @@ chellow/gas/transportation.py,sha256=Bkg8TWOs-v0ES-4qqwbleiOhqbE_t2KauUx9JYMZELM
|
|
|
79
79
|
chellow/gas/views.py,sha256=GeCvi6BGTUN7bu7sVkypNckwG3Crl6AbUcRob9qMi0E,59733
|
|
80
80
|
chellow/reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
81
|
chellow/reports/report_109.py,sha256=Exb-FQ5f70-ier_h15CgHGysQ7vJ7k3gFZ1001zM3iM,11171
|
|
82
|
-
chellow/reports/report_111.py,sha256=
|
|
82
|
+
chellow/reports/report_111.py,sha256=LAWmCLVE5yhPTVV_agZtlTyXHyNmJVes2zL7CS9eITo,30211
|
|
83
83
|
chellow/reports/report_169.py,sha256=wortJyvgXTrnjjXhLzqwaksKKu63K5IgdzU5f4SkHMI,9246
|
|
84
84
|
chellow/reports/report_181.py,sha256=ypfYWYVNC1X2fMlJyDzwNiNTTRrpPW49DirXE_xDKa0,4958
|
|
85
85
|
chellow/reports/report_183.py,sha256=fGONpKEIXTqIT_3dE5jZKBIesWPgLq-chHO6X22dIv0,8768
|
|
@@ -104,7 +104,7 @@ chellow/reports/report_bills.py,sha256=LP7XDxzO0Fp10c8xDE67e4tHTEc7nN74ESQBy762N
|
|
|
104
104
|
chellow/reports/report_csv_llfcs.py,sha256=mMB06b6Jems5kcQU4H4Le_fyKgVr8THP8BCx3pkvg5E,1903
|
|
105
105
|
chellow/reports/report_csv_site_hh_data.py,sha256=ik0OkGVo1bfTXLdcT3gPUHnxSkSdorzZheP3qgnOR5c,4331
|
|
106
106
|
chellow/reports/report_csv_site_snags.py,sha256=AuAy6vjL0g7vwPPAZhBqxOyITL9_jnyFj012MnUcxxk,2627
|
|
107
|
-
chellow/reports/report_ecoes_comparison.py,sha256=
|
|
107
|
+
chellow/reports/report_ecoes_comparison.py,sha256=ZI-wHFbWHO_MzqJ8zFZb8rJMi_O1J4ymQEoNjQ7XltQ,22784
|
|
108
108
|
chellow/reports/report_g_monthly_duration.py,sha256=aEY3hSBaCxjOBgWZYWZH38TmZEO5MpOfpOQe2Lhfpmo,18288
|
|
109
109
|
chellow/reports/report_g_supplies_snapshot.py,sha256=9xB6RDrnbgxuomMcP1b1yEP4kOnEJ34WgKpyxLTprOQ,3998
|
|
110
110
|
chellow/reports/report_g_supply_virtual_bill.py,sha256=EaYrB8PHJIXrUuhiZ7dwUlbNBkuyJebQHrdc308_z1o,3653
|
|
@@ -148,7 +148,7 @@ chellow/templates/rate_server.html,sha256=SezuwdKhHRZ00-R_S6ttKiZ-nvRpwozV9QcIMf
|
|
|
148
148
|
chellow/templates/report_run.html,sha256=O_wjIu43S-mKVyZyku3dJJdvyck3rAgEdhw59TsCcK0,4040
|
|
149
149
|
chellow/templates/report_run_asset_comparison.html,sha256=VYCCUmIC7Mfe7uuaAHb6ihiK6zsqeTlQbzgtzLqR3zg,2305
|
|
150
150
|
chellow/templates/report_run_bill_check.html,sha256=I4VLSTOGE7cjjZggG3EAI9EW-2b7e0oOTs-S7FlknS4,5110
|
|
151
|
-
chellow/templates/report_run_ecoes_comparison.html,sha256=
|
|
151
|
+
chellow/templates/report_run_ecoes_comparison.html,sha256=EYjmdiQ14lt_CW7e6mdyQYec1t-rg8g85wFb1757YpI,4812
|
|
152
152
|
chellow/templates/report_run_g_bill_check.html,sha256=tOXl_mjR__foYKiOYflJbK-459actAtjzv8rfuL3TwM,4851
|
|
153
153
|
chellow/templates/report_run_missing_e_bills.html,sha256=l5idQhfaNhMvvzIRv-iqCpeDnYl_wgs6-mZMBOmuyR8,2447
|
|
154
154
|
chellow/templates/report_run_monthly_duration_org.html,sha256=gGNGJ4Q50q4BtIMi98rhO-7NqRHcsFUmbj2qzeOLejw,1713
|
|
@@ -386,6 +386,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
|
|
|
386
386
|
chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
|
|
387
387
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
388
388
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
389
|
-
chellow-
|
|
390
|
-
chellow-
|
|
391
|
-
chellow-
|
|
389
|
+
chellow-1755078653.0.0.dist-info/METADATA,sha256=KbKInBogTjyWa07u4oygauNjPH3P6FDkHayi_EazfJY,12519
|
|
390
|
+
chellow-1755078653.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
391
|
+
chellow-1755078653.0.0.dist-info/RECORD,,
|
|
File without changes
|