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 %]'
13 [% INCLUDE 'doc-head-close.inc' %]
16 <body id="admin_cash_registers" class="admin">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'prefs-admin-search.inc' %]
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 %]'
31 <div class="main container-fluid">
33 <div class="col-sm-10 col-sm-push-2">
36 [% FOREACH m IN messages %]
37 <div class="dialog [% m.type | html %]">
39 [% CASE 'success_on_insert' %]
40 Cash register added successfully.
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 'error_on_update' %]
46 An error occurred when updating this cash register.
47 [% CASE 'success_on_default' %]
48 Branch default updated successfully.
49 [% CASE 'error_on_update' %]
50 An error on setting branch default.
51 [% CASE 'success_on_archive' %]
52 Cash register archived successfully.
53 [% CASE 'success_on_restore' %]
54 Cash register restored successfully.
61 [% IF op == 'add_form' %]
62 <h3>[% IF cash_register %]Modify cash register[% ELSE %]Add new cash_register[% END %]</h3>
63 <form action="/cgi-bin/koha/admin/cash_registers.pl" id="Aform" name="Aform" class="validated" method="post">
65 <fieldset class="rows">
66 <input type="hidden" name="op" value="add_validate" />
68 [% IF cash_register %]
70 <span class="label">Cash register ID: </span>[% cash_register.id | html %]
71 <input type="hidden" name="id" value="[% cash_register.id | html %]" />
76 <label for="name" class="required">Name: </label>
77 <input type="text" name="name" id="name" size="80" value="[% cash_register.name | html %]" class="required" />
78 <span class="required">Required</span>
82 <label for="description">Description: </label>
83 <input type="text" name="description" id="description" value="[% cash_register.description | html %]"/>
86 <label for="branch">Library: </label>
87 <select id="branch" name="branch">
88 [% FOREACH branch IN branch_list %]
89 [% IF cash_register.branch == branch.branchcode %]
90 <option value="[% branch.branchcode | html %]" selected="1">[% branch.branchname | html %]</option>
92 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
99 <label for="starting_float">Initial float: </label>
100 <input type="text" pattern='^\d+(?:\.\d{0,2})$' name="starting_float" id="starting_float" value="[% cash_register.starting_float | html %]" />
105 <fieldset class="action">
106 [% IF cash_register %]
107 <input type="submit" value="Save" />
109 <input type="submit" value="Add" />
111 <a class=cancel" href="/cgi-bin/koha/admin/cash_registers.pl?op=list">Cancel</a>
116 [% IF op == 'list' %]
117 <div id="toolbar" class="btn-toolbar">
118 <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>
121 <h3>Cash registers for <select id="branch_filter" name="branch_filter">
122 <option value=""></option>
123 [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
127 [% IF cash_registers.count %]
128 <table id="table_cash_registers">
134 <th>Initial float</th>
138 [% FOREACH cash_register IN cash_registers %]
139 [% IF cash_register.branch_default %]
144 <td>[% cash_register.name | html %]</td>
145 <td>[% cash_register.description | html %]</td>
146 <td>[% cash_register.library.branchname | html %]</td>
147 <td>[% IF cash_register.branch_default %]Yes[% ELSE %]No[% END %]</td>
148 <td>[% cash_register.starting_float | html %]</td>
149 [% IF cash_register.archived == '0' %]
151 <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>
152 [% IF cash_register.branch_default %]
153 <a class="btn btn-default btn-xs" href="cash_registers.pl?op=drop_default&id=[% cash_register.id | uri %]"><i class="fa fa-archive"></i> Drop default</a>
155 <a class="btn btn-default btn-xs" href="cash_registers.pl?op=make_default&id=[% cash_register.id | uri %]"><i class="fa fa-archive"></i> Make default</a>
157 <a class="btn btn-default btn-xs" href="cash_registers.pl?op=archive&id=[% cash_register.id | uri %]"><i class="fa fa-archive"></i> Archive</a>
160 <td class="actions"><a class="btn btn-default btn-xs" href="cash_registers.pl?op=unarchive&id=[% cash_register.id | uri %]"><i class="fa fa-trash-restore"></i> Restore</a></td>
167 <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>
168 [% END # /cash_register.count %]
169 [% END # /op == 'list' %]
171 </div> <!-- /.col-sm-10.col-sm-push-2 -->
173 <div class="col-sm-2 col-sm-pull-10">
175 [% INCLUDE 'admin-menu.inc' %]
177 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
178 </div> <!-- /.row -->
180 [% MACRO jsinclude BLOCK %]
181 [% Asset.js("js/admin-menu.js") | $raw %]
182 [% INCLUDE 'datatables.inc' %]
184 function filterDataTable( table, column, term ){
186 table.column( column ).search( term ).draw();
188 table.search( term ).draw();
193 function clearFilter( term ){
195 $(".dt_button_clear_filter").addClass("disabled");
197 $(".dt_button_clear_filter").removeClass("disabled");
201 $(document).ready(function() {
202 var crtable = $("#table_cash_registers").DataTable($.extend(true, {}, dataTablesDefaults, {
204 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable":false },
206 "aaSorting": [[ 1, "asc" ]],
207 "paginationType": "full",
210 $("#branch_filter").on("change", function(){
211 // Table must be filtered by the <option>'s text, not its value
212 var opt = $(this).find("option:selected").text();
213 filterDataTable( crtable, 2, opt );
220 [% INCLUDE 'intranet-bottom.inc' %]