still allow void of ancient invoices from unusual circumstances
authorIvan Kohler <ivan@freeside.biz>
Sun, 28 Feb 2016 07:11:38 +0000 (23:11 -0800)
committerIvan Kohler <ivan@freeside.biz>
Sun, 28 Feb 2016 07:11:38 +0000 (23:11 -0800)
FS/FS/cust_bill_pay.pm

index 3f787d3..873d718 100644 (file)
@@ -89,9 +89,9 @@ Deletes this payment application, unless the closed flag for the parent payment
 sub delete {
   my $self = shift;
   return "Can't delete application for closed payment"
-    if $self->cust_pay->closed =~ /^Y/i;
+    if $self->cust_pay && $self->cust_pay->closed =~ /^Y/i;
   return "Can't delete application for closed invoice"
-    if $self->cust_bill->closed =~ /^Y/i;
+    if $self->cust_bill && $self->cust_bill->closed =~ /^Y/i;
   $self->SUPER::delete(@_);
 }