X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;fp=FS%2FFS%2Fcust_main.pm;h=ea524dae4ea0770dedfcafac815253bff118f424;hp=3bffa3a599099fbbc31646c8a07f913888cd1658;hb=f81eebbe27a6acc0ae4284fa04b5525a41ae4570;hpb=4c5f25435ed32c15a6c8078109b62654ff96797b diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 3bffa3a59..ea524dae4 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -5414,6 +5414,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