Line 0
Link Here
|
0 |
- |
1 |
[% USE raw %] |
|
|
2 |
[% USE Asset %] |
3 |
[% USE Branches %] |
4 |
[% USE Price %] |
5 |
[% SET footerjs = 1 %] |
6 |
[% INCLUDE 'doc-head-open.inc' %] |
7 |
<title>Koha › Administration › |
8 |
[% IF op =='add_form' %] |
9 |
Account types › |
10 |
[% IF debit_type.code %] |
11 |
Modify account [% type %] type |
12 |
[% ELSE %] |
13 |
New account [% type %] type |
14 |
[% END %] |
15 |
[% ELSE %] |
16 |
[% IF op == 'delete_confirm' %] |
17 |
Account types › Confirm deletion of account [% type %] type |
18 |
[% ELSE %] |
19 |
Account types |
20 |
[% END %] |
21 |
[% END %] |
22 |
</title> |
23 |
[% INCLUDE 'doc-head-close.inc' %] |
24 |
</head> |
25 |
|
26 |
<body id="admin_debit_types" class="admin"> |
27 |
[% INCLUDE 'header.inc' %] |
28 |
[% INCLUDE 'prefs-admin-search.inc' %] |
29 |
|
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">Account types</a> |
34 |
[% IF op == 'add_form' %] |
35 |
› [% IF debit_type.code %]Modify[% ELSE %]New[% END %] Account [% type %] type |
36 |
[% ELSIF op == 'delete_confirm' %] |
37 |
› Confirm deletion of account [% type %] type |
38 |
[% END %] |
39 |
</div> |
40 |
|
41 |
<div class="main container-fluid"> |
42 |
<div class="row"> |
43 |
<div class="col-sm-10 col-sm-push-2"> |
44 |
<main> |
45 |
|
46 |
[% FOREACH m IN messages %] |
47 |
<div class="dialog [% m.type %]"> |
48 |
[% SWITCH m.code %] |
49 |
[% CASE 'error_on_saving' %] |
50 |
An error occurred when saving this account type. |
51 |
[% CASE 'error_on_delete' %] |
52 |
An error occurred when deleting this account type. Check the logs. |
53 |
[% CASE 'success_on_saving' %] |
54 |
Account type saved successfully. |
55 |
[% CASE 'success_on_delete' %] |
56 |
Account type deleted successfully. |
57 |
[% CASE %] |
58 |
[% m.code %] |
59 |
[% END %] |
60 |
</div> |
61 |
[% END %] |
62 |
|
63 |
[% IF op == 'add_form' %] |
64 |
[% IF debit_type %] |
65 |
<h3>Modify an account [% type %] type</h3> |
66 |
[% ELSE %] |
67 |
<h3>New account [% type %] type</h3> |
68 |
[% END %] |
69 |
|
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 |
<input type="hidden" name="type" value="[% type %]" /> |
73 |
<fieldset class="rows"> |
74 |
<ol> |
75 |
<li> |
76 |
<label for="code" class="required">Account [% type | html %] type code: </label> |
77 |
[% IF debit_type %] |
78 |
<strong>[% debit_type.code | html %]</strong> |
79 |
<input type="hidden" name="code" value="[% code %]" /> |
80 |
[% ELSE %] |
81 |
<input type="text" name="code" id="code" size="10" maxlength="5" class="required" required="required"><span class="required">Required. Maximum length is 16 letters</span> |
82 |
[% END %] |
83 |
</li> |
84 |
[% IF type == 'debit' %] |
85 |
<li> |
86 |
<label for="default_amount">Default amount: </label> |
87 |
<input type="text" name="default_amount" id="default_amount" size="80" maxlength="100" value="[% debit_type.default_amount | html %]" /> |
88 |
</li> |
89 |
[% END %] |
90 |
<li> |
91 |
<label for="description" class="required">Description: </label> |
92 |
<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> |
93 |
</li> |
94 |
<li> |
95 |
<label for="can_be_added_manually">Can be added manually? </label> |
96 |
[% IF debit_type.can_be_added_manually %] |
97 |
<input type="checkbox" name="can_be_added_manually" id="can_be_added_manually" checked="checked" value="1" /> |
98 |
[% ELSE %] |
99 |
<input type="checkbox" name="can_be_added_manually" id="can_be_added_manually" value="1" /> |
100 |
[% END %] |
101 |
</li> |
102 |
<li> |
103 |
<label for="branches">Libraries limitation: </label> |
104 |
<select id="branches" name="branches" multiple size="10"> |
105 |
<option value="">All libraries</option> |
106 |
[% FOREACH branch IN branches_loop %] |
107 |
[% IF ( branch.selected ) %] |
108 |
<option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
109 |
[% ELSE %] |
110 |
<option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
111 |
[% END %] |
112 |
[% END %] |
113 |
</select> |
114 |
<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> |
115 |
</li> |
116 |
</ol> |
117 |
</fieldset> |
118 |
|
119 |
<fieldset class="action"> |
120 |
<button id="save_debit_type" class="btn btn-default"><i class="fa fa-save"></i> Save</button> |
121 |
<a class="cancel btn-link" href="/cgi-bin/koha/admin/debit_types.pl"><i class="fa fa-times"></i> Cancel</a> |
122 |
</fieldset> |
123 |
</form> |
124 |
[% END %] |
125 |
|
126 |
[% IF op == 'delete_confirm' %] |
127 |
<div class="dialog alert"> |
128 |
<h3>Delete account [% type | html %] type "[% debit_type.description | html %]?"</h3> |
129 |
<table> |
130 |
<tr><th>Account type code</th> |
131 |
<td>[% debit_type.code | html %]</td> |
132 |
</tr> |
133 |
<tr><th>Account type description</th> |
134 |
<td>[% debit_type.description | html %]</td> |
135 |
</tr> |
136 |
</table> |
137 |
<form action="/cgi-bin/koha/admin/debit_types.pl" method="post"> |
138 |
<input type="hidden" name="op" value="delete_confirmed" /> |
139 |
<input type="hidden" name="code" value="[% debit_type.code | html %]" /> |
140 |
<input type="hidden" name="type" value="[% type | html %]" /> |
141 |
<button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button> |
142 |
</form> |
143 |
<form action="/cgi-bin/koha/admin/debit_types.pl" method="get"> |
144 |
<button type=submit" class="btn btn-default deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button> |
145 |
</form> |
146 |
</div> |
147 |
[% END %] |
148 |
|
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&type=debit"><i class="fa fa-plus"></i> New debit type</a> |
152 |
</div> |
153 |
|
154 |
<h3>Account debit types</h3> |
155 |
[% IF debit_types.count %] |
156 |
<table id="table_debit_types"> |
157 |
<thead> |
158 |
<th>Account type code</th> |
159 |
<th>Description</th> |
160 |
<th>Default amount</th> |
161 |
<th>Can be added manually</th> |
162 |
<th>Library limitations</th> |
163 |
<th>Actions</th> |
164 |
</thead> |
165 |
<tbody> |
166 |
[% FOREACH debit_type IN debit_types %] |
167 |
<tr> |
168 |
<td>[% debit_type.code | html %]</td> |
169 |
<td>[% debit_type.description | html %]</td> |
170 |
<td>[% debit_type.default_amount | $Price %]</td> |
171 |
<td>[% IF debit_type.can_be_added_manually %]Yes[% ELSE %]No[% END %]</td> |
172 |
<td> |
173 |
[% IF debit_type.library_limits.count > 0 %] |
174 |
[% library_limits_str = "" %] |
175 |
[% FOREACH library IN debit_type.library_limits %] |
176 |
[%- IF loop.first -%] |
177 |
[% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %] |
178 |
[% ELSE %] |
179 |
[% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] |
180 |
[% END %] |
181 |
[% END %] |
182 |
<span class="library_limitation" title="[% library_limits_str | html %]"> |
183 |
[% IF debit_type.library_limits.count > 1 %] |
184 |
[% debit_type.library_limits.count | html %] library limitations |
185 |
[% ELSE %] |
186 |
[% debit_type.library_limits.count | html %] library limitation |
187 |
[% END %] |
188 |
[% ELSE %] |
189 |
No limitation |
190 |
[% END %] |
191 |
</td> |
192 |
<td class="actions"> |
193 |
[% IF !debit_type.is_system %] |
194 |
<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> |
195 |
<a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=delete_confirm&code=[% debit_type.code | uri %]&type=debit"><i class="fa fa-trash"></i> Delete</a> |
196 |
[% END %] |
197 |
</td> |
198 |
</tr> |
199 |
[% END %] |
200 |
</tbody> |
201 |
</table> |
202 |
[% ELSE %] |
203 |
<div class="dialog message"> |
204 |
There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&type=debit">Create new debit type</a> |
205 |
</div> |
206 |
[% END %] |
207 |
[% END %] |
208 |
</main> |
209 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
210 |
|
211 |
<div class="col-sm-2 col-sm-pull-10"> |
212 |
<aside> |
213 |
[% INCLUDE 'admin-menu.inc' %] |
214 |
</aside> |
215 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
216 |
</div> <!-- /.row --> |
217 |
|
218 |
[% MACRO jsinclude BLOCK %] |
219 |
[% Asset.js("js/admin-menu.js") | $raw %] |
220 |
[% INCLUDE 'datatables.inc' %] |
221 |
|
222 |
<script> |
223 |
$(document).ready(function() { |
224 |
$("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, { |
225 |
"aoColumnDefs": [ |
226 |
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, |
227 |
], |
228 |
"aaSorting": [[ 1, "asc" ]], |
229 |
"iDisplayLength": 10, |
230 |
"sPaginationType": "full_numbers" |
231 |
})); |
232 |
}); |
233 |
</script> |
234 |
[% END %] |
235 |
|
236 |
[% INCLUDE 'intranet-bottom.inc' %] |