chellow 1755078653.0.0__py3-none-any.whl → 1755598989.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.

@@ -11,7 +11,7 @@ from openpyxl import load_workbook
11
11
 
12
12
  from werkzeug.exceptions import BadRequest
13
13
 
14
- from chellow.utils import to_ct, to_utc
14
+ from chellow.utils import hh_max, hh_min, to_ct, to_utc
15
15
 
16
16
 
17
17
  class Title(Enum):
@@ -159,6 +159,12 @@ def _parse_row(bills, sheet, row, title_row):
159
159
  charge_period_end_naive = get_date_naive(
160
160
  sheet, row, column_map[Title.CHARGE_PERIOD_END]
161
161
  )
162
+ if charge_period_end_naive is None:
163
+ charge_period_end = None
164
+ else:
165
+ charge_period_end = to_utc(
166
+ to_ct(charge_period_end_naive) + relativedelta(hours=23, minutes=30)
167
+ )
162
168
 
163
169
  try:
164
170
  mprn_values = bills[mprn]
@@ -174,18 +180,25 @@ def _parse_row(bills, sheet, row, title_row):
174
180
  "reference": reference,
175
181
  "account": account,
176
182
  "issue_date": issue_date,
177
- "start_date": charge_period_from,
178
- "finish_date": to_utc(
179
- to_ct(charge_period_end_naive) + relativedelta(hours=23, minutes=30)
180
- ),
181
183
  "kwh": Decimal("0"),
182
184
  "breakdown": defaultdict(int, {}),
183
185
  "net_gbp": Decimal("0.00"),
184
186
  "vat_gbp": Decimal("0.00"),
185
187
  "gross_gbp": Decimal("0.00"),
186
- "raw_lines": str([(c.value) for c in sheet[row]]),
188
+ "raw_lines": [],
187
189
  "reads": [],
188
190
  }
191
+ if charge_period_from is not None:
192
+ if "start_date" in bill:
193
+ bill["start_date"] = hh_min(bill["start_date"], charge_period_from)
194
+ else:
195
+ bill["start_date"] = charge_period_from
196
+ if charge_period_end is not None:
197
+ if "finish_date" in bill:
198
+ bill["finish_date"] = hh_max(bill["finish_date"], charge_period_end)
199
+ else:
200
+ bill["finish_date"] = charge_period_end
201
+ bill["raw_lines"].append([c.value for c in sheet[row]])
189
202
 
190
203
  bd = bill["breakdown"]
191
204
  element_desc = get_value(sheet, row, column_map[Title.CHARGE_TYPE])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chellow
3
- Version: 1755078653.0.0
3
+ Version: 1755598989.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)
@@ -67,7 +67,7 @@ chellow/e/bill_parsers/settlement_dc_stark_xlsx.py,sha256=osCpUYUdLcPtlo7ngXWGw0
67
67
  chellow/e/bill_parsers/sse_edi.py,sha256=L85DOfNkqexeEIEr8pCBn_2sHJI-zEaw6cogpE3YyYM,15204
68
68
  chellow/e/bill_parsers/sww_xls.py,sha256=QEjiuvwvr5FuWCfqqVw8LaA_vZyAKsvRAS5fw3xtFhM,7533
69
69
  chellow/gas/bill_import.py,sha256=w0lPgK_Drzh8rtnEBQe3qFuxrgzZ6qQSgpaGrrGznMU,6549
70
- chellow/gas/bill_parser_bgs_xlsx.py,sha256=ZuLts8Y31gxtCQoXJq2CQRRMMpYbAWqsbfMB1S6fPqU,7757
70
+ chellow/gas/bill_parser_bgs_xlsx.py,sha256=r3lWjs_QbT3KgBi7wNVAXUV-9Mm7tBRyvvcftqsY1mA,8265
71
71
  chellow/gas/bill_parser_csv.py,sha256=Ecdy-apFT-mWAxddAsM4k1s-9-FpIaOfjP0oFc0rdQg,5557
72
72
  chellow/gas/bill_parser_engie_edi.py,sha256=Ko0vZP-QdVQ1uuhS_5cdrii60_cM4b_LFJMoY0pZqnk,8950
73
73
  chellow/gas/bill_parser_total_edi.py,sha256=8HZH5Le24bVNFDc7vaKbauMaYR-n9P6u0ZG7gDdqbIA,11325
@@ -386,6 +386,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
386
386
  chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
387
387
  chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
388
388
  chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
389
- chellow-1755078653.0.0.dist-info/METADATA,sha256=KbKInBogTjyWa07u4oygauNjPH3P6FDkHayi_EazfJY,12519
390
- chellow-1755078653.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
391
- chellow-1755078653.0.0.dist-info/RECORD,,
389
+ chellow-1755598989.0.0.dist-info/METADATA,sha256=FhPH5NLhdbXRUAOO14Em-legw7CpFMXAIo7wRI0rwvQ,12519
390
+ chellow-1755598989.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
391
+ chellow-1755598989.0.0.dist-info/RECORD,,