5 [% PROCESS 'i18n.inc' %]
7 [% PROCESS 'accounts.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% FILTER collapse %]
10 [% IF op =='add_form' %]
11 [% IF debit_type.code %]
12 [% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %]
14 [% t("New debit type") | html %]
17 [% t("Debit types") | html %] ›
18 [% t("Administration") | html %] ›
19 [% t("Koha") | html %]
21 [% INCLUDE 'doc-head-close.inc' %]
24 <body id="admin_debit_types" class="admin">
25 [% WRAPPER 'header.inc' %]
26 [% INCLUDE 'prefs-admin-search.inc' %]
29 [% WRAPPER 'sub-header.inc' %]
30 [% WRAPPER breadcrumbs %]
31 [% WRAPPER breadcrumb_item %]
32 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
35 [% IF op == 'add_form' %]
36 [% WRAPPER breadcrumb_item %]
37 <a href="/cgi-bin/koha/admin/debit_types.pl">Debit types</a>
39 [% WRAPPER breadcrumb_item bc_active= 1 %]
40 [% IF debit_type.code %]
41 [% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %]
43 <span>New debit type</span>
48 [% WRAPPER breadcrumb_item bc_active= 1 %]
49 <span>Debit types</span>
52 [% END #/ WRAPPER breadcrumbs %]
53 [% END #/ WRAPPER sub-header.inc %]
55 <div class="main container-fluid">
57 <div class="col-sm-10 col-sm-push-2">
60 [% FOREACH m IN messages %]
61 <div class="dialog [% m.type | html %]">
63 [% CASE 'success_on_saving' %]
64 <span>Debit type saved successfully.</span>
65 [% CASE 'error_on_saving' %]
66 <span>An error occurred when saving this debit type. Check the logs for details.</span>
67 [% CASE 'success_on_archive' %]
68 <span>Debit type archived successfully.</span>
69 [% CASE 'success_on_restore' %]
70 <span>Debit type restored successfully.</span>
72 <span>[% m.code | html %]</span>
77 [% IF op == 'add_form' %]
79 <h1>[% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %]</h1>
81 <h1>New debit type</h1>
84 <form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated">
85 <input type="hidden" name="op" value="add_validate" />
86 <fieldset class="rows">
89 <label for="code" class="required">Debit type code: </label>
91 <strong>[% debit_type.code | html %]</strong>
92 <input type="hidden" name="code" value="[% code | html %]" />
94 <input type="text" name="code" id="code" size="80" maxlength="64" class="required focus" required="required"><span class="required">Required. Maximum length is 64 letters</span>
98 <label for="default_amount">Default amount: </label>
99 <input type="text" pattern="^\d+(\.\d{2})?$" name="default_amount" id="default_amount" size="80" maxlength="100" value="[% debit_type.default_amount | $Price on_editing => 1 %]" step="any" min="0"/>
102 <label for="description" class="required">Description: </label>
103 [% IF debit_type && debit_type.is_system %]
104 <span>[%- PROCESS debit_type_description debit_type = debit_type -%]</span>
106 <input type="text" name="description" id="description" required="required" class="required" size="80" maxlength="100" value="[% debit_type.description | html %]" /> <span class="required">Required</span>
110 <label for="can_be_invoiced">Can be manually invoiced? </label>
111 [% IF debit_type.can_be_invoiced %]
112 <input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" checked="checked" value="1" />
114 <input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" value="1" />
118 <label for="can_be_sold">Can be sold? </label>
119 [% IF debit_type.can_be_sold %]
120 <input type="checkbox" name="can_be_sold" id="can_be_sold" checked="checked" value="1" />
122 <input type="checkbox" name="can_be_sold" id="can_be_sold" value="1" />
126 <label for="restricts_checkouts">Included in noissuescharge? </label>
127 [% IF debit_type.restricts_checkouts %]
128 <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" checked="checked" value="1" />
130 <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" value="1" />
134 <label for="branches">Libraries limitation: </label>
135 <select id="branches" name="branches" multiple size="10">
136 <option value="">All libraries</option>
137 [% FOREACH branch IN branches_loop %]
138 [% IF ( branch.selected ) %]
139 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
141 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
145 <div class="hint">Select 'All libraries' if this debit type should be available at all libraries. Otherwise select libraries you want to associate debit type with.</div>
150 <fieldset class="action">
151 <button id="save_debit_type" class="btn btn-primary">Save</button>
152 <a class="cancel" href="/cgi-bin/koha/admin/debit_types.pl">Cancel</a>
157 [% IF op == 'list' %]
158 <div id="toolbar" class="btn-toolbar">
159 <a class="btn btn-default" id="newdebittype" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form"><i class="fa fa-plus"></i> New debit type</a>
163 [% IF debit_types.count %]
164 <div class="page-section">
165 <table id="table_debit_types">
171 <th>Default amount</th>
172 <th>Available for</th>
173 <th>Library limitations</th>
174 <th>Blocks checkouts?</th>
175 <th class="noExport">Actions</th>
178 [% FOREACH debit_type IN debit_types %]
180 <td>[% debit_type.archived | html %]</td>
181 <td>[% debit_type.is_system | html %]</td>
182 <td>[% debit_type.code | html %]</td>
183 <td>[%- PROCESS debit_type_description debit_type = debit_type -%]</td>
184 <td>[% debit_type.default_amount | $Price %]</td>
185 <td>[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %]
186 <i class="fa fa-id-card"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale
187 [% ELSIF debit_type.can_be_invoiced %]
188 <i class="fa fa-id-card"></i> Invoicing
189 [% ELSIF debit_type.can_be_sold %]
190 <i class="fa fa-shopping-cart"></i> Sale
194 [% IF debit_type.library_limits.count > 0 %]
195 [% library_limits_str = "" %]
196 [% FOREACH library IN debit_type.library_limits %]
197 [%- IF loop.first -%]
198 [% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %]
200 [% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
203 <span class="library_limitation" title="[% library_limits_str | html %]">
204 [% IF debit_type.library_limits.count > 1 %]
205 <span>[% debit_type.library_limits.count | html %] library limitations</span>
207 <span>[% debit_type.library_limits.count | html %] library limitation</span>
210 <span>No limitation</span>
214 [% IF debit_type.restricts_checkouts %]
221 [% IF !debit_type.archived %]
222 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&code=[% debit_type.code | uri %]&type=debit"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
223 [% IF !debit_type.is_system %]
224 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=archive&code=[% debit_type.code | uri %]"><i class="fa fa-archive"></i> Archive</a>
226 [% ELSIF debit_type.archived %]
227 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=unarchive&code=[% debit_type.code | uri %]"><i class="fa fa-undo"></i> Restore</a>
234 </div><!-- /.page-section -->
236 <div class="dialog message">
237 There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new debit type</a>
242 </div> <!-- /.col-sm-10.col-sm-push-2 -->
244 <div class="col-sm-2 col-sm-pull-10">
246 [% INCLUDE 'admin-menu.inc' %]
248 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
249 </div> <!-- /.row -->
251 [% MACRO jsinclude BLOCK %]
252 [% Asset.js("js/admin-menu.js") | $raw %]
253 [% INCLUDE 'datatables.inc' %]
256 $(document).ready(function() {
257 var txtActivefilter = _("Filter system debit types");
258 var txtInactivefilter = _("Show all debit types");
259 var table_debit_types = $("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, {
261 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
262 { "aTargets": [ 0, 1 ], "bSortable": false, "bVisible": false },
264 "aaSorting": [[ 0, "asc" ],[ 2, "asc" ]],
265 "sDom": 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>',
266 "iDisplayLength": 20,
267 "sPaginationType": "full_numbers"
269 $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
270 $('#filter_system').click(function(e) {
272 if ($(this).hasClass('filtered')) {
273 var filteredValue = '';
274 $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
275 } else { //Not filtered. Let's do it!
276 var filteredValue = '0';
277 $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
279 table_debit_types.fnFilter(filteredValue, 1, false, false);
280 $(this).toggleClass('filtered');
284 $('#filter_system').click();
289 [% INCLUDE 'intranet-bottom.inc' %]