From c8a68efa5c6961482f78e2e7603b78da12309b7e Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 12 Sep 2006 02:53:37 +0000 Subject: [PATCH] WHY ARE THEY DIFFERENT?!?! ... it works now git-svn-id: svn://svn.open-ils.org/ILS/trunk@6073 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Storage/Publisher/money.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm index cce232bc83..6a15e89343 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm @@ -19,6 +19,7 @@ sub _make_mbts { my $lb = undef; for my $b ($x->billings) { next if ($b->voided); + #$log->debug( "billing is ".$b->amount, DEBUG ); $to += int($b->amount * 100); $lb ||= $b->billing_ts; if ($b->billing_ts ge $lb) { @@ -29,12 +30,13 @@ sub _make_mbts { } } - $s->total_owed( sprintf('%0.2f', $to / 100 ) ); + $s->total_owed( sprintf('%0.2f', int($to) / 100 ) ); my $tp = 0; my $lp = undef; for my $p ($x->payments) { - next if ($p->voided); + #$log->debug( "payment is ".$p->amount." voided = ".$p->voided, DEBUG ); + next if ($p->voided eq 't'); $tp += int($p->amount * 100); $lp ||= $p->payment_ts; if ($p->payment_ts ge $lp) { @@ -44,9 +46,10 @@ sub _make_mbts { $s->last_payment_type($p->payment_type); } } - $s->total_paid( sprintf('%0.2f', $tp / 100 ) ); + $s->total_paid( sprintf('%0.2f', int($tp) / 100 ) ); - $s->balance_owed( sprintf('%0.2f', int($to - $tp) / 100) ); + $s->balance_owed( sprintf('%0.2f', int(int($to) - int($tp)) / 100) ); + #$log->debug( "balance of ".$x->id." == ".$s->balance_owed, DEBUG ); $s->xact_type( 'grocery' ) if (money::grocery->retrieve($x->id)); $s->xact_type( 'circulation' ) if (action::circulation->retrieve($x->id)); -- 2.43.2