6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Administration ›
8 [% IF op =='add_form' %]
10 [% IF debit_type.code %]
16 [% IF op == 'delete_confirm' %]
17 Debit types › Confirm deletion of debit type
23 [% INCLUDE 'doc-head-close.inc' %]
26 <body id="admin_debit_types" class="admin">
27 [% INCLUDE 'header.inc' %]
28 [% INCLUDE 'prefs-admin-search.inc' %]
30 <div id="breadcrumbs">
31 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
33 › <a href="/cgi-bin/koha/admin/debit_types.pl">Debit types</a>
34 [% IF op == 'add_form' %]
35 › [% IF debit_type.code %]Modify[% ELSE %]New[% END %] debit type
36 [% ELSIF op == 'delete_confirm' %]
37 › Confirm deletion of debit type
41 <div class="main container-fluid">
43 <div class="col-sm-10 col-sm-push-2">
46 [% FOREACH m IN messages %]
47 <div class="dialog [% m.type | html %]">
49 [% CASE 'error_on_saving' %]
50 An error occurred when saving this debit type.
51 [% CASE 'error_on_delete' %]
52 An error occurred when deleting this debit type. Check the logs.
53 [% CASE 'success_on_saving' %]
54 Debit type saved successfully.
55 [% CASE 'success_on_delete' %]
56 Debit type deleted successfully.
63 [% IF op == 'add_form' %]
65 <h3>Modify a debit type</h3>
67 <h3>New debit type</h3>
70 <form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated">
71 <input type="hidden" name="op" value="add_validate" />
72 <fieldset class="rows">
75 <label for="code" class="required">Debit type code: </label>
77 <strong>[% debit_type.code | html %]</strong>
78 <input type="hidden" name="code" value="[% code | html %]" />
80 <input type="text" name="code" id="code" size="80" maxlength="64" class="required" required="required"><span class="required">Required. Maximum length is 64 letters</span>
84 <label for="default_amount">Default amount: </label>
85 <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"/>
88 <label for="description" class="required">Description: </label>
89 <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>
92 <label for="can_be_added_manually">Can be added manually? </label>
93 [% IF debit_type.can_be_added_manually %]
94 <input type="checkbox" name="can_be_added_manually" id="can_be_added_manually" checked="checked" value="1" />
96 <input type="checkbox" name="can_be_added_manually" id="can_be_added_manually" value="1" />
100 <label for="branches">Libraries limitation: </label>
101 <select id="branches" name="branches" multiple size="10">
102 <option value="">All libraries</option>
103 [% FOREACH branch IN branches_loop %]
104 [% IF ( branch.selected ) %]
105 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
107 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
111 <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>
116 <fieldset class="action">
117 <button id="save_debit_type" class="btn btn-default"><i class="fa fa-save"></i> Save</button>
118 <a class="cancel btn-link" href="/cgi-bin/koha/admin/debit_types.pl"><i class="fa fa-times"></i> Cancel</a>
123 [% IF op == 'delete_confirm' %]
124 <div class="dialog alert">
125 <h3>Delete debit type "[% debit_type.description | html %]?"</h3>
127 <tr><th>Debit type code</th>
128 <td>[% debit_type.code | html %]</td>
130 <tr><th>Debit type description</th>
131 <td>[% debit_type.description | html %]</td>
134 <form action="/cgi-bin/koha/admin/debit_types.pl" method="post">
135 <input type="hidden" name="op" value="delete_confirmed" />
136 <input type="hidden" name="code" value="[% debit_type.code | html %]" />
137 <button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
139 <form action="/cgi-bin/koha/admin/debit_types.pl" method="get">
140 <button type=submit" class="btn btn-default deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
145 [% IF op == 'list' %]
146 <div id="toolbar" class="btn-toolbar">
147 <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>
150 <h3>Account debit types</h3>
151 [% IF debit_types.count %]
152 <table id="table_debit_types">
156 <th>Default amount</th>
157 <th>Can be added manually</th>
158 <th>Library limitations</th>
162 [% FOREACH debit_type IN debit_types %]
164 <td>[% debit_type.code | html %]</td>
165 <td>[% debit_type.description | html %]</td>
166 <td>[% debit_type.default_amount | $Price %]</td>
167 <td>[% IF debit_type.can_be_added_manually %]Yes[% ELSE %]No[% END %]</td>
169 [% IF debit_type.library_limits.count > 0 %]
170 [% library_limits_str = "" %]
171 [% FOREACH library IN debit_type.library_limits %]
172 [%- IF loop.first -%]
173 [% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %]
175 [% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
178 <span class="library_limitation" title="[% library_limits_str | html %]">
179 [% IF debit_type.library_limits.count > 1 %]
180 [% debit_type.library_limits.count | html %] library limitations
182 [% debit_type.library_limits.count | html %] library limitation
189 [% IF !debit_type.is_system %]
190 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&code=[% debit_type.code | uri %]"><i class="fa fa-pencil"></i> Edit</a>
191 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=delete_confirm&code=[% debit_type.code | uri %]"><i class="fa fa-trash"></i> Delete</a>
199 <div class="dialog message">
200 There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new debit type</a>
205 </div> <!-- /.col-sm-10.col-sm-push-2 -->
207 <div class="col-sm-2 col-sm-pull-10">
209 [% INCLUDE 'admin-menu.inc' %]
211 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
212 </div> <!-- /.row -->
214 [% MACRO jsinclude BLOCK %]
215 [% Asset.js("js/admin-menu.js") | $raw %]
216 [% INCLUDE 'datatables.inc' %]
219 $(document).ready(function() {
220 $("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, {
222 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
224 "aaSorting": [[ 1, "asc" ]],
225 "iDisplayLength": 10,
226 "sPaginationType": "full_numbers"
232 [% INCLUDE 'intranet-bottom.inc' %]