RT#25563: Better handling of commissions which do not have rates configured [more...
[freeside.git] / FS / FS / part_event / Action / Mixin / credit_flat.pm
index 374cf5d..c35d5d8 100644 (file)
@@ -19,7 +19,10 @@ sub option_fields {
 
 sub _calc_credit {
   my $self = shift;
-  $self->option('amount');
+  my $warnref = $_[2]; #other input not used by credit_flat
+  my $warning = $self->option('amount') ? '' : 'Amount set to zero ';
+  $$warnref .= $warning if ref($warnref);
+  return $self->option('amount');
 }
 
 1;