diff options
author | Mitch Jackson <mitch@freeside.biz> | 2018-08-09 14:55:44 -0400 |
---|---|---|
committer | Mitch Jackson <mitch@freeside.biz> | 2018-09-19 00:42:00 -0400 |
commit | d1dfa92834944079595def7f1ba2d62b2f30243b (patch) | |
tree | b12fd28c5f037f931227a41691e580c1c57a350d /FS/FS/cust_main.pm | |
parent | 7b326a5bd5550034f98086ef7df1884c9cf72bb7 (diff) |
RT# 78547 bill_and_collect() small optimization
Diffstat (limited to 'FS/FS/cust_main.pm')
-rw-r--r-- | FS/FS/cust_main.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 22d0dcc..64b002b 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -5694,6 +5694,16 @@ sub process_bill_and_collect { $cust_main->bill_and_collect( %$param ); } +=item pending_invoice_count + +Return number of cust_bill with pending=Y for this customer + +=cut + +sub pending_invoice_count { + FS::cust_bill->count( 'custnum = '.shift->custnum."AND pending = 'Y'" ); +} + #starting to take quite a while for big dbs # (JRNL: journaled so it only happens once per database) # - seq scan of h_cust_main (yuck), but not going to index paycvv, so |