Browse Source

Bug 24786: (QA follow-up) Hide archived registers

This patch hides archived registers from the list when useing the
Registers template plugin.  It also includes a check for
UseCashRegisters so that if the preference is disabled after some
registers have been defined then the plugin will no longer return the
list regardless.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Martin Renvoize 4 years ago
committed by Jonathan Druart
parent
commit
349591b3a4
  1. 4
      Koha/Template/Plugin/Registers.pm

4
Koha/Template/Plugin/Registers.pm

@ -84,8 +84,10 @@ Returns a list of all cash registers available that adhere to the passed filters
sub all { sub all {
my ( $self, $params ) = @_; my ( $self, $params ) = @_;
return unless C4::Context->preference('UseCashRegisters');
my $filters = $params->{filters} // {}; my $filters = $params->{filters} // {};
my $where; my $where = { archived => 0 };
$where->{branch} = C4::Context->userenv->{'branch'} $where->{branch} = C4::Context->userenv->{'branch'}
if ( $filters->{current_branch} && C4::Context->userenv ); if ( $filters->{current_branch} && C4::Context->userenv );
my $registers = Koha::Cash::Registers->search($where)->unblessed(); my $registers = Koha::Cash::Registers->search($where)->unblessed();

Loading…
Cancel
Save