|
Lines 76-200
Link Here
|
| 76 |
</ol> |
76 |
</ol> |
| 77 |
<input type="hidden" name="op" value="mod" /> |
77 |
<input type="hidden" name="op" value="mod" /> |
| 78 |
<input type="hidden" name="invoiceid" value="[% invoiceid %]" /> |
78 |
<input type="hidden" name="invoiceid" value="[% invoiceid %]" /> |
| 79 |
</fieldset> |
79 |
<fieldset class="action"> |
| 80 |
<fieldset class="action"> |
80 |
<input type="submit" value="Save" /> |
| 81 |
<input type="submit" value="Save" /> |
81 |
[% UNLESS orders_loop.size %] |
| 82 |
[% UNLESS orders_loop.size %] |
82 |
<a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a> |
| 83 |
<a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a> |
83 |
[% END %] |
| 84 |
[% END %] |
84 |
</fieldset> |
| 85 |
</fieldset> |
85 |
</fieldset> |
| 86 |
</form> |
86 |
</form> |
| 87 |
<form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated"> |
87 |
|
| 88 |
<input type="hidden" name="invoiceid" value="[% invoiceid %]" /> |
88 |
<hr /> |
| 89 |
<table id="invoice_adj_table"> |
89 |
|
| 90 |
<tr> |
90 |
<h3>Adjustments</h3> |
| 91 |
<th>Id</th> |
91 |
|
| 92 |
<th>Amount</th> |
92 |
<form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated"> |
| 93 |
<th>Reason</th> |
93 |
<fieldset class="rows"> |
| 94 |
<th>Note</th> |
94 |
<input type="hidden" name="invoiceid" value="[% invoiceid %]" /> |
| 95 |
<th>Fund</th> |
|
|
| 96 |
<th>Encumber while invoice open</th> |
| 97 |
<th> </th> |
| 98 |
</tr> |
| 99 |
[% IF (adjustments.count > 0) %] |
95 |
[% IF (adjustments.count > 0) %] |
| 100 |
<tr><td colspan="7">Current adjustments</td></tr> |
96 |
<table id="invoice_adj_table"> |
| 101 |
[% total_adj = 0 %] |
97 |
<tr> |
| 102 |
[% FOREACH adjustment IN adjustments %] |
98 |
<th>Id</th> |
| 103 |
[% total_adj = total_adj + adjustment.adjustment %] |
99 |
<th>Amount</th> |
| 104 |
<tr> |
100 |
<th>Reason</th> |
| 105 |
<td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id %]" />[% adjustment.adjustment_id %]</td> |
101 |
<th>Note</th> |
| 106 |
<td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td> |
102 |
<th>Fund</th> |
| 107 |
<td> |
103 |
<th>Encumber while invoice open</th> |
| 108 |
[% reasons = AuthorisedValues.Get("ADJ_REASON") %] |
104 |
<th> </th> |
| 109 |
[% IF reasons.0 %] |
105 |
</tr> |
| 110 |
<select id="reason_[% adjustment.adjustment_id %]" name="reason"> |
106 |
[% total_adj = 0 %] |
| 111 |
<option value="">No reason</option> |
107 |
[% FOREACH adjustment IN adjustments %] |
| 112 |
[% FOREACH reason IN reasons %] |
108 |
[% total_adj = total_adj + adjustment.adjustment %] |
| 113 |
[% IF ( adjustment.reason == reason.authorised_value ) %] |
109 |
<tr> |
| 114 |
<option selected="selected" value="[% reason.authorised_value %]"> |
110 |
<td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id %]" />[% adjustment.adjustment_id %]</td> |
| 115 |
[% ELSE %] |
111 |
<td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td> |
| 116 |
<option value="[% reason.authorised_value %]"> |
112 |
<td> |
| 117 |
[% END %] |
113 |
[% reasons = AuthorisedValues.Get("ADJ_REASON") %] |
| 118 |
[% reason.lib %] |
114 |
[% IF reasons.0 %] |
| 119 |
</option> |
115 |
<select id="reason_[% adjustment.adjustment_id %]" name="reason"> |
| 120 |
[% END %] |
116 |
<option value="">No reason</option> |
| 121 |
</select> |
117 |
[% FOREACH reason IN reasons %] |
| 122 |
[% ELSE %] |
118 |
[% IF ( adjustment.reason == reason.authorised_value ) %] |
| 123 |
<p title="Define values in authorised value category ADJ_REASON to enable">None</p> |
119 |
<option selected="selected" value="[% reason.authorised_value %]"> |
| 124 |
<input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id %]" value="" /> |
120 |
[% ELSE %] |
|
|
121 |
<option value="[% reason.authorised_value %]"> |
| 122 |
[% END %] |
| 123 |
[% reason.lib %] |
| 124 |
</option> |
| 125 |
[% END %] |
| 126 |
</select> |
| 127 |
[% ELSE %] |
| 128 |
<p title="Define values in authorised value category ADJ_REASON to enable">None</p> |
| 129 |
<input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id %]" value="" /> |
| 130 |
[% END %] |
| 131 |
</td> |
| 132 |
<td><input type="text" name="note" id="note_new" value="[% adjustment.note %]"/></td> |
| 133 |
<td> |
| 134 |
<select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id"> |
| 135 |
<option value="">No fund</option> |
| 136 |
[% FOREACH budget IN budgets_loop %] |
| 137 |
[% IF ( budget.budget_id == adjustment.budget_id ) %] |
| 138 |
<option selected="selected" value="[% budget.budget_id %]"> |
| 139 |
[% ELSE %] |
| 140 |
<option value="[% budget.budget_id %]"> |
| 141 |
[% END %] |
| 142 |
[% budget.budget_name %] |
| 143 |
</option> |
| 144 |
[% END %] |
| 145 |
</select> |
| 146 |
</td> |
| 147 |
[% IF adjustment.encumber_open %] |
| 148 |
<td> |
| 149 |
<input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" checked/> |
| 150 |
</td> |
| 151 |
[% ELSE %] |
| 152 |
<td> |
| 153 |
<input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" /> |
| 154 |
</td> |
| 155 |
[% END %] |
| 156 |
<td> |
| 157 |
<a class="btn btn-default btn-xs delete_adjustment" href="/cgi-bin/koha/acqui/invoice.pl?op=del_adj&adjustment_id=[% adjustment.adjustment_id %]&invoiceid=[% invoiceid %]"><i class="fa fa-trash"></i> Delete</a> |
| 158 |
</td> |
| 159 |
</tr> |
| 125 |
[% END %] |
160 |
[% END %] |
| 126 |
</td> |
161 |
</table> |
| 127 |
<td><input type="text" name="note" id="note_new" value="[% adjustment.note %]"/></td> |
|
|
| 128 |
<td> |
| 129 |
<select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id"> |
| 130 |
<option value="">No fund</option> |
| 131 |
[% FOREACH budget IN budgets_loop %] |
| 132 |
[% IF ( budget.budget_id == adjustment.budget_id ) %] |
| 133 |
<option selected="selected" value="[% budget.budget_id %]"> |
| 134 |
[% ELSE %] |
| 135 |
<option value="[% budget.budget_id %]"> |
| 136 |
[% END %] |
| 137 |
[% budget.budget_name %] |
| 138 |
</option> |
| 139 |
[% END %] |
| 140 |
</select> |
| 141 |
</td> |
| 142 |
[% IF adjustment.encumber_open %] |
| 143 |
<td> |
| 144 |
<input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" checked/> |
| 145 |
</td> |
| 146 |
[% ELSE %] |
| 147 |
<td> |
| 148 |
<input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" /> |
| 149 |
</td> |
| 150 |
[% END %] |
| 151 |
<td> |
| 152 |
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/acqui/invoice.pl?op=del_adj&adjustment_id=[% adjustment.adjustment_id %]&invoiceid=[% invoiceid %]"><i class="fa fa-trash"></i> Delete</a> |
| 153 |
</td> |
| 154 |
</tr> |
| 155 |
[% END %] |
162 |
[% END %] |
| 156 |
[% END %] |
163 |
|
| 157 |
<tr><td colspan="7">Add an adjustment</td></tr> |
164 |
<p> |
| 158 |
<td><input type="hidden" name="adjustment_id" value="new" />New</td> |
165 |
<a href="#" id="show_invoice_adjustment" class="toggle_invoice_adjustment"><i class="fa fa-plus"></i> Add an adjustment</a> |
| 159 |
<td><input type="text" name="adjustment" id="adjustment_new]" /></td> |
166 |
</p> |
| 160 |
<td> |
167 |
|
| 161 |
[% reasons = AuthorisedValues.Get("ADJ_REASON") %] |
168 |
<fieldset id="add_invoice_adjustment" style="display:none"> |
| 162 |
[% IF reasons.0 %] |
169 |
<h4>Add an adjustment</h4> |
| 163 |
<select id="reason_[% adjustment.adjustment_id %]" name="reason"> |
170 |
<input type="hidden" name="adjustment_id" value="new" /> |
| 164 |
<option value="">No reason</option> |
171 |
<ol> |
| 165 |
[% FOREACH reason IN reasons %] |
172 |
<li> |
| 166 |
<option value="[% reason.authorised_value %]"> |
173 |
<label for="adjustment_new">Amount: </label> |
| 167 |
[% reason.lib %] |
174 |
<input type="text" name="adjustment" id="adjustment_new" /> |
| 168 |
</option> |
175 |
</li> |
| 169 |
[% END %] |
176 |
[% reasons = AuthorisedValues.Get("ADJ_REASON") %] |
| 170 |
</select> |
177 |
[% IF reasons.0 %] |
| 171 |
[% ELSE %] |
178 |
<li> |
| 172 |
<p title="Define values in authorised value category ADJ_REASON to enable">None</p> |
179 |
<label for="reason_[% adjustment.adjustment_id %]">Reason: </label> |
| 173 |
[% END %] |
180 |
<select id="reason_[% adjustment.adjustment_id %]" name="reason"> |
| 174 |
</td> |
181 |
<option value="">No reason</option> |
| 175 |
<td><input type="text" name="note" id="note_new" value=""/></td> |
182 |
[% FOREACH reason IN reasons %] |
| 176 |
<td> |
183 |
<option value="[% reason.authorised_value %]"> |
| 177 |
<select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id"> |
184 |
[% reason.lib %] |
| 178 |
<option selected="selected" value="">No fund</option> |
185 |
</option> |
| 179 |
[% FOREACH budget IN budgets_loop %] |
186 |
[% END %] |
| 180 |
<option value="[% budget.budget_id %]"> |
187 |
</select> |
| 181 |
[% budget.budget_name %] |
188 |
</li> |
| 182 |
</option> |
189 |
[% ELSE %] |
| 183 |
[% END %] |
190 |
<li> |
| 184 |
</select> |
191 |
<span class="label">Reason: </span> |
| 185 |
</td> |
192 |
<span>None</span> |
| 186 |
<td><input type="checkbox" name="encumber_open" id="encumber_new" value="new" /></td> |
193 |
<div class="hint">Define values in authorised value category ADJ_REASON to enable</div> |
| 187 |
<td><input type="hidden" name="delete" value=""></td> |
194 |
</li> |
| 188 |
</tr> |
195 |
[% END %] |
| 189 |
</table> |
196 |
<li> |
| 190 |
<input type="hidden" name="op" value="mod_adj" /> |
197 |
<label for="note_new">Note: </label> |
| 191 |
<input type="submit" value="Update adjustments" /> |
198 |
<input type="text" name="note" id="note_new" value=""/> |
| 192 |
</form> |
199 |
</li> |
|
|
200 |
<li> |
| 201 |
<label for="budget_id_new">Fund: </label> |
| 202 |
<select id="budget_id_new" name="budget_id"> |
| 203 |
<option selected="selected" value="">No fund</option> |
| 204 |
[% FOREACH budget IN budgets_loop %] |
| 205 |
<option value="[% budget.budget_id %]"> |
| 206 |
[% budget.budget_name %] |
| 207 |
</option> |
| 208 |
[% END %] |
| 209 |
</select> |
| 210 |
</li> |
| 211 |
<li> |
| 212 |
<label for="encumber_new">Encumber while invoice open? </label> |
| 213 |
<input type="checkbox" name="encumber_open" id="encumber_new" value="new" /> |
| 214 |
<input type="hidden" name="delete" value=""> |
| 215 |
</li> |
| 216 |
<li> |
| 217 |
<span class="label"> </span> |
| 218 |
<a href="#" id="cancel_invoice_adjustment" class="toggle_invoice_adjustment" style="display:none"><i class="fa fa-remove"></i> Cancel</a> |
| 219 |
</li> |
| 220 |
</ol> |
| 221 |
</fieldset> |
| 222 |
<fieldset class="action"> |
| 223 |
<input type="hidden" name="op" value="mod_adj" /> |
| 224 |
<input type="submit" value="Update adjustments" /> |
| 225 |
</fieldset> |
| 226 |
</fieldset> |
| 227 |
</form> |
| 193 |
<p> |
228 |
<p> |
| 194 |
<a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a> |
229 |
<a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a> |
| 195 |
[% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %] |
230 |
[% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %] |
| 196 |
</p> |
231 |
</p> |
| 197 |
<h2>Invoice details</h2> |
232 |
<h2>Invoice details</h2> |
|
|
233 |
<fieldset> |
| 198 |
[% IF orders_loop.size %] |
234 |
[% IF orders_loop.size %] |
| 199 |
<label for="show_all_details"> |
235 |
<label for="show_all_details"> |
| 200 |
<input type="checkbox" style="vertical-align: middle;" id="show_all_details" /> |
236 |
<input type="checkbox" style="vertical-align: middle;" id="show_all_details" /> |
|
Lines 317-322
Link Here
|
| 317 |
</tbody> |
353 |
</tbody> |
| 318 |
</table> |
354 |
</table> |
| 319 |
[% END %] |
355 |
[% END %] |
|
|
356 |
</fieldset> |
| 320 |
</main> |
357 |
</main> |
| 321 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
358 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
| 322 |
|
359 |
|
|
Lines 374-379
Link Here
|
| 374 |
|
411 |
|
| 375 |
$("#show_all_details").prop('checked', false); |
412 |
$("#show_all_details").prop('checked', false); |
| 376 |
updateColumnsVisibility(false); |
413 |
updateColumnsVisibility(false); |
|
|
414 |
$(".toggle_invoice_adjustment").on("click", function(e){ |
| 415 |
e.preventDefault(); |
| 416 |
$("#show_invoice_adjustment, #cancel_invoice_adjustment, #add_invoice_adjustment").toggle(); |
| 417 |
}); |
| 418 |
$("a.delete_adjustment").click(function(){ |
| 419 |
return ( confirm( _("Are you sure you want to delete this file ?") ) ); |
| 420 |
}); |
| 377 |
}); |
421 |
}); |
| 378 |
</script> |
422 |
</script> |
| 379 |
[% END %] |
423 |
[% END %] |
| 380 |
- |
|
|