X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_main.pm;h=461c38762c27afb790cc29e0e290e29eff140967;hb=568cf104bb07789ae00f39ea3524f7e1ee32e1e3;hp=2a8f47b605e69e1b016237436d7f97fbc3af145e;hpb=5d20de9563b173877e6419934f2b63332da2dc49;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 2a8f47b60..461c38762 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -40,6 +40,7 @@ use FS::payby; use FS::cust_pkg; use FS::cust_svc; use FS::cust_bill; +use FS::legacy_cust_bill; use FS::cust_pay; use FS::cust_pay_pending; use FS::cust_pay_void; @@ -3575,6 +3576,25 @@ sub open_cust_bill { } +=item legacy_cust_bill [ OPTION => VALUE... | EXTRA_QSEARCH_PARAMS_HASHREF ] + +Returns all the legacy invoices (see L) for this customer. + +=cut + +sub legacy_cust_bill { + my $self = shift; + + #return $self->num_legacy_cust_bill unless wantarray; + + map { $_ } #behavior of sort undefined in scalar context + sort { $a->_date <=> $b->_date } + qsearch({ 'table' => 'legacy_cust_bill', + 'hashref' => { 'custnum' => $self->custnum, }, + 'order_by' => 'ORDER BY _date ASC', + }); +} + =item cust_statement [ OPTION => VALUE... | EXTRA_QSEARCH_PARAMS_HASHREF ] Returns all the statements (see L) for this customer. @@ -3809,6 +3829,9 @@ sub display_custnum { my $self = shift; if ( $conf->exists('cust_main-default_agent_custid') && $self->agent_custid ){ return $self->agent_custid; + } elsif ( $conf->config('cust_main-custnum-display_prefix') ) { + return $conf->config('cust_main-custnum-display_prefix'). + sprintf('%08d', $self->custnum) } else { return $self->custnum; }