[freeside-commits] freeside/FS/FS cust_bill_ApplicationCommon.pm, 1.19, 1.20

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


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

Modified Files:
	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.19
retrieving revision 1.20
diff -u -w -d -r1.19 -r1.20
--- cust_bill_ApplicationCommon.pm	19 Jan 2010 02:03:28 -0000	1.19
+++ cust_bill_ApplicationCommon.pm	27 Feb 2010 02:59:32 -0000	1.20
@@ -273,9 +273,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..
@@ -320,10 +322,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