chellow 1716909517.0.0__py3-none-any.whl → 1716973778.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.

@@ -73,7 +73,7 @@ CHARGE_UNITS_LOOKUP = {
73
73
  ELEMENT_LOOKUP = {
74
74
  "10ANNUAL": "standing",
75
75
  "20RS0108": "unrestricted",
76
- "9WANNUAL": "site_fee",
76
+ "9WANNUAL": "site-fee",
77
77
  "20RS0123": "day",
78
78
  "30RS0123": "night",
79
79
  "90ANNUAL": "duos-fixed",
@@ -181,14 +181,14 @@ def _handle_0470(headers, pre_record, record):
181
181
  def _handle_1455(headers, pre_record, record):
182
182
  parts = _chop_record(record, ccl_kwh=13, unknown_1=8, ccl_rate=15, ccl_gbp=13)
183
183
  bd = headers["breakdown"]
184
- bd["ccl_kwh"] += Decimal(parts["ccl_kwh"])
185
- if "ccl_rate" in bd:
186
- ccl_rates = bd["ccl_rate"]
184
+ bd["ccl-kwh"] += Decimal(parts["ccl_kwh"])
185
+ if "ccl-rate" in bd:
186
+ ccl_rates = bd["ccl-rate"]
187
187
  else:
188
- ccl_rates = bd["ccl_rate"] = set()
188
+ ccl_rates = bd["ccl-rate"] = set()
189
189
 
190
190
  ccl_rates.add(Decimal(parts["ccl_rate"]) / Decimal("100"))
191
- bd["ccl_gbp"] += Decimal(parts["ccl_gbp"]) / Decimal("100")
191
+ bd["ccl-gbp"] += Decimal(parts["ccl_gbp"]) / Decimal("100")
192
192
 
193
193
 
194
194
  def _handle_1460(headers, pre_record, record):
@@ -15,8 +15,8 @@ from chellow.models import (
15
15
  Bill,
16
16
  BillType,
17
17
  Era,
18
+ RSession,
18
19
  RegisterRead,
19
- Session,
20
20
  Supply,
21
21
  User,
22
22
  )
@@ -27,31 +27,33 @@ from chellow.views import chellow_redirect
27
27
  def content(year, month, months, supply_id, user_id):
28
28
  f = None
29
29
  try:
30
- with Session() as sess:
30
+ with RSession() as sess:
31
31
  user = User.get_by_id(sess, user_id)
32
32
 
33
33
  f = open_file("register_reads.csv", user, mode="w", newline="")
34
34
  w = csv.writer(f, lineterminator="\n")
35
35
  titles = (
36
- "Duration Start",
37
- "Duration Finish",
38
- "Supply Id",
39
- "Import MPAN Core",
40
- "Export MPAN Core",
41
- "Batch Reference",
42
- "Bill Id",
43
- "Bill Reference",
44
- "Bill Issue Date",
45
- "Bill Type",
46
- "Register Read Id",
47
- "TPR",
48
- "Coefficient",
49
- "Previous Read Date",
50
- "Previous Read Value",
51
- "Previous Read Type",
52
- "Present Read Date",
53
- "Present Read Value",
54
- "Present Read Type",
36
+ "duration_start",
37
+ "duration_finish",
38
+ "site_code",
39
+ "site_name",
40
+ "supply_id",
41
+ "imp_mpan_core",
42
+ "exp_mpan_core",
43
+ "batch_reference",
44
+ "bill_id",
45
+ "bill_reference",
46
+ "bill_issue_date",
47
+ "bill_type",
48
+ "register_read_id",
49
+ "tpr",
50
+ "coefficient",
51
+ "prev_read_date",
52
+ "prev_read_value",
53
+ "prev_read_type",
54
+ "pres_read_date",
55
+ "pres_read_value",
56
+ "pres_read_type",
55
57
  )
56
58
  w.writerow(titles)
57
59
 
@@ -118,6 +120,8 @@ def content(year, month, months, supply_id, user_id):
118
120
  else:
119
121
  era = eras[-1]
120
122
 
123
+ site = era.get_physical_site(sess)
124
+
121
125
  for read in (
122
126
  sess.query(RegisterRead)
123
127
  .filter(
@@ -139,28 +143,30 @@ def content(year, month, months, supply_id, user_id):
139
143
  joinedload(RegisterRead.present_type),
140
144
  )
141
145
  ):
142
- vals = [
143
- start_date,
144
- finish_date,
145
- supply_id,
146
- era.imp_mpan_core,
147
- era.exp_mpan_core,
148
- batch.reference,
149
- bill.id,
150
- bill.reference,
151
- bill.issue_date,
152
- bill_type.code,
153
- read.id,
154
- "md" if read.tpr is None else read.tpr.code,
155
- read.coefficient,
156
- read.previous_date,
157
- read.previous_value,
158
- read.previous_type.code,
159
- read.present_date,
160
- read.present_value,
161
- read.present_type.code,
162
- ]
163
- w.writerow(csv_make_val(v) for v in vals)
146
+ vals = {
147
+ "duration_start": start_date,
148
+ "duration_finish": finish_date,
149
+ "site_code": site.code,
150
+ "site_name": site.name,
151
+ "supply_id": supply_id,
152
+ "imp_mpan_core": era.imp_mpan_core,
153
+ "exp_mpan_core": era.exp_mpan_core,
154
+ "batch_reference": batch.reference,
155
+ "bill_id": bill.id,
156
+ "bill_reference": bill.reference,
157
+ "bill_issue_date": bill.issue_date,
158
+ "bill_type": bill_type.code,
159
+ "register_read_id": read.id,
160
+ "tpr": "md" if read.tpr is None else read.tpr.code,
161
+ "coefficient": read.coefficient,
162
+ "prev_read_date": read.previous_date,
163
+ "prev_read_value": read.previous_value,
164
+ "prev_read_type": read.previous_type.code,
165
+ "pres_read_date": read.present_date,
166
+ "pres_read_value": read.present_value,
167
+ "pres_read_type": read.present_type.code,
168
+ }
169
+ w.writerow(csv_make_val(vals.get(t)) for t in titles)
164
170
 
165
171
  # Avoid a long-running transaction
166
172
  sess.rollback()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: chellow
3
- Version: 1716909517.0.0
3
+ Version: 1716973778.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)
@@ -51,7 +51,7 @@ chellow/e/bill_parsers/gdf_csv.py,sha256=ZfK3Oc6oP28p_P9DIevLNB_zW2WLcEJ3Lvb1gL3
51
51
  chellow/e/bill_parsers/haven_csv.py,sha256=0uENq8IgVNqdxfBQMBxLTSZWCOuDHXZC0xzk52SbfyE,13652
52
52
  chellow/e/bill_parsers/haven_edi.py,sha256=YGPHRxPOhje9s32jqPHHELni2tooOYj3cMC_qaZVPq4,16107
53
53
  chellow/e/bill_parsers/haven_edi_tprs.py,sha256=ZVX9CCqUybsot_Z0BEOJPvl9x5kSr7fEWyuJXvZDcz4,11841
54
- chellow/e/bill_parsers/mm.py,sha256=PiKjKypy5g0HmasrWTzgoq478y97AfsVDn1XN2XhkLM,8528
54
+ chellow/e/bill_parsers/mm.py,sha256=5ChR3uVImZ6pJe_wZFeDkA06uxcVlyWWizwKJnMR_gg,8528
55
55
  chellow/e/bill_parsers/nonsettlement_dc_stark_xlsx.py,sha256=yogXTuQHGRL7IiqvRWr2C9V24ez1j9Yx0128UygPE_k,4723
56
56
  chellow/e/bill_parsers/settlement_dc_stark_xlsx.py,sha256=gKeYMdUO4bVycV8n1lWs5AIfF3bHZLkM6tkasD4rhHs,6239
57
57
  chellow/e/bill_parsers/sse_edi.py,sha256=L85DOfNkqexeEIEr8pCBn_2sHJI-zEaw6cogpE3YyYM,15204
@@ -73,7 +73,7 @@ chellow/reports/report_169.py,sha256=tnTiHmhigcgZ7E8rUSfgzsVYUCW947xBZZq04-KqfK8
73
73
  chellow/reports/report_181.py,sha256=mCL6vXfrj8r0kL-LilDS0SnSu5tJOzCq7eMJVx9zpEw,4999
74
74
  chellow/reports/report_183.py,sha256=DZX-hHJPl_Tbgkt31C_cuLZg_5L2b6iCPQ5foOZizR0,8817
75
75
  chellow/reports/report_187.py,sha256=UvpaYHjyJFNV5puYq8_KxfzoBtVrwFgIGUOmC5oGA9A,9956
76
- chellow/reports/report_219.py,sha256=o2eEg3mX9_raP2b4gjc2Gu4vqnMqcvvJBYQ1oQjxvpE,6637
76
+ chellow/reports/report_219.py,sha256=cA0lfJKnJg41Zc4_gZB1KUXZ9JeJo0TiTlu5jm1bdDM,7158
77
77
  chellow/reports/report_231.py,sha256=gOb1AkXZQvwVpRg5cIenO7iR7Se1_zsWnJp9l2BlgpA,5008
78
78
  chellow/reports/report_233.py,sha256=cIatj-HHYW_GNIRsji-DlsmYjt8rUdm_5xujPLOYL8U,4537
79
79
  chellow/reports/report_241.py,sha256=AlFmSHnfG2HWv_ICmWX7fNpPwLHjq7mo1QtOTjSKO3k,5384
@@ -364,6 +364,6 @@ chellow/templates/g/supply_note_edit.html,sha256=6UQf_qbhFDys3cVsTp-c7ABWZpggW9R
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-1716909517.0.0.dist-info/METADATA,sha256=LyXn7aMKKbo8Ir-4xP1EcvGNuWiAflgFKRORKLzbAWc,12205
368
- chellow-1716909517.0.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
369
- chellow-1716909517.0.0.dist-info/RECORD,,
367
+ chellow-1716973778.0.0.dist-info/METADATA,sha256=BR86ws0YMWBZHavEOJuh7KngaxixyJ5Mh8yZ1Nwlz2g,12205
368
+ chellow-1716973778.0.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
369
+ chellow-1716973778.0.0.dist-info/RECORD,,