6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Administration ›
8 [% IF op =='add_form' %]
10 [% IF debit_type.code %]
19 [% INCLUDE 'doc-head-close.inc' %]
22 <body id="admin_debit_types" class="admin">
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'prefs-admin-search.inc' %]
26 <nav aria-label="Breadcrumb" class="breadcrumb">
29 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
35 [% IF op == 'add_form' %]
37 <a href="/cgi-bin/koha/admin/debit_types.pl">Debit types</a>
40 <a href="#" aria-current="page">
41 [% IF debit_type.code %]
51 <a href="#" aria-current="page">
59 <div class="main container-fluid">
61 <div class="col-sm-10 col-sm-push-2">
64 [% FOREACH m IN messages %]
65 <div class="dialog [% m.type | html %]">
67 [% CASE 'success_on_saving' %]
68 Debit type saved successfully.
69 [% CASE 'error_on_saving' %]
70 An error occurred when saving this debit type.
71 [% CASE 'success_on_archive' %]
72 Debit type archived successfully.
73 [% CASE 'success_on_restore' %]
74 Debit type restored successfully.
81 [% IF op == 'add_form' %]
83 <h3>Modify a debit type</h3>
85 <h3>New debit type</h3>
88 <form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated">
89 <input type="hidden" name="op" value="add_validate" />
90 <fieldset class="rows">
93 <label for="code" class="required">Debit type code: </label>
95 <strong>[% debit_type.code | html %]</strong>
96 <input type="hidden" name="code" value="[% code | html %]" />
98 <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>
102 <label for="default_amount">Default amount: </label>
103 <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"/>
106 <label for="description" class="required">Description: </label>
107 <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="branches">Libraries limitation: </label>
127 <select id="branches" name="branches" multiple size="10">
128 <option value="">All libraries</option>
129 [% FOREACH branch IN branches_loop %]
130 [% IF ( branch.selected ) %]
131 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
133 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
137 <span>Select 'All libraries' if this debit type should be available at all libraries. Otherwise select libraries you want to associate debit type with.</span>
142 <fieldset class="action">
143 <button id="save_debit_type" class="btn btn-default">Save</button>
144 <a class="cancel" href="/cgi-bin/koha/admin/debit_types.pl">Cancel</a>
149 [% IF op == 'list' %]
150 <div id="toolbar" class="btn-toolbar">
151 <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>
154 <h3>Account debit types</h3>
155 [% IF debit_types.count %]
156 <table id="table_debit_types">
162 <th>Default amount</th>
163 <th>Available for</th>
164 <th>Library limitations</th>
165 <th class="noExport">Actions</th>
168 [% FOREACH debit_type IN debit_types %]
170 <td>[% debit_type.archived | html %]</td>
171 <td>[% debit_type.is_system | html %]</td>
172 <td>[% debit_type.code | html %]</td>
173 <td>[% debit_type.description | html %]</td>
174 <td>[% debit_type.default_amount | $Price %]</td>
175 <td>[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %]
176 <i class="fa fa-id-card-o"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale
177 [% ELSIF debit_type.can_be_invoiced %]
178 <i class="fa fa-id-card-o"></i> Invoicing
179 [% ELSIF debit_type.can_be_sold %]
180 <i class="fa fa-shopping-cart"></i> Sale
184 [% IF debit_type.library_limits.count > 0 %]
185 [% library_limits_str = "" %]
186 [% FOREACH library IN debit_type.library_limits %]
187 [%- IF loop.first -%]
188 [% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %]
190 [% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
193 <span class="library_limitation" title="[% library_limits_str | html %]">
194 [% IF debit_type.library_limits.count > 1 %]
195 [% debit_type.library_limits.count | html %] library limitations
197 [% debit_type.library_limits.count | html %] library limitation
204 [% IF !debit_type.is_system && !debit_type.archived %]
205 <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 fa-pencil"></i> Edit</a>
206 <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>
207 [% ELSIF debit_type.archived %]
208 <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>
216 <div class="dialog message">
217 There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new debit type</a>
222 </div> <!-- /.col-sm-10.col-sm-push-2 -->
224 <div class="col-sm-2 col-sm-pull-10">
226 [% INCLUDE 'admin-menu.inc' %]
228 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
229 </div> <!-- /.row -->
231 [% MACRO jsinclude BLOCK %]
232 [% Asset.js("js/admin-menu.js") | $raw %]
233 [% INCLUDE 'datatables.inc' %]
236 $(document).ready(function() {
237 var txtActivefilter = _("Filter system debit types");
238 var txtInactivefilter = _("Show all debit types");
239 var table_debit_types = $("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, {
241 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
242 { "aTargets": [ 0, 1 ], "bSortable": false, "bVisible": false },
244 "aaSorting": [[ 0, "asc" ],[ 2, "asc" ]],
245 "sDom": 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>',
246 "iDisplayLength": 20,
247 "sPaginationType": "full_numbers"
249 $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
250 $('#filter_system').click(function(e) {
252 if ($(this).hasClass('filtered')) {
253 var filteredValue = '';
254 $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
255 } else { //Not filtered. Let's do it!
256 var filteredValue = '0';
257 $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
259 table_debit_types.fnFilter(filteredValue, 1, false, false);
260 $(this).toggleClass('filtered');
264 $('#filter_system').click();
269 [% INCLUDE 'intranet-bottom.inc' %]