From 529341c78bfaf7b8ece43e18cc30a13b64478639 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. Signed-off-by: David Nind Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../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 9833799576..a853880cca 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' %] @@ -74,6 +76,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 0652471493..4decab72b5 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -86,21 +86,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'); my $line = $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.39.5