diff options
author | ivan <ivan> | 2011-02-21 01:21:17 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-02-21 01:21:17 +0000 |
commit | 9e6bf0f56f0bd9ceef7cbc22975583968e9f4fb2 (patch) | |
tree | 84af66acf8aacd1bf662aed8e54547457892c9f3 /FS/FS | |
parent | f6ec862de3441618ae8035db1b754d417c5cb1b0 (diff) |
add agent_pkgid
Diffstat (limited to 'FS/FS')
-rw-r--r-- | FS/FS/Schema.pm | 3 | ||||
-rw-r--r-- | FS/FS/cust_pkg.pm | 1 | ||||
-rw-r--r-- | FS/FS/cust_pkg/Import.pm | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 327c96c..acac4a7 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1428,11 +1428,12 @@ sub tables_hashref { 'manual_flag', 'char', 'NULL', 1, '', '', 'no_auto', 'char', 'NULL', 1, '', '', 'quantity', 'int', 'NULL', '', '', '', + 'agent_pkgid', 'int', 'NULL', '', '', '', ], 'primary_key' => 'pkgnum', 'unique' => [], 'index' => [ ['custnum'], ['pkgpart'], [ 'pkgbatch' ], [ 'locationnum' ], - [ 'usernum' ], + [ 'usernum' ], [ 'agent_pkgid' ], [ 'start_date' ], ['setup'], ['last_bill'], ['bill'], ['susp'], ['adjourn'], ['expire'], ['cancel'], ['change_date'], ['order_date'], diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index b3ed2f2..c31b7e5 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -594,6 +594,7 @@ sub check { || $self->ut_numbern('adjourn') || $self->ut_numbern('expire') || $self->ut_enum('no_auto', [ '', 'Y' ]) + || $self->ut_numbern('agent_pkgid') ; return $error if $error; diff --git a/FS/FS/cust_pkg/Import.pm b/FS/FS/cust_pkg/Import.pm index 9c93677..fe69f82 100644 --- a/FS/FS/cust_pkg/Import.pm +++ b/FS/FS/cust_pkg/Import.pm @@ -170,8 +170,9 @@ sub batch_import { my $format = delete $opt->{'format'}; my @fields = (); - if ( $format =~ /^(.*)-agent_custid$/ ) { + if ( $format =~ /^(.*)-agent_custid(-agent_pkgid)?$/ ) { $format = $1; + my $agent_pkgid = $2; @fields = ( sub { my( $self, $value ) = @_; # $conf, $param @@ -182,6 +183,7 @@ sub batch_import { $self->custnum($cust_main->custnum) if $cust_main; }, ); + push @fields, 'agent_pkgid' if $agent_pkgid; } else { @fields = ( 'custnum' ); } |