chellow 1734005435.0.0__py3-none-any.whl → 1737970902.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.

@@ -7,7 +7,7 @@ from openpyxl import load_workbook
7
7
 
8
8
  from werkzeug.exceptions import BadRequest
9
9
 
10
- from chellow.utils import HH, ct_datetime, parse_mpan_core, to_ct, to_utc
10
+ from chellow.utils import c_months_u, ct_datetime, parse_mpan_core, to_ct, to_utc
11
11
 
12
12
 
13
13
  def get_cell(sheet, col, row):
@@ -83,9 +83,72 @@ ELEM_LOOKUP = {
83
83
  "units": "duos-red-kwh",
84
84
  "rate": "duos-red-gbp-per-kwh",
85
85
  },
86
+ "Unit Rate Super Red": {
87
+ "name": "duos-super-red",
88
+ "gbp": "duos-super-red-gbp",
89
+ "units": "duos-super-red-kwh",
90
+ "rate": "duos-super-red-gbp-per-kwh",
91
+ },
86
92
  }
87
93
 
88
94
 
95
+ def _parse_gduos_sheet(sheet, mpan_core, issue_date):
96
+ bills = []
97
+ for row in range(2, len(sheet["A"]) + 1):
98
+ val = get_cell(sheet, "A", row).value
99
+ if val is None or val == "":
100
+ break
101
+
102
+ start_date_str = get_str(sheet, "B", row)
103
+ start_date_ct = to_ct(Datetime.strptime(start_date_str, "%Y-%m"))
104
+ start_date, finish_date = next(
105
+ c_months_u(
106
+ start_year=start_date_ct.year, start_month=start_date_ct.month, months=1
107
+ )
108
+ )
109
+
110
+ element_desc = get_str(sheet, "D", row).strip()
111
+ units = get_dec(sheet, "E", row)
112
+ rate = get_dec(sheet, "F", row)
113
+ net = round(get_dec(sheet, "G", row), 2)
114
+
115
+ titles = ELEM_LOOKUP[element_desc]
116
+ if titles is None:
117
+ continue
118
+
119
+ breakdown = {
120
+ titles["gbp"]: net,
121
+ titles["units"]: units,
122
+ titles["rate"]: [rate],
123
+ }
124
+ bill = {
125
+ "bill_type_code": "N",
126
+ "kwh": Decimal(0),
127
+ "vat": Decimal("0.00"),
128
+ "net": net,
129
+ "gross": net,
130
+ "reads": [],
131
+ "breakdown": breakdown,
132
+ "account": mpan_core,
133
+ "issue_date": issue_date,
134
+ "start_date": start_date,
135
+ "finish_date": finish_date,
136
+ "mpan_core": mpan_core,
137
+ "reference": "_".join(
138
+ (
139
+ to_ct(start_date).strftime("%Y%m%d"),
140
+ to_ct(finish_date).strftime("%Y%m%d"),
141
+ to_ct(issue_date).strftime("%Y%m%d"),
142
+ mpan_core,
143
+ titles["name"],
144
+ )
145
+ ),
146
+ }
147
+
148
+ bills.append(bill)
149
+ return bills
150
+
151
+
89
152
  def _make_raw_bills(book):
90
153
  bills = []
91
154
  sheet = book.worksheets[0]
@@ -135,56 +198,8 @@ def _make_raw_bills(book):
135
198
  }
136
199
  )
137
200
  sheet = book.worksheets[3]
138
- for row in range(2, len(sheet["A"]) + 1):
139
- val = get_cell(sheet, "A", row).value
140
- if val is None or val == "":
141
- break
142
-
143
- start_date_str = get_str(sheet, "B", row)
144
- start_date_ct = to_ct(Datetime.strptime(start_date_str, "%Y-%m"))
145
- start_date = to_utc(start_date_ct)
146
- finish_date = to_utc(start_date_ct + relativedelta(months=1) - HH)
147
-
148
- element_desc = get_str(sheet, "D", row).strip()
149
- units = get_dec(sheet, "E", row)
150
- rate = get_dec(sheet, "F", row)
151
- net = round(get_dec(sheet, "G", row), 2)
152
-
153
- titles = ELEM_LOOKUP[element_desc]
154
- if titles is None:
155
- continue
201
+ bills.extend(_parse_gduos_sheet(sheet, mpan_core, issue_date))
156
202
 
157
- breakdown = {
158
- titles["gbp"]: net,
159
- titles["units"]: units,
160
- titles["rate"]: [rate],
161
- }
162
-
163
- bills.append(
164
- {
165
- "bill_type_code": "N",
166
- "kwh": Decimal(0),
167
- "vat": Decimal("0.00"),
168
- "net": net,
169
- "gross": net,
170
- "reads": [],
171
- "breakdown": breakdown,
172
- "account": mpan_core,
173
- "issue_date": issue_date,
174
- "start_date": start_date,
175
- "finish_date": finish_date,
176
- "mpan_core": mpan_core,
177
- "reference": "_".join(
178
- (
179
- to_ct(start_date).strftime("%Y%m%d"),
180
- to_ct(finish_date).strftime("%Y%m%d"),
181
- to_ct(issue_date).strftime("%Y%m%d"),
182
- mpan_core,
183
- titles["name"],
184
- )
185
- ),
186
- }
187
- )
188
203
  return bills
189
204
 
190
205
 
@@ -114,6 +114,7 @@ ELEMENT_LOOKUP = {
114
114
  "20RS0050": "duos-amber",
115
115
  "30RS0050": "duos-red",
116
116
  "9CANNUAL": "duos-reactive",
117
+ "40RS0050": "duos-super-red",
117
118
  }
118
119
 
119
120
 
@@ -186,7 +187,9 @@ def _handle_0461(headers, pre_record, record):
186
187
  headers["mpan_core"] = mpan_core
187
188
  units = CONSUMPTION_UNITS_LOOKUP[parts["units"].strip()]
188
189
  register_code = parts["register_code"].strip()
189
- if units == "kWh" and not register_code.startswith("NOCHARGE"):
190
+ if units == "kWh" and not (
191
+ register_code.startswith("NOCHARGE") or register_code.endswith("XXXX")
192
+ ):
190
193
  headers["kwh"] += Decimal(parts["quantity"])
191
194
 
192
195
  prev_read_date_str = parts["prev_read_date"].strip()
@@ -218,8 +218,6 @@
218
218
  {{ input_number('months', initial='1', size='2', maxlength='2', required=True) }}
219
219
  <label>Final Month</label>
220
220
  {{ input_date('finish', last_month_finish, 'month') }}
221
- <label>Include bill check tabs?</label>
222
- {{input_checkbox('is_bill_check')}}
223
221
  <input type="submit" value="Download">
224
222
  </fieldset>
225
223
  </form>
@@ -366,10 +366,8 @@
366
366
  <fieldset>
367
367
  <input type="hidden" name="g_supply_id" value="{{g_supply.id}}">
368
368
  <legend>Monthly Duration</legend>
369
- <br>
370
- For <input name="months" maxlength="2" size="2" value="1">
371
- month(s) finishing at the end of
372
- {{ input_date('finish', last_month_finish, 'month') }}
369
+ <label>Months Long</label> <input name="months" maxlength="2" size="2" value="1">
370
+ <label>Last Month</label> {{ input_date('finish', last_month_finish, 'month') }}
373
371
  <input type="submit" value="Download">
374
372
  </fieldset>
375
373
  </form>
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: chellow
3
- Version: 1734005435.0.0
3
+ Version: 1737970902.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)
@@ -49,7 +49,7 @@ chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=UgWXDPzQkQghyj_lfgBqoSJ
49
49
  chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=-HMoIfa_utXYKA44RuC0Xqv3vd2HLeQU_4P0iBUd3WA,4219
50
50
  chellow/e/bill_parsers/bgb_edi.py,sha256=GuwHeYbAGk7BVg5n19FcTANFDyKI-y0z3f9niQaPSSw,4828
51
51
  chellow/e/bill_parsers/csv.py,sha256=U5zcIaZ6B5QTTpFDAcBnk4G2r8B3j5kJhDPL4AJNkEk,5640
52
- chellow/e/bill_parsers/edf_export_xlsx.py,sha256=t-M9-dGNWXu3VDI1DbS5Ez1oHW33oopJryNgMTvTjys,6307
52
+ chellow/e/bill_parsers/edf_export_xlsx.py,sha256=J4lY8epiSTIePZ6D1SGD76TXRoev35KrUC2sjHkNqlE,6632
53
53
  chellow/e/bill_parsers/engie_edi.py,sha256=CTobTskDjzdcqqf_qk2ukDSaTLrVpGZMM0sYlwehog4,14985
54
54
  chellow/e/bill_parsers/engie_export_xlsx.py,sha256=oZO0qHdDlOxjJ6J5Ate82CkAoX4bxed1EJyUKHxBcpk,4690
55
55
  chellow/e/bill_parsers/engie_xls.py,sha256=jrut2heH_ZWmSjcn7celOydZS9Y49GfpYjDk_EKwamI,14453
@@ -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=CdYVV3OI-BCtpd9PohOPkY3127dhz0wOCtXOLCDRVsw,10724
61
+ chellow/e/bill_parsers/mm.py,sha256=5909bJe_zwRItqkMYnq5bdZA6XhBBMquvBqsC6bbnqU,10808
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
@@ -320,7 +320,7 @@ chellow/templates/e/supplier_contracts.html,sha256=VwWD4q88Fynz7vioFSAsyH6RR_1Sy
320
320
  chellow/templates/e/supplier_rate_script.html,sha256=tjWeCUAgNip3VLHzbXqe19Msiasys3Wm5Vra936qJjI,1245
321
321
  chellow/templates/e/supplier_rate_script_add.html,sha256=Yf2LZEIHbL7qT6oxBCtPf0ZX7vJsSo_ZeOKJhJoVh3o,690
322
322
  chellow/templates/e/supplier_rate_script_edit.html,sha256=VaYJt8nxHdnuP-zEAuBJC-ibEpjDU1b80hXtdBQH1dg,1968
323
- chellow/templates/e/supply.html,sha256=No26xivLm4hA8kRufVvPjrEOE3of7pmZaW_jgTcKSY0,8511
323
+ chellow/templates/e/supply.html,sha256=kFyYPIzMgRZz7tHY_TfmjYzUkc1zXyaJses6X372Ozg,8427
324
324
  chellow/templates/e/supply_edit.html,sha256=2BRGU35nb0ZpUHKCi_fgAPMU6SlHI7ve3_Ne8LXHtms,2333
325
325
  chellow/templates/e/supply_eras.html,sha256=5lB7_oC-sTWRQoASuPgBWj5XSZa9ajR0s6V6xKHvf6E,19996
326
326
  chellow/templates/e/supply_hh_data.html,sha256=d9ho4Tq3ZkR5GmxSZr_zHGwCU68PH3aSc4OwFG9i9zE,3587
@@ -369,13 +369,13 @@ chellow/templates/g/supplier_rate_script.html,sha256=e4dwskWTQcLv6qyX150VUeuaUvE
369
369
  chellow/templates/g/supplier_rate_script_add.html,sha256=zMjTkjupOsHFu-peUXL4IKjjc2OaSL-2ah4T9OdKp_o,620
370
370
  chellow/templates/g/supplier_rate_script_edit.html,sha256=GoUqXf52gWEH1iApmNdxOcKLItzpA-o7iQPQ1_in9BA,1950
371
371
  chellow/templates/g/supplies.html,sha256=oEAEfZaAuKv7EA6fd3blWjPwv_XKoNHLPlkRJ_afZHs,1267
372
- chellow/templates/g/supply.html,sha256=HMR2haS4-k24rGqWApA74Ufi_IODN0oNIa9d7L9Xe1o,11001
372
+ chellow/templates/g/supply.html,sha256=eWuSDHh8de-LgLVlrNPWLX-_jiRn1uB3CZNpGK1xBYA,11006
373
373
  chellow/templates/g/supply_edit.html,sha256=F2Ip4xCXLl4eFiRjMLZyUMIiznWw97GF7mN_50QAEWA,1653
374
374
  chellow/templates/g/supply_note_add.html,sha256=zWwppQTxBfN7Dw6Cgr330mw7SgDRoTcaIdAucNisZRE,658
375
375
  chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1nAPevz-AgkhQ,1036
376
376
  chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
377
377
  chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
378
378
  chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
379
- chellow-1734005435.0.0.dist-info/METADATA,sha256=rikcxSjkW6hkiNWM_zQJBT9tqQUz1C0JhNytTqShEdk,12204
380
- chellow-1734005435.0.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
381
- chellow-1734005435.0.0.dist-info/RECORD,,
379
+ chellow-1737970902.0.0.dist-info/METADATA,sha256=-PX-L_InK77KEH_JUnv2jKfvvmY1VKsDdHOZsJWuj5Y,12204
380
+ chellow-1737970902.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
381
+ chellow-1737970902.0.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any