diff options
author | jeff <jeff> | 2008-12-30 22:00:27 +0000 |
---|---|---|
committer | jeff <jeff> | 2008-12-30 22:00:27 +0000 |
commit | 1bed9c8b081558e4b25adae1048d3faf898e2100 (patch) | |
tree | 786cbbcf64c825f0306f7b2631606bcb7bbd6600 /FS/FS/cust_pkg.pm | |
parent | 583ba53e6f0c7126466eac5f68356ad843cddf1e (diff) |
yet more timestamping improvements and corrections to reasons based on history records
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r-- | FS/FS/cust_pkg.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 6807383d9..70f23df9b 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -551,7 +551,7 @@ sub cancel { if ( $options{'reason'} ) { $error = $self->insert_reason( 'reason' => $options{'reason'}, 'action' => $date ? 'expire' : 'cancel', - 'date' => $date, + 'date' => $date ? $date : $cancel_time, 'reason_otaker' => $options{'reason_otaker'}, ); if ( $error ) { @@ -749,10 +749,12 @@ sub suspend { return "Package $pkgnum expires before it would be suspended."; } + my $suspend_time = $options{'time'} || time; + if ( $options{'reason'} ) { $error = $self->insert_reason( 'reason' => $options{'reason'}, 'action' => $date ? 'adjourn' : 'suspend', - 'date' => $date, + 'date' => $date ? $date : $suspend_time, 'reason_otaker' => $options{'reason_otaker'}, ); if ( $error ) { @@ -819,7 +821,7 @@ sub suspend { if ( $date ) { $hash{'adjourn'} = $date; } else { - $hash{'susp'} = time; + $hash{'susp'} = $suspend_time; } my $new = new FS::cust_pkg ( \%hash ); $error = $new->replace( $self, options => { $self->options } ); |