|
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 |
Debit types › |
| 10 |
[% IF debit_type.code %] |
| 11 |
Modify debit type |
| 12 |
[% ELSE %] |
| 13 |
New debit type |
| 14 |
[% END %] |
| 15 |
[% ELSE %] |
| 16 |
[% IF op == 'delete_confirm' %] |
| 17 |
Debit types › Confirm deletion of debit type |
| 18 |
[% ELSE %] |
| 19 |
Debit 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">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 |
| 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 | html %]"> |
| 48 |
[% SWITCH m.code %] |
| 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. |
| 57 |
[% CASE %] |
| 58 |
[% m.code | html %] |
| 59 |
[% END %] |
| 60 |
</div> |
| 61 |
[% END %] |
| 62 |
|
| 63 |
[% IF op == 'add_form' %] |
| 64 |
[% IF debit_type %] |
| 65 |
<h3>Modify a debit type</h3> |
| 66 |
[% ELSE %] |
| 67 |
<h3>New debit 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 | html %]" /> |
| 73 |
<fieldset class="rows"> |
| 74 |
<ol> |
| 75 |
<li> |
| 76 |
<label for="code" class="required">Debit type code: </label> |
| 77 |
[% IF debit_type %] |
| 78 |
<strong>[% debit_type.code | html %]</strong> |
| 79 |
<input type="hidden" name="code" value="[% code | html %]" /> |
| 80 |
[% ELSE %] |
| 81 |
<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> |
| 82 |
[% END %] |
| 83 |
</li> |
| 84 |
<li> |
| 85 |
<label for="default_amount">Default amount: </label> |
| 86 |
<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"/> |
| 87 |
</li> |
| 88 |
<li> |
| 89 |
<label for="description" class="required">Description: </label> |
| 90 |
<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> |
| 91 |
</li> |
| 92 |
<li> |
| 93 |
<label for="can_be_added_manually">Can be added manually? </label> |
| 94 |
[% IF debit_type.can_be_added_manually %] |
| 95 |
<input type="checkbox" name="can_be_added_manually" id="can_be_added_manually" checked="checked" value="1" /> |
| 96 |
[% ELSE %] |
| 97 |
<input type="checkbox" name="can_be_added_manually" id="can_be_added_manually" value="1" /> |
| 98 |
[% END %] |
| 99 |
</li> |
| 100 |
<li> |
| 101 |
<label for="branches">Libraries limitation: </label> |
| 102 |
<select id="branches" name="branches" multiple size="10"> |
| 103 |
<option value="">All libraries</option> |
| 104 |
[% FOREACH branch IN branches_loop %] |
| 105 |
[% IF ( branch.selected ) %] |
| 106 |
<option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
| 107 |
[% ELSE %] |
| 108 |
<option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
| 109 |
[% END %] |
| 110 |
[% END %] |
| 111 |
</select> |
| 112 |
<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> |
| 113 |
</li> |
| 114 |
</ol> |
| 115 |
</fieldset> |
| 116 |
|
| 117 |
<fieldset class="action"> |
| 118 |
<button id="save_debit_type" class="btn btn-default"><i class="fa fa-save"></i> Save</button> |
| 119 |
<a class="cancel btn-link" href="/cgi-bin/koha/admin/debit_types.pl"><i class="fa fa-times"></i> Cancel</a> |
| 120 |
</fieldset> |
| 121 |
</form> |
| 122 |
[% END %] |
| 123 |
|
| 124 |
[% IF op == 'delete_confirm' %] |
| 125 |
<div class="dialog alert"> |
| 126 |
<h3>Delete debit type "[% debit_type.description | html %]?"</h3> |
| 127 |
<table> |
| 128 |
<tr><th>Debit type code</th> |
| 129 |
<td>[% debit_type.code | html %]</td> |
| 130 |
</tr> |
| 131 |
<tr><th>Debit type description</th> |
| 132 |
<td>[% debit_type.description | html %]</td> |
| 133 |
</tr> |
| 134 |
</table> |
| 135 |
<form action="/cgi-bin/koha/admin/debit_types.pl" method="post"> |
| 136 |
<input type="hidden" name="op" value="delete_confirmed" /> |
| 137 |
<input type="hidden" name="code" value="[% debit_type.code | html %]" /> |
| 138 |
<input type="hidden" name="type" value="[% type | html %]" /> |
| 139 |
<button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button> |
| 140 |
</form> |
| 141 |
<form action="/cgi-bin/koha/admin/debit_types.pl" method="get"> |
| 142 |
<button type=submit" class="btn btn-default deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button> |
| 143 |
</form> |
| 144 |
</div> |
| 145 |
[% END %] |
| 146 |
|
| 147 |
[% IF op == 'list' %] |
| 148 |
<div id="toolbar" class="btn-toolbar"> |
| 149 |
<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> |
| 150 |
</div> |
| 151 |
|
| 152 |
<h3>Account debit types</h3> |
| 153 |
[% IF debit_types.count %] |
| 154 |
<table id="table_debit_types"> |
| 155 |
<thead> |
| 156 |
<th>Code</th> |
| 157 |
<th>Description</th> |
| 158 |
<th>Default amount</th> |
| 159 |
<th>Can be added manually</th> |
| 160 |
<th>Library limitations</th> |
| 161 |
<th>Actions</th> |
| 162 |
</thead> |
| 163 |
<tbody> |
| 164 |
[% FOREACH debit_type IN debit_types %] |
| 165 |
<tr> |
| 166 |
<td>[% debit_type.code | html %]</td> |
| 167 |
<td>[% debit_type.description | html %]</td> |
| 168 |
<td>[% debit_type.default_amount | $Price %]</td> |
| 169 |
<td>[% IF debit_type.can_be_added_manually %]Yes[% ELSE %]No[% END %]</td> |
| 170 |
<td> |
| 171 |
[% IF debit_type.library_limits.count > 0 %] |
| 172 |
[% library_limits_str = "" %] |
| 173 |
[% FOREACH library IN debit_type.library_limits %] |
| 174 |
[%- IF loop.first -%] |
| 175 |
[% library_limits_str = library.branchname _ " (" _ library.branchcode _ ")" %] |
| 176 |
[% ELSE %] |
| 177 |
[% library_limits_str = library_limits_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] |
| 178 |
[% END %] |
| 179 |
[% END %] |
| 180 |
<span class="library_limitation" title="[% library_limits_str | html %]"> |
| 181 |
[% IF debit_type.library_limits.count > 1 %] |
| 182 |
[% debit_type.library_limits.count | html %] library limitations |
| 183 |
[% ELSE %] |
| 184 |
[% debit_type.library_limits.count | html %] library limitation |
| 185 |
[% END %] |
| 186 |
[% ELSE %] |
| 187 |
No limitation |
| 188 |
[% END %] |
| 189 |
</td> |
| 190 |
<td class="actions"> |
| 191 |
[% IF !debit_type.is_system %] |
| 192 |
<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> |
| 193 |
<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> |
| 194 |
[% END %] |
| 195 |
</td> |
| 196 |
</tr> |
| 197 |
[% END %] |
| 198 |
</tbody> |
| 199 |
</table> |
| 200 |
[% ELSE %] |
| 201 |
<div class="dialog message"> |
| 202 |
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> |
| 203 |
</div> |
| 204 |
[% END %] |
| 205 |
[% END %] |
| 206 |
</main> |
| 207 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
| 208 |
|
| 209 |
<div class="col-sm-2 col-sm-pull-10"> |
| 210 |
<aside> |
| 211 |
[% INCLUDE 'admin-menu.inc' %] |
| 212 |
</aside> |
| 213 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
| 214 |
</div> <!-- /.row --> |
| 215 |
|
| 216 |
[% MACRO jsinclude BLOCK %] |
| 217 |
[% Asset.js("js/admin-menu.js") | $raw %] |
| 218 |
[% INCLUDE 'datatables.inc' %] |
| 219 |
|
| 220 |
<script> |
| 221 |
$(document).ready(function() { |
| 222 |
$("#table_debit_types").dataTable($.extend(true, {}, dataTablesDefaults, { |
| 223 |
"aoColumnDefs": [ |
| 224 |
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, |
| 225 |
], |
| 226 |
"aaSorting": [[ 1, "asc" ]], |
| 227 |
"iDisplayLength": 10, |
| 228 |
"sPaginationType": "full_numbers" |
| 229 |
})); |
| 230 |
}); |
| 231 |
</script> |
| 232 |
[% END %] |
| 233 |
|
| 234 |
[% INCLUDE 'intranet-bottom.inc' %] |