|
Lines 7-26
Link Here
|
| 7 |
[% SET footerjs = 1 %] |
7 |
[% SET footerjs = 1 %] |
| 8 |
[% PROCESS 'accounts.inc' %] |
8 |
[% PROCESS 'accounts.inc' %] |
| 9 |
[% INCLUDE 'doc-head-open.inc' %] |
9 |
[% INCLUDE 'doc-head-open.inc' %] |
| 10 |
<title |
10 |
<title>[% FILTER collapse %] |
| 11 |
>[% FILTER collapse %] |
11 |
[% IF op =='add_form' %] |
| 12 |
[% IF op =='add_form' %] |
12 |
[% IF debit_type.code %] |
| 13 |
[% IF debit_type.code %] |
13 |
[% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %] |
| 14 |
[% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %] |
14 |
[% ELSE %] |
| 15 |
[% ELSE %] |
15 |
[% t("New debit type") | html %] |
| 16 |
[% t("New debit type") | html %] |
16 |
[% END %] › |
| 17 |
[% END %] |
17 |
[% END %] |
| 18 |
› |
18 |
[% t("Debit types") | html %] › |
| 19 |
[% END %] |
19 |
[% t("Administration") | html %] › |
| 20 |
[% t("Debit types") | html %] |
20 |
[% t("Koha") | html %] |
| 21 |
› [% t("Administration") | html %] › [% t("Koha") | html %] |
21 |
[% END %]</title> |
| 22 |
[% END %]</title |
|
|
| 23 |
> |
| 24 |
[% INCLUDE 'doc-head-close.inc' %] |
22 |
[% INCLUDE 'doc-head-close.inc' %] |
| 25 |
</head> |
23 |
</head> |
| 26 |
|
24 |
|
|
Lines 46-51
Link Here
|
| 46 |
<span>New debit type</span> |
44 |
<span>New debit type</span> |
| 47 |
[% END %] |
45 |
[% END %] |
| 48 |
[% END %] |
46 |
[% END %] |
|
|
47 |
|
| 49 |
[% ELSE %] |
48 |
[% ELSE %] |
| 50 |
[% WRAPPER breadcrumb_item bc_active= 1 %] |
49 |
[% WRAPPER breadcrumb_item bc_active= 1 %] |
| 51 |
<span>Debit types</span> |
50 |
<span>Debit types</span> |
|
Lines 56-296
Link Here
|
| 56 |
|
55 |
|
| 57 |
[% WRAPPER 'main-container.inc' aside='admin-menu' %] |
56 |
[% WRAPPER 'main-container.inc' aside='admin-menu' %] |
| 58 |
|
57 |
|
| 59 |
[% FOREACH m IN messages %] |
58 |
[% FOREACH m IN messages %] |
| 60 |
<div class="alert alert-[% m.type | html %]"> |
59 |
<div class="alert alert-[% m.type | html %]"> |
| 61 |
[% SWITCH m.code %] |
60 |
[% SWITCH m.code %] |
| 62 |
[% CASE 'success_on_saving' %] |
61 |
[% CASE 'success_on_saving' %] |
| 63 |
<span>Debit type saved successfully.</span> |
62 |
<span>Debit type saved successfully.</span> |
| 64 |
[% CASE 'error_on_saving' %] |
63 |
[% CASE 'error_on_saving' %] |
| 65 |
<span>An error occurred when saving this debit type. Check the logs for details.</span> |
64 |
<span>An error occurred when saving this debit type. Check the logs for details.</span> |
| 66 |
[% CASE 'success_on_archive' %] |
65 |
[% CASE 'success_on_archive' %] |
| 67 |
<span>Debit type archived successfully.</span> |
66 |
<span>Debit type archived successfully.</span> |
| 68 |
[% CASE 'success_on_restore' %] |
67 |
[% CASE 'success_on_restore' %] |
| 69 |
<span>Debit type restored successfully.</span> |
68 |
<span>Debit type restored successfully.</span> |
| 70 |
[% CASE %] |
69 |
[% CASE %] |
| 71 |
<span>[% m.code | html %]</span> |
70 |
<span>[% m.code | html %]</span> |
| 72 |
[% END %] |
71 |
[% END %] |
| 73 |
</div> |
72 |
</div> |
| 74 |
[% END %] |
73 |
[% END %] |
| 75 |
|
|
|
| 76 |
[% IF op == 'add_form' %] |
| 77 |
[% IF debit_type %] |
| 78 |
<h1>[% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %]</h1> |
| 79 |
[% ELSE %] |
| 80 |
<h1>New debit type</h1> |
| 81 |
[% END %] |
| 82 |
|
| 83 |
<form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated"> |
| 84 |
[% INCLUDE 'csrf-token.inc' %] |
| 85 |
<input type="hidden" name="op" value="cud-add_validate" /> |
| 86 |
<fieldset class="rows"> |
| 87 |
<ol> |
| 88 |
<li> |
| 89 |
<label for="code" class="required">Debit type code: </label> |
| 90 |
[% IF debit_type %] |
| 91 |
<strong>[% debit_type.code | html %]</strong> |
| 92 |
<input type="hidden" name="code" value="[% code | html %]" /> |
| 93 |
[% ELSE %] |
| 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> |
| 95 |
[% END %] |
| 96 |
</li> |
| 97 |
<li> |
| 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" /> |
| 100 |
</li> |
| 101 |
<li> |
| 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> |
| 105 |
[% ELSE %] |
| 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> |
| 107 |
[% END %] |
| 108 |
</li> |
| 109 |
<li> |
| 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" /> |
| 113 |
[% ELSE %] |
| 114 |
<input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" value="1" /> |
| 115 |
[% END %] |
| 116 |
</li> |
| 117 |
<li> |
| 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" /> |
| 121 |
[% ELSE %] |
| 122 |
<input type="checkbox" name="can_be_sold" id="can_be_sold" value="1" /> |
| 123 |
[% END %] |
| 124 |
</li> |
| 125 |
<li> |
| 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" /> |
| 129 |
[% ELSE %] |
| 130 |
<input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" value="1" /> |
| 131 |
[% END %] |
| 132 |
</li> |
| 133 |
<li> |
| 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> |
| 140 |
[% ELSE %] |
| 141 |
<option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
| 142 |
[% END %] |
| 143 |
[% END %] |
| 144 |
</select> |
| 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> |
| 146 |
</li> |
| 147 |
</ol> |
| 148 |
</fieldset> |
| 149 |
|
| 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> |
| 153 |
</fieldset> |
| 154 |
</form> |
| 155 |
[% END %] |
| 156 |
|
74 |
|
| 157 |
[% IF op == 'list' %] |
75 |
[% IF op == 'add_form' %] |
| 158 |
<div id="toolbar" class="btn-toolbar"> |
76 |
[% IF debit_type %] |
| 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> |
77 |
<h1>[% tx("Modify debit type '{debit_type}'", { debit_type = debit_type.code }) | html %]</h1> |
| 160 |
</div> |
78 |
[% ELSE %] |
|
|
79 |
<h1>New debit type</h1> |
| 80 |
[% END %] |
| 161 |
|
81 |
|
| 162 |
<h1>Debit types</h1> |
82 |
<form action="/cgi-bin/koha/admin/debit_types.pl" name="Aform" method="post" class="validated"> |
| 163 |
[% IF debit_types.count %] |
83 |
[% INCLUDE 'csrf-token.inc' %] |
| 164 |
<div class="page-section"> |
84 |
<input type="hidden" name="op" value="cud-add_validate" /> |
| 165 |
<table id="table_debit_types"> |
85 |
<fieldset class="rows"> |
| 166 |
<thead> |
86 |
<ol> |
| 167 |
<th>Archived</th> |
87 |
<li> |
| 168 |
<th>System</th> |
88 |
<label for="code" class="required">Debit type code: </label> |
| 169 |
<th>Code</th> |
89 |
[% IF debit_type %] |
| 170 |
<th>Description</th> |
90 |
<strong>[% debit_type.code | html %]</strong> |
| 171 |
<th>Default amount</th> |
91 |
<input type="hidden" name="code" value="[% code | html %]" /> |
| 172 |
<th>Available for</th> |
92 |
[% ELSE %] |
| 173 |
<th>Library limitations</th> |
93 |
<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> |
| 174 |
<th>Blocks checkouts?</th> |
|
|
| 175 |
<th class="noExport">Actions</th> |
| 176 |
</thead> |
| 177 |
<tbody> |
| 178 |
[% FOREACH debit_type IN debit_types %] |
| 179 |
<tr> |
| 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 |
| 186 |
>[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %] |
| 187 |
<i class="fa fa-id-card"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale |
| 188 |
[% ELSIF debit_type.can_be_invoiced %] |
| 189 |
<i class="fa fa-id-card"></i> Invoicing |
| 190 |
[% ELSIF debit_type.can_be_sold %] |
| 191 |
<i class="fa fa-shopping-cart"></i> Sale |
| 192 |
[% END %] |
94 |
[% END %] |
| 193 |
</td> |
95 |
</li> |
| 194 |
<td> |
96 |
<li> |
| 195 |
[% IF debit_type.library_limits.count > 0 %] |
97 |
<label for="default_amount">Default amount: </label> |
| 196 |
[% library_limits_str = "" %] |
98 |
<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"/> |
| 197 |
[% FOREACH library IN debit_type.library_limits %] |
99 |
</li> |
| 198 |
[%- IF loop.first -%] |
100 |
<li> |
| 199 |
[% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %] |
101 |
<label for="description" class="required">Description: </label> |
| 200 |
[% ELSE %] |
102 |
[% IF debit_type && debit_type.is_system %] |
| 201 |
[% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] |
103 |
<span>[%- PROCESS debit_type_description debit_type = debit_type -%]</span> |
| 202 |
[% END %] |
104 |
[% ELSE %] |
| 203 |
[% END %] |
105 |
<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> |
| 204 |
<span class="library_limitation" title="[% library_limits_str | html %]"> |
106 |
[% END %] |
| 205 |
[% IF debit_type.library_limits.count > 1 %] |
107 |
</li> |
| 206 |
<span>[% debit_type.library_limits.count | html %] library limitations</span> |
108 |
<li> |
| 207 |
[% ELSE %] |
109 |
<label for="can_be_invoiced">Can be manually invoiced? </label> |
| 208 |
<span>[% debit_type.library_limits.count | html %] library limitation</span> |
110 |
[% IF debit_type.can_be_invoiced %] |
| 209 |
[% END %] |
111 |
<input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" checked="checked" value="1" /> |
| 210 |
</span> |
|
|
| 211 |
[% ELSE %] |
112 |
[% ELSE %] |
| 212 |
<span>No limitation</span> |
113 |
<input type="checkbox" name="can_be_invoiced" id="can_be_invoiced" value="1" /> |
| 213 |
[% END %] |
114 |
[% END %] |
| 214 |
</td> |
115 |
</li> |
| 215 |
<td> |
116 |
<li> |
|
|
117 |
<label for="can_be_sold">Can be sold? </label> |
| 118 |
[% IF debit_type.can_be_sold %] |
| 119 |
<input type="checkbox" name="can_be_sold" id="can_be_sold" checked="checked" value="1" /> |
| 120 |
[% ELSE %] |
| 121 |
<input type="checkbox" name="can_be_sold" id="can_be_sold" value="1" /> |
| 122 |
[% END %] |
| 123 |
</li> |
| 124 |
<li> |
| 125 |
<label for="restricts_checkouts">Included in noissuescharge? </label> |
| 216 |
[% IF debit_type.restricts_checkouts %] |
126 |
[% IF debit_type.restricts_checkouts %] |
| 217 |
<span>Yes</span> |
127 |
<input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" checked="checked" value="1" /> |
| 218 |
[% ELSE %] |
128 |
[% ELSE %] |
| 219 |
<span>No</span> |
129 |
<input type="checkbox" name="restricts_checkouts" id="restricts_checkouts" value="1" /> |
| 220 |
[% END %] |
130 |
[% END %] |
| 221 |
</td> |
131 |
</li> |
| 222 |
<td class="actions"> |
132 |
<li> |
| 223 |
[% IF !debit_type.archived %] |
133 |
<label for="branches">Libraries limitation: </label> |
| 224 |
<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> |
134 |
<select id="branches" name="branches" multiple size="10"> |
| 225 |
[% IF !debit_type.is_system %] |
135 |
<option value="">All libraries</option> |
| 226 |
<form id="archive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl"> |
136 |
[% FOREACH branch IN branches_loop %] |
| 227 |
[% INCLUDE 'csrf-token.inc' %] |
137 |
[% IF ( branch.selected ) %] |
| 228 |
<input type="hidden" name="op" value="cud-archive" /> |
138 |
<option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
| 229 |
<input type="hidden" name="code" value="[% debit_type.code | html %]" /> |
139 |
[% ELSE %] |
| 230 |
<button type="submit" class="btn btn-default btn-xs archive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-archive"></i> Archive</button> |
140 |
<option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
| 231 |
</form> |
|
|
| 232 |
[% END %] |
141 |
[% END %] |
| 233 |
[% ELSIF debit_type.archived %] |
142 |
[% END %] |
| 234 |
<form id="unarchive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl"> |
143 |
</select> |
| 235 |
[% INCLUDE 'csrf-token.inc' %] |
144 |
<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> |
| 236 |
<input type="hidden" name="op" value="cud-unarchive" /> |
145 |
</li> |
| 237 |
<input type="hidden" name="code" value="[% debit_type.code | html %]" /> |
146 |
</ol> |
| 238 |
<button type="submit" class="btn btn-default btn-xs unarchive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-undo"></i> Restore</button> |
147 |
</fieldset> |
| 239 |
</form> |
148 |
[% IF additional_fields.size %] |
| 240 |
[% END %] |
149 |
[% INCLUDE 'additional-fields-entry.inc' available=additional_fields values=additional_field_values wrap_fieldset=1 %] |
| 241 |
</td> |
|
|
| 242 |
</tr> |
| 243 |
[% END %] |
150 |
[% END %] |
| 244 |
</tbody> |
151 |
<fieldset class="action"> |
| 245 |
</table> </div |
152 |
<button id="save_debit_type" class="btn btn-primary">Save</button> |
| 246 |
><!-- /.page-section --> |
153 |
<a class="cancel" href="/cgi-bin/koha/admin/debit_types.pl">Cancel</a> |
| 247 |
[% ELSE %] |
154 |
</fieldset> |
| 248 |
<div class="alert alert-info"> There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new debit type</a> </div> |
155 |
</form> |
| 249 |
[% END %] |
156 |
[% END %] |
| 250 |
[% END %] |
157 |
|
|
|
158 |
[% IF op == 'list' %] |
| 159 |
<div id="toolbar" class="btn-toolbar"> |
| 160 |
<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> |
| 161 |
</div> |
| 162 |
|
| 163 |
<h1>Debit types</h1> |
| 164 |
[% IF debit_types.count %] |
| 165 |
<div class="page-section"> |
| 166 |
<table id="table_debit_types"> |
| 167 |
<thead> |
| 168 |
<th>Archived</th> |
| 169 |
<th>System</th> |
| 170 |
<th>Code</th> |
| 171 |
<th>Description</th> |
| 172 |
<th>Default amount</th> |
| 173 |
<th>Available for</th> |
| 174 |
<th>Library limitations</th> |
| 175 |
<th>Blocks checkouts?</th> |
| 176 |
<th class="noExport">Actions</th> |
| 177 |
</thead> |
| 178 |
<tbody> |
| 179 |
[% FOREACH debit_type IN debit_types %] |
| 180 |
<tr> |
| 181 |
<td>[% debit_type.archived | html %]</td> |
| 182 |
<td>[% debit_type.is_system | html %]</td> |
| 183 |
<td>[% debit_type.code | html %]</td> |
| 184 |
<td>[%- PROCESS debit_type_description debit_type = debit_type -%]</td> |
| 185 |
<td>[% debit_type.default_amount | $Price %]</td> |
| 186 |
<td>[% IF debit_type.can_be_invoiced && debit_type.can_be_sold %] |
| 187 |
<i class="fa fa-id-card"></i> Invoicing, <i class="fa fa-shopping-cart"></i> Sale |
| 188 |
[% ELSIF debit_type.can_be_invoiced %] |
| 189 |
<i class="fa fa-id-card"></i> Invoicing |
| 190 |
[% ELSIF debit_type.can_be_sold %] |
| 191 |
<i class="fa fa-shopping-cart"></i> Sale |
| 192 |
[% END %] |
| 193 |
</td> |
| 194 |
<td> |
| 195 |
[% IF debit_type.library_limits.count > 0 %] |
| 196 |
[% library_limits_str = "" %] |
| 197 |
[% FOREACH library IN debit_type.library_limits %] |
| 198 |
[%- IF loop.first -%] |
| 199 |
[% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %] |
| 200 |
[% ELSE %] |
| 201 |
[% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] |
| 202 |
[% END %] |
| 203 |
[% END %] |
| 204 |
<span class="library_limitation" title="[% library_limits_str | html %]"> |
| 205 |
[% IF debit_type.library_limits.count > 1 %] |
| 206 |
<span>[% debit_type.library_limits.count | html %] library limitations</span> |
| 207 |
[% ELSE %] |
| 208 |
<span>[% debit_type.library_limits.count | html %] library limitation</span> |
| 209 |
[% END %] |
| 210 |
[% ELSE %] |
| 211 |
<span>No limitation</span> |
| 212 |
[% END %] |
| 213 |
</td> |
| 214 |
<td> |
| 215 |
[% IF debit_type.restricts_checkouts %] |
| 216 |
<span>Yes</span> |
| 217 |
[% ELSE %] |
| 218 |
<span>No</span> |
| 219 |
[% END %] |
| 220 |
</td> |
| 221 |
<td class="actions"> |
| 222 |
[% IF !debit_type.archived %] |
| 223 |
<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> |
| 224 |
[% IF !debit_type.is_system %] |
| 225 |
<form id="archive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl"> |
| 226 |
[% INCLUDE 'csrf-token.inc' %] |
| 227 |
<input type="hidden" name="op" value="cud-archive" /> |
| 228 |
<input type="hidden" name="code" value="[% debit_type.code | html %]" /> |
| 229 |
<button type="submit" class="btn btn-default btn-xs archive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-archive"></i> Archive</button> |
| 230 |
</form> |
| 231 |
[% END %] |
| 232 |
[% ELSIF debit_type.archived %] |
| 233 |
<form id="unarchive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl"> |
| 234 |
[% INCLUDE 'csrf-token.inc' %] |
| 235 |
<input type="hidden" name="op" value="cud-unarchive" /> |
| 236 |
<input type="hidden" name="code" value="[% debit_type.code | html %]" /> |
| 237 |
<button type="submit" class="btn btn-default btn-xs unarchive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-undo"></i> Restore</button> |
| 238 |
</form> |
| 239 |
[% END %] |
| 240 |
</td> |
| 241 |
</tr> |
| 242 |
[% END %] |
| 243 |
</tbody> |
| 244 |
</table> |
| 245 |
</div><!-- /.page-section --> |
| 246 |
[% ELSE %] |
| 247 |
<div class="alert alert-info"> |
| 248 |
There are no account debit types defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new debit type</a> |
| 249 |
</div> |
| 250 |
[% END %] |
| 251 |
[% END %] |
| 251 |
[% END %] |
252 |
[% END %] |
| 252 |
|
253 |
|
| 253 |
[% MACRO jsinclude BLOCK %] |
254 |
[% MACRO jsinclude BLOCK %] |
| 254 |
[% Asset.js("js/admin-menu.js") | $raw %] |
255 |
[% Asset.js("js/admin-menu.js") | $raw %] |
|
|
256 |
[% Asset.js("js/additional-fields-entry.js") | $raw %] |
| 255 |
[% INCLUDE 'datatables.inc' %] |
257 |
[% INCLUDE 'datatables.inc' %] |
|
|
258 |
|
| 256 |
<script> |
259 |
<script> |
| 257 |
$(document).ready(function () { |
260 |
$(document).ready(function() { |
| 258 |
var txtActivefilter = _("Filter system debit types"); |
261 |
var txtActivefilter = _("Filter system debit types"); |
| 259 |
var txtInactivefilter = _("Show all debit types"); |
262 |
var txtInactivefilter = _("Show all debit types"); |
| 260 |
var table_debit_types = $("#table_debit_types").dataTable( |
263 |
var table_debit_types = $("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 261 |
$.extend(true, {}, dataTablesDefaults, { |
264 |
"columnDefs": [ |
| 262 |
columnDefs: [ |
265 |
{ "targets": [ -1 ], "orderable": false, "searchable": false }, |
| 263 |
{ targets: [-1], orderable: false, searchable: false }, |
266 |
{ "targets": [ 0, 1 ], "orderable": false, "visible": false }, |
| 264 |
{ targets: [0, 1], orderable: false, visible: false }, |
267 |
], |
| 265 |
], |
268 |
"order": [[ 0, "asc" ],[ 2, "asc" ]], |
| 266 |
order: [ |
269 |
"dom": 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', |
| 267 |
[0, "asc"], |
270 |
"pageLength": 20, |
| 268 |
[2, "asc"], |
271 |
"pagingType": "full_numbers" |
| 269 |
], |
272 |
})); |
| 270 |
dom: 'C<"top pager"ilpfB><"#filter_s">tr<"bottom pager"ip>', |
273 |
$("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> '+txtActivefilter+'</a>'); |
| 271 |
pageLength: 20, |
274 |
$('#filter_system').click(function(e) { |
| 272 |
pagingType: "full_numbers", |
|
|
| 273 |
}) |
| 274 |
); |
| 275 |
$("#filter_s").html('<p><a href="#" id="filter_system"><i class="fa fa-filter"></i> ' + txtActivefilter + "</a>"); |
| 276 |
$("#filter_system").click(function (e) { |
| 277 |
e.preventDefault(); |
275 |
e.preventDefault(); |
| 278 |
if ($(this).hasClass("filtered")) { |
276 |
if ($(this).hasClass('filtered')) { |
| 279 |
var filteredValue = ""; |
277 |
var filteredValue = ''; |
| 280 |
$(this).html('<i class="fa fa-filter"></i> ' + txtActivefilter); |
278 |
$(this).html('<i class="fa fa-filter"></i> '+txtActivefilter); |
| 281 |
} else { |
279 |
} else { // Not filtered. Let's do it! |
| 282 |
// Not filtered. Let's do it! |
280 |
var filteredValue = '0'; |
| 283 |
var filteredValue = "0"; |
281 |
$(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter); |
| 284 |
$(this).html('<i class="fa fa-filter"></i> ' + txtInactivefilter); |
|
|
| 285 |
} |
282 |
} |
| 286 |
table_debit_types.DataTable().columns(1).search(filteredValue, false, false).draw(); |
283 |
table_debit_types.DataTable().columns(1).search(filteredValue, false, false).draw(); |
| 287 |
$(this).toggleClass("filtered"); |
284 |
$(this).toggleClass('filtered'); |
| 288 |
}); |
285 |
}); |
| 289 |
|
286 |
|
| 290 |
//Start filtered |
287 |
//Start filtered |
| 291 |
$("#filter_system").click(); |
288 |
$('#filter_system').click(); |
|
|
289 |
|
| 292 |
}); |
290 |
}); |
| 293 |
</script> |
291 |
</script> |
| 294 |
[% END %] |
292 |
[% END %] |
| 295 |
|
293 |
|
| 296 |
[% INCLUDE 'intranet-bottom.inc' %] |
294 |
[% INCLUDE 'intranet-bottom.inc' %] |
| 297 |
- |
|
|