X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=7ea586a90dc70cca232a057912794b6f1b84d795;hb=3ac62d97d20400c10a1812b33617bf902f595626;hp=6a4fa1e8fbd2276738b7ae4a9b5401d8ef3e2eff;hpb=cf90a22a09d15140168f8232ccea788c36af71f2;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 6a4fa1e8f..7ea586a90 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -253,7 +253,7 @@ sub void { } } - $error = $self->delete; + $error = $self->_delete; if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; @@ -265,20 +265,22 @@ sub void { } -=item delete - -This method now works but you probably shouldn't use it. Instead, apply a -credit against the invoice, or use the new void method. - -Using this method to delete invoices outright is really, really bad. There -would be no record you ever posted this invoice, and there are no check to -make sure charged = 0 or that there are no associated cust_bill_pkg records. - -Really, don't use it. - -=cut - -sub delete { +# removed docs entirely and renamed method to _delete to further indicate it is +# internal-only and discourage use +# +# =item delete +# +# DO NOT USE THIS METHOD. Instead, apply a credit against the invoice, or use +# the B method. +# +# This is only for internal use by V, which is what you should be using. +# +# DO NOT USE THIS METHOD. Whatever reason you think you have is almost certainly +# wrong. Use B, that's what it is for. Really. This means you. +# +# =cut + +sub _delete { my $self = shift; return "Can't delete closed invoice" if $self->closed =~ /^Y/i;