diff options
| author | ivan <ivan> | 2011-06-16 23:06:20 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2011-06-16 23:06:20 +0000 |
| commit | dbe1f22d63052dbbfe8b3cb578a0d831213ebb75 (patch) | |
| tree | 64d085d5a4045b5e95b84c09a13146e34cb4450e /FS | |
| parent | d01937e1d00012b5221f676178710e4e47618c2c (diff) | |
rework suspension delays, RT#6956
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/Schema.pm | 1 | ||||
| -rw-r--r-- | FS/FS/cust_pkg.pm | 1 | ||||
| -rw-r--r-- | FS/FS/part_event/Condition/pkg_dundate.pm | 32 |
3 files changed, 34 insertions, 0 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 25912a22f..9dc5dc6f8 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1436,6 +1436,7 @@ sub tables_hashref { 'cancel', @date_type, '', '', 'expire', @date_type, '', '', 'contract_end', @date_type, '', '', + 'dundate', @date_type, '', '', 'change_date', @date_type, '', '', 'change_pkgnum', 'int', 'NULL', '', '', '', 'change_pkgpart', 'int', 'NULL', '', '', '', diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index deb1cf1fe..872a6446a 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -596,6 +596,7 @@ sub check { || $self->ut_numbern('cancel') || $self->ut_numbern('adjourn') || $self->ut_numbern('expire') + || $self->ut_numbern('dundate') || $self->ut_enum('no_auto', [ '', 'Y' ]) || $self->ut_enum('waive_setup', [ '', 'Y' ]) || $self->ut_numbern('agent_pkgid') diff --git a/FS/FS/part_event/Condition/pkg_dundate.pm b/FS/FS/part_event/Condition/pkg_dundate.pm new file mode 100644 index 000000000..08b4e0abc --- /dev/null +++ b/FS/FS/part_event/Condition/pkg_dundate.pm @@ -0,0 +1,32 @@ +package FS::part_event::Condition::pkg_dundate; +use base qw( FS::part_event::Condition ); + +use strict; + +sub description { + "Skip until package suspension delay date"; +} + +sub eventtable_hashref { + { 'cust_main' => 0, + 'cust_bill' => 0, + 'cust_pkg' => 1, + }; +} + +sub condition { + my($self, $cust_pkg, %opt) = @_; + + #my $cust_main = $self->cust_main($cust_pkg); + + $cust_pkg->dundate <= $opt{time}; + +} + +#sub condition_sql { +# my( $self, $table ) = @_; +# +# 'true'; +#} + +1; |
