Address LP bug #724583, "Paying Bills with Patron Credit does not always decrease...
authordbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Mar 2011 19:15:01 +0000 (19:15 +0000)
committerdbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Mar 2011 19:15:01 +0000 (19:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19639 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm

index dcf19cc..a88cdac 100644 (file)
@@ -323,11 +323,11 @@ sub make_payments {
         my $amount = $payment->amount;
         my $transid = $payment->xact;
         my $trans = $xacts{$transid};
+        # making payment with existing patron credit.
+        $credit -= $amount if $type eq 'credit_payment';
         if( (my $cred = ($trans->balance_owed - $amount)) <= 0 ) {
             # Any overpay on this transaction goes directly into patron
-            # credit making payment with existing patron credit.
-            $credit -= $amount if $type eq 'credit_payment';
-
+            # credit
             $cred = -$cred;
             $credit += $cred;
             my $circ = $e->retrieve_action_circulation($transid);