Bug 36844: Set library, desk, and cash register menu follow-ups

This patch ties up a couple of loose ends which should have been
included in Bug 36582. The patch includes fixes for the staff interface
login page and the cash register statistics page.

To test you should have multiple libraries, desks, and cash registers
defined. You may need to enable the UseCirculationDesks and
UseCashRegisters system preferences.

- Apply the patch and log out of the staff interface.
- On the login form, test that changing your selected library correctly
  affects the desk and cash register dropdowns: Only desks and registers
  for your selected library should appear.
- Log in and confirm that your selections were submitted correctly.

- Go to Reports, and under "Statistics wizards" choose "Cash register."
- Confirm that changes to the "Transaction library" correctly change the
  available options in the "Cash register" dropdown, including the "All"
  option.

Sponsored-By: Athens County Public Libraries
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2024-05-13 16:53:39 +00:00 committed by Katrin Fischer
parent 70b9f02920
commit e02ac2ece6
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 35 additions and 17 deletions

View File

@ -144,11 +144,11 @@
<p>
[% IF Koha.Preference('ForceLibrarySelection') %]
<label for="branch" class="required">Library:</label>
<select name="branch" id="branch" class="input" tabindex="3" required="required">
<select name="branch" id="set-library-branch" class="input" tabindex="3" required="required">
<option value=""></option>
[% ELSE %]
<label for="branch">Library:</label>
<select name="branch" id="branch" class="input" tabindex="3">
<label for="set-library-branch">Library:</label>
<select name="branch" id="set-library-branch" class="input" tabindex="3">
<option value="">My library</option>
[% END %]
[% FOREACH l IN Branches.all( unfiltered => 1 ) %]
@ -162,8 +162,8 @@
[% IF Koha.Preference('UseCirculationDesks') && Desks.all %]
<p>
<label for="desk">Desk:</label>
<select name="desk_id" id="desk_id" class="input" tabindex="3">
<label for="set-library-desk_id">Desk:</label>
<select name="desk_id" id="set-library-desk_id" class="input" tabindex="3">
<option id="nodesk" value="">---</option>
[% FOREACH d IN Desks.all %]
<option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" disabled >[% d.desk_name | html %]</option>
@ -174,8 +174,8 @@
[% IF Koha.Preference('UseCashRegisters') && Registers.all().size %]
<p>
<label for="register_id">Cash register:</label>
<select name="register_id" id="register_id" class="input" tabindex="4">
<label for="set-library-register_id">Cash register:</label>
<select name="register_id" id="set-library-register_id" class="input" tabindex="4">
<option id="noregister" value="" selected="selected">Library default</option>
[% PROCESS options_for_registers registers => Registers.all() %]
</select>
@ -255,8 +255,6 @@
</div>
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/desk_selection.js") | $raw %]
[% Asset.js("js/register_selection.js") | $raw %]
<script>
$(document).ready( function() {
if ( document.location.hash ) {

View File

@ -222,21 +222,41 @@
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/register_selection.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
<script id="js">
[% INCLUDE 'calendar.inc' %]
<script>
actTotal = "";
$(document).ready(function() {
$("#tbl_cash_register_stats").dataTable($.extend(true, {}, dataTablesDefaults, {
"pageLength": 50,
"pagingType": "full_numbers"
}));
});
</script>
[% INCLUDE 'calendar.inc' %]
<script>
actTotal = "";
$(document).ready(function() {
$("#branch").on("change", function() {
var selectedBranch = $("#branch").children(
"option:selected").val();
$("#registerid").children().each(function() {
// default to no-register
if ($(this).is("#noregister")) {
$(this).prop("selected", true)
}
// display branch registers
else if ($(this).hasClass(selectedBranch)) {
$(this).prop("disabled", false);
$(this).show();
// default to branch default if there is one
if ($(this).hasClass("default")) {
$(this).prop("selected", true)
}
}
// hide non-branch registers
else {
$(this).hide();
$(this).prop("disabled", true);
}
});
});
$('#frmCashRegister').submit(function() {
var isFormValid = true;