Bug 23673: Set updated_on=time_queued on DB update
[koha-ffzg.git] / Koha / Account.pm
index 04bbd08..ae6bebb 100644 (file)
@@ -32,6 +32,7 @@ use C4::Stats qw( UpdateStats );
 use Koha::Patrons;
 use Koha::Account::Lines;
 use Koha::Account::Offsets;
+use Koha::Account::DebitTypes;
 use Koha::DateUtils qw( dt_from_string );
 use Koha::Exceptions;
 use Koha::Exceptions::Account;
@@ -247,7 +248,7 @@ sub pay {
     UpdateStats(
         {
             branch         => $library_id,
-            type           => $type,
+            type           => lc($type),
             amount         => $amount,
             borrowernumber => $self->{patron_id},
         }
@@ -281,7 +282,7 @@ sub pay {
                 lang    => $patron->lang,
                 tables => {
                     borrowers       => $self->{patron_id},
-                    branches        => $self->{library_id},
+                    branches        => $library_id,
                 },
                 substitute => {
                     credit => $payment,
@@ -403,7 +404,7 @@ sub add_credit {
                 UpdateStats(
                     {
                         branch         => $library_id,
-                        type           => $credit_type,
+                        type           => lc($credit_type),
                         amount         => $amount,
                         borrowernumber => $self->{patron_id},
                     }