Line 0
Link Here
|
0 |
- |
1 |
[% USE raw %] |
|
|
2 |
[% USE Asset %] |
3 |
[% SET footerjs = 1 %] |
4 |
[% USE ColumnsSettings %] |
5 |
[% INCLUDE 'doc-head-open.inc' %] |
6 |
<title>Koha › Administration › Cash Registers |
7 |
[% IF op == 'add_form' %] |
8 |
›[% IF cash_register %]Modify cash register[% ELSE %]New cash register [% cash_register.id | html %][% END %] |
9 |
[% ELSIF op == 'delete_confirm' %] |
10 |
› Confirm deletion of cash register '[% cash_register.id | html %]' |
11 |
[% END %] |
12 |
</title> |
13 |
[% INCLUDE 'doc-head-close.inc' %] |
14 |
</head> |
15 |
|
16 |
<body id="admin_cash_registers" class="admin"> |
17 |
[% INCLUDE 'header.inc' %] |
18 |
[% INCLUDE 'prefs-admin-search.inc' %] |
19 |
|
20 |
<div id="breadcrumbs"> |
21 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
22 |
› <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> |
23 |
› <a href="/cgi-bin/koha/admin/cash_registers.pl">Cash registers</a> |
24 |
[% IF op == 'add_form' %] |
25 |
› [% IF cash_register %]Modify cash register [% cash_register.id | html %][% ELSE %]New cash register[% END %] |
26 |
[% ELSIF op == 'delete_confirm' %] |
27 |
› Confirm deletion of cash register '[% cash_register.id | html %]' |
28 |
[% END %] |
29 |
</div> |
30 |
|
31 |
<div class="main container-fluid"> |
32 |
<div class="row"> |
33 |
<div class="col-sm-10 col-sm-push-2"> |
34 |
<main> |
35 |
|
36 |
[% FOREACH m IN messages %] |
37 |
<div class="dialog [% m.type | html %]"> |
38 |
[% SWITCH m.code %] |
39 |
[% CASE 'error_on_update' %] |
40 |
An error occurred when updating this cash register. |
41 |
[% CASE 'error_on_insert' %] |
42 |
An error occurred when adding this cash register. |
43 |
[% CASE 'success_on_update' %] |
44 |
Cash register updated successfully. |
45 |
[% CASE 'success_on_insert' %] |
46 |
Cash register added successfully. |
47 |
[% CASE 'success_on_archive' %] |
48 |
Cash register archived successfully. |
49 |
[% CASE 'success_on_restore' %] |
50 |
Cash register restored successfully. |
51 |
[% CASE 'success_on_delete' %] |
52 |
Cash register deleted successfully. |
53 |
[% CASE %] |
54 |
[% m.code | html %] |
55 |
[% END %] |
56 |
</div> |
57 |
[% END %] |
58 |
|
59 |
[% IF op == 'add_form' %] |
60 |
<h3>[% IF cash_register %]Modify cash register[% ELSE %]Add new cash_register[% END %]</h3> |
61 |
<form action="/cgi-bin/koha/admin/cash_registers.pl" id="Aform" name="Aform" class="validated" method="post"> |
62 |
|
63 |
<fieldset class="rows"> |
64 |
<input type="hidden" name="op" value="add_validate" /> |
65 |
<ol> |
66 |
[% IF cash_register %] |
67 |
<li> |
68 |
<span class="label">Cash Register ID: </span>[% cash_register.id | html %] |
69 |
<input type="hidden" name="id" value="[% cash_register.id %]" /> |
70 |
</li> |
71 |
[% END %] |
72 |
|
73 |
<li> |
74 |
<label for="name" class="required">Name: </label> |
75 |
<input type="text" name="name" id="name" size="80" value="[% cash_register.name | html %]" class="required" /> |
76 |
<span class="required">Required</span> |
77 |
</li> |
78 |
|
79 |
<li> |
80 |
<label for="description">Description: </label> |
81 |
<input type="text" name="description" id="description" value="[% cash_register.description %]"/> |
82 |
</li> |
83 |
<li> |
84 |
<label for="branch">Branch: </label> |
85 |
<select id="branch" name="branch"> |
86 |
[% FOREACH branch IN branch_list %] |
87 |
[% IF cash_register.branch == branch.branchcode %] |
88 |
<option value="[% branch.branchcode %]" selected="1">[% branch.branchname %]</option> |
89 |
[% ELSE %] |
90 |
<option value="[% branch.branchcode %]">[% branch.branchname %]</option> |
91 |
[% END %] |
92 |
[% END %] |
93 |
</select> |
94 |
</li> |
95 |
|
96 |
<li> |
97 |
<label for="starting_float">Initial float: </label> |
98 |
<input type="text" pattern='^\d+(?:\.\d{0,2})$' name="starting_float" id="starting_float" value="[% cash_register.starting_float %]" /> |
99 |
</li> |
100 |
</ol> |
101 |
</fieldset> |
102 |
|
103 |
<fieldset class="action"> |
104 |
[% IF cash_register %] |
105 |
<input type="submit" value="Save" /> |
106 |
[% ELSE %] |
107 |
<input type="submit" value="Add" /> |
108 |
[% END %] |
109 |
<a class=cancel" href="/cgi-bin/koha/admin/cash_registers.pl?op=list">Cancel</a> |
110 |
</fieldset> |
111 |
</form> |
112 |
[% END %] |
113 |
|
114 |
[% IF op == 'list' %] |
115 |
<div id="toolbar" class="btn-toolbar"> |
116 |
<a class="btn btn-default" id="newcashregister" href="/cgi-bin/koha/admin/cash_registers.pl?op=add_form"><i class="fa fa-plus"></i> New cash register</a> |
117 |
</div> |
118 |
|
119 |
<h3>Cash Registers</h3> |
120 |
[% IF cash_registers.count %] |
121 |
<table id="table_cash_registers"> |
122 |
<thead> |
123 |
<th>Id</th> |
124 |
<th>Name</th> |
125 |
<th>Description</th> |
126 |
<th>Branch</th> |
127 |
<th>Initial float</th> |
128 |
<th>Actions</th> |
129 |
</thead> |
130 |
<tbody> |
131 |
[% FOREACH cash_register IN cash_registers %] |
132 |
<tr> |
133 |
<td>[% cash_register.id %]</td> |
134 |
<td>[% cash_register.name %]</td> |
135 |
<td>[% cash_register.description %]</td> |
136 |
<td>[% cash_register.library.branchname %]</td> |
137 |
<td>[% cash_register.starting_float %]</td> |
138 |
[% IF cash_register.archived == '0' %] |
139 |
<td class="actions"><a class="btn btn-default btn-xs" href="cash_registers.pl?op=add_form&id=[% cash_register.id | uri %]"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs" href="cash_registers.pl?op=archive&id=[% cash_register.id %]"><i class="fa fa-archive"></i> Archive</a></td> |
140 |
[% ELSE %] |
141 |
<td class="actions"><a class="btn btn-default btn-xs" href="cash_registers.pl?op=unarchive&id=[% cash_register.id %]"><i class="fa fa-trash-restore"></i> Restore</a></td> |
142 |
[% END %] |
143 |
</tr> |
144 |
[% END %] |
145 |
</tbody> |
146 |
</table> |
147 |
[% ELSE %] |
148 |
<div class="dialog message">There are no cash registers defined. <a href="/cgi-bin/koha/admin/cash_registers.pl?op=add_form">Start adding cash registers</a>.</div> |
149 |
[% END # /cash_register.count %] |
150 |
[% END # /op == 'list' %] |
151 |
</main> |
152 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
153 |
|
154 |
<div class="col-sm-2 col-sm-pull-10"> |
155 |
<aside> |
156 |
[% INCLUDE 'admin-menu.inc' %] |
157 |
</aside> |
158 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
159 |
</div> <!-- /.row --> |
160 |
|
161 |
[% MACRO jsinclude BLOCK %] |
162 |
[% Asset.js("js/admin-menu.js") | $raw %] |
163 |
[% INCLUDE 'datatables.inc' %] |
164 |
|
165 |
<script> |
166 |
$(document).ready(function() { |
167 |
$("#table_cash_registers").dataTable($.extend(true, {}, dataTablesDefaults, { |
168 |
"aoColumnDefs": [ |
169 |
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable":false }, |
170 |
], |
171 |
"aaSorting": [[ 1, "asc" ]], |
172 |
})); |
173 |
}); |
174 |
</script> |
175 |
[% END %] |
176 |
|
177 |
[% INCLUDE 'intranet-bottom.inc' %] |