Bug 29139: Fix incorrect relation call
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 30 Sep 2021 08:14:15 +0000 (09:14 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 1 Oct 2021 14:28:55 +0000 (16:28 +0200)
The bug here was worse than originally thought. We were calling the
wrong relation too.. we should probably add some exceptions to catch
this, it confuses me every single time!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Account.pm

index 47961df..45f0fa6 100644 (file)
@@ -110,7 +110,7 @@ sub pay {
     }
 
     my $patron = Koha::Patrons->find( $self->{patron_id} );
-    my @account_offsets = $payment->debit_offsets->as_list;
+    my @account_offsets = $payment->credit_offsets->as_list;
     if ( C4::Context->preference('UseEmailReceipts') ) {
         if (
             my $letter = C4::Letters::GetPreparedLetter(