chellow 1759155233.0.0__py3-none-any.whl → 1759411815.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.
- chellow/reports/report_111.py +37 -1
- chellow/templates/report_run_bill_check.html +1 -1
- chellow/templates/report_run_row_bill_check.html +6 -1
- chellow/views.py +9 -6
- {chellow-1759155233.0.0.dist-info → chellow-1759411815.0.0.dist-info}/METADATA +1 -1
- {chellow-1759155233.0.0.dist-info → chellow-1759411815.0.0.dist-info}/RECORD +7 -7
- {chellow-1759155233.0.0.dist-info → chellow-1759411815.0.0.dist-info}/WHEEL +0 -0
chellow/reports/report_111.py
CHANGED
|
@@ -4,7 +4,7 @@ import threading
|
|
|
4
4
|
import traceback
|
|
5
5
|
from collections import defaultdict
|
|
6
6
|
from datetime import datetime as Datetime
|
|
7
|
-
from decimal import Decimal
|
|
7
|
+
from decimal import Decimal, ROUND_HALF_UP
|
|
8
8
|
from itertools import combinations
|
|
9
9
|
from numbers import Number
|
|
10
10
|
|
|
@@ -18,6 +18,8 @@ from sqlalchemy.sql.expression import null
|
|
|
18
18
|
|
|
19
19
|
from werkzeug.exceptions import BadRequest
|
|
20
20
|
|
|
21
|
+
from zish import ZishException
|
|
22
|
+
|
|
21
23
|
|
|
22
24
|
from chellow.dloads import open_file
|
|
23
25
|
from chellow.e.computer import SupplySource, contract_func
|
|
@@ -456,6 +458,40 @@ def _process_period(
|
|
|
456
458
|
f"the Net GBP ({bill.net}) + VAT GBP ({bill.vat}) of the bill."
|
|
457
459
|
)
|
|
458
460
|
|
|
461
|
+
vat_net = Decimal("0.00")
|
|
462
|
+
vat_vat = Decimal("0.00")
|
|
463
|
+
|
|
464
|
+
try:
|
|
465
|
+
bd = bill.bd
|
|
466
|
+
|
|
467
|
+
if "vat" in bd:
|
|
468
|
+
for vat_percentage, vat_vals in bd["vat"].items():
|
|
469
|
+
calc_vat = Decimal(
|
|
470
|
+
float(vat_percentage) / 100 * float(vat_vals["net"])
|
|
471
|
+
).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)
|
|
472
|
+
if calc_vat != vat_vals["vat"]:
|
|
473
|
+
actual_bill["problem"] += (
|
|
474
|
+
f"The VAT at {vat_percentage}% on the net amount "
|
|
475
|
+
f"{vat_vals['net']} is calculated to be {calc_vat}, "
|
|
476
|
+
f"which is different from the value in the bill of "
|
|
477
|
+
f"{vat_vals['vat']}"
|
|
478
|
+
)
|
|
479
|
+
vat_net += vat_vals["net"]
|
|
480
|
+
vat_vat += vat_vals["vat"]
|
|
481
|
+
except ZishException as e:
|
|
482
|
+
actual_bill["problem"] += f"Problem parsing the breakdown: {e}"
|
|
483
|
+
|
|
484
|
+
if vat_net != bill.net:
|
|
485
|
+
actual_bill["problem"] += (
|
|
486
|
+
f"The total 'net' {vat_net} in the VAT breakdown doesn't "
|
|
487
|
+
f"match the 'net' {bill.net} of the bill."
|
|
488
|
+
)
|
|
489
|
+
if vat_vat != bill.vat:
|
|
490
|
+
actual_bill["problem"] += (
|
|
491
|
+
f"The total VAT {vat_vat} in the VAT breakdown doesn't "
|
|
492
|
+
f"match the VAT {bill.vat} of the bill."
|
|
493
|
+
)
|
|
494
|
+
|
|
459
495
|
if len(actual_bill["problem"]) > 0:
|
|
460
496
|
vals["problem"] += "Bills have problems. "
|
|
461
497
|
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
{% for row in rows %}
|
|
102
102
|
{% set data = row.data['data'] %}
|
|
103
103
|
{% set properties = row.data.get('properties', {}) %}
|
|
104
|
-
{% set
|
|
104
|
+
{% set market_role_code = data['market_role_code'] %}
|
|
105
105
|
<tr>
|
|
106
106
|
<td><a href="/report_run_rows/{{row.id}}">View</a></td>
|
|
107
107
|
<td style="white-space: nowrap">
|
|
@@ -108,7 +108,12 @@
|
|
|
108
108
|
<td>
|
|
109
109
|
<strong style="color: red">{{bill.problem}}</strong>
|
|
110
110
|
</td>
|
|
111
|
-
<td>
|
|
111
|
+
<td>
|
|
112
|
+
<details>
|
|
113
|
+
<summary>Breakdown</summary>
|
|
114
|
+
<pre>{{bill.breakdown}}</pre>
|
|
115
|
+
</details>
|
|
116
|
+
</td>
|
|
112
117
|
</tr>
|
|
113
118
|
{% endfor %}
|
|
114
119
|
</tbody>
|
chellow/views.py
CHANGED
|
@@ -1389,14 +1389,17 @@ def report_run_get(run_id):
|
|
|
1389
1389
|
)
|
|
1390
1390
|
for n in element_names
|
|
1391
1391
|
]
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1392
|
+
if len(diff_selects) > 0:
|
|
1393
|
+
sum_diffs = g.sess.execute(
|
|
1394
|
+
select(*diff_selects).where(ReportRunRow.report_run == run)
|
|
1395
|
+
).one()
|
|
1395
1396
|
|
|
1396
|
-
|
|
1397
|
-
|
|
1397
|
+
for elem, sum_diff in zip(element_names, sum_diffs):
|
|
1398
|
+
elements.append((elem, sum_diff))
|
|
1398
1399
|
|
|
1399
|
-
|
|
1400
|
+
elements.sort(
|
|
1401
|
+
key=lambda x: 0 if x[1] is None else abs(x[1]), reverse=True
|
|
1402
|
+
)
|
|
1400
1403
|
|
|
1401
1404
|
if "element" in request.values:
|
|
1402
1405
|
element = req_str("element")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1759411815.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)
|
|
@@ -13,7 +13,7 @@ chellow/rate_server.py,sha256=RwJo-AzBIdzxx7PAtboZEUH1nUjAeJckw0bk06-9oyM,5672
|
|
|
13
13
|
chellow/rrun.py,sha256=sWm_tuJ_6xH3T28TY1w63k1Q44N_S_p_pYF5YCeztqU,2226
|
|
14
14
|
chellow/testing.py,sha256=Dj2c1NX8lVlygueOrh2eyYawLW6qKEHxNhXVVUaNRO0,3637
|
|
15
15
|
chellow/utils.py,sha256=i3GQK9MIcweosZk2gi-nX_IFq2DxURAJDyNoLBg6YwM,19421
|
|
16
|
-
chellow/views.py,sha256=
|
|
16
|
+
chellow/views.py,sha256=9IUUbYjqEmQQzbYQB4w-ygCo25gecIxYVbxTXRF-YfY,86078
|
|
17
17
|
chellow/e/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
chellow/e/aahedc.py,sha256=d2usudp7KYWpU6Pk3fal5EQ47EbvkvKeaFGylnb3NWw,606
|
|
19
19
|
chellow/e/bill_importer.py,sha256=mEW4s_P5tp81uf1cYWCKcr5DW1EkeRi0JUHy9caz5mI,10353
|
|
@@ -78,7 +78,7 @@ chellow/gas/transportation.py,sha256=uWFh0v-ViA02nH9Vof9JG3PiyAPXwhYZ1SvPxuzsQ0I
|
|
|
78
78
|
chellow/gas/views.py,sha256=GeCvi6BGTUN7bu7sVkypNckwG3Crl6AbUcRob9qMi0E,59733
|
|
79
79
|
chellow/reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
80
80
|
chellow/reports/report_109.py,sha256=Exb-FQ5f70-ier_h15CgHGysQ7vJ7k3gFZ1001zM3iM,11171
|
|
81
|
-
chellow/reports/report_111.py,sha256=
|
|
81
|
+
chellow/reports/report_111.py,sha256=LNrSqXb_oIShjWj5KewciAc2KCtOZiSIVr4lhZkif1I,26168
|
|
82
82
|
chellow/reports/report_169.py,sha256=wortJyvgXTrnjjXhLzqwaksKKu63K5IgdzU5f4SkHMI,9246
|
|
83
83
|
chellow/reports/report_181.py,sha256=ypfYWYVNC1X2fMlJyDzwNiNTTRrpPW49DirXE_xDKa0,4958
|
|
84
84
|
chellow/reports/report_183.py,sha256=fGONpKEIXTqIT_3dE5jZKBIesWPgLq-chHO6X22dIv0,8768
|
|
@@ -146,13 +146,13 @@ chellow/templates/object_summary.html,sha256=VGCAAYcWTzgNfL0mxEef2Fa8dP3FcBhzj0f
|
|
|
146
146
|
chellow/templates/rate_server.html,sha256=SezuwdKhHRZ00-R_S6ttKiZ-nvRpwozV9QcIMf9StG8,5360
|
|
147
147
|
chellow/templates/report_run.html,sha256=O_wjIu43S-mKVyZyku3dJJdvyck3rAgEdhw59TsCcK0,4040
|
|
148
148
|
chellow/templates/report_run_asset_comparison.html,sha256=VYCCUmIC7Mfe7uuaAHb6ihiK6zsqeTlQbzgtzLqR3zg,2305
|
|
149
|
-
chellow/templates/report_run_bill_check.html,sha256=
|
|
149
|
+
chellow/templates/report_run_bill_check.html,sha256=gLeQbDb6AayGR-gvDq5v7M-XxEkNA6f0PO6-NP-UjPU,4505
|
|
150
150
|
chellow/templates/report_run_ecoes_comparison.html,sha256=EYjmdiQ14lt_CW7e6mdyQYec1t-rg8g85wFb1757YpI,4812
|
|
151
151
|
chellow/templates/report_run_g_bill_check.html,sha256=tOXl_mjR__foYKiOYflJbK-459actAtjzv8rfuL3TwM,4851
|
|
152
152
|
chellow/templates/report_run_missing_e_bills.html,sha256=l5idQhfaNhMvvzIRv-iqCpeDnYl_wgs6-mZMBOmuyR8,2447
|
|
153
153
|
chellow/templates/report_run_monthly_duration_org.html,sha256=gGNGJ4Q50q4BtIMi98rhO-7NqRHcsFUmbj2qzeOLejw,1713
|
|
154
154
|
chellow/templates/report_run_row.html,sha256=bmtcdqJaS1CXpL0i8PuqvmeF98jKNYX5-mnQu-OuDKQ,3791
|
|
155
|
-
chellow/templates/report_run_row_bill_check.html,sha256=
|
|
155
|
+
chellow/templates/report_run_row_bill_check.html,sha256=JzedUA9R4-0jnonnoluV7CYCnzGsSAPFQtEVgMt6GTc,8105
|
|
156
156
|
chellow/templates/report_run_row_g_bill_check.html,sha256=2Ym9mkwvA_DGDrgktDDwXQXlUK7tR2aR3gp3KUqMLoI,7017
|
|
157
157
|
chellow/templates/report_run_supply_contacts.html,sha256=JNzwz9M6qbLRDMkCzFCxxANapUer5klxo7t5a48nAzg,2117
|
|
158
158
|
chellow/templates/report_runs.html,sha256=ecoIkl2WtfYtifiTxnslmpMGYYGVQW-CVSBpqhXyiE4,1131
|
|
@@ -399,6 +399,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
|
|
|
399
399
|
chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
|
|
400
400
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
401
401
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
402
|
-
chellow-
|
|
403
|
-
chellow-
|
|
404
|
-
chellow-
|
|
402
|
+
chellow-1759411815.0.0.dist-info/METADATA,sha256=BDsyDyi0K8znwxoja9PvDrJJCVAIOiddSch-eAR_AU4,12519
|
|
403
|
+
chellow-1759411815.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
404
|
+
chellow-1759411815.0.0.dist-info/RECORD,,
|
|
File without changes
|