add per-agent invoice templates, add per-package suspend invoice events, fix automati...
[freeside.git] / FS / FS / cust_credit_bill.pm
index 0bbc656..bd76c2e 100644 (file)
@@ -74,6 +74,8 @@ sub table { 'cust_credit_bill'; }
 Adds this cust_credit_bill to the database ("Posts" all or part of a credit).
 If there is an error, returns the error, otherwise returns false.
 
+=cut
+
 sub insert {
   my $self = shift;
   my $error = $self->SUPER::insert(@_);
@@ -94,7 +96,10 @@ Currently unimplemented.
 =cut
 
 sub delete {
-  return "Can't unapply credit!"
+  my $self = shift;
+  return "Can't delete application for closed credit"
+    if $self->cust_credit->closed =~ /^Y/i;
+  $self->SUPER::delete(@_);
 }
 
 =item replace OLD_RECORD