From f49f02f8525a7b4cf0e92f23395c5cd9108ccf48 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 29 Jun 2022 17:19:05 +0100 Subject: [PATCH] Bug 29987: Add register support to manual credits This patch adds the register and transaction type selection options to the manual credit page. --- .../prog/en/modules/members/mancredit.tt | 27 ++++++++++++++++++ members/mancredit.pl | 28 +++++++++++-------- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt index ca3e93d84a..1cf63ebe11 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt @@ -2,11 +2,13 @@ [% USE Asset %] [% USE Koha %] [% USE Branches %] +[% USE Registers %] [% SET footerjs = 1 %] [% PROCESS 'accounts.inc' %] [% INCLUDE 'doc-head-open.inc' %] +[% SET registers = Registers.all( { filters => { current_branch => 1 } } ) %] Create manual credit › Patrons › Koha [% INCLUDE 'doc-head-close.inc' %] @@ -69,6 +71,31 @@
  • Example: 5.00
  • + [% INCLUDE 'transaction_types.inc' %] + [% IF Koha.Preference('UseCashRegisters') %] +
  • + [% IF Koha.Preference('RequireCashRegister') %] +
  • + [% END %] diff --git a/members/mancredit.pl b/members/mancredit.pl index 7ec9b957b2..68abdc3022 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -85,21 +85,25 @@ if ($add) { my $item = Koha::Items->find( { barcode => $barcode } ); $item_id = $item->itemnumber if $item; } - my $description = $input->param('desc'); - my $note = $input->param('note'); - my $amount = $input->param('amount') || 0; - my $type = $input->param('type'); + my $description = $input->param('desc'); + my $note = $input->param('note'); + my $amount = $input->param('amount') || 0; + my $type = $input->param('type'); + my $payment_type = $input->param('payment_type'); + my $cash_register_id = $input->param('cash_register'); $patron->account->add_credit( { - amount => $amount, - description => $description, - item_id => $item_id, - library_id => $library_id, - note => $note, - type => $type, - user_id => $logged_in_user->id, - interface => C4::Context->interface + amount => $amount, + description => $description, + item_id => $item_id, + library_id => $library_id, + note => $note, + type => $type, + user_id => $logged_in_user->id, + interface => C4::Context->interface, + payment_type => $payment_type, + cash_register => $cash_register_id } ); -- 2.20.1