diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_main.pm | 2 | ||||
-rw-r--r-- | FS/FS/cust_pkg.pm | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 6331fda6d..d1e975406 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1011,6 +1011,8 @@ sub bill { # only for figuring next bill date, nothing else, so, reset $sdate again # here $sdate = $cust_pkg->bill || $cust_pkg->setup || $time; + $cust_pkg->last_bill($sdate) + if $cust_pkg->dbdef_table->column('last_bill'); $mon += $part_pkg->freq; until ( $mon < 12 ) { $mon -= 12; $year++; } diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 88ffd4d17..4eea2c087 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -477,6 +477,10 @@ Useful for billing metered services. sub last_bill { my $self = shift; + if ( $self->dbdef_table->column('manual_flag') ) { + return $self->setfield('last_bill', $_[1]) if @_; + return $self->getfield('last_bill') if $self->getfield('last_bill'); + } my $cust_bill_pkg = qsearchs('cust_bill_pkg', { 'pkgnum' => $self->pkgnum, 'edate' => $self->bill, } ); $cust_bill_pkg ? $cust_bill_pkg->sdate : $self->setup || 0; |