From 6178a15b24780f425a6bcad8a5e7679956558207 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 21 Feb 2011 01:21:44 +0000 Subject: [PATCH] add agent_pkgid --- FS/FS/Schema.pm | 3 ++- FS/FS/cust_pkg.pm | 1 + 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 42153bff6..bae2ab7f8 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1326,11 +1326,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 fcfd7e956..968441d03 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 9c93677a7..fe69f82fd 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' ); } -- 2.11.0