From cae27cb5934005ce0ad1724e4447668739650f4e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 3 Oct 2019 17:13:25 +0100 Subject: [PATCH] Bug 23354: Update to account for bug 23049 Signed-off-by: Kyle M Hall Signed-off-by: Josef Moravec Signed-off-by: Martin Renvoize --- Koha/Charges/Sales.pm | 9 +++------ koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt | 9 ++++----- pos/pay.pl | 7 +++++++ 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Koha/Charges/Sales.pm b/Koha/Charges/Sales.pm index 27bcc1a399..bd88423d6a 100644 --- a/Koha/Charges/Sales.pm +++ b/Koha/Charges/Sales.pm @@ -157,12 +157,9 @@ sub _get_valid_items { my $self = shift; $self->{valid_items} //= { - map { $_ => 1 } Koha::AuthorisedValues->search( - { - category => 'MANUAL_INV', - branchcode => $self->{cash_register}->branch - } - )->get_column('authorised_value') + map { $_ => 1 } + Koha::Account::DebitTypes->search_with_library_limits( {}, {}, + $self->{cash_register}->branch )->get_column('code') }; return $self->{valid_items}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc index e8e51bab53..d551d7e538 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/pos-menu.inc @@ -7,8 +7,8 @@
  • Cash registers
  • [% END %] - [% IF ( CAN_user_parameters_manage_auth_values ) %] -
  • Purchase items
  • + [% IF ( CAN_user_parameters_manage_accounts ) %] +
  • Purchase items
  • [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt index 479a65a0d2..398459d570 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt @@ -31,7 +31,6 @@
    Items for purchase Please select items from below to add to this transaction: - [% SET invoice_types = AuthorisedValues.GetAuthValueDropbox('MANUAL_INV') %] [% IF invoice_types %] @@ -45,11 +44,11 @@ [% FOREACH invoice IN invoice_types %] - - - + + + [% END %] diff --git a/pos/pay.pl b/pos/pay.pl index 9903459c9e..3406f24461 100755 --- a/pos/pay.pl +++ b/pos/pay.pl @@ -9,6 +9,7 @@ use C4::Auth qw/:DEFAULT get_session/; use C4::Output; use C4::Context; +use Koha::Account::DebitTypes; use Koha::AuthorisedValues; use Koha::Cash::Registers; use Koha::Charges::Sales; @@ -53,6 +54,12 @@ else { ); } +my $invoice_types = + Koha::Account::DebitTypes->search_with_library_limits( + { can_be_added_manually => 1 }, + {}, $library_id ); +$template->param( invoice_types => $invoice_types ); + my $total_paid = $q->param('paid'); if ( $total_paid and $total_paid ne '0.00' ) { my $cash_register = Koha::Cash::Registers->find( { id => $registerid } ); -- 2.39.5
    [% invoice.authorised_value | html %][% invoice.lib_opac | html %][% invoice.lib | html %][% invoice.code | html %][% invoice.description | html %][% invoice.default_amount | $Price %] - +