with _make_mbts, don't cast as integer until setting the object, and do that with...
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Sep 2006 18:30:27 +0000 (18:30 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 25 Sep 2006 18:30:27 +0000 (18:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6214 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm

index 20f6203..0fdbeab 100644 (file)
@@ -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);
index 000d85a..57d7957 100644 (file)
@@ -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);
index 6a15e89..be28794 100644 (file)
@@ -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));