X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=19a5816566b53f71e6ef2be7431d6dea663cb68a;hp=f4990a4181cc6b54681374f67c86ebc8c697d6a2;hb=5cfe4a2d5a299af5af44b249e12f114c9c886850;hpb=f630d74ba5579f18e4c65733b13081f5afed9229 diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index f4990a418..19a581656 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3432,6 +3432,20 @@ sub num_cust_attachments_deleted { ); } +=item max_invnum + +Returns the most recent invnum (invoice number) for this customer. + +=cut + +sub max_invnum { + my $self = shift; + $self->scalar_sql( + " SELECT MAX(invnum) FROM cust_bill WHERE custnum = ?", + $self->custnum + ); +} + =item cust_bill [ OPTION => VALUE... | EXTRA_QSEARCH_PARAMS_HASHREF ] Returns all the invoices (see L) for this customer.