chellow 1751875889.0.0__py3-none-any.whl → 1751991276.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.

@@ -104,6 +104,7 @@ ELEMENT_MAP = {
104
104
  "duos-availability-kva",
105
105
  ),
106
106
  "209269": ("tnuos-gbp", "tnuos-rate", "tnuos-days"),
107
+ "065950": ("eii-gbp", "eii-rate", "eii-kwh"),
107
108
  },
108
109
  "DUSDIS": {
109
110
  "122568": ("nrg-gsp-losses-gbp", "nrg-rate", "nrg-gsp-losses-kwh"),
@@ -149,7 +150,6 @@ ELEMENT_MAP = {
149
150
  "930504": ("eii-gbp", None, None),
150
151
  "331201": ("eii-gbp", None, None),
151
152
  "307253": ("eii-gbp", "eii-rate", "eii-kwh"),
152
- "065950": ("eii-gbp", "eii-rate", "eii-kwh"),
153
153
  }
154
154
 
155
155
  TPR_LOOKUP = {
@@ -47,7 +47,9 @@ def _handle_0050(headers, pre_record, record):
47
47
  unknown_4=12,
48
48
  late_payment=12,
49
49
  )
50
- headers["late_payment"] = Decimal(parts["late_payment"]) / Decimal(100)
50
+ headers["breakdown"]["late_payment"] += Decimal(parts["late_payment"]) / Decimal(
51
+ 100
52
+ )
51
53
  """
52
54
 
53
55
 
@@ -57,13 +59,10 @@ def _handle_0051(headers, pre_record, record):
57
59
 
58
60
  def _handle_0100(headers, pre_record, record):
59
61
  issue_date = headers["issue_date"]
60
- late_payment = headers.get("late_payment")
61
62
  headers.clear()
62
63
  headers["issue_date"] = issue_date
63
- if late_payment is not None:
64
- headers["late_payment"] = late_payment
65
- headers["account"] = pre_record[43:52]
66
- headers["reference"] = pre_record[41:46]
64
+ headers["account"] = pre_record[42:52]
65
+ headers["reference"] = pre_record[52:64]
67
66
  headers["kwh"] = Decimal("0")
68
67
  headers["breakdown"] = defaultdict(int, {"vat": {}})
69
68
  headers["reads"] = []
@@ -245,6 +244,17 @@ def _handle_0860(headers, pre_record, record):
245
244
  bd["metering-gbp"] += Decimal(parts["metering_gbp"]) / Decimal("100")
246
245
 
247
246
 
247
+ def _handle_0960(headers, pre_record, record):
248
+ parts = _chop_record(
249
+ record,
250
+ days=3,
251
+ payment=12,
252
+ rate=6,
253
+ )
254
+ bd = headers["breakdown"]
255
+ bd["late_payment_gbp"] += Decimal(parts["payment"]) / Decimal(100)
256
+
257
+
248
258
  def _handle_1455(headers, pre_record, record):
249
259
  parts = _chop_record(
250
260
  record, ccl_kwh=13, unknown_1=10, ccl_rate=13, ccl_gbp=12, unkown_2=8
@@ -294,12 +304,6 @@ def _handle_1500(headers, pre_record, record):
294
304
  breakdown = headers["breakdown"]
295
305
  net = Decimal("0.00") + Decimal(parts["net"]) / Decimal("100")
296
306
  gross = Decimal("0.00") + Decimal(parts["gross"]) / Decimal("100")
297
- if "late_payment" in headers:
298
- late_payment_gbp = headers["late_payment"]
299
- net += late_payment_gbp
300
- gross += late_payment_gbp
301
- breakdown["late-payment-gbp"] += late_payment_gbp
302
- del headers["late_payment"]
303
307
 
304
308
  return {
305
309
  "bill_type_code": "W" if net < 0 else "N",
@@ -354,6 +358,7 @@ LINE_HANDLERS = {
354
358
  "0461": _handle_0461,
355
359
  "0470": _handle_0470,
356
360
  "0860": _handle_0860,
361
+ "0960": _handle_0960,
357
362
  "1455": _handle_1455,
358
363
  "1460": _handle_1460,
359
364
  "1500": _handle_1500,
@@ -471,14 +471,13 @@ def _process_site(
471
471
  if supply_ids is not None:
472
472
  q = q.where(Supply.id.in_(supply_ids))
473
473
  for supply in sess.execute(q).scalars():
474
- last_era = (
475
- sess.execute(
476
- select(Era).where(Era.supply == supply).order_by(Era.start_date.desc())
477
- )
478
- .scalars()
479
- .first()
480
- )
481
- if last_era.finish_date is not None and last_era.start_date <= finish_date:
474
+ last_era = sess.scalars(
475
+ select(Era)
476
+ .join(SiteEra)
477
+ .where(Era.supply == supply)
478
+ .order_by(Era.start_date.desc())
479
+ ).first()
480
+ if last_era.finish_date is not None and last_era.finish_date < finish_date:
482
481
  site_era = sess.execute(
483
482
  select(SiteEra).where(
484
483
  SiteEra.era == last_era,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chellow
3
- Version: 1751875889.0.0
3
+ Version: 1751991276.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)
@@ -50,7 +50,7 @@ chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=opjXRrqrgBTbSKzL0JfTLP0
50
50
  chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=-HMoIfa_utXYKA44RuC0Xqv3vd2HLeQU_4P0iBUd3WA,4219
51
51
  chellow/e/bill_parsers/bgb_edi.py,sha256=GuwHeYbAGk7BVg5n19FcTANFDyKI-y0z3f9niQaPSSw,4828
52
52
  chellow/e/bill_parsers/csv.py,sha256=U5zcIaZ6B5QTTpFDAcBnk4G2r8B3j5kJhDPL4AJNkEk,5640
53
- chellow/e/bill_parsers/drax_edi.py,sha256=cqd1YhW_IsxUMsW5xcyC_0CHpqkMRWKQgcXERZoIqGM,15083
53
+ chellow/e/bill_parsers/drax_edi.py,sha256=TC_vlBLn_elmIZrug-vqVRjUcrd7U2fDO75PTzwmcEY,15091
54
54
  chellow/e/bill_parsers/drax_element_edi.py,sha256=kxjg1KA4UheMa8doGp9skXtQYrNK8Eisy9ksafR5TQo,13661
55
55
  chellow/e/bill_parsers/edf_export_xlsx.py,sha256=J4lY8epiSTIePZ6D1SGD76TXRoev35KrUC2sjHkNqlE,6632
56
56
  chellow/e/bill_parsers/engie_edi.py,sha256=PDMDI0aqUM1lalgzxih1YmMho11n1rMqE0vyL-aEIs8,15840
@@ -61,7 +61,7 @@ chellow/e/bill_parsers/gdf_csv.py,sha256=ZfK3Oc6oP28p_P9DIevLNB_zW2WLcEJ3Lvb1gL3
61
61
  chellow/e/bill_parsers/haven_csv.py,sha256=0uENq8IgVNqdxfBQMBxLTSZWCOuDHXZC0xzk52SbfyE,13652
62
62
  chellow/e/bill_parsers/haven_edi.py,sha256=YGPHRxPOhje9s32jqPHHELni2tooOYj3cMC_qaZVPq4,16107
63
63
  chellow/e/bill_parsers/haven_edi_tprs.py,sha256=ZVX9CCqUybsot_Z0BEOJPvl9x5kSr7fEWyuJXvZDcz4,11841
64
- chellow/e/bill_parsers/mm.py,sha256=i1TcEo3eY6_i_1DfRP3fIX7kIsx5cVx_FZPFG6S-FNo,11252
64
+ chellow/e/bill_parsers/mm.py,sha256=1myKrms3yVAhKFCzk3swWJjCwepZYk8GkD0wK0bpsj4,11184
65
65
  chellow/e/bill_parsers/nonsettlement_dc_stark_xlsx.py,sha256=YvQ0Q6HlZ4XSk6Phx1UWaTSj8FREVjwQe8nrpiLVzbU,5458
66
66
  chellow/e/bill_parsers/settlement_dc_stark_xlsx.py,sha256=osCpUYUdLcPtlo7ngXWGw0ImnxssLa1fOSejMwe51-k,6381
67
67
  chellow/e/bill_parsers/sse_edi.py,sha256=L85DOfNkqexeEIEr8pCBn_2sHJI-zEaw6cogpE3YyYM,15204
@@ -88,7 +88,7 @@ chellow/reports/report_219.py,sha256=3Zs16ka6dWWY_lCDoA-ZFrlPb4vHk1LQoa2yrlTMntA
88
88
  chellow/reports/report_231.py,sha256=WARLztV2HzBFSi5_xvY_DTXVyuBBbBYiU0RazfjKw-Y,5270
89
89
  chellow/reports/report_233.py,sha256=qJdPFuBgQAWD24BsljgGJ44L_RGdHOA1RqsxGjTWhFc,4975
90
90
  chellow/reports/report_241.py,sha256=lfivElRkV_CZAhck0rxAuhqzgponj3aWwmwGMNQvUxg,5343
91
- chellow/reports/report_247.py,sha256=SnbGqvCkakeYrPvFA13NRSiuwJWaO_CVO2hU4_pw4w0,46044
91
+ chellow/reports/report_247.py,sha256=00a-shl3TRRWyana42OZHvPnjE803rQc_2HzlSA5xKE,46029
92
92
  chellow/reports/report_29.py,sha256=ZXnq6Kg5on-IPquUsH4bn46mBVESY_WhwqDWZPXOJwo,2695
93
93
  chellow/reports/report_291.py,sha256=BnWtxe0eWN2QKKWpwjs5-RI5LbReBKL119QbkrkNhV8,7478
94
94
  chellow/reports/report_33.py,sha256=lt1EN_LNx6u-AgdaS3YRkPMZA33JgMcELolHF4oJUMw,16689
@@ -385,6 +385,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
385
385
  chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
386
386
  chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
387
387
  chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
388
- chellow-1751875889.0.0.dist-info/METADATA,sha256=kcMnLuPtGWof_7oGIYIBdGKxSEfv0td8GuA6NsLidvw,12585
389
- chellow-1751875889.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
390
- chellow-1751875889.0.0.dist-info/RECORD,,
388
+ chellow-1751991276.0.0.dist-info/METADATA,sha256=3ZCeJU6ewzdHi69KcwtbjlustTVdKbO5HcmRUZQueHM,12585
389
+ chellow-1751991276.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
390
+ chellow-1751991276.0.0.dist-info/RECORD,,