X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=747776b26d2a451c4332c4f6a734541418a0da0f;hp=55a31f8858234e2f5d2ae53114e874e7cd7e1540;hb=cdcb49048123ab536a9ae1dcba2e5d31d0159b0d;hpb=2a56c671635687bf2648eb3a7cf4bce228101af3 diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 55a31f885..747776b26 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3406,6 +3406,22 @@ sub charge_postal_fee { $error ? $error : $cust_pkg; } +=item num_cust_attachment_deleted + +Returns the number of deleted attachments for this customer (see +L). + +=cut + +sub num_cust_attachments_deleted { + my $self = shift; + $self->scalar_sql( + " SELECT COUNT(*) FROM cust_attachment ". + " WHERE custnum = ? AND disabled IS NOT NULL AND disabled > 0", + $self->custnum + ); +} + =item cust_bill [ OPTION => VALUE... | EXTRA_QSEARCH_PARAMS_HASHREF ] Returns all the invoices (see L) for this customer.