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.

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 -88
  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 +478 -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 +182 -179
  70. chellow/views.py +55 -65
  71. {chellow-1755614564.0.0.dist-info → chellow-1759155233.0.0.dist-info}/METADATA +2 -2
  72. {chellow-1755614564.0.0.dist-info → chellow-1759155233.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-1755614564.0.0.dist-info → chellow-1759155233.0.0.dist-info}/WHEEL +0 -0
@@ -7,12 +7,9 @@
7
7
 
8
8
  {% block nav %}
9
9
  <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
10
- <a href="/e/supplier_contracts/{{batch.contract.id}}">{{batch.contract.name}}</a>
11
- &raquo;
12
- <a href="/e/supplier_batches?supplier_contract_id={{batch.contract.id}}">Batches</a>
13
- &raquo;
14
- <a href="/e/supplier_batches/{{batch.id}}">{{batch.reference}}</a> &raquo;
15
- Upload Bill File
10
+ <a href="/e/supplier_contracts/{{batch.contract.id}}">{{batch.contract.name}}</a> &raquo;
11
+ <a href="/e/supplier_batches/{{batch.contract.id}}/batches">Batches</a> &raquo;
12
+ <a href="/e/supplier_batches/{{batch.id}}">{{batch.reference}}</a> &raquo; Upload Bill File
16
13
  {% endblock %}
17
14
 
18
15
  {% block content %}
@@ -50,6 +47,7 @@
50
47
  <td>VAT</td>
51
48
  <td>Gross</td>
52
49
  <td>Breakdown</td>
50
+ <td>read</td>
53
51
  <td>R1 Meter Serial Number</td>
54
52
  <td>R1 MPAN</td>
55
53
  <td>R1 Coefficient</td>
@@ -61,15 +59,91 @@
61
59
  <td>R1 Present Read Date</td>
62
60
  <td>R1 Present Read Value</td>
63
61
  <td>R1 Present Read Type</td>
62
+ <td>element</td>
63
+ <td>Name</td>
64
+ <td>Start Date (YYY-mm-dd HH:MM)</td>
65
+ <td>Finish Date (YYY-mm-dd HH:MM)</td>
66
+ <td>Net</td>
67
+ <td>Breakdown</td>
64
68
  </tr>
65
69
  </tbody>
66
70
  </table>
67
71
 
68
72
  <p>
69
- The register read block of fields can be repeated for each
70
- register, or can be left out entirely if the bill doesn't have
71
- any readings associated with it.
73
+ The columns after 'read' can be repeated for each register, or can be left out
74
+ entirely if the bill doesn't have any readings associated with it. The same applies to the
75
+ columns after 'element'. Here's an example:
72
76
  </p>
77
+
78
+ <table>
79
+ <caption>Example CSV File</caption>
80
+ <tbody>
81
+ <tr>
82
+ <td>N</td>
83
+ <td>JJih988</td>
84
+ <td>22 7338 1192 184</td>
85
+ <td>jhl449</td>
86
+ <td>2025-07-13 03:26</td>
87
+ <td>2025-06-01 00:00</td>
88
+ <td>2025-06-30 23:30</td>
89
+ <td>288</td>
90
+ <td>13.76</td>
91
+ <td>1.56</td>
92
+ <td>15.82</td>
93
+ <td>{}</td>
94
+ <td>element</td>
95
+ <td>nrg</td>
96
+ <td>2025-06-01 00:00</td>
97
+ <td>2025-06-30 23:30</td>
98
+ <td>5.88</td>
99
+ <td>{"kwh": 55, 'rate': 0.05}</td>
100
+ <td>element</td>
101
+ <td>ccl</td>
102
+ <td>2025-06-01 00:00</td>
103
+ <td>2025-06-30 23:30</td>
104
+ <td>0.92</td>
105
+ <td>{"kwh": 55, 'rate': 0.075}</td>
106
+ </tr>
107
+ <tr>
108
+ <td>N</td>
109
+ <td>jhgjfj8i</td>
110
+ <td>22 9981 4881 118</td>
111
+ <td>khghl</td>
112
+ <td>2025-07-13 03:26</td>
113
+ <td>2025-06-01 00:00</td>
114
+ <td>2025-06-30 23:30</td>
115
+ <td>8892</td>
116
+ <td>885.71</td>
117
+ <td>32.87</td>
118
+ <td>15.82</td>
119
+ <td>{}</td>
120
+ <td>element</td>
121
+ <td>day</td>
122
+ <td>2025-06-01 00:00</td>
123
+ <td>2025-06-30 23:30</td>
124
+ <td>881.77</td>
125
+ <td>{"kwh": 81, 'rate': 0.12}</td>
126
+ <td>read</td>
127
+ <td>xxiE90</td>
128
+ <td>22 9981 4881 118</td>
129
+ <td>1</td>
130
+ <td>kWh</td>
131
+ <td>00041</td>
132
+ <td>2025-05-31 00:00</td>
133
+ <td>276766</td>
134
+ <td>A</td>
135
+ <td>2025-06-30 00:00</td>
136
+ <td>277298</td>
137
+ <td>C</td>
138
+ <td>element</td>
139
+ <td>aahedc</td>
140
+ <td>2025-06-01 00:00</td>
141
+ <td>2025-06-30 23:30</td>
142
+ <td>88</td>
143
+ <td>{"kwh": 7754, 'rate': 0.0511}</td>
144
+ </tr>
145
+ </tbody>
146
+ </table>
73
147
  <table>
74
148
  <caption>
75
149
  Mapping Between Read Types
@@ -7,12 +7,13 @@
7
7
  {% block nav %}
8
8
  <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
9
9
  <a href="/e/supplier_contracts/{{contract.id}}">{{contract.name}}</a> &raquo;
10
- Batches [<a href="/e/supplier_contracts/{{contract.id}}/add_batch">add</a>]
10
+ Batches [<a href="/e/supplier_contracts/{{contract.id}}/batches/edit">edit</a>]
11
11
  {% endblock %}
12
12
 
13
13
  {% block content %}
14
14
  <table class="sticky">
15
- <caption>Batches</caption>
15
+ <caption>Batches [<a href="/e/supplier_contracts/{{contract.id}}/batches/add">add</a>]
16
+ </caption>
16
17
  <thead>
17
18
  <tr>
18
19
  <th>Reference</th>
@@ -29,8 +30,7 @@
29
30
  {% set batch = row[0] %}
30
31
  <tr>
31
32
  <td>
32
- <a href="/e/supplier_batches/{{batch.id}}?bill_limit=1000"
33
- >{{batch.reference}}</a>
33
+ <a href="/e/supplier_batches/{{batch.id}}">{{batch.reference}}</a>
34
34
  </td>
35
35
  <td>{{batch.description}}</td>
36
36
  <td>{{ "{:,}".format(row[1]) }}</td>
@@ -0,0 +1,26 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}
4
+ &raquo; Supplier Contracts &raquo; {{contract.name}} &raquo; Batches
5
+ {% endblock %}
6
+
7
+ {% block nav %}
8
+ <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
9
+ <a href="/e/supplier_contracts/{{contract.id}}">{{contract.name}}</a> &raquo;
10
+ <a href="/e/supplier_contracts/{{contract.id}}/batches">Batches</a> &raquo;
11
+ Edit
12
+ {% endblock %}
13
+
14
+ {% block content %}
15
+ <form hx-post="/e/supplier_contracts/{{contract.id}}/batches/edit"
16
+ hx-confirm="Are you sure you want to delete all the bills then re-import bills from the files for all batches in the contract that have batch files?"
17
+ >
18
+ <fieldset>
19
+ <legend>
20
+ For All Batches With At Least One Batch File, Delete All The Bills And Then Re-import Rrom The
21
+ Files
22
+ </legend>
23
+ <button name="delete_import_bills">Re-Import Bills</button>
24
+ </fieldset>
25
+ </form>
26
+ {% endblock %}
@@ -7,13 +7,10 @@
7
7
 
8
8
  {% block nav %}
9
9
  <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
10
- <a href="/e/supplier_contracts/{{bill.batch.contract.id}}"
11
- >{{bill.batch.contract.name}}</a> &raquo;
12
- <a href="/e/supplier_batches?supplier_contract_id={{bill.batch.contract.id}}"
13
- >Batches</a> &raquo;
10
+ <a href="/e/supplier_contracts/{{bill.batch.contract.id}}">{{bill.batch.contract.name}}</a> &raquo;
11
+ <a href="/e/supplier_contracts/{{bill.batch.contract.id}}/batches">Batches</a> &raquo;
14
12
  <a href="/e/supplier_batches/{{bill.batch.id}}">{{bill.batch.reference}}</a> &raquo;
15
- Bill {{bill.id}}
16
- [<a href="/e/supplier_bills/{{bill.id}}/edit">edit</a>]
13
+ Bill {{bill.id}} [<a href="/e/supplier_bills/{{bill.id}}/edit">edit</a>]
17
14
  {% endblock %}
18
15
 
19
16
  {% block content %}
@@ -122,6 +119,32 @@
122
119
  </tbody>
123
120
  </table>
124
121
 
122
+ <table>
123
+ <legend>Elements [<a href="/e/supplier_bills/{{bill.id}}/add_element">add</a>]</legend>
124
+ <thead>
125
+ <tr>
126
+ <th>Edit</th>
127
+ <th>Name</th>
128
+ <th>Start Date</th>
129
+ <th>Finish Date</th>
130
+ <th>Net GBP</th>
131
+ <th>Breakdown</th>
132
+ </tr>
133
+ </thead>
134
+ <tbody>
135
+ {% for element in elements %}
136
+ <tr>
137
+ <td>[<a href="/e/supplier_elements/{{element.id}}/edit">edit</a>]</td>
138
+ <td>{{element.name}}</td>
139
+ <td>{{element.start_date|hh_format}}</td>
140
+ <td>{{element.finish_date|hh_format}}</td>
141
+ <td style="text-align: right">{{element.net}}</td>
142
+ <td>{{element.breakdown}}</td>
143
+ </tr>
144
+ {% endfor %}
145
+ </tbody>
146
+ </table>
147
+
125
148
  <table>
126
149
  <caption>Breakdown</caption>
127
150
  <thead>
@@ -42,11 +42,11 @@
42
42
 
43
43
  <label>kWh</label> {{input_text('kwh', '0')}}
44
44
 
45
- <label>Net</label> {{input_text('net', '0')}}
45
+ <label>Net</label> {{input_text('net', '0.00')}}
46
46
 
47
- <label>VAT</label> {{input_text('vat', '0')}}
47
+ <label>VAT</label> {{input_text('vat', '0.00')}}
48
48
 
49
- <label>Gross</label> {{input_text('gross', '0')}}
49
+ <label>Gross</label> {{input_text('gross', '0.00')}}
50
50
 
51
51
  <label>Account</label> {{input_text('account', account)}}
52
52
 
@@ -9,7 +9,7 @@
9
9
  <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
10
10
  <a href="/e/supplier_contracts/{{batch.contract.id}}">{{batch.contract.name}}</a>
11
11
  &raquo;
12
- <a href="/e/supplier_batches?supplier_contract_id={{batch.contract.id}}">Batches</a>
12
+ <a href="/e/supplier_contracts/{{batch.contract.id}}/batches">Batches</a>
13
13
  &raquo;
14
14
  <a href="/e/supplier_batches/{{batch.id}}">{{batch.reference}}</a> &raquo;
15
15
  {{importer_id}}
@@ -0,0 +1,118 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}
4
+ &raquo; Supplier Contracts &raquo; {{contract.name}} &raquo;
5
+ Batches &raquo; {{importer_id}}
6
+ {% endblock %}
7
+
8
+ {% block nav %}
9
+ <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
10
+ <a href="/e/supplier_contracts/{{contract.id}}">{{contract.name}}</a> &raquo;
11
+ <a href="/e/supplier_contracts/{{contract.id}}/batches">Batches</a> &raquo;
12
+ {{importer_id}}
13
+ {% endblock %}
14
+
15
+ {% block content %}
16
+ <h2>Bill Import</h2>
17
+
18
+ {% if is_alive %}
19
+ <p>Still running. Refresh the page to see latest progress.</p>
20
+ {% endif %}
21
+
22
+ {% if status %}
23
+ <p>{{status}}</p>
24
+ {% endif %}
25
+
26
+ <ul>
27
+ {% for msg in log %}
28
+ <li>{{msg}}</li>
29
+ {% endfor %}
30
+ </ul>
31
+
32
+ {% if failed_bills|length > 0 %}
33
+ <table class="sticky">
34
+ <caption>Failed Bills</caption>
35
+ <thead>
36
+ <tr>
37
+ <th>Error</th>
38
+ <th>MPAN Core</th>
39
+ <th>Account</th>
40
+ <th>Reference</th>
41
+ <th>Bill Type Code</th>
42
+ <th>Issue Date</th>
43
+ <th>Start Date</th>
44
+ <th>Finish Date</th>
45
+ <th>kWh</th>
46
+ <th>Net</th>
47
+ <th>VAT</th>
48
+ <th>Gross</th>
49
+ <th>Breakdown</th>
50
+ {% for i in range(failed_max_registers) %}
51
+ <th>R{{loop.index}} MPAN</th>
52
+ <th>R{{loop.index}} Meter Serial Number</th>
53
+ <th>R{{loop.index}} Coefficient</th>
54
+ <th>R{{loop.index}} Units</th>
55
+ <th>R{{loop.index}} TPR</th>
56
+ <th>R{{loop.index}} Previous Read Date</th>
57
+ <th>R{{loop.index}} Previous Read Value</th>
58
+ <th>R{{loop.index}} Previous Read Type</th>
59
+ <th>R{{loop.index}} Present Read Date</th>
60
+ <th>R{{loop.index}} Present Read Value</th>
61
+ <th>R{{loop.index}} Present Read Type</th>
62
+ {% endfor %}
63
+ </tr>
64
+ </thead>
65
+ <tbody>
66
+ {% for bill in failed_bills %}
67
+ <tr>
68
+ <td>{{bill.error}}</td>
69
+ <td>
70
+ <a href="/supplies?search_pattern={{bill.mpan_core}}"
71
+ >{{bill.mpan_core}}</a>
72
+ </td>
73
+ <td>{{bill.account}}</td>
74
+ <td>{{bill.reference}}</td>
75
+ <td>{{bill.bill_type_code}}</td>
76
+ <td>
77
+ {% if 'issue_date' in bill %}
78
+ {{bill.issue_date|hh_format}}
79
+ {% endif %}
80
+ </td>
81
+ <td>
82
+ {% if 'start_date' in bill %}
83
+ {{bill.start_date|hh_format}}
84
+ {% endif %}
85
+ </td>
86
+ <td>
87
+ {% if 'finish_date' in bill %}
88
+ {{bill.finish_date|hh_format}}</td>
89
+ {% endif %}
90
+ <td>{{bill.kwh}}</td>
91
+ <td>{{bill.net}}</td>
92
+ <td>{{bill.vat}}</td>
93
+ <td>{{bill.gross}}</td>
94
+ <td>
95
+ {% if 'breakdown' in bill %}
96
+ <pre>{{bill.breakdown|dumps}}</pre>
97
+ {% endif %}
98
+ </td>
99
+ {% for read in bill.reads %}
100
+ <td>{{read.mpan}}</td>
101
+ <td>{{read.msn}}</td>
102
+ <td>{{read.coefficient}}</td>
103
+ <td>{{read.units}}</td>
104
+ <td>{{read.tpr_code}}</td>
105
+ <td>{{read.prev_date|hh_format}}</td>
106
+ <td>{{read.prev_value}}</td>
107
+ <td>{{read.prev_type_code}}</td>
108
+ <td>{{read.pres_date|hh_format}}</td>
109
+ <td>{{read.pres_value}}</td>
110
+ <td>{{read.pres_type_code}}</td>
111
+ {% endfor %}
112
+ </tr>
113
+ {% endfor %}
114
+ </tbody>
115
+ </table>
116
+ {% endif %}
117
+
118
+ {% endblock %}
@@ -59,7 +59,7 @@
59
59
 
60
60
  <ul>
61
61
  <li>
62
- <a href="/e/supplier_batches?supplier_contract_id={{contract.id}}">Batches</a>
62
+ <a href="/e/supplier_contracts/{{contract.id}}/batches">Batches</a>
63
63
  </li>
64
64
  </ul>
65
65
 
@@ -0,0 +1,45 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}
4
+ &raquo; Supplier Contracts &raquo; {{element.bill.batch.contract.name}} &raquo;
5
+ Batches &raquo; {{element.bill.batch.reference}} &raquo; {{element.bill.reference}} &raquo;
6
+ {{element.bill.reference}} &raquo; {{element.name}}
7
+ {% endblock %}
8
+
9
+ {% block nav %}
10
+ <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
11
+ <a href="/e/supplier_contracts/{{element.bill.batch.contract.id}}"
12
+ >{{element.bill.batch.contract.name}}</a> &raquo;
13
+ <a href="/e/supplier_contracts/{{element.bill.batch.contract.id}}/batches"
14
+ >Batches</a> &raquo;
15
+ <a href="/e/supplier_batches/{{element.bill.batch.id}}"
16
+ >{{element.bill.batch.reference}}</a> &raquo;
17
+ <a href="/e/supplier_bills/{{element.bill.id}}">{{element.bill.reference}}</a> &raquo;
18
+ {{element.name}}</a> &raquo; [<a href="/e/supplier_elements/{{element.id}}/edit">edit</a>]
19
+ {% endblock %}
20
+
21
+ {% block content %}
22
+ <table>
23
+ <caption>Element</caption>
24
+ <thead>
25
+ <tr>
26
+ <th>Name</th>
27
+ <th>Start Date</th>
28
+ <th>Finish Date</th>
29
+ <th>Net GBP</th>
30
+ <th>Breakdown</th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ <tr>
35
+ <td>{{element.name}}</td>
36
+ <td>{{element.start_date|hh_format }}</td>
37
+ <td>{{element.finish_date|hh_format }}</td>
38
+ <td>{{element.net}}</td>
39
+ <td><pre>{{element.breakdown}}</pre></td>
40
+ </tr>
41
+ </tbody>
42
+ </table>
43
+
44
+
45
+ {% endblock %}
@@ -0,0 +1,36 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}
4
+ &raquo; Supplier Contracts &raquo; {{bill.batch.contract.name}} &raquo; Batches &raquo;
5
+ {{bill.batch.reference}} &raquo; {{bill.reference}} &raquo; Add Element
6
+ {% endblock %}
7
+
8
+ {% block nav %}
9
+ <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
10
+ <a href="/e/supplier_contracts/{{bill.batch.contract.id}}">{{bill.batch.contract.name}}</a> &raquo;
11
+ <a href="/e/supplier_contract/{{bill.batch.contract.id}}/batches">Batches</a> &raquo;
12
+ <a href="/e/supplier_batches/{{bill.batch.id}}">{{bill.batch.reference}}</a> &raquo;
13
+ <a href="/e/supplier_bills/{{bill.id}}">{{bill.reference}}</a> &raquo;
14
+ Add Element
15
+ {% endblock %}
16
+
17
+ {% block content %}
18
+ <form action="/e/supplier_bills/{{bill.id}}/add_element" method="post">
19
+ <fieldset>
20
+ <legend>Add An Element</legend>
21
+
22
+ <label>Name</label> {{input_text('name')}}
23
+
24
+ <label>Start Date</label> {{input_date('start', start_date)}}
25
+
26
+ <label>Finish Date</label> {{input_date('finish')}}
27
+
28
+ <label>Net GBP</label> {{input_text('net', '0.00')}}
29
+
30
+ <label>Breakdown</label>
31
+ {{input_textarea('breakdown', '{}', 10, 80, show_pos=True)}}
32
+
33
+ <input type="submit" value="Add">
34
+ </fieldset>
35
+ </form>
36
+ {% endblock %}
@@ -0,0 +1,51 @@
1
+ {% extends "base.html" %}
2
+
3
+ {% block title %}
4
+ &raquo; Supplier Contracts &raquo; {{element.bill.batch.contract.name}} &raquo;
5
+ Batches &raquo; {{element.bill.batch.reference}} &raquo; Bills &raquo;
6
+ {{element.bill.reference}} &raquo; {{element.name}} &raquo; Edit
7
+ {% endblock %}
8
+
9
+ {% block nav %}
10
+ <a href="/e/supplier_contracts">Supplier Contracts</a> &raquo;
11
+ <a href="/e/supplier_contracts/{{element.bill.batch.contract.id}}"
12
+ >{{element.bill.batch.contract.name}}</a> &raquo;
13
+ <a href="/e/supplier_contracts/{{element.bill.batch.contract.id}}/batches"
14
+ >Batches</a> &raquo;
15
+ <a href="/e/supplier_batches/{{element.bill.batch.id}}"
16
+ >{{element.bill.batch.reference}}</a> &raquo;
17
+ <a href="/e/supplier_bills/{{element.bill.id}}">{{element.bill.reference}}</a> &raquo;
18
+ <a href="/e/supplier_elements/{{element.id}}">{{element.name}}</a> &raquo;
19
+ Edit
20
+ {% endblock %}
21
+
22
+ {% block content %}
23
+
24
+ <form method="post" action="/e/supplier_elements/{{element.id}}/edit">
25
+ <fieldset>
26
+ <legend>Update This Element</legend>
27
+ <label>Name</label> {{input_text('name', element.name)}}
28
+ <label>Start Date</label> {{input_date('start', element.start_date)}}
29
+ <label>Finish Date</label> {{input_date('finish', element.finish_date)}}
30
+ <label>Net GBP</label> {{input_text('net', element.net)}}
31
+ <label>Breakdown</label>
32
+ {{input_textarea('breakdown', element.breakdown, 10, 80, show_pos=True)}}
33
+ <input type="submit" name="update" value="Update">
34
+ </fieldset>
35
+ </form>
36
+
37
+ <h3>Example Breakdown</h3>
38
+
39
+ <pre>{
40
+ "nrg-kwh": 1000,
41
+ "nrg-rate": 0.1,
42
+ }</pre>
43
+
44
+ <form hx-delete="/e/supplier_elements/{{element.id}}/edit"
45
+ hx-confirm="Are you sure you want to delete this element?">
46
+ <fieldset>
47
+ <legend>Delete This Element</legend>
48
+ <input type="submit" name="confirm_delete" value="Delete">
49
+ </fieldset>
50
+ </form>
51
+ {% endblock %}