@@ -, +, @@ --- .../prog/en/includes/html_helpers.inc | 2 +- .../intranet-tmpl/prog/en/modules/pos/pay.tt | 13 +++++------ pos/pay.pl | 22 ------------------- 3 files changed, 6 insertions(+), 31 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -25,7 +25,7 @@ [% BLOCK options_for_registers %] - + [% FOREACH r IN registers %] [% IF r.branch == branch %] [% IF r.selected %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt @@ -1,11 +1,14 @@ [% USE raw %] [% USE Asset %] +[% USE Branches %] [% USE Koha %] [% USE Price %] [% USE TablesSettings %] +[% USE Registers %] [% SET footerjs = 1 %] [% PROCESS 'payments.inc' %] [% INCLUDE 'doc-head-open.inc' %] +[% SET registers = Registers.all( filters => { current_branch => 1 } ) %] Koha › Payments [% INCLUDE 'doc-head-close.inc' %] @@ -20,7 +23,7 @@
- [% IF ( error_registers ) %] + [% IF ( registers.size == 0 ) %]

You must have at least one cash register associated with the library before you can record payments. @@ -126,13 +129,7 @@

  • --- a/pos/pay.pl +++ a/pos/pay.pl @@ -32,28 +32,6 @@ my $logged_in_user = Koha::Patrons->find($loggedinuser) or die "Not logged in"; my $library_id = C4::Context->userenv->{'branch'}; my $registerid = $input->param('registerid'); -my $default_registerid = $input->param('default_register'); -my $registers = Koha::Cash::Registers->search( - { branch => $library_id, archived => 0 }, - { order_by => { '-asc' => 'name' } } -); - -if ( !$registers->count ) { - $template->param( error_registers => 1 ); -} -else { - if ( !$default_registerid ) { - my $default_register = Koha::Cash::Registers->find( - { branch => $library_id, branch_default => 1 } ); - $default_registerid = - $default_register ? $default_register->id : $registers->next->id; - } - - $template->param( - default_register => $default_registerid, - registers => $registers, - ); -} my $invoice_types = Koha::Account::DebitTypes->search_with_library_limits( { can_be_sold => 1 }, --