=head1 DESCRIPTION
An FS::cust_credit_bill object represents application of a credit (see
-L<FS::cust_credit>) to an invoice (see L<FS::cust_bill>). FS::cust_credit
+L<FS::cust_credit>) to an invoice (see L<FS::cust_bill>). FS::cust_credit_bill
inherits from FS::Record. The following fields are currently supported:
=over 4
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(@_);
=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