From 9f7bb067293ed36b539454d071c5eea2459038fc Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 8 Nov 2006 19:17:37 +0000 Subject: [PATCH] added some more detailed logging git-svn-id: svn://svn.open-ils.org/ILS/trunk@6566 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm index eb9fdd36ce..a7f728ffa8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm @@ -85,7 +85,8 @@ sub make_payments { $trans = $self->fetch_mbts($client, $login, $transid); return $trans if $U->event_code($trans); - $logger->info("payment method retrieved transaction [$transid] with balance_owed = " . $trans->balance_owed); + $logger->info("payment: processing transaction [$transid] with balance_owed = ". + $trans->balance_owed. ", payment amount = $amount, and payment type = $type"); if($trans->usr != $userid) { # Do we need to restrict this in some way ?? $logger->info( " * User $userid is making a payment for " . @@ -100,6 +101,8 @@ sub make_payments { # A negative payment is a refund. if( $amount < 0 ) { + + $logger->info("payment: received a negative payment (refund) of $amount"); # If the refund causes the transaction balance to exceed 0 dollars, # we are in effect loaning the patron money. This is not allowed. @@ -112,7 +115,6 @@ sub make_payments { my $desk_total = 0; my $desk_payments = $e->search_money_desk_payment( { xact => $transid, voided => 'f' }); - #$desk_total += $_->amount_collected for @$desk_payments; $desk_total += $_->amount for @$desk_payments; if( (-$amount) > $desk_total ) { @@ -144,11 +146,12 @@ sub make_payments { # Any overpay on this transaction goes directly into patron credit $cred = -$cred; + + $logger->info("payment: amount ($amount) exceeds transaction balance of ". + $trans->balance_owed.". Applying patron credit of $cred"); + $credit += $cred; - $logger->activity("user ".$user->id." applying credit ". - "of $cred on transaction ".$trans->id. " because of overpayment"); - $logger->debug("Transactin " . $trans->id . ' is complete'); $trans = $session->request( "open-ils.storage.direct.money.billable_transaction.retrieve", $transid )->gather(1); @@ -167,9 +170,6 @@ sub make_payments { } } - - $logger->debug("Creating new $payobj for \$$amount\n"); - my $s = $session->request( "open-ils.storage.direct.money.$type.create", $payobj )->gather(1); if(!$s) { throw OpenSRF::EX::ERROR ("Error creating new $type"); } -- 2.11.0