[freeside-commits] branch master updated. cdcb49048123ab536a9ae1dcba2e5d31d0159b0d

Ivan ivan at 420.am
Fri Nov 18 09:24:37 PST 2016


The branch, master has been updated
       via  cdcb49048123ab536a9ae1dcba2e5d31d0159b0d (commit)
      from  2a56c671635687bf2648eb3a7cf4bce228101af3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cdcb49048123ab536a9ae1dcba2e5d31d0159b0d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Nov 18 09:24:36 2016 -0800

    don't link to deleted attachments if there aren't any

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 55a31f8..747776b 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<FS::num_cust_attachment>).
+
+=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<FS::cust_bill>) for this customer.

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main.pm |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)




More information about the freeside-commits mailing list