From: pines Date: Mon, 25 Sep 2006 18:30:27 +0000 (+0000) Subject: with _make_mbts, don't cast as integer until setting the object, and do that with... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e5677cfec10f868d28702ffddc732ee00ea0dafd;p=Evergreen.git with _make_mbts, don't cast as integer until setting the object, and do that with sprintf git-svn-id: svn://svn.open-ils.org/ILS/trunk@6214 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 20f6203d19..0fdbeabcac 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -1941,7 +1941,7 @@ sub _make_mbts { my $lb = undef; for my $b (@{ $x->billings }) { next if ($U->is_true($b->voided)); - $to += int($b->amount * 100); + $to += ($b->amount * 100); $lb ||= $b->billing_ts; if ($b->billing_ts ge $lb) { $lb = $b->billing_ts; @@ -1957,7 +1957,7 @@ sub _make_mbts { my $lp = undef; for my $p (@{ $x->payments }) { next if ($U->is_true($p->voided)); - $tp += int($p->amount * 100); + $tp += ($p->amount * 100); $lp ||= $p->payment_ts; if ($p->payment_ts ge $lp) { $lp = $p->payment_ts; @@ -1968,7 +1968,7 @@ sub _make_mbts { } $s->total_paid( sprintf('%0.2f', $tp / 100 ) ); - $s->balance_owed( sprintf('%0.2f', int($to - $tp) / 100) ); + $s->balance_owed( sprintf('%0.2f', ($to - $tp) / 100) ); $s->xact_type( 'grocery' ) if ($x->grocery); $s->xact_type( 'circulation' ) if ($x->circulation); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm index 000d85a7d6..57d7957065 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm @@ -503,7 +503,7 @@ sub _make_mbts { my $lb = undef; for my $b (@{ $x->billings }) { next if ($U->is_true($b->voided)); - $to += int($b->amount * 100); + $to += ($b->amount * 100); $lb ||= $b->billing_ts; if ($b->billing_ts ge $lb) { $lb = $b->billing_ts; @@ -518,7 +518,7 @@ sub _make_mbts { my $lp = undef; for my $p (@{ $x->payments }) { next if ($U->is_true($p->voided)); - $tp += int($p->amount * 100); + $tp += ($p->amount * 100); $lp ||= $p->payment_ts; if ($p->payment_ts ge $lp) { $lp = $p->payment_ts; @@ -529,7 +529,7 @@ sub _make_mbts { } $s->total_paid( sprintf('%0.2f', $tp / 100 ) ); - $s->balance_owed( sprintf('%0.2f', int($to - $tp) / 100) ); + $s->balance_owed( sprintf('%0.2f', ($to - $tp) / 100) ); $s->xact_type( 'grocery' ) if ($x->grocery); $s->xact_type( 'circulation' ) if ($x->circulation); 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 6a15e89343..be28794f70 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm @@ -20,7 +20,7 @@ sub _make_mbts { for my $b ($x->billings) { next if ($b->voided); #$log->debug( "billing is ".$b->amount, DEBUG ); - $to += int($b->amount * 100); + $to += ($b->amount * 100); $lb ||= $b->billing_ts; if ($b->billing_ts ge $lb) { $lb = $b->billing_ts; @@ -30,14 +30,14 @@ sub _make_mbts { } } - $s->total_owed( sprintf('%0.2f', int($to) / 100 ) ); + $s->total_owed( sprintf('%0.2f', ($to) / 100 ) ); my $tp = 0; my $lp = undef; for my $p ($x->payments) { #$log->debug( "payment is ".$p->amount." voided = ".$p->voided, DEBUG ); next if ($p->voided eq 't'); - $tp += int($p->amount * 100); + $tp += ($p->amount * 100); $lp ||= $p->payment_ts; if ($p->payment_ts ge $lp) { $lp = $p->payment_ts; @@ -46,9 +46,9 @@ sub _make_mbts { $s->last_payment_type($p->payment_type); } } - $s->total_paid( sprintf('%0.2f', int($tp) / 100 ) ); + $s->total_paid( sprintf('%0.2f', ($tp) / 100 ) ); - $s->balance_owed( sprintf('%0.2f', int(int($to) - int($tp)) / 100) ); + $s->balance_owed( sprintf('%0.2f', (($to) - ($tp)) / 100) ); #$log->debug( "balance of ".$x->id." == ".$s->balance_owed, DEBUG ); $s->xact_type( 'grocery' ) if (money::grocery->retrieve($x->id));