chellow 1734005435.0.0__py3-none-any.whl → 1736431515.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):
@@ -86,6 +86,63 @@ ELEM_LOOKUP = {
86
86
  }
87
87
 
88
88
 
89
+ def _parse_gduos_sheet(sheet, mpan_core, issue_date):
90
+ bills = []
91
+ for row in range(2, len(sheet["A"]) + 1):
92
+ val = get_cell(sheet, "A", row).value
93
+ if val is None or val == "":
94
+ break
95
+
96
+ start_date_str = get_str(sheet, "B", row)
97
+ start_date_ct = to_ct(Datetime.strptime(start_date_str, "%Y-%m"))
98
+ start_date, finish_date = next(
99
+ c_months_u(
100
+ start_year=start_date_ct.year, start_month=start_date_ct.month, months=1
101
+ )
102
+ )
103
+
104
+ element_desc = get_str(sheet, "D", row).strip()
105
+ units = get_dec(sheet, "E", row)
106
+ rate = get_dec(sheet, "F", row)
107
+ net = round(get_dec(sheet, "G", row), 2)
108
+
109
+ titles = ELEM_LOOKUP[element_desc]
110
+ if titles is None:
111
+ continue
112
+
113
+ breakdown = {
114
+ titles["gbp"]: net,
115
+ titles["units"]: units,
116
+ titles["rate"]: [rate],
117
+ }
118
+ bill = {
119
+ "bill_type_code": "N",
120
+ "kwh": Decimal(0),
121
+ "vat": Decimal("0.00"),
122
+ "net": net,
123
+ "gross": net,
124
+ "reads": [],
125
+ "breakdown": breakdown,
126
+ "account": mpan_core,
127
+ "issue_date": issue_date,
128
+ "start_date": start_date,
129
+ "finish_date": finish_date,
130
+ "mpan_core": mpan_core,
131
+ "reference": "_".join(
132
+ (
133
+ to_ct(start_date).strftime("%Y%m%d"),
134
+ to_ct(finish_date).strftime("%Y%m%d"),
135
+ to_ct(issue_date).strftime("%Y%m%d"),
136
+ mpan_core,
137
+ titles["name"],
138
+ )
139
+ ),
140
+ }
141
+
142
+ bills.append(bill)
143
+ return bills
144
+
145
+
89
146
  def _make_raw_bills(book):
90
147
  bills = []
91
148
  sheet = book.worksheets[0]
@@ -135,56 +192,8 @@ def _make_raw_bills(book):
135
192
  }
136
193
  )
137
194
  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
195
+ bills.extend(_parse_gduos_sheet(sheet, mpan_core, issue_date))
142
196
 
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
156
-
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
197
  return bills
189
198
 
190
199
 
@@ -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: 1736431515.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=weVvtnXVBSNtz-CMiUHCTI2W8kV19lX7UDMZilxybKk,6440
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
@@ -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-1736431515.0.0.dist-info/METADATA,sha256=78QJHzK7SfEhS31W3L2h1zcoNfkEVk9udgaEMeqXepU,12204
380
+ chellow-1736431515.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
381
+ chellow-1736431515.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