chellow 1757320031.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.

Files changed (75) hide show
  1. chellow/e/bill_importer.py +136 -80
  2. chellow/e/bill_parsers/activity_mop_stark_xlsx.py +99 -86
  3. chellow/e/bill_parsers/annual_mop_stark_xlsx.py +78 -61
  4. chellow/e/bill_parsers/csv.py +139 -101
  5. chellow/e/bill_parsers/drax_edi.py +65 -89
  6. chellow/e/bill_parsers/engie_edi.py +187 -255
  7. chellow/e/bill_parsers/engie_xls.py +153 -167
  8. chellow/e/bill_parsers/haven_edi.py +189 -228
  9. chellow/e/bill_parsers/haven_edi_tprs.py +67 -67
  10. chellow/e/bill_parsers/nonsettlement_dc_stark_xlsx.py +75 -66
  11. chellow/e/bill_parsers/settlement_dc_stark_xlsx.py +229 -126
  12. chellow/e/bill_parsers/sse_edi.py +107 -75
  13. chellow/e/bill_parsers/sww_xls.py +78 -91
  14. chellow/e/computer.py +1 -1
  15. chellow/e/views.py +626 -281
  16. chellow/edi_lib.py +4 -27
  17. chellow/models.py +92 -3
  18. chellow/reports/report_111.py +514 -616
  19. chellow/reports/report_247.py +96 -137
  20. chellow/templates/e/dc_batch.html +110 -157
  21. chellow/templates/e/dc_batch_add.html +2 -3
  22. chellow/templates/e/dc_batch_edit.html +42 -46
  23. chellow/templates/e/dc_batch_file.html +2 -3
  24. chellow/templates/e/dc_batch_file_edit.html +28 -40
  25. chellow/templates/e/dc_batch_upload_file.html +68 -0
  26. chellow/templates/e/dc_batches.html +2 -1
  27. chellow/templates/e/dc_batches_edit.html +26 -0
  28. chellow/templates/e/dc_bill.html +27 -5
  29. chellow/templates/e/dc_bill_add.html +4 -4
  30. chellow/templates/e/dc_bill_edit.html +43 -63
  31. chellow/templates/e/dc_bill_import.html +1 -1
  32. chellow/templates/e/dc_bill_import_contract.html +130 -0
  33. chellow/templates/e/dc_contract.html +1 -1
  34. chellow/templates/e/dc_element.html +41 -0
  35. chellow/templates/e/dc_element_add.html +36 -0
  36. chellow/templates/e/dc_element_edit.html +49 -0
  37. chellow/templates/e/dc_rate_script_edit.html +27 -43
  38. chellow/templates/e/mop_batch.html +105 -152
  39. chellow/templates/e/mop_batch_add.html +2 -3
  40. chellow/templates/e/mop_batch_edit.html +43 -51
  41. chellow/templates/e/mop_batch_upload_file.html +71 -5
  42. chellow/templates/e/mop_batches.html +2 -1
  43. chellow/templates/e/mop_batches_edit.html +26 -0
  44. chellow/templates/e/mop_bill.html +31 -8
  45. chellow/templates/e/mop_bill_add.html +7 -27
  46. chellow/templates/e/mop_bill_import.html +1 -1
  47. chellow/templates/e/mop_bill_import_contract.html +130 -0
  48. chellow/templates/e/mop_contract.html +4 -5
  49. chellow/templates/e/mop_element.html +41 -0
  50. chellow/templates/e/mop_element_add.html +36 -0
  51. chellow/templates/e/mop_element_edit.html +49 -0
  52. chellow/templates/e/supplier_batch.html +3 -7
  53. chellow/templates/e/supplier_batch_add.html +2 -2
  54. chellow/templates/e/supplier_batch_edit.html +1 -1
  55. chellow/templates/e/supplier_batch_file.html +3 -5
  56. chellow/templates/e/supplier_batch_file_add.html +18 -11
  57. chellow/templates/e/supplier_batch_upload_file.html +83 -9
  58. chellow/templates/e/supplier_batches.html +4 -4
  59. chellow/templates/e/supplier_batches_edit.html +26 -0
  60. chellow/templates/e/supplier_bill.html +29 -6
  61. chellow/templates/e/supplier_bill_add.html +3 -3
  62. chellow/templates/e/supplier_bill_import.html +1 -1
  63. chellow/templates/e/supplier_bill_import_contract.html +118 -0
  64. chellow/templates/e/supplier_contract.html +1 -1
  65. chellow/templates/e/supplier_element.html +45 -0
  66. chellow/templates/e/supplier_element_add.html +36 -0
  67. chellow/templates/e/supplier_element_edit.html +51 -0
  68. chellow/templates/report_run_bill_check.html +137 -179
  69. chellow/templates/report_run_row_bill_check.html +187 -179
  70. chellow/views.py +57 -64
  71. {chellow-1757320031.0.0.dist-info → chellow-1759411815.0.0.dist-info}/METADATA +2 -2
  72. {chellow-1757320031.0.0.dist-info → chellow-1759411815.0.0.dist-info}/RECORD +73 -60
  73. chellow/e/bill_parsers/drax_element_edi.py +0 -459
  74. chellow/templates/e/supplier_bill_imports.html +0 -421
  75. {chellow-1757320031.0.0.dist-info → chellow-1759411815.0.0.dist-info}/WHEEL +0 -0
@@ -9,191 +9,149 @@
9
9
  {% endblock %}
10
10
 
11
11
  {% block content %}
12
- {% if request.method == "GET" and request.values.delete %}
13
- <form method="post" action="/report_runs/{{run.id}}">
14
- <fieldset>
15
- <legend>Are you sure you want to delete this report run?</legend>
16
- <input type="submit" name="delete" value="delete">
17
- <a href="/report_runs/{{run.id}}">Cancel</a>
18
- </fieldset>
19
- </form>
20
- {% else %}
21
- <table>
22
- <caption>Bill Check</caption>
23
- <thead>
24
- <tr>
25
- <th>Date Created</th>
26
- <th>Created By</th>
27
- <th>Title</th>
28
- <th>State</th>
29
- <th>Number Of Rows</th>
30
- <th>Sum Of Difference GBP</th>
31
- <th>Delete</th>
32
- <th>Download Spreadsheet</th>
33
- </tr>
34
- </thead>
35
- <tbody>
12
+ <table>
13
+ <caption>Bill Check</caption>
14
+ <thead>
15
+ <tr>
16
+ <th>Date Created</th>
17
+ <th>Created By</th>
18
+ <th>Title</th>
19
+ <th>State</th>
20
+ <th>Number Of Rows</th>
21
+ <th>Delete</th>
22
+ <th>Download Spreadsheet</th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td>{{run.date_created|hh_format}}</td>
28
+ <td>{{run.creator}}</td>
29
+ <td>{{run.title}}</td>
30
+ <td>{{run.state}}</td>
31
+ <td>{{rows|length}} (truncated at {{ROW_LIMIT}})</td>
32
+ <td>
33
+ <form hx-delete="/report_runs/{{run.id}}"
34
+ hx-confirm="Are you sure you want to delete this report run?">
35
+ <fieldset style="border: none;">
36
+ <input type="submit" name="delete" value="Delete">
37
+ </fieldset>
38
+ </form>
39
+ </td>
40
+ <td><a href="/report_runs/{{run.id}}/spreadsheet">Download</a></td>
41
+ </tr>
42
+ </tbody>
43
+ </table>
44
+
45
+ <table class="sticky">
46
+ <caption>Periods - Ordered By Difference In {{element}}</caption>
47
+ <thead>
48
+ <tr>
49
+ <th rowspan="3">View</th>
50
+ <th rowspan="3">Contract</th>
51
+ <th rowspan="3">Supply</th>
52
+ <th rowspan="3">Import MPAN Core</th>
53
+ <th rowspan="3">Export MPAN Core</th>
54
+ <th rowspan="3">Site</th>
55
+ <th rowspan="3">Period Start</th>
56
+ <th rowspan="3">Period Finish</th>
57
+ <th rowspan="3" style="white-space: nowrap">
58
+ {% if element == 'problem' %}
59
+ &uparrow;
60
+ {% else %}
61
+ <a href="/report_runs/{{run.id}}?element=problem">&uparrow;</a>
62
+ {% endif %}
63
+ Problem
64
+ </th>
65
+ <th colspan="{{elements|length + 1}}">Difference GBP</th>
66
+ </tr>
67
+ <tr>
68
+ <th>
69
+ {% if 'sum_difference' in summary and summary.sum_difference is not none %}
70
+ {{"{:0,.2f}".format(summary.sum_difference)}}
71
+ {% endif %}
72
+ </th>
73
+ {% for elem, diff in elements %}
74
+ <th style="white-space: nowrap">
75
+ {{"{:0,.2f}".format(diff)}}
76
+ </th>
77
+ {% endfor %}
78
+ </tr>
79
+ <tr>
80
+ <th style="white-space: nowrap">
81
+ {% if element == 'net' %}
82
+ &uparrow;
83
+ {% else %}
84
+ <a href="/report_runs/{{run.id}}?element=net">&uparrow;</a>
85
+ {% endif %}
86
+ Total
87
+ </th>
88
+ {% for elem, diff in elements %}
89
+ <th style="white-space: nowrap">
90
+ {% if elem == element %}
91
+ &uparrow;
92
+ {% else %}
93
+ <a href="/report_runs/{{run.id}}?element={{elem}}">&uparrow;</a>
94
+ {% endif %}
95
+ {{elem}}
96
+ </th>
97
+ {% endfor %}
98
+ </tr>
99
+ </thead>
100
+ <tbody>
101
+ {% for row in rows %}
102
+ {% set data = row.data['data'] %}
103
+ {% set properties = row.data.get('properties', {}) %}
104
+ {% set market_role_code = data['market_role_code'] %}
36
105
  <tr>
37
- <td>{{run.date_created|hh_format}}</td>
38
- <td>{{run.creator}}</td>
39
- <td>{{run.title}}</td>
40
- <td>{{run.state}}</td>
41
- <td>{{rows|length}} (truncated at {{ROW_LIMIT}})</td>
42
- <td>
43
- {% if 'sum_difference' in summary %}
44
- {{"%.2f"|format(summary.sum_difference)}}</td>
106
+ <td><a href="/report_run_rows/{{row.id}}">View</a></td>
107
+ <td style="white-space: nowrap">
108
+ {% if market_role_code == 'X' %}
109
+ <a href="/e/supplier_contracts/{{data['contract_id']}}">{{data['contract_name']}}</a>
110
+ {% elif market_role_code == 'C' %}
111
+ <a href="/e/dc_contracts/{{data['contract_id']}}">{{data['contract_name']}}</a>
112
+ {% elif market_role_code == 'M' %}
113
+ <a href="/e/mop_contracts/{{data['contract_id']}}">{{data['contract_name']}}</a>
45
114
  {% endif %}
115
+ </td>
46
116
  <td>
47
- <form action="/report_runs/{{run.id}}">
48
- <fieldset style="border: none;">
49
- <input type="submit" name="delete" value="Delete">
50
- </fieldset>
51
- </form>
117
+ <a href="/e/supplies/{{data['supply_id']}}">View</a>
52
118
  </td>
53
- <td><a href="/report_runs/{{run.id}}/spreadsheet">Download</a></td>
54
- </tr>
55
- </tbody>
56
- </table>
57
-
58
- {% if summary.missing_bills|length > 0 %}
59
- <table class="sticky">
60
- <caption>
61
- Some Missing Bills (<a href="/report_runs/{{report_run}}">x</a>)
62
- </caption>
63
- <thead>
64
- <tr>
65
- <th>View</th>
66
- <th>Import MPAN Core</th>
67
- <th>Export MPAN Core</th>
68
- <th>Start</th>
69
- <th>Finish</th>
70
- <th>Problem</th>
71
- <th>Estimated Difference GBP</th>
72
- </tr>
73
- </thead>
74
- <tbody>
75
- {% for row in rows %}
76
- <tr>
77
- <td><a href="/report_run_rows/{{row.id}}">View</a></td>
78
- {% for title in row.data.titles %}
79
- <td>{{row.data['values'][title]}}</td>
80
- {% endfor %}
81
- </tr>
82
- {% endfor %}
83
- </tbody>
84
- </table>
85
- {% endif %}
86
-
87
- <table class="sticky">
88
- <caption>Elements</caption>
89
- <thead>
90
- <tr>
91
- <th>Element</th>
92
- {% for elname, diff in elements %}
93
- <th>{{elname}}</th>
94
- {% endfor %}
95
- </tr>
96
- </thead>
97
- <tbody>
98
- <tr>
99
- <td>Sum of differences (GBP)</td>
100
- {% for elname, diff in elements %}
101
- <td>{{"%.2f"|format(diff)}}</td>
102
- {% endfor %}
103
- </tr>
104
- <tr>
105
- <td rowspan="2">Order rows</td>
106
- {% for elname, diff in elements %}
107
- <td>
108
- {% if elname == element and not hide_checked %}
109
- Order (show checked)
110
- {% else %}
111
- <a href="/report_runs/{{run.id}}?element={{elname}}&amp;hide_checked=false"
112
- >Order (show checked)</a>
113
- {% endif %}
114
- </td>
115
- {% endfor %}
116
- </tr>
117
- <tr>
118
- {% for elname, diff in elements %}
119
- <td>
120
- {% if elname == element and hide_checked %}
121
- Order (hide checked)
122
- {% else %}
123
- <a href="/report_runs/{{run.id}}?element={{elname}}&amp;hide_checked=true"
124
- >Order (hide checked)</a>
119
+ <td style="white-space: nowrap">
120
+ {% if data['imp_mpan_core'] is not none %}
121
+ {{data['imp_mpan_core']}}
122
+ {% endif %}
123
+ </td>
124
+ <td style="white-space: nowrap">
125
+ {% if data['exp_mpan_core'] is not none %}
126
+ {{data['exp_mpan_core']}}
127
+ {% endif %}
128
+ </td>
129
+ <td style="white-space: nowrap">
130
+ {% if data['site_id'] is not none %}
131
+ <a href="/sites/{{data['site_id']}}" title="{{data.site_name}}">{{data.site_code}}</a>
132
+ {% endif %}
133
+ </td>
134
+ <td style="white-space: nowrap">
135
+ {{data['period_start']}}
136
+ </td>
137
+ <td style="white-space: nowrap">
138
+ {{data['period_finish']}}
139
+ </td>
140
+ <td style="text-align: right;">
141
+ {{data['problem']}}
142
+ </td>
143
+ <td style="text-align: right;">
144
+ {{"{:0,.2f}".format(data['difference_net_gbp'])}}
145
+ </td>
146
+ {% for elem, diff in elements %}
147
+ <td style="text-align: right;">
148
+ {% if elem in data.elements %}
149
+ {{"{:0,.2f}".format(data.elements[elem]['parts']['gbp']['difference'])}}
125
150
  {% endif %}
126
151
  </td>
127
152
  {% endfor %}
128
153
  </tr>
129
- </tbody>
130
- </table>
131
-
132
- <table class="etheling etheling_sticky">
133
- <caption>Rows - Ordered By Difference In {{element}}</caption>
134
- {% set titles = [
135
- 'batch', 'bill-reference', 'imp-mpan-core',
136
- 'exp-mpan-core', 'site-code', 'site-name',
137
- 'covered-from', 'covered-to'
138
- ]
139
- %}
140
- <thead>
141
- <tr>
142
- <th rowspan="2">View</th>
143
- {% for title in titles %}
144
- <th rowspan="2">{{title}}</th>
145
- {% endfor %}
146
- <th colspan="{{elements|length}}">Difference GBP</th>
147
- <th rowspan="2">Note</th>
148
- </tr>
149
- <tr>
150
- {% for elem, diff in elements %}
151
- <th>{{elem}}</th>
152
- {% endfor %}
153
- </tr>
154
- </thead>
155
- <tbody>
156
- {% for row in rows %}
157
- {% set values = row.data['values'] %}
158
- {% set properties = row.data.get('properties', {}) %}
159
- <tr>
160
- <td><a href="/report_run_rows/{{row.id}}">View</a></td>
161
- {% for title in titles %}
162
- <td>
163
- {%
164
- if title == 'covered-bills' and
165
- values['covered-bills'] != None
166
- %}
167
- <ul>
168
- {% for bill_id in values['covered-bills'] %}
169
- <li>
170
- <a href="/e/supplier_bills/{{bill_id}}"
171
- >{{bill_id}}</a>
172
- {% if bill_id == values.bill_id %}
173
- (This bill)
174
- {% endif %}
175
- </li>
176
- {% endfor %}
177
- </ul>
178
- {% elif values[title] is not none %}
179
- {{values[title]}}
180
- {% endif %}
181
- </td>
182
- {% endfor %}
183
- {% for elem, diff in elements %}
184
- {% set title = 'difference-' + elem + '-gbp' %}
185
- <td>
186
- {% if title in values %}
187
- {{"%.2f"|format(values[title])}}
188
- {% endif %}
189
- </td>
190
- {% endfor %}
191
- <td>
192
- {{ properties.get('note', '') }}
193
- </td>
194
- </tr>
195
- {% endfor %}
196
- </tbody>
197
- </table>
198
- {% endif %}
154
+ {% endfor %}
155
+ </tbody>
156
+ </table>
199
157
  {% endblock %}