chellow 1755614564.0.0__py3-none-any.whl → 1759155233.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/e/bill_importer.py +136 -80
- chellow/e/bill_parsers/activity_mop_stark_xlsx.py +99 -86
- chellow/e/bill_parsers/annual_mop_stark_xlsx.py +78 -61
- chellow/e/bill_parsers/csv.py +139 -101
- chellow/e/bill_parsers/drax_edi.py +65 -88
- chellow/e/bill_parsers/engie_edi.py +187 -255
- chellow/e/bill_parsers/engie_xls.py +153 -167
- chellow/e/bill_parsers/haven_edi.py +189 -228
- chellow/e/bill_parsers/haven_edi_tprs.py +67 -67
- chellow/e/bill_parsers/nonsettlement_dc_stark_xlsx.py +75 -66
- chellow/e/bill_parsers/settlement_dc_stark_xlsx.py +229 -126
- chellow/e/bill_parsers/sse_edi.py +107 -75
- chellow/e/bill_parsers/sww_xls.py +78 -91
- chellow/e/computer.py +1 -1
- chellow/e/views.py +626 -281
- chellow/edi_lib.py +4 -27
- chellow/models.py +92 -3
- chellow/reports/report_111.py +478 -616
- chellow/reports/report_247.py +96 -137
- chellow/templates/e/dc_batch.html +110 -157
- chellow/templates/e/dc_batch_add.html +2 -3
- chellow/templates/e/dc_batch_edit.html +42 -46
- chellow/templates/e/dc_batch_file.html +2 -3
- chellow/templates/e/dc_batch_file_edit.html +28 -40
- chellow/templates/e/dc_batch_upload_file.html +68 -0
- chellow/templates/e/dc_batches.html +2 -1
- chellow/templates/e/dc_batches_edit.html +26 -0
- chellow/templates/e/dc_bill.html +27 -5
- chellow/templates/e/dc_bill_add.html +4 -4
- chellow/templates/e/dc_bill_edit.html +43 -63
- chellow/templates/e/dc_bill_import.html +1 -1
- chellow/templates/e/dc_bill_import_contract.html +130 -0
- chellow/templates/e/dc_contract.html +1 -1
- chellow/templates/e/dc_element.html +41 -0
- chellow/templates/e/dc_element_add.html +36 -0
- chellow/templates/e/dc_element_edit.html +49 -0
- chellow/templates/e/dc_rate_script_edit.html +27 -43
- chellow/templates/e/mop_batch.html +105 -152
- chellow/templates/e/mop_batch_add.html +2 -3
- chellow/templates/e/mop_batch_edit.html +43 -51
- chellow/templates/e/mop_batch_upload_file.html +71 -5
- chellow/templates/e/mop_batches.html +2 -1
- chellow/templates/e/mop_batches_edit.html +26 -0
- chellow/templates/e/mop_bill.html +31 -8
- chellow/templates/e/mop_bill_add.html +7 -27
- chellow/templates/e/mop_bill_import.html +1 -1
- chellow/templates/e/mop_bill_import_contract.html +130 -0
- chellow/templates/e/mop_contract.html +4 -5
- chellow/templates/e/mop_element.html +41 -0
- chellow/templates/e/mop_element_add.html +36 -0
- chellow/templates/e/mop_element_edit.html +49 -0
- chellow/templates/e/supplier_batch.html +3 -7
- chellow/templates/e/supplier_batch_add.html +2 -2
- chellow/templates/e/supplier_batch_edit.html +1 -1
- chellow/templates/e/supplier_batch_file.html +3 -5
- chellow/templates/e/supplier_batch_file_add.html +18 -11
- chellow/templates/e/supplier_batch_upload_file.html +83 -9
- chellow/templates/e/supplier_batches.html +4 -4
- chellow/templates/e/supplier_batches_edit.html +26 -0
- chellow/templates/e/supplier_bill.html +29 -6
- chellow/templates/e/supplier_bill_add.html +3 -3
- chellow/templates/e/supplier_bill_import.html +1 -1
- chellow/templates/e/supplier_bill_import_contract.html +118 -0
- chellow/templates/e/supplier_contract.html +1 -1
- chellow/templates/e/supplier_element.html +45 -0
- chellow/templates/e/supplier_element_add.html +36 -0
- chellow/templates/e/supplier_element_edit.html +51 -0
- chellow/templates/report_run_bill_check.html +137 -179
- chellow/templates/report_run_row_bill_check.html +182 -179
- chellow/views.py +55 -65
- {chellow-1755614564.0.0.dist-info → chellow-1759155233.0.0.dist-info}/METADATA +2 -2
- {chellow-1755614564.0.0.dist-info → chellow-1759155233.0.0.dist-info}/RECORD +73 -60
- chellow/e/bill_parsers/drax_element_edi.py +0 -459
- chellow/templates/e/supplier_bill_imports.html +0 -421
- {chellow-1755614564.0.0.dist-info → chellow-1759155233.0.0.dist-info}/WHEEL +0 -0
chellow/reports/report_247.py
CHANGED
|
@@ -21,6 +21,7 @@ from chellow.e.scenario import make_calcs, make_site_deltas, scenario_fill_cache
|
|
|
21
21
|
from chellow.models import (
|
|
22
22
|
Bill,
|
|
23
23
|
Contract,
|
|
24
|
+
Element,
|
|
24
25
|
Era,
|
|
25
26
|
MeasurementRequirement,
|
|
26
27
|
RSession,
|
|
@@ -73,8 +74,17 @@ def make_bill_row(titles, bill):
|
|
|
73
74
|
return [bill.get(t) for t in titles]
|
|
74
75
|
|
|
75
76
|
|
|
76
|
-
def _add_bills(
|
|
77
|
-
|
|
77
|
+
def _add_bills(sess, era, chunk_start, chunk_finish):
|
|
78
|
+
bill_data = defaultdict(int)
|
|
79
|
+
num = 0
|
|
80
|
+
for bill in sess.scalars(
|
|
81
|
+
select(Bill).where(
|
|
82
|
+
Bill.supply == era.supply,
|
|
83
|
+
Bill.start_date <= chunk_finish,
|
|
84
|
+
Bill.finish_date >= chunk_start,
|
|
85
|
+
)
|
|
86
|
+
):
|
|
87
|
+
num += 1
|
|
78
88
|
contract = bill.batch.contract
|
|
79
89
|
bill_role_code = contract.market_role.code
|
|
80
90
|
bill_start = bill.start_date
|
|
@@ -85,7 +95,6 @@ def _add_bills(month_data, era, bills, chunk_start, chunk_finish):
|
|
|
85
95
|
).total_seconds() + (30 * 60)
|
|
86
96
|
proportion = overlap_duration / bill_duration
|
|
87
97
|
bill_prop_kwh = proportion * float(bill.kwh)
|
|
88
|
-
bill_prop_net_gbp = proportion * float(bill.net)
|
|
89
98
|
bill_prop_vat_gbp = proportion * float(bill.vat)
|
|
90
99
|
bill_prop_gross_gbp = proportion * float(bill.gross)
|
|
91
100
|
if bill_role_code == "X":
|
|
@@ -100,13 +109,74 @@ def _add_bills(month_data, era, bills, chunk_start, chunk_finish):
|
|
|
100
109
|
else:
|
|
101
110
|
raise BadRequest("Role code not recognized.")
|
|
102
111
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
bill_data[f"billed-{polarity}-kwh"] += bill_prop_kwh
|
|
113
|
+
bill_data[f"billed-{polarity}-vat-gbp"] += bill_prop_vat_gbp
|
|
114
|
+
bill_data[f"billed-{polarity}-gross-gbp"] += bill_prop_gross_gbp
|
|
115
|
+
bill_data[f"billed-{role_name}-{polarity}-vat-gbp"] += bill_prop_vat_gbp
|
|
116
|
+
bill_data[f"billed-{role_name}-{polarity}-gross-gbp"] += bill_prop_gross_gbp
|
|
117
|
+
|
|
118
|
+
for element in sess.scalars(
|
|
119
|
+
select(Element)
|
|
120
|
+
.join(Bill)
|
|
121
|
+
.where(
|
|
122
|
+
Bill.supply == era.supply,
|
|
123
|
+
Element.start_date <= chunk_finish,
|
|
124
|
+
Element.finish_date >= chunk_start,
|
|
125
|
+
)
|
|
126
|
+
):
|
|
127
|
+
num += 1
|
|
128
|
+
contract = element.bill.batch.contract
|
|
129
|
+
bill_role_code = contract.market_role.code
|
|
130
|
+
element_start = element.start_date
|
|
131
|
+
element_finish = element.finish_date
|
|
132
|
+
element_duration = (element_finish - element_start).total_seconds() + (30 * 60)
|
|
133
|
+
overlap_duration = (
|
|
134
|
+
min(element_finish, chunk_finish) - max(element_start, chunk_start)
|
|
135
|
+
).total_seconds() + (30 * 60)
|
|
136
|
+
proportion = overlap_duration / element_duration
|
|
137
|
+
element_prop_net_gbp = proportion * float(element.net)
|
|
138
|
+
if bill_role_code == "X":
|
|
139
|
+
role_name = "supplier"
|
|
140
|
+
polarity = "export" if contract == era.exp_supplier_contract else "import"
|
|
141
|
+
elif bill_role_code == "C":
|
|
142
|
+
role_name = "dc"
|
|
143
|
+
polarity = "import"
|
|
144
|
+
elif bill_role_code == "M":
|
|
145
|
+
role_name = "mop"
|
|
146
|
+
polarity = "import"
|
|
147
|
+
else:
|
|
148
|
+
raise BadRequest("Role code not recognized.")
|
|
149
|
+
|
|
150
|
+
bill_data[f"billed-{polarity}-net-gbp"] += element_prop_net_gbp
|
|
151
|
+
bill_data[f"billed-{role_name}-{polarity}-net-gbp"] += element_prop_net_gbp
|
|
152
|
+
return num, bill_data
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def _create_month_data():
|
|
156
|
+
month_data = {}
|
|
157
|
+
for sname in (
|
|
158
|
+
"import-gen",
|
|
159
|
+
"export-gen",
|
|
160
|
+
"import-3rd-party",
|
|
161
|
+
"export-3rd-party",
|
|
162
|
+
"used",
|
|
163
|
+
"displaced",
|
|
164
|
+
"used-3rd-party",
|
|
165
|
+
"billed-export",
|
|
166
|
+
):
|
|
167
|
+
for xname in ("kwh", "net-gbp"):
|
|
168
|
+
month_data[f"{sname}-{xname}"] = 0
|
|
169
|
+
for polarity in ("import", "export"):
|
|
170
|
+
month_data[f"billed-{polarity}-kwh"] = 0
|
|
171
|
+
month_data[f"{polarity}-grid-kwh"] = 0
|
|
172
|
+
for suf in ("net-gbp", "vat-gbp", "gross-gbp"):
|
|
173
|
+
month_data[f"{polarity}-grid-{suf}"] = 0
|
|
174
|
+
month_data[f"billed-{polarity}-{suf}"] = 0
|
|
175
|
+
month_data[f"billed-supplier-{polarity}-{suf}"] = 0
|
|
176
|
+
month_data[f"billed-dc-{polarity}-{suf}"] = 0
|
|
177
|
+
month_data[f"billed-mop-{polarity}-{suf}"] = 0
|
|
178
|
+
month_data[f"billed-export-{suf}"] = 0
|
|
179
|
+
return month_data
|
|
110
180
|
|
|
111
181
|
|
|
112
182
|
def _process_site(
|
|
@@ -153,30 +223,7 @@ def _process_site(
|
|
|
153
223
|
sorted(calcs, key=str)
|
|
154
224
|
):
|
|
155
225
|
if imp_mpan_core == "displaced":
|
|
156
|
-
month_data =
|
|
157
|
-
for sname in (
|
|
158
|
-
"import-gen",
|
|
159
|
-
"export-gen",
|
|
160
|
-
"import-3rd-party",
|
|
161
|
-
"export-3rd-party",
|
|
162
|
-
"msp",
|
|
163
|
-
"used",
|
|
164
|
-
"used-3rd-party",
|
|
165
|
-
"billed-export",
|
|
166
|
-
):
|
|
167
|
-
for xname in ("kwh", "net-gbp"):
|
|
168
|
-
month_data[f"{sname}-{xname}"] = 0
|
|
169
|
-
month_data["billed-import-kwh"] = 0
|
|
170
|
-
month_data["import-grid-kwh"] = 0
|
|
171
|
-
month_data["export-grid-kwh"] = 0
|
|
172
|
-
for suf in ("net-gbp", "vat-gbp", "gross-gbp"):
|
|
173
|
-
month_data[f"import-grid-{suf}"] = 0
|
|
174
|
-
month_data[f"export-grid-{suf}"] = 0
|
|
175
|
-
month_data[f"billed-import-{suf}"] = 0
|
|
176
|
-
month_data[f"billed-supplier-import-{suf}"] = None
|
|
177
|
-
month_data[f"billed-dc-import-{suf}"] = None
|
|
178
|
-
month_data[f"billed-mop-import-{suf}"] = None
|
|
179
|
-
month_data[f"billed-export-{suf}"] = 0
|
|
226
|
+
month_data = _create_month_data()
|
|
180
227
|
|
|
181
228
|
month_data["used-kwh"] = month_data["displaced-kwh"] = sum(
|
|
182
229
|
hh["msp-kwh"] for hh in imp_ss.hh_data
|
|
@@ -240,28 +287,7 @@ def _process_site(
|
|
|
240
287
|
supply = imp_ss.supply
|
|
241
288
|
|
|
242
289
|
site_sources.add(source_code)
|
|
243
|
-
month_data =
|
|
244
|
-
for name in (
|
|
245
|
-
"import-gen",
|
|
246
|
-
"export-gen",
|
|
247
|
-
"import-3rd-party",
|
|
248
|
-
"export-3rd-party",
|
|
249
|
-
"displaced",
|
|
250
|
-
"used",
|
|
251
|
-
"used-3rd-party",
|
|
252
|
-
"billed-export",
|
|
253
|
-
):
|
|
254
|
-
for sname in ("kwh", "net-gbp"):
|
|
255
|
-
month_data[f"{name}-{sname}"] = 0
|
|
256
|
-
for polarity in ("import", "export"):
|
|
257
|
-
month_data[f"billed-{polarity}-kwh"] = 0
|
|
258
|
-
month_data[f"{polarity}-grid-kwh"] = 0
|
|
259
|
-
for suf in ("net-gbp", "vat-gbp", "gross-gbp"):
|
|
260
|
-
month_data[f"{polarity}-grid-{suf}"] = 0
|
|
261
|
-
month_data[f"billed-{polarity}-{suf}"] = 0
|
|
262
|
-
month_data[f"billed-supplier-{polarity}-{suf}"] = 0
|
|
263
|
-
month_data[f"billed-dc-{polarity}-{suf}"] = 0
|
|
264
|
-
month_data[f"billed-mop-{polarity}-{suf}"] = 0
|
|
290
|
+
month_data = _create_month_data()
|
|
265
291
|
|
|
266
292
|
if imp_ss is not None:
|
|
267
293
|
imp_supplier_contract = imp_ss.supplier_contract
|
|
@@ -377,14 +403,10 @@ def _process_site(
|
|
|
377
403
|
era_associates = {
|
|
378
404
|
s.site.code for s in sss.era.site_eras if not s.is_physical
|
|
379
405
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
Bill.finish_date >= sss.start_date,
|
|
385
|
-
)
|
|
386
|
-
).all()
|
|
387
|
-
_add_bills(month_data, sss.era, bills, sss.start_date, sss.finish_date)
|
|
406
|
+
num_bills, bill_dict = _add_bills(
|
|
407
|
+
sess, sss.era, sss.start_date, sss.finish_date
|
|
408
|
+
)
|
|
409
|
+
month_data.update(bill_dict)
|
|
388
410
|
|
|
389
411
|
if imp_ss is None:
|
|
390
412
|
imp_supplier_contract_name = imp_voltage_level_code = None
|
|
@@ -488,43 +510,12 @@ def _process_site(
|
|
|
488
510
|
if site_era is not None:
|
|
489
511
|
chunk_start = max(start_date, last_era.finish_date + HH)
|
|
490
512
|
chunk_finish = finish_date
|
|
491
|
-
|
|
492
|
-
sess
|
|
493
|
-
select(Bill).where(
|
|
494
|
-
Bill.supply == supply,
|
|
495
|
-
Bill.start_date <= chunk_finish,
|
|
496
|
-
Bill.finish_date >= chunk_start,
|
|
497
|
-
)
|
|
498
|
-
)
|
|
499
|
-
.scalars()
|
|
500
|
-
.all()
|
|
513
|
+
num_bills, bill_dict = _add_bills(
|
|
514
|
+
sess, last_era, chunk_start, chunk_finish
|
|
501
515
|
)
|
|
502
|
-
if
|
|
503
|
-
month_data =
|
|
504
|
-
|
|
505
|
-
"import-gen",
|
|
506
|
-
"export-gen",
|
|
507
|
-
"import-3rd-party",
|
|
508
|
-
"export-3rd-party",
|
|
509
|
-
"displaced",
|
|
510
|
-
"used",
|
|
511
|
-
"used-3rd-party",
|
|
512
|
-
"billed-export",
|
|
513
|
-
):
|
|
514
|
-
for sname in ("kwh", "net-gbp"):
|
|
515
|
-
month_data[f"{name}-{sname}"] = 0
|
|
516
|
-
month_data["billed-import-kwh"] = 0
|
|
517
|
-
month_data["import-grid-kwh"] = 0
|
|
518
|
-
month_data["export-grid-kwh"] = 0
|
|
519
|
-
for suf in ("net-gbp", "vat-gbp", "gross-gbp"):
|
|
520
|
-
month_data[f"import-grid-{suf}"] = 0
|
|
521
|
-
month_data[f"export-grid-{suf}"] = 0
|
|
522
|
-
month_data[f"billed-import-{suf}"] = 0
|
|
523
|
-
month_data[f"billed-supplier-import-{suf}"] = 0
|
|
524
|
-
month_data[f"billed-dc-import-{suf}"] = 0
|
|
525
|
-
month_data[f"billed-mop-import-{suf}"] = 0
|
|
526
|
-
|
|
527
|
-
_add_bills(month_data, last_era, bills, chunk_start, chunk_finish)
|
|
516
|
+
if num_bills > 0:
|
|
517
|
+
month_data = _create_month_data()
|
|
518
|
+
month_data.update(bill_dict)
|
|
528
519
|
|
|
529
520
|
imp_supplier_contract = last_era.imp_supplier_contract
|
|
530
521
|
imp_llfc = last_era.imp_llfc
|
|
@@ -607,44 +598,12 @@ def _process_site(
|
|
|
607
598
|
if site_era is not None:
|
|
608
599
|
chunk_start = start_date
|
|
609
600
|
chunk_finish = hh_min(finish_date, first_era.start_date - HH)
|
|
610
|
-
|
|
611
|
-
sess
|
|
612
|
-
select(Bill).where(
|
|
613
|
-
Bill.supply == supply,
|
|
614
|
-
Bill.start_date <= chunk_finish,
|
|
615
|
-
Bill.finish_date >= chunk_start,
|
|
616
|
-
)
|
|
617
|
-
)
|
|
618
|
-
.scalars()
|
|
619
|
-
.all()
|
|
601
|
+
num_bills, bill_dict = _add_bills(
|
|
602
|
+
sess, first_era, chunk_start, chunk_finish
|
|
620
603
|
)
|
|
621
|
-
if
|
|
622
|
-
month_data =
|
|
623
|
-
|
|
624
|
-
"import-gen",
|
|
625
|
-
"export-gen",
|
|
626
|
-
"import-3rd-party",
|
|
627
|
-
"export-3rd-party",
|
|
628
|
-
"displaced",
|
|
629
|
-
"used",
|
|
630
|
-
"used-3rd-party",
|
|
631
|
-
):
|
|
632
|
-
for sname in ("kwh", "net-gbp"):
|
|
633
|
-
month_data[f"{name}-{sname}"] = 0
|
|
634
|
-
month_data["billed-import-kwh"] = 0
|
|
635
|
-
month_data["billed-export-kwh"] = 0
|
|
636
|
-
month_data["import-grid-kwh"] = 0
|
|
637
|
-
month_data["export-grid-kwh"] = 0
|
|
638
|
-
for suf in ("net-gbp", "vat-gbp", "gross-gbp"):
|
|
639
|
-
month_data[f"billed-import-{suf}"] = 0
|
|
640
|
-
month_data[f"billed-export-{suf}"] = 0
|
|
641
|
-
month_data[f"import-grid-{suf}"] = 0
|
|
642
|
-
month_data[f"export-grid-{suf}"] = 0
|
|
643
|
-
month_data[f"billed-supplier-import-{suf}"] = 0
|
|
644
|
-
month_data[f"billed-supplier-export-{suf}"] = 0
|
|
645
|
-
month_data[f"billed-dc-import-{suf}"] = 0
|
|
646
|
-
month_data[f"billed-mop-import-{suf}"] = 0
|
|
647
|
-
_add_bills(month_data, first_era, bills, chunk_start, chunk_finish)
|
|
604
|
+
if num_bills > 0:
|
|
605
|
+
month_data = _create_month_data()
|
|
606
|
+
month_data.update(bill_dict)
|
|
648
607
|
|
|
649
608
|
imp_supplier_contract = first_era.imp_supplier_contract
|
|
650
609
|
imp_llfc = last_era.imp_llfc
|
|
@@ -8,178 +8,131 @@
|
|
|
8
8
|
{% block nav %}
|
|
9
9
|
<a href="/e/dc_contracts">DC Contracts</a> »
|
|
10
10
|
<a href="/e/dc_contracts/{{batch.contract.id}}">{{batch.contract.name}}</a> »
|
|
11
|
-
<a href="/e/
|
|
11
|
+
<a href="/e/dc_contracts/{{batch.contract.id}}/batches">Batches</a> »
|
|
12
12
|
{{batch.reference}} [<a href="/e/dc_batches/{{batch.id}}/edit">edit</a>]
|
|
13
13
|
{% endblock %}
|
|
14
14
|
|
|
15
15
|
{% block content %}
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
25
|
-
</
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<h2>
|
|
32
|
-
Are you sure you want to delete all the bills in this batch and then
|
|
33
|
-
re-import bills from the files?
|
|
34
|
-
</h2>
|
|
35
|
-
<input type="submit" name="delete_import_bills" value="Re-Import">
|
|
36
|
-
<a href="/e/dc_batches/{{batch.id}}">Cancel</a>
|
|
37
|
-
</fieldset>
|
|
38
|
-
</form>
|
|
39
|
-
|
|
40
|
-
{% elif request.method == 'GET' and request.values.confirm_import_bills %}
|
|
41
|
-
|
|
42
|
-
<form method="post" action="/e/dc_batches/{{batch.id}}">
|
|
43
|
-
<fieldset>
|
|
44
|
-
<legend>
|
|
45
|
-
Are you sure you want to import the bills from the files into this batch?
|
|
46
|
-
</legend>
|
|
47
|
-
<input type="submit" name="import_bills" value="Import">
|
|
48
|
-
<a href="/e/dc_batches/{{batch.id}}">Cancel</a>
|
|
49
|
-
</fieldset>
|
|
50
|
-
</form>
|
|
51
|
-
|
|
52
|
-
{% else %}
|
|
53
|
-
|
|
54
|
-
<table>
|
|
55
|
-
<tr>
|
|
56
|
-
<th>Reference</th>
|
|
57
|
-
<td>{{ batch.reference }}</td>
|
|
58
|
-
</tr>
|
|
17
|
+
<table>
|
|
18
|
+
<tr>
|
|
19
|
+
<th>Reference</th>
|
|
20
|
+
<td>{{ batch.reference }}</td>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>Description</th>
|
|
24
|
+
<td>{{ batch.description }}</td>
|
|
25
|
+
</tr>
|
|
26
|
+
<tr>
|
|
27
|
+
<th>Number Of Bills</th>
|
|
28
|
+
<td>{{ bills|length }}</td>
|
|
29
|
+
</tr>
|
|
30
|
+
{% if batch_reports %}
|
|
59
31
|
<tr>
|
|
60
|
-
<th>
|
|
61
|
-
<td>
|
|
32
|
+
<th>Custom Reports</th>
|
|
33
|
+
<td>
|
|
34
|
+
<ul>
|
|
35
|
+
{% for report in batch_reports %}
|
|
36
|
+
<li>
|
|
37
|
+
<a href="/local_reports/{{report.id}}/output?batch_id={{batch.id}}">{{report.name}}</a>
|
|
38
|
+
</li>
|
|
39
|
+
{% endfor %}
|
|
40
|
+
</ul>
|
|
41
|
+
</td>
|
|
62
42
|
</tr>
|
|
43
|
+
{% endif %}
|
|
44
|
+
</table>
|
|
45
|
+
|
|
46
|
+
<table>
|
|
47
|
+
<caption>
|
|
48
|
+
Billing Files [<a href="/e/dc_batches/{{batch.id}}/upload_file">upload</a>]
|
|
49
|
+
</caption>
|
|
50
|
+
<thead>
|
|
63
51
|
<tr>
|
|
64
|
-
<th>
|
|
65
|
-
<
|
|
52
|
+
<th>View</th>
|
|
53
|
+
<th>Filename</th>
|
|
54
|
+
<th>Upload Timestamp</th>
|
|
55
|
+
<th>Parser Name</th>
|
|
66
56
|
</tr>
|
|
67
|
-
|
|
57
|
+
</thead>
|
|
58
|
+
<tbody>
|
|
59
|
+
{% for file in batch.files %}
|
|
68
60
|
<tr>
|
|
69
|
-
<
|
|
70
|
-
<td>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<li>
|
|
74
|
-
<a href="/local_reports/{{report.id}}/output?batch_id={{batch.id}}">{{report.name}}</a>
|
|
75
|
-
</li>
|
|
76
|
-
{% endfor %}
|
|
77
|
-
</ul>
|
|
78
|
-
</td>
|
|
61
|
+
<td><a href="/e/dc_batch_files/{{file.id}}"/>View</td>
|
|
62
|
+
<td>{{file.filename}}</td>
|
|
63
|
+
<td>{{file.upload_timestamp|hh_format}}</td>
|
|
64
|
+
<td>{{file.parser_name}}</td>
|
|
79
65
|
</tr>
|
|
80
|
-
{%
|
|
81
|
-
</
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<
|
|
66
|
+
{% endfor %}
|
|
67
|
+
</tbody>
|
|
68
|
+
</table>
|
|
69
|
+
|
|
70
|
+
<table>
|
|
71
|
+
<caption>Imports</caption>
|
|
72
|
+
<thead>
|
|
73
|
+
<th>View</th>
|
|
74
|
+
<th>Id</th>
|
|
75
|
+
</thead>
|
|
76
|
+
<tbody>
|
|
77
|
+
{% for id in importer_ids %}
|
|
88
78
|
<tr>
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<th>Upload Timestamp</th>
|
|
92
|
-
<th>Parser Name</th>
|
|
79
|
+
<td><a href="/e/dc_bill_imports/{{id}}">View</a></td>
|
|
80
|
+
<td>{{id}}</td>
|
|
93
81
|
</tr>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<
|
|
82
|
+
{% endfor %}
|
|
83
|
+
</tbody>
|
|
84
|
+
</table>
|
|
85
|
+
|
|
86
|
+
<ul>
|
|
87
|
+
<li>
|
|
88
|
+
<a href="/reports/111?batch_id={{batch.id}}">Check Bills</a>
|
|
89
|
+
</li>
|
|
90
|
+
<li>
|
|
91
|
+
<a href="/e/dc_batches/{{batch.id}}/csv">CSV of Bills</a>
|
|
92
|
+
</li>
|
|
93
|
+
</ul>
|
|
94
|
+
|
|
95
|
+
<table class="sticky">
|
|
96
|
+
<caption>
|
|
97
|
+
Bills [<a href="/e/dc_batches/{{batch.id}}/add_bill">add</a>]
|
|
98
|
+
</caption>
|
|
99
|
+
<thead>
|
|
100
|
+
<tr>
|
|
110
101
|
<th>View</th>
|
|
111
|
-
<th>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
<input name="confirm_import_bills" type="submit" value="Import Bills">
|
|
127
|
-
<input name="confirm_delete_bills" type="submit" value="Delete Bills">
|
|
128
|
-
<input name="confirm_delete_import_bills" type="submit" value="Re-Import Bills">
|
|
129
|
-
</fieldset>
|
|
130
|
-
</form>
|
|
131
|
-
|
|
132
|
-
<ul>
|
|
133
|
-
<li>
|
|
134
|
-
<a href="/reports/111?batch_id={{batch.id}}">Check Bills</a>
|
|
135
|
-
</li>
|
|
136
|
-
<li>
|
|
137
|
-
<a href="/e/dc_batches/{{batch.id}}/csv">CSV of Bills</a>
|
|
138
|
-
</li>
|
|
139
|
-
</ul>
|
|
140
|
-
|
|
141
|
-
<table class="sticky">
|
|
142
|
-
<caption>
|
|
143
|
-
Bills [<a href="/e/dc_batches/{{batch.id}}/add_bill">add</a>]
|
|
144
|
-
</caption>
|
|
145
|
-
<thead>
|
|
102
|
+
<th>Reference</th>
|
|
103
|
+
<th>Supply</th>
|
|
104
|
+
<th>Account</th>
|
|
105
|
+
<th>Issue Date</th>
|
|
106
|
+
<th>From</th>
|
|
107
|
+
<th>To</th>
|
|
108
|
+
<th>kWh</th>
|
|
109
|
+
<th>Net</th>
|
|
110
|
+
<th>VAT</th>
|
|
111
|
+
<th>Gross</th>
|
|
112
|
+
<th>Type</th>
|
|
113
|
+
</tr>
|
|
114
|
+
</thead>
|
|
115
|
+
<tbody>
|
|
116
|
+
{% for bill in bills %}
|
|
146
117
|
<tr>
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
<
|
|
150
|
-
<
|
|
151
|
-
<
|
|
152
|
-
<
|
|
153
|
-
<
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
<
|
|
158
|
-
<
|
|
118
|
+
<td><a href="/e/dc_bills/{{bill.id}}">View</a></td>
|
|
119
|
+
<td>{{ bill.reference }}</td>
|
|
120
|
+
<td><a href="/e/supplies/{{bill.supply.id}}">supply</a></td>
|
|
121
|
+
<td>{{ bill.account }}</td>
|
|
122
|
+
<td>{{ bill.issue_date|hh_format }}</td>
|
|
123
|
+
<td>{{ bill.start_date|hh_format }}</td>
|
|
124
|
+
<td>{{ bill.finish_date|hh_format }}</td>
|
|
125
|
+
<td>{{ bill.kwh }}</td>
|
|
126
|
+
<td>{{ bill.net }}</td>
|
|
127
|
+
<td>{{ bill.vat }}</td>
|
|
128
|
+
<td>{{ bill.gross }}</td>
|
|
129
|
+
<td>
|
|
130
|
+
<a href="/bill_types/{{bill.bill_type.id}}"
|
|
131
|
+
title="{{bill.bill_type.description}}">{{bill.bill_type.code}}</a>
|
|
132
|
+
</td>
|
|
159
133
|
</tr>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
<tr>
|
|
164
|
-
<td><a href="/e/dc_bills/{{bill.id}}">View</a></td>
|
|
165
|
-
<td>{{ bill.reference }}</td>
|
|
166
|
-
<td><a href="/e/supplies/{{bill.supply.id}}">supply</a></td>
|
|
167
|
-
<td>{{ bill.account }}</td>
|
|
168
|
-
<td>{{ bill.issue_date|hh_format }}</td>
|
|
169
|
-
<td>{{ bill.start_date|hh_format }}</td>
|
|
170
|
-
<td>{{ bill.finish_date|hh_format }}</td>
|
|
171
|
-
<td>{{ bill.kwh }}</td>
|
|
172
|
-
<td>{{ bill.net }}</td>
|
|
173
|
-
<td>{{ bill.vat }}</td>
|
|
174
|
-
<td>{{ bill.gross }}</td>
|
|
175
|
-
<td>
|
|
176
|
-
<a href="/bill_types/{{bill.bill_type.id}}"
|
|
177
|
-
title="{{bill.bill_type.description}}">{{bill.bill_type.code}}</a>
|
|
178
|
-
</td>
|
|
179
|
-
</tr>
|
|
180
|
-
{% endfor %}
|
|
181
|
-
</tbody>
|
|
182
|
-
</table>
|
|
134
|
+
{% endfor %}
|
|
135
|
+
</tbody>
|
|
136
|
+
</table>
|
|
183
137
|
|
|
184
|
-
{% endif %}
|
|
185
138
|
{% endblock %}
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
{% block nav %}
|
|
8
8
|
<a href="/e/dc_contracts">DC Contracts</a> »
|
|
9
9
|
<a href="/e/dc_contracts/{{contract.id}}">{{contract.name}}</a> »
|
|
10
|
-
<a href="/e/
|
|
11
|
-
Add
|
|
10
|
+
<a href="/e/dc_contracts/{{contract.id}}/batches">Batches</a> » Add
|
|
12
11
|
{% endblock %}
|
|
13
12
|
|
|
14
13
|
{% block content %}
|
|
15
14
|
|
|
16
|
-
<form action="/e/dc_contracts/{{contract.id}}/
|
|
15
|
+
<form action="/e/dc_contracts/{{contract.id}}/batches/add" method="post">
|
|
17
16
|
<fieldset class="grid">
|
|
18
17
|
<legend>Add a batch</legend>
|
|
19
18
|
<label>Reference</label>
|