Lines 266-280
Link Here
|
266 |
<li> |
266 |
<li> |
267 |
<label for="bookfund" class="required">Fund: </label> |
267 |
<label for="bookfund" class="required">Fund: </label> |
268 |
<select id="bookfund" name="bookfund"> |
268 |
<select id="bookfund" name="bookfund"> |
269 |
<option value=""></option> |
269 |
<optgroup label="Current"> |
270 |
[% FOREACH period IN budget_loop %] |
270 |
<option id="selected_bookfund" selected="selected"></option> |
271 |
<optgroup label="[% period.description | html %]"> |
|
|
272 |
[% FOREACH fund IN period.funds %] |
273 |
<option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option> |
274 |
[% END %] |
275 |
</optgroup> |
271 |
</optgroup> |
|
|
272 |
[% FOREACH budget_period_id IN budget_loops.keys %] |
273 |
[% SET budget_period = budget_loops.$budget_period_id %] |
274 |
[% IF budget_period.active %] |
275 |
<optgroup label="[% budget_period.description | html %]"> |
276 |
[% ELSE %] |
277 |
<optgroup class="inactive_budget" label="[% budget_period.description | html %] (Inactive)"> |
278 |
[% END %] |
279 |
[% FOREACH budget_loo IN budget_period.funds %] |
280 |
[% level_indent_cnt = 0 %] |
281 |
[% level_indent = "" %] |
282 |
[% WHILE level_indent_cnt < budget_loo.b_level %] |
283 |
[% level_indent = level_indent _ " -- " %] |
284 |
[% level_indent_cnt = level_indent_cnt +1 %] |
285 |
[% END %] |
286 |
|
287 |
[% IF ( budget_loo.b_sel ) %] |
288 |
[% active_count = 0 #select no other fund %] |
289 |
<option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> |
290 |
[% ELSIF active_count==1 && budget_loo.b_active %] |
291 |
<option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> |
292 |
[% ELSE %] |
293 |
[% bdgclass=budget_loo.b_active? "": "inactive_budget" | html %] |
294 |
<option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> |
295 |
[% END %] |
296 |
[% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %] |
297 |
</option> |
276 |
[% END %] |
298 |
[% END %] |
|
|
299 |
</optgroup> |
300 |
[% END %] |
277 |
</select> |
301 |
</select> |
|
|
302 |
<span class="required">Required</span> |
303 |
<label for="showallbudgets" style="float:none;"> Show inactive:</label> |
304 |
<input type="checkbox" id="showallbudgets" /> |
278 |
</li> |
305 |
</li> |
279 |
<li> |
306 |
<li> |
280 |
<label> </label> |
307 |
<label> </label> |
Lines 492-497
Link Here
|
492 |
var invoice_id = "[% invoiceid | html %]"; |
519 |
var invoice_id = "[% invoiceid | html %]"; |
493 |
|
520 |
|
494 |
$(document).ready(function(){ |
521 |
$(document).ready(function(){ |
|
|
522 |
// keep a copy for re-rendering |
523 |
var $funds_tree = $('#bookfund').html(); |
495 |
var base_query = { "order_id": {"in": [[% multiple_orders | html %]]}}; |
524 |
var base_query = { "order_id": {"in": [[% multiple_orders | html %]]}}; |
496 |
var pending_orders_url = "/api/v1/acquisitions/orders?only_active=1"; |
525 |
var pending_orders_url = "/api/v1/acquisitions/orders?only_active=1"; |
497 |
var options = { |
526 |
var options = { |
Lines 1059-1065
Link Here
|
1059 |
.filter(function(name){ |
1088 |
.filter(function(name){ |
1060 |
return name |
1089 |
return name |
1061 |
}) |
1090 |
}) |
1062 |
.join(', ')+' (<a href="http://localhost:8081/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.biblio.suggestions[0].suggestionid+'&op=show">'+SUGGESTION.format(row.biblio.suggestions[0].suggestionid)+'</a>)' |
1091 |
.join(', ')+' (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='+row.biblio.suggestions[0].suggestion_id+'&op=show">'+SUGGESTION.format(row.biblio.suggestions[0].suggestion_id)+'</a>)' |
1063 |
); |
1092 |
); |
1064 |
} else { |
1093 |
} else { |
1065 |
$("#biblio_suggestion_suggester").parent().hide(); |
1094 |
$("#biblio_suggestion_suggester").parent().hide(); |
Lines 1084-1093
Link Here
|
1084 |
|
1113 |
|
1085 |
var effective_create_items = row.basket.create_items || AcqCreateItem; |
1114 |
var effective_create_items = row.basket.create_items || AcqCreateItem; |
1086 |
$("#datereceived").val(row.date_received||$date(new Date().toISOString())); |
1115 |
$("#datereceived").val(row.date_received||$date(new Date().toISOString())); |
1087 |
$("#bookfund option[value='']").html(FUND_KEEP.format(row.fund.budget.budget_period_description, row.fund.name)); |
1116 |
// restore the full tree |
1088 |
if(row.fund_id != row.fund.fund_id) { |
1117 |
$("#bookfund").html($funds_tree); |
|
|
1118 |
$("#selected_bookfund") |
1119 |
.html(FUND_KEEP.format(row.fund.budget.budget_period_description, row.fund.name)) |
1120 |
.attr( 'data-sort1-authcat', row.fund.sort1_authcat ) |
1121 |
.attr( 'data-sort2-authcat', row.fund.sort2_authcat ); |
1122 |
if (row.fund_id != row.fund.fund_id) { |
1089 |
$("#bookfund").val(row.fund_id); |
1123 |
$("#bookfund").val(row.fund_id); |
1090 |
} |
1124 |
} |
|
|
1125 |
$("#bookfund").select2({ width: '100%' }); |
1091 |
$("#current-fund").html(FUNC_CUR.format(row.fund.budget.budget_period_description, row.fund.name)); |
1126 |
$("#current-fund").html(FUNC_CUR.format(row.fund.budget.budget_period_description, row.fund.name)); |
1092 |
$("#creator").html([row.creator.surname, row.creator.firstname].filter(function(name){return name}).join(', ')+" ("+row.creator.patron_id+')') |
1127 |
$("#creator").html([row.creator.surname, row.creator.firstname].filter(function(name){return name}).join(', ')+" ("+row.creator.patron_id+')') |
1093 |
$("#quantity_to_receive").val(row.quantity).prop('readonly', !row.subscription_id); |
1128 |
$("#quantity_to_receive").val(row.quantity).prop('readonly', !row.subscription_id); |
Lines 1181-1186
Link Here
|
1181 |
$("#invoice_currency").val(active_currency); |
1216 |
$("#invoice_currency").val(active_currency); |
1182 |
$("#invoice_unitprice").val(''); |
1217 |
$("#invoice_unitprice").val(''); |
1183 |
} |
1218 |
} |
|
|
1219 |
|
1220 |
disabledBudgetsCopy = $('#bookfund').html(); |
1221 |
$('#bookfund .inactive_budget').remove(); |
1222 |
|
1223 |
$('#showallbudgets').click(function() { |
1224 |
if ($(this).is(":checked")) { |
1225 |
$('#bookfund').html(disabledBudgetsCopy); //Puts back all the funds |
1226 |
} |
1227 |
else { |
1228 |
$('#bookfund .inactive_budget').remove(); |
1229 |
} |
1230 |
}); |
1184 |
set_modal_buttons(); |
1231 |
set_modal_buttons(); |
1185 |
}; |
1232 |
}; |
1186 |
|
1233 |
|
1187 |
- |
|
|