Bug 29987: (follow-up) Fix missing payment type
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 24 Aug 2022 10:23:25 +0000 (11:23 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 5 Dec 2022 21:15:41 +0000 (21:15 +0000)
The payment type include has changed since the patch was first written,
we now require a 'type' is passed to properly set the field name.

This should fix the 'bankable' issue raised.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a0593924906b74f41c8b347469a3eaa558e400a1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt
members/mancredit.pl

index 1cf63eb..255f299 100644 (file)
@@ -71,7 +71,7 @@
                             <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
                             <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
                             <li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value=""/> Example: 5.00</li>
-                            [% INCLUDE 'transaction_types.inc' %]
+                            [% INCLUDE 'transaction_types.inc' type="credit" %]
                             [% IF Koha.Preference('UseCashRegisters') %]
                             <li>
                                 [% IF Koha.Preference('RequireCashRegister') %]
index 68abdc3..e8860b7 100755 (executable)
@@ -85,11 +85,11 @@ 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 $payment_type = $input->param('payment_type');
+    my $description      = $input->param('desc');
+    my $note             = $input->param('note');
+    my $amount           = $input->param('amount') || 0;
+    my $type             = $input->param('type');
+    my $credit_type      = $input->param('credit_type');
     my $cash_register_id = $input->param('cash_register');
 
     $patron->account->add_credit(
@@ -102,7 +102,7 @@ if ($add) {
             type          => $type,
             user_id       => $logged_in_user->id,
             interface     => C4::Context->interface,
-            payment_type  => $payment_type,
+            payment_type  => $credit_type,
             cash_register => $cash_register_id
         }
     );