[freeside-commits] freeside/FS/FS cust_bill_ApplicationCommon.pm, 1.13, 1.13.2.1

Ivan,,, ivan at wavetail.420.am
Fri Feb 26 18:59:42 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv15171

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	cust_bill_ApplicationCommon.pm 
Log Message:
fix rare "Illegal division by zero" error applying things when using weights, RT#7491

Index: cust_bill_ApplicationCommon.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill_ApplicationCommon.pm,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -w -d -r1.13 -r1.13.2.1
--- cust_bill_ApplicationCommon.pm	21 Sep 2009 02:41:43 -0000	1.13
+++ cust_bill_ApplicationCommon.pm	27 Feb 2010 02:59:39 -0000	1.13.2.1
@@ -248,9 +248,11 @@
 	}
 	@items = @newitems;
 
-      } while ( $lessflag );
+      } while ( $lessflag && @items );
 
-      #and now that we've fallen out of the loop, distribute the rest equally...
+      if ( @items ) {
+
+        #and now that we've fallen out of the loop, distribute the rest equally
 
       # should cust_bill_pay_pkg and cust_credit_bill_pkg amount columns
       # become real instead of numeric(10,2) ???  no..
@@ -297,10 +299,10 @@
 	     " to line item (cust_bill_pkg ". $_->[0]->billpkgnum. ")\n"
 	  foreach @equi_apply;
       }
-
-
       push @apply, @equi_apply;
 
+      }
+
       #$remaining_amount -= $applytotal;
       last unless $remaining_amount;
 



More information about the freeside-commits mailing list