chellow 1730306906.0.0__py3-none-any.whl → 1731581146.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/bill_parsers/mm.py +1 -1
- chellow/general_import.py +14 -13
- chellow/reports/report_111.py +32 -10
- {chellow-1730306906.0.0.dist-info → chellow-1731581146.0.0.dist-info}/METADATA +1 -1
- {chellow-1730306906.0.0.dist-info → chellow-1731581146.0.0.dist-info}/RECORD +6 -6
- {chellow-1730306906.0.0.dist-info → chellow-1731581146.0.0.dist-info}/WHEEL +1 -1
chellow/e/bill_parsers/mm.py
CHANGED
chellow/general_import.py
CHANGED
|
@@ -83,7 +83,8 @@ ALLOWED_ACTIONS = ("insert", "update", "delete")
|
|
|
83
83
|
|
|
84
84
|
def general_import_era(sess, action, vals, args):
|
|
85
85
|
if action == "update":
|
|
86
|
-
|
|
86
|
+
mpan_core_str = add_arg(args, "mpan_core", vals, 0)
|
|
87
|
+
mpan_core = parse_mpan_core(mpan_core_str)
|
|
87
88
|
supply = Supply.get_by_mpan_core(sess, mpan_core)
|
|
88
89
|
date_str = add_arg(args, "date", vals, 1)
|
|
89
90
|
dt = parse_hh_start(date_str)
|
|
@@ -148,13 +149,13 @@ def general_import_era(sess, action, vals, args):
|
|
|
148
149
|
comm_code = add_arg(args, "Comms Type", vals, 12)
|
|
149
150
|
comm = era.comm if comm_code == NO_CHANGE else Comm.get_by_code(sess, comm_code)
|
|
150
151
|
|
|
151
|
-
|
|
152
|
-
if
|
|
153
|
-
|
|
154
|
-
elif len(
|
|
155
|
-
|
|
152
|
+
ssc_code_str = add_arg(args, "SSC", vals, 13)
|
|
153
|
+
if ssc_code_str == NO_CHANGE:
|
|
154
|
+
ssc_code = None if era.ssc is None else era.ssc.code
|
|
155
|
+
elif len(ssc_code_str) == 0:
|
|
156
|
+
ssc_code = None
|
|
156
157
|
else:
|
|
157
|
-
|
|
158
|
+
ssc_code = ssc_code_str
|
|
158
159
|
|
|
159
160
|
es_code = add_arg(args, "Energisation Status", vals, 14)
|
|
160
161
|
if es_code == NO_CHANGE:
|
|
@@ -162,11 +163,11 @@ def general_import_era(sess, action, vals, args):
|
|
|
162
163
|
else:
|
|
163
164
|
es = EnergisationStatus.get_by_code(sess, es_code)
|
|
164
165
|
|
|
165
|
-
|
|
166
|
-
if
|
|
167
|
-
|
|
166
|
+
dtc_meter_type_code = add_arg(args, "DTC Meter Type", vals, 15)
|
|
167
|
+
if dtc_meter_type_code == NO_CHANGE:
|
|
168
|
+
dtc_meter_type = era.dtc_meter_type
|
|
168
169
|
else:
|
|
169
|
-
|
|
170
|
+
dtc_meter_type = DtcMeterType.get_by_code(sess, dtc_meter_type_code)
|
|
170
171
|
|
|
171
172
|
imp_mpan_core = add_arg(args, "Import MPAN Core", vals, 16)
|
|
172
173
|
imp_llfc_code = None
|
|
@@ -266,9 +267,9 @@ def general_import_era(sess, action, vals, args):
|
|
|
266
267
|
mtc_code,
|
|
267
268
|
cop,
|
|
268
269
|
comm,
|
|
269
|
-
|
|
270
|
+
ssc_code,
|
|
270
271
|
es,
|
|
271
|
-
|
|
272
|
+
dtc_meter_type,
|
|
272
273
|
imp_mpan_core,
|
|
273
274
|
imp_llfc_code,
|
|
274
275
|
imp_supplier_contract,
|
chellow/reports/report_111.py
CHANGED
|
@@ -178,6 +178,7 @@ def content(
|
|
|
178
178
|
"bill-kwh",
|
|
179
179
|
"bill-net-gbp",
|
|
180
180
|
"bill-vat-gbp",
|
|
181
|
+
"bill-gross-gbp",
|
|
181
182
|
"bill-start-date",
|
|
182
183
|
"bill-finish-date",
|
|
183
184
|
"imp-mpan-core",
|
|
@@ -371,7 +372,13 @@ def _process_supply(
|
|
|
371
372
|
|
|
372
373
|
covered_start = bill_start
|
|
373
374
|
covered_finish = bill_start
|
|
374
|
-
covered_bdown = {
|
|
375
|
+
covered_bdown = {
|
|
376
|
+
"sum-msp-kwh": 0,
|
|
377
|
+
"net-gbp": 0,
|
|
378
|
+
"vat-gbp": 0,
|
|
379
|
+
"gross-gbp": 0,
|
|
380
|
+
"problem": "",
|
|
381
|
+
}
|
|
375
382
|
|
|
376
383
|
vb_elems = set()
|
|
377
384
|
enlarged = True
|
|
@@ -439,9 +446,23 @@ def _process_supply(
|
|
|
439
446
|
primary_covered_bill = None
|
|
440
447
|
for covered_bill in covered_bills.values():
|
|
441
448
|
bill_ids.discard(covered_bill.id)
|
|
442
|
-
covered_bdown["net-gbp"] += float(covered_bill.net)
|
|
443
|
-
covered_bdown["vat-gbp"] += float(covered_bill.vat)
|
|
444
449
|
covered_bdown["sum-msp-kwh"] += float(covered_bill.kwh)
|
|
450
|
+
for elem, val in (
|
|
451
|
+
("net", covered_bill.net),
|
|
452
|
+
("vat", covered_bill.vat),
|
|
453
|
+
("gross", covered_bill.gross),
|
|
454
|
+
):
|
|
455
|
+
covered_bdown[f"{elem}-gbp"] += float(val)
|
|
456
|
+
covered_elems.add(elem)
|
|
457
|
+
add_gap(
|
|
458
|
+
caches,
|
|
459
|
+
gaps,
|
|
460
|
+
elem,
|
|
461
|
+
covered_bill.start_date,
|
|
462
|
+
covered_bill.finish_date,
|
|
463
|
+
False,
|
|
464
|
+
val,
|
|
465
|
+
)
|
|
445
466
|
for k, v in loads(covered_bill.breakdown).items():
|
|
446
467
|
if k in ("raw_lines", "raw-lines", "vat"):
|
|
447
468
|
continue
|
|
@@ -599,7 +620,7 @@ def _process_supply(
|
|
|
599
620
|
|
|
600
621
|
for dt, bl in vb_hhs.items():
|
|
601
622
|
for k, v in bl.items():
|
|
602
|
-
if
|
|
623
|
+
if k.endswith("-gbp") and v != 0:
|
|
603
624
|
add_gap(caches, gaps, k[:-4], dt, dt, True, v)
|
|
604
625
|
|
|
605
626
|
for k in virtual_bill.keys():
|
|
@@ -625,13 +646,13 @@ def _process_supply(
|
|
|
625
646
|
f"virtual bill. "
|
|
626
647
|
)
|
|
627
648
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
except KeyError:
|
|
631
|
-
pass
|
|
632
|
-
|
|
649
|
+
virtual_bill.pop("net-gbp", None)
|
|
650
|
+
virtual_bill.pop("gross-gbp", None)
|
|
633
651
|
virtual_bill["net-gbp"] = sum(
|
|
634
|
-
v for k, v in virtual_bill.items() if k.endswith("-gbp")
|
|
652
|
+
v for k, v in virtual_bill.items() if k.endswith("-gbp") and k != "vat-gbp"
|
|
653
|
+
)
|
|
654
|
+
virtual_bill["gross-gbp"] = virtual_bill["net-gbp"] + virtual_bill.get(
|
|
655
|
+
"vat-gbp", 0
|
|
635
656
|
)
|
|
636
657
|
|
|
637
658
|
era = supply.find_era_at(sess, bill_finish)
|
|
@@ -665,6 +686,7 @@ def _process_supply(
|
|
|
665
686
|
"bill-kwh": bill.kwh,
|
|
666
687
|
"bill-net-gbp": bill.net,
|
|
667
688
|
"bill-vat-gbp": bill.vat,
|
|
689
|
+
"bill-gross-gbp": bill.gross,
|
|
668
690
|
"bill-start-date": bill_start,
|
|
669
691
|
"bill-finish-date": bill_finish,
|
|
670
692
|
"imp-mpan-core": imp_mpan_core,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1731581146.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)
|
|
@@ -4,7 +4,7 @@ chellow/bank_holidays.py,sha256=T_utYMwe_g1dz5X-aOTdIPryg49SvB7QsWM1yphlqG8,4423
|
|
|
4
4
|
chellow/commands.py,sha256=ESBe9ZWj1c3vdZgqMZ9gFvYAB3hRag2R1PzOwuw9yFo,1302
|
|
5
5
|
chellow/dloads.py,sha256=dixp-O0MF2_mlwrnKx3D9DH09Qu05BjTo0rZfigTjR4,5534
|
|
6
6
|
chellow/edi_lib.py,sha256=alu20x9ZX06iPfnNI9dEJzuP6RIf4We3Y_M_bl7RrcY,51789
|
|
7
|
-
chellow/general_import.py,sha256=
|
|
7
|
+
chellow/general_import.py,sha256=5kJszUnk3CVJclsW-mCjLF0z8lw7CaNNhIzUoaq20kY,65965
|
|
8
8
|
chellow/models.py,sha256=9LLROzS6gXZGICk0ITXhCyTtKaIY7HW4bMqWg4Mc-xw,244221
|
|
9
9
|
chellow/national_grid.py,sha256=czwIZqzJndSGhEMQ5YzI6hRBhvjkM6VRVYXybf4_KXg,4377
|
|
10
10
|
chellow/proxy.py,sha256=cVXIktPlX3tQ1BYcwxq0nJXKE6r3DtFTtfFHPq55HaM,1351
|
|
@@ -58,7 +58,7 @@ chellow/e/bill_parsers/gdf_csv.py,sha256=ZfK3Oc6oP28p_P9DIevLNB_zW2WLcEJ3Lvb1gL3
|
|
|
58
58
|
chellow/e/bill_parsers/haven_csv.py,sha256=0uENq8IgVNqdxfBQMBxLTSZWCOuDHXZC0xzk52SbfyE,13652
|
|
59
59
|
chellow/e/bill_parsers/haven_edi.py,sha256=YGPHRxPOhje9s32jqPHHELni2tooOYj3cMC_qaZVPq4,16107
|
|
60
60
|
chellow/e/bill_parsers/haven_edi_tprs.py,sha256=ZVX9CCqUybsot_Z0BEOJPvl9x5kSr7fEWyuJXvZDcz4,11841
|
|
61
|
-
chellow/e/bill_parsers/mm.py,sha256=
|
|
61
|
+
chellow/e/bill_parsers/mm.py,sha256=zeNF5F8uduQeEFjYOm5lfMS-DO3JjTB7oarA3H_Si5s,10019
|
|
62
62
|
chellow/e/bill_parsers/nonsettlement_dc_stark_xlsx.py,sha256=yogXTuQHGRL7IiqvRWr2C9V24ez1j9Yx0128UygPE_k,4723
|
|
63
63
|
chellow/e/bill_parsers/settlement_dc_stark_xlsx.py,sha256=PlEqCZuJ9DfQXeeYQ64jtf3ML7sUt_tt61QOOTnkE5c,6380
|
|
64
64
|
chellow/e/bill_parsers/sse_edi.py,sha256=L85DOfNkqexeEIEr8pCBn_2sHJI-zEaw6cogpE3YyYM,15204
|
|
@@ -75,7 +75,7 @@ chellow/gas/transportation.py,sha256=Bkg8TWOs-v0ES-4qqwbleiOhqbE_t2KauUx9JYMZELM
|
|
|
75
75
|
chellow/gas/views.py,sha256=R4Ky8syioWSQJLTuSKVLsc266eDv8a6WEo_e60u_4ug,59021
|
|
76
76
|
chellow/reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
77
77
|
chellow/reports/report_109.py,sha256=FmRWG8wQC97cj0nqQH7mrfbYesRIKWXQLh6ERHvtHrU,11212
|
|
78
|
-
chellow/reports/report_111.py,sha256=
|
|
78
|
+
chellow/reports/report_111.py,sha256=MBXMABwHonjH2cvkqFYC0Vx7rU7LB2mJxXsEjI0RvTU,28828
|
|
79
79
|
chellow/reports/report_169.py,sha256=tnTiHmhigcgZ7E8rUSfgzsVYUCW947xBZZq04-KqfK8,9287
|
|
80
80
|
chellow/reports/report_181.py,sha256=mCL6vXfrj8r0kL-LilDS0SnSu5tJOzCq7eMJVx9zpEw,4999
|
|
81
81
|
chellow/reports/report_183.py,sha256=DZX-hHJPl_Tbgkt31C_cuLZg_5L2b6iCPQ5foOZizR0,8817
|
|
@@ -377,6 +377,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
|
|
|
377
377
|
chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
|
|
378
378
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
379
379
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
380
|
-
chellow-
|
|
381
|
-
chellow-
|
|
382
|
-
chellow-
|
|
380
|
+
chellow-1731581146.0.0.dist-info/METADATA,sha256=nVYIrIIfi0Wd791y4tLcCZoJMu9CQO31xsJCB77Pqfc,12204
|
|
381
|
+
chellow-1731581146.0.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
382
|
+
chellow-1731581146.0.0.dist-info/RECORD,,
|