6 [% PROCESS 'accounts.inc' %]
7 [% INCLUDE 'doc-head-open.inc' %]
9 [% IF op =='add_form' %]
10 [% IF debit_type.code %]
14 [% END %] › [% END %]
15 Debit types › Administration › Koha
17 [% INCLUDE 'doc-head-close.inc' %]
20 <body id="admin_debit_types" class="admin">
21 [% WRAPPER 'header.inc' %]
22 [% INCLUDE 'prefs-admin-search.inc' %]
25 [% WRAPPER 'sub-header.inc' %]
26 [% WRAPPER breadcrumbs %]
27 [% WRAPPER breadcrumb_item %]
28 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
31 [% IF op == 'add_form' %]
32 [% WRAPPER breadcrumb_item %]
33 <a href="/cgi-bin/koha/admin/debit_types.pl">Debit types</a>
35 [% WRAPPER breadcrumb_item bc_active= 1 %]
36 [% IF debit_type.code %]
37 <span>Modify debit type</span>
39 <span>New debit type</span>
44 [% WRAPPER breadcrumb_item bc_active= 1 %]
45 <span>Debit types</span>
48 [% END #/ WRAPPER breadcrumbs %]
49 [% END #/ WRAPPER sub-header.inc %]
51 <div class="main container-fluid">
53 <div class="col-sm-10 col-sm-push-2">
56 [% FOREACH m IN messages %]
57 <div class="dialog [% m.type | html %]">
59 [% CASE 'success_on_saving' %]
60 <span>Debit type saved successfully</span>
61 [% CASE 'error_on_saving' %]
62 <span>An error occurred when saving this debit type</span>
63 [% CASE 'success_on_archive' %]
64 <span>Debit type archived successfully</span>
65 [% CASE 'success_on_restore' %]
66 <span>Debit type restored successfully</span>
68 <span>[% m.code | html %]</span>
73 [% IF op == 'add_form' %]
75 <h1>Modify a debit type</h1>
77 <h1>New debit type</h1>
80 <form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated">
81 <input type="hidden" name="op" value="add_validate" />
82 <fieldset class="rows">
85 <label for="code" class="required">Debit type code: </label>
87 <strong>[% debit_type.code | html %]</strong>
88 <input type="hidden" name="code" value="[% code | html %]" />
90 <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>
94 <label for="default_amount">Default amount: </label>
95 <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"/>
98 <label for="description" class="required">Description: </label>
99 [% IF debit_type && debit_type.is_system %]
100 <span>[%- PROCESS debit_type_description debit_type = debit_type -%]</span>
102 <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>
106 <label for="can_be_invoiced">Can be manually invoiced? </label>
107 [% IF debit_type.can_be_invoiced %]
108 <input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" checked="checked" value="1" />
110 <input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" value="1" />
114 <label for="can_be_sold">Can be sold? </label>
115 [% IF debit_type.can_be_sold %]
116 <input type="checkbox" name="can_be_sold" id="can_be_sold" checked="checked" value="1" />
118 <input type="checkbox" name="can_be_sold" id="can_be_sold" value="1" />
122 <label for="restricts_checkouts">Included in noissuescharge? </label>
123 [% IF debit_type.restricts_checkouts %]
124 <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" checked="checked" value="1" />
126 <input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" value="1" />
130 <label for="branches">Libraries limitation: </label>
131 <select id="branches" name="branches" multiple size="10">
132 <option value="">All libraries</option>
133 [% FOREACH branch IN branches_loop %]
134 [% IF ( branch.selected ) %]
135 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
137 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
141 <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>
146 <fieldset class="action">
147 <button id="save_debit_type" class="btn btn-primary">Save</button>
148 <a class="cancel" href="/cgi-bin/koha/admin/debit_types.pl">Cancel</a>
153 [% IF op == 'list' %]
154 <div id="toolbar" class="btn-toolbar">
155 <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>
158 <h1>Account debit types</h1>
159 [% IF debit_types.count %]
160 <div class="page-section">
161 <table id="table_debit_types">
167 <th>Default amount</th>
168 <th>Available for</th>
169 <th>Library limitations</th>
170 <th>Blocks checkouts?</th>
171 <th class="noExport">Actions</th>
174 [% FOREACH debit_type IN debit_types %]
176 <td>[% debit_type.archived | html %]</td>
177 <td>[% debit_type.is_system | html %]</td>
178 <td>[% debit_type.code | html %]</td>
179 <td>[%- PROCESS debit_type_description debit_type = debit_type -%]</td>
180 <td>[% debit_type.default_amount | $Price %]</td>
181 <td>[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %]
182 <i class="fa fa-id-card"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale
183 [% ELSIF debit_type.can_be_invoiced %]
184 <i class="fa fa-id-card"></i> Invoicing
185 [% ELSIF debit_type.can_be_sold %]
186 <i class="fa fa-shopping-cart"></i> Sale
190 [% IF debit_type.library_limits.count > 0 %]
191 [% library_limits_str = "" %]
192 [% FOREACH library IN debit_type.library_limits %]
193 [%- IF loop.first -%]
194 [% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %]
196 [% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
199 <span class="library_limitation" title="[% library_limits_str | html %]">
200 [% IF debit_type.library_limits.count > 1 %]
201 <span>[% debit_type.library_limits.count | html %] library limitations</span>
203 <span>[% debit_type.library_limits.count | html %] library limitation</span>
206 <span>No limitation</span>
210 [% IF debit_type.restricts_checkouts %]
217 [% IF !debit_type.archived %]
218 <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-alt"></i> Edit</a>
219 [% IF !debit_type.is_system %]
220 <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>
222 [% ELSIF debit_type.archived %]
223 <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>
230 </div><!-- /.page-section -->
232 <div class="dialog message">
233 There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new debit type</a>
238 </div> <!-- /.col-sm-10.col-sm-push-2 -->
240 <div class="col-sm-2 col-sm-pull-10">
242 [% INCLUDE 'admin-menu.inc' %]
244 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
245 </div> <!-- /.row -->
247 [% MACRO jsinclude BLOCK %]
248 [% Asset.js("js/admin-menu.js") | $raw %]
249 [% INCLUDE 'datatables.inc' %]
252 $(document).ready(function() {
253 var txtActivefilter = _("Filter system debit types");
254 var txtInactivefilter = _("Show all debit types");
255 var table_debit_types = $("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, {
257 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
258 { "aTargets": [ 0, 1 ], "bSortable": false, "bVisible": false },
260 "aaSorting": [[ 0, "asc" ],[ 2, "asc" ]],
261 "sDom": 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>',
262 "iDisplayLength": 20,
263 "sPaginationType": "full_numbers"
265 $("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>');
266 $('#filter_system').click(function(e) {
268 if ($(this).hasClass('filtered')) {
269 var filteredValue = '';
270 $(this).html('<i class="fa fa-filter"></i> '+txtActivefilter);
271 } else { //Not filtered. Let's do it!
272 var filteredValue = '0';
273 $(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter);
275 table_debit_types.fnFilter(filteredValue, 1, false, false);
276 $(this).toggleClass('filtered');
280 $('#filter_system').click();
285 [% INCLUDE 'intranet-bottom.inc' %]