RT#25563: Better handling of commissions which do not have rates configured [more...
[freeside.git] / FS / FS / part_event / Action / Mixin / credit_bill.pm
index 5a26d2e..91fa21f 100644 (file)
@@ -107,9 +107,12 @@ sub _calc_credit {
     # don't multiply by quantity here; it's already included
   }
 
-  $$warnref .= $warning if ref($warnref);
+  if ($charge < 0) { # e.g. prorate
+    $charge = 0;
+    $warning .= 'Negative charge set to zero ';
+  }
 
-  $charge = 0 if $charge < 0; # e.g. prorate
+  $$warnref .= $warning if ref($warnref);
   return ($percent * $charge / 100);
 }