chellow 1731435800.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/general_import.py CHANGED
@@ -149,11 +149,13 @@ def general_import_era(sess, action, vals, args):
149
149
  comm_code = add_arg(args, "Comms Type", vals, 12)
150
150
  comm = era.comm if comm_code == NO_CHANGE else Comm.get_by_code(sess, comm_code)
151
151
 
152
- ssc_code = add_arg(args, "SSC", vals, 13)
153
- if ssc_code == NO_CHANGE:
154
- ssc_code = era.ssc.code
155
- elif len(ssc_code) == 0:
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
156
  ssc_code = None
157
+ else:
158
+ ssc_code = ssc_code_str
157
159
 
158
160
  es_code = add_arg(args, "Energisation Status", vals, 14)
159
161
  if es_code == NO_CHANGE:
@@ -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 = {"sum-msp-kwh": 0, "net-gbp": 0, "vat-gbp": 0, "problem": ""}
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 all((k.endswith("-gbp"), k != "net-gbp", v != 0)):
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
- try:
629
- del virtual_bill["net-gbp"]
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: 1731435800.0.0
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=Ia2Y40NEwqOYBHUwafJRcI34EO0WMX6FSBQJtGHeY0M,65874
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
@@ -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=rgwoOPfvbfwIC_IjBqs2e8umF_YTtpyejLrX_uCgyHE,28145
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-1731435800.0.0.dist-info/METADATA,sha256=ilPn6kcxryT74lMCin7HXAJqf48jbjfuyV1Y3qmf9dA,12204
381
- chellow-1731435800.0.0.dist-info/WHEEL,sha256=WJ9WQ4-pUYxfD_tEj5GvKSG9KSULNumqkTQdolV8mME,87
382
- chellow-1731435800.0.0.dist-info/RECORD,,
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,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.2
2
+ Generator: hatchling 1.26.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any